raindrop.rb
raindrop is a Ruby command line client for Raindrop.io.
It is built for everyday bookmark workflows from the terminal: authenticate with OAuth, search saved raindrops, inspect an item, add new links, update metadata, delete old ones, and list tags or collections.
Installation
Install the gem:
gem install raindropThen check that the executable is available:
raindrop --helpQuick Start
All URLs, IDs, names, and metadata in the examples are fictitious and do not refer to data from a real Raindrop.io account.
Create an OAuth application in Raindrop.io and register this Redirect URL:
http://127.0.0.1:42813/callback
Log in with your OAuth client credentials:
raindrop auth login \
--client-id CLIENT_ID \
--client-secret CLIENT_SECRETSearch your saved raindrops:
raindrop search exampleInspect a raindrop:
raindrop get 1234567890Add a new link:
raindrop add https://example.com/articleUpdate an existing raindrop:
raindrop update 1234567890 --title "Example Article" --tag exampleAuthentication
raindrop supports OAuth authentication. Test token authentication is not supported.
The default OAuth Redirect URL is:
http://127.0.0.1:42813/callback
When you run auth login, the CLI prints an authorization URL and starts a temporary local callback server on 127.0.0.1:42813. Open the URL in your browser, authorize the app, and Raindrop.io redirects back to the local callback URL. The CLI then exchanges the authorization code for OAuth tokens and stores them in the config file.
raindrop auth login \
--client-id CLIENT_ID \
--client-secret CLIENT_SECRETIf your OAuth application uses a different Redirect URL, pass it explicitly:
raindrop auth login \
--client-id CLIENT_ID \
--client-secret CLIENT_SECRET \
--redirect-uri http://127.0.0.1:42813/callbackCheck the current authentication status:
raindrop auth statusRemove stored OAuth credentials:
raindrop auth logoutCommands
JSON output
Use --json to output API results as JSON. This option is available for search, get, add, update, delete, tags rename, tags merge, and tags remove.
raindrop search example --jsonSearch
Search saved raindrops:
raindrop search exampleBy default, search returns up to 50 items. You can specify a smaller limit:
raindrop search example --limit 20Sort results:
raindrop search example --sort score
raindrop search example --sort -created
raindrop search example --sort titleSupported sort values are -created, created, score, -sort, title, -title, domain, and -domain. score requires a search query.
Fetch all matching pages with --all:
raindrop search example --all--all waits one second between pages to avoid sending requests too aggressively. It cannot be combined with --limit.
Filter by tag:
raindrop search --tag example
raindrop search example --tag reference --tag tutorialFilter by collection:
raindrop search --collection 12345678
raindrop search example --collection 12345678When --collection is provided, the search query itself is optional.
Get
Show a single saved raindrop:
raindrop get 1234567890Add
Add a URL:
raindrop add https://example.com/articleAdd a URL with metadata:
raindrop add https://example.com/article \
--title "Example Article" \
--description "Example article description" \
--note "Read later" \
--tag example \
--tag reference \
--collection 12345678Update
Update a saved raindrop by ID:
raindrop update 1234567890 \
--title "Example Article" \
--description "Example article description" \
--note "Read later" \
--tag example \
--tag reference \
--collection 12345678At least one update option is required. Tags replace the raindrop's tag list with the tags passed on the command line.
Delete
Delete a saved raindrop by ID:
raindrop delete 1234567890Tags
List tags:
raindrop tagsRename a tag in all collections:
raindrop tags rename old-tag new-tagRestrict the rename to one collection:
raindrop tags rename old-tag new-tag --collection 12345678When --collection is omitted, the tag is renamed across all collections. The old and new tag names must be different.
Merge two or more tags into one tag:
raindrop tags merge old-tag legacy-tag --into new-tagRestrict the merge to one collection:
raindrop tags merge old-tag legacy-tag --into new-tag --collection 12345678When --collection is omitted, the tags are merged across all collections. Duplicate source tags and the destination tag are removed from the source list, and at least two source tags must remain.
Remove one or more tags from all collections:
raindrop tags remove unused-tag temporary-tagRestrict the removal to one collection:
raindrop tags remove unused-tag temporary-tag --collection 12345678When --collection is omitted, the tags are removed across all collections. This command does not prompt for confirmation, and removal cannot be undone through the Tags API.
Show the available tag management commands:
raindrop tags --helpCollections
List collections:
raindrop collectionsConfiguration
The config file is stored under the XDG config directory. By default, this is:
~/.config/raindrop-cli/config.yml
Show the actual config path:
raindrop config pathShow config status:
raindrop configExample output:
Auth: oauth
Access token: [REDACTED]
Refresh token: [REDACTED]
Token type: Bearer
Expires in: 3600
Access tokens and refresh tokens are never printed by raindrop config.
Development
Install dependencies:
bundle installRun the CLI from the working tree:
bin/raindrop --helpRun tests:
bundle exec rake testBuild the gem locally:
bundle exec gem build raindrop.gemspecLicense
MIT