AI-powered Pinboard bookmark manager using AI for tagging and summarization
Project description
๐ smartpin (pinit
CLI)
AI-powered Pinboard bookmark manager that automatically extracts metadata from web pages
smartpin installs the CLI tool pinit
, which intelligently analyzes web pages and creates perfectly organized bookmarks for your Pinboard account. Just provide a URL, and AI will extract the title, generate a concise description, and suggest relevant tags - no manual data entry required! ๐คโจ
โจ Features
- ๐ค Automatic metadata extraction - AI analyzes pages to extract title, description, and relevant tags
- ๐ฏ Smart tagging - AI suggests contextually appropriate tags for better organization
- ๐ Flexible AI models - Supports Claude, GPT-4, Gemini, and other LLM providers
- ๐ Reliable content fetching - Local HTTP client with BeautifulSoup for robust page parsing (v0.2.0)
- ๐ป Rich terminal UI - Beautiful output with progress indicators and formatted results
- ๐งช Dry-run mode - Preview extractions without saving to Pinboard
- ๐ JSON output - Machine-readable format for scripting and automation
- ๐ Privacy controls - Mark bookmarks as private or "to read" as needed
๐ Quick Start
Installation
# Clone the repository
git clone https://github.com/kevinmcmahon/smartpin.git
cd smartpin
# Install with uv (recommended)
uv pip install -e .
# Or install all dependencies
uv sync
Configuration
1. Get your Pinboard API token:
Visit https://pinboard.in/settings/password to find your API token.
2. Set up environment variables:
# Required: Pinboard authentication
export PINBOARD_API_TOKEN=your_username:your_token
# Required: AI provider API key (choose one based on your model)
export ANTHROPIC_API_KEY=your_key # For Claude models
# OR
export OPENAI_API_KEY=your_key # For GPT models
# OR see LLM docs for other providers
3. Optional: Create a .env
file for persistent configuration:
# Create in project directory as .env or at ~/.pinit/config
PINBOARD_API_TOKEN=your_username:your_token
# Choose your AI provider (set the appropriate key)
ANTHROPIC_API_KEY=your_anthropic_api_key # For Claude models
# OPENAI_API_KEY=your_openai_api_key # For GPT models
# Optional: specify model (defaults to anthropic/claude-sonnet-4-0)
PINIT_MODEL=gpt-4 # or claude-opus-4-0, gpt-3.5-turbo, etc.
Basic Usage
# Add a bookmark with AI analysis
pinit add https://example.com
# Preview extraction without saving
pinit add https://example.com --dry-run
# Add private bookmark marked as "to read"
pinit add https://example.com --private --toread
# Get JSON output for scripting
pinit add https://example.com --json
๐ Usage Examples
Standard Bookmark Addition
$ pinit add https://example.com/ai-software-development
Output:
โโ Extracted Bookmark โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Title: How to Build Better Software with AI โ
โ URL: https://example.com/ai-software-development โ
โ Description: A comprehensive guide exploring how โ
โ artificial intelligence can enhance software โ
โ development workflows and code quality. โ
โ Tags: ai, software-development, programming, guide โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Bookmark saved successfully!
Advanced Options
# Use a different AI model
pinit add https://example.com --model gpt-4
# Or use GPT-3.5 for faster/cheaper processing
pinit add https://example.com --model gpt-3.5-turbo
# Check your configuration
pinit config
# JSON output for automation
pinit add https://example.com --json | jq '.tags'
๐ง Configuration
Configuration Loading
Configuration is loaded in this priority order (highest to lowest):
- System environment variables
- Local
.env
file (current directory) - User configuration
~/.pinit/config
AI Model Configuration
The application uses the LLM library for flexible AI model integration:
- Default model:
anthropic/claude-sonnet-4-0
(can be changed viaPINIT_MODEL
) - Supported providers: Anthropic Claude, OpenAI GPT, Google Gemini, and many others
- Easy model switching: Change models without code modifications
- Required API keys depend on your chosen provider:
ANTHROPIC_API_KEY
for Claude modelsOPENAI_API_KEY
for GPT modelsGEMINI_API_KEY
for Google Gemini- See LLM documentation for other providers
Supported Models
Provider | Popular Models | Environment Variable |
---|---|---|
OpenAI | gpt-4, gpt-4-turbo, gpt-3.5-turbo | OPENAI_API_KEY |
Anthropic | claude-sonnet-4-0, claude-opus-4-0 | ANTHROPIC_API_KEY |
gemini-pro, gemini-ultra | GEMINI_API_KEY | |
Cohere | command, command-light | COHERE_API_KEY |
Others | Various | See LLM docs |
Choose the model that best fits your needs:
- Speed: GPT-3.5-turbo, Claude Sonnet, Gemini Pro
- Quality: GPT-4, Claude Opus, Gemini Ultra
- Cost: GPT-3.5-turbo, Cohere Command-light
๐ ๏ธ Development
Setup Development Environment
# Install development dependencies
make dev
# Run all quality checks
make check
# Individual commands
make lint # Run Ruff linting
make typecheck # Run MyPy type checking
make format # Auto-format code
make clean # Remove cache files
Architecture
smartpin installs the CLI tool pinit
, which follows modern Python best practices with:
- Type hints throughout the codebase
- Comprehensive error handling with user-friendly messages
- Clean separation of concerns between CLI, AI processing, and API interactions
- Rich terminal formatting for beautiful output
- Configurable AI models via the LLM library abstraction
Core Components
PinboardBookmarkExtractor
- Interfaces with AI models to analyze web pagespinboard_client
- Wrapper functions for Pinboard API operationscli
- Click-based command interface with Rich formatting- Jinja2 templates - Customizable prompts for AI extraction
๐ฆ Dependencies
- CLI Framework:
click
- Command-line interface creation - Terminal UI:
rich
- Beautiful terminal formatting - AI Integration:
llm
- Universal LLM library for multiple providers - API Client:
pinboard
- Official Pinboard API client - Configuration:
python-dotenv
- Environment variable management - Templating:
jinja2
- Prompt template rendering
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Run quality checks (
make check
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ Acknowledgments
- Built with the excellent LLM library by Simon Willison
- Terminal UI enhanced by Rich
- Pinboard API by Pinboard
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file smartpin-0.2.3.tar.gz
.
File metadata
- Download URL: smartpin-0.2.3.tar.gz
- Upload date:
- Size: 51.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4b33cef7f025565601056a4ad7307daa08236d2cc8ed53e99cf12372ef1e9955
|
|
MD5 |
c0b740bba6f67e26ecefa6b9d760748c
|
|
BLAKE2b-256 |
f1619e568b2064faff357542fe39b86ae14c2c68a5de1326523ed0774f6630cb
|
File details
Details for the file smartpin-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: smartpin-0.2.3-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
579a5a376c4c58c60ad639fa4f80cbe416daceac92b226afc42e64f2cc2926ee
|
|
MD5 |
ac282171149ef04d1d117aa7d7f7f1ee
|
|
BLAKE2b-256 |
731e30adc25101d494de318543914257009cb50441f8a0bcaa71809e64873afe
|