Skip to content

Bunchhieng/rl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rl - Read Later CLI

A minimal, local-first "read later" CLI tool for macOS and Linux. Store links locally with SQLite, no account, no sync, no background daemon. Follows Linux command conventions (ls, rm, grep) for familiarity.

Features

  • Local-first: All data stored in a single SQLite file
  • Fast: Minimal dependencies, quick startup
  • Portable: Easy export/import via JSON
  • Search: Full-text search across URLs, titles, notes, and tags
  • Interactive TUI: Beautiful terminal interface with multi-select support
  • Simple: Clean CLI interface with standard library only

Installation

Go Install

go install github.com/bunchhieng/rl@latest

Add to PATH:

# zsh (macOS)
GOPATH=$(go env GOPATH)
echo "export PATH=\"$GOPATH/bin:\$PATH\"" >> ~/.zshrc && source ~/.zshrc

# bash (Linux)
GOPATH=$(go env GOPATH)
echo "export PATH=\"$GOPATH/bin:\$PATH\"" >> ~/.bashrc && source ~/.bashrc

Verify: rl version

Build from Source

git clone https://github.com/bunchhieng/rl.git && cd rl
make build              # Build binary
make install            # Install to $GOPATH/bin
# Or manually: go build -o bin/rl .

Database Location

  • macOS: ~/Library/Application Support/rl/links.db
  • Linux: ~/.config/rl/links.db
  • Windows: %AppData%/rl/links.db

Override with --db-path flag.

Usage

Commands follow Linux conventions for familiarity. Use rl --help or rl <command> for details.

Interactive TUI Mode

Launch the interactive terminal interface:

rl              # Launch TUI (default when no command provided)
rl tui          # Or explicitly launch TUI

Keyboard shortcuts:

  • j/ - Move down
  • k/ - Move up
  • g - Go to top
  • G - Go to bottom
  • Space - Toggle selection (multi-select)
  • Ctrl+A - Select all visible links
  • Ctrl+D - Deselect all
  • / - Search mode
  • Tab - Cycle filter (Unread/Read/All)
  • o/Enter - Open link in browser
  • d - Mark as read (works on selected items)
  • u - Mark as unread (works on selected items)
  • r - Delete link(s) (with confirmation, works on selected items)
  • q - Quit

Add a link

rl add <url> [--title "..."] [--note "..."] [--tags "..."]
rl add https://example.com --title "Example" --tags "web,example"

List links (ls - Linux standard)

rl ls                      # Unread links (default)
rl ls --read               # Read links only
rl ls --all                # All links
rl ls --tag <tag>          # Filter by tag
rl ls --limit <n>          # Limit number of results
# 'list' also works as alias

Open, mark, delete

rl open <id>               # Open link in browser (doesn't mark as read)
rl done <id>               # Mark link as read
rl undo <id>               # Mark link as unread
rl rm <id> [id...]         # Delete one or more links (Linux standard)

Search (grep - Linux standard)

rl grep <query>            # Full-text search across URL, title, note, tags
# 'search' also works as alias

Export/Import

rl export > links.json     # Export all links to JSON
rl import <file>           # Import links from JSON (merges duplicates)

Examples

# Interactive mode
rl                          # Launch TUI for interactive browsing

# Add links
rl add https://golang.org --title "Go" --tags "programming,go"
rl add https://rust-lang.org --tags "programming,rust"

# List and filter
rl ls                      # List unread
rl ls --tag programming    # Filter by tag
rl ls --all --limit 10     # All links, limited

# Work with links
rl open <id>               # Open in browser
rl done <id>               # Mark as read
rl rm <id> <id>            # Delete multiple links

# Search and backup
rl grep "programming"      # Search links
rl export > backup.json    # Backup all links

Development

make build                 # Build binary
make test                  # Run tests
make install               # Install locally

JSON Export Format

[
  {
    "id": "9m1w2z3x",
    "url": "https://example.com",
    "title": "Example Site",
    "note": "Optional note",
    "tags": "tag1,tag2",
    "created_at": "2024-01-01T12:00:00Z",
    "read_at": "2024-01-02T10:30:00Z"
  }
]

Architecture

  • main.go: Main entry point
  • internal/app: Application initialization
  • internal/storage: SQLite implementation
  • internal/model: Data models and validation
  • internal/cli: Command handlers
  • internal/tui: Interactive terminal UI (Bubble Tea)

Dependencies

  • modernc.org/sqlite: Pure Go SQLite driver (no CGO)
  • github.com/jmoiron/sqlx: Lightweight SQL extensions
  • github.com/charmbracelet/bubbletea: Terminal UI framework

License

MIT

About

rl - Read Later CLI

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors