A simple command-line tool for saving bookmarks to Pinboard. Generated by Claude.
- Automatically fetches the page title before saving the bookmark.
- Go 1.16 or higher
- A Pinboard account and API token
# Clone this repository
git clone https://github.com/sent-hil/pinboard-cli
cd pinboard-cli
# Build the binary
go build -o pinboard-cli
# Move to a directory in your PATH (optional)
sudo mv pinboard-cli /usr/local/bin/You need to set your Pinboard API token as an environment variable.
Set the environment variable for your current session:
set -x PINBOARD_API_TOKEN "username:TOKEN"Add it to your Fish config for persistence:
# Add this line to ~/.config/fish/config.fish
set -gx PINBOARD_API_TOKEN "username:TOKEN"Replace username:TOKEN with your actual Pinboard username and API token, which you can find in your Pinboard settings under "password" tab.
pinboard-cli https://example.com
pinboard-cli --tags="programming,golang,cli" https://example.com
# Provide a custom title/description (skips automatic title fetching)
pinboard-cli --desc="My Custom Title" https://example.comThe tool automatically cleans titles from certain websites to remove common prefixes/suffixes. Built-in rules include GitHub repository titles.
Custom Title Rules
You can create a title_rules.json file in the same directory as the executable to add your own title cleaning rules:
[
{
"host_pattern": "github.com",
"title_pattern": "^GitHub - [^:]+: (.+)$",
"replacement": "$1"
},
{
"host_pattern": "arxiv.org",
"title_pattern": "^\\[[0-9.]+\\] (.+)$",
"replacement": "$1"
}
]Each rule consists of:
host_pattern: A string that should be in the URL host- `title_pattern``: A regular expression to match against the title
replacement: The replacement pattern (can use regex capture groups)
If you see an error about the API token:
Error: PINBOARD_API_TOKEN environment variable not set
Make sure you've set the environment variable correctly:
set -x PINBOARD_API_TOKEN "username:TOKEN"
echo $PINBOARD_API_TOKEN # Verify it's set correctlyMIT