Skip to main content

beautiful TUI to manage your bookmarks stored on linkhut

Project description

LinkHut CLI

PyPI Downloads PyPI version

A powerful command-line interface for managing your bookmarks with LinkHut. Efficiently add, update, delete, and organize your bookmarks directly from the terminal.

alt text

Features

  • Bookmark Management: Add, update, delete, and list bookmarks
  • Tag Management: Rename and delete tags across all bookmarks
  • Reading List: Maintain a reading list with to-read/read status toggling
  • Features:
    • Automatic title fetching when adding bookmarks.
    • Tag suggestions based on bookmark content.
    • Rich formatting for improved readability.
    • Auto completion for commands and options using key.

Installation

Option 1: Install from PyPI (recommended)

pip install linkhut-cli

Option 2: Install from source

# Clone the repository
git clone https://github.com/yourusername/linkhut-cli.git
cd linkhut-cli

# Install in development mode
pip install -e .

Configuration

The CLI requires two environment variables to function:

  • LH_PAT: Your LinkHut Personal Access Token. (sign in and get it from here)
  • LINK_PREVIEW_API_KEY: Free API key for fetching link previews (get it for free from here)

You can set these in a .env file in the project root or set them in your environment.

Checking Configuration

# Verify your configuration status
linkhut config_status

Handy Aliases

You can set up aliases in your shell configuration file (e.g., .bashrc, .zshrc) for convenience:

alias bm='linkhut'
alias bg='bm bookmarks get'
alias ba='bm bookmarks add'
alias rl='bm reading-list'

all the flags and options stay the same.

Usage Guide

Managing Bookmarks

bookmarks get help menu

Get Bookmarks

bookmarks get operation

# get your most recent bookmarks (default: 15)
linkhut bookmarks get

# get bookmarks filtered by tags seperated by commas, separated by spaces inside quotes or mix and match
linkhut bookmarks get -g stream,cricket
linkhut bookmarks get -g 'stream cricket'
linkhut bookmarks get -g 'stream, cricket'

# se the count of bookmarks to fetch
linkhut bookmarks get -g stream -c 5

# Filter by specific date (YYYY-MM-DD format)
linkhut bookmarks get -d 2025-05-19 -g personal-blog -c 4

# Search for a specific URL
# because of limitation of the API, it can only match exact URLs
linkhut bookmarks get -u https://registry.jsonresume.org/

Adding Bookmarks

alt text

If the url already exists, program will throw an error. You can add -R flag to replace the existing bookmark.

# Add a bookmark with just the URL (title and tags will be fetched automatically)
linkhut bookmarks add https://example.com

# Add with full details
linkhut bookmarks add https://github.com/xiangechen/chili3d -g "simulation, 3d, cad, blender" -n "A browser based 3D simulation engine"

# Add multiple bookmarks seperated by commas or newlines inside quotes
ba "https://github.com/thomasdavis/resume
https://www.npmjs.com/package/jsonresume-theme-onepage-plus
https://github.com/vkcelik/jsonresume-theme-onepage-plus
https://www.npmjs.com/package/jsonresume-theme-even"

Updating Bookmarks

alt text

The default behavior of the update command is to append tags and notes to the existing bookmark. If you want to replace the existing tags or notes, you can use the -R flag.

# replace existing tags
linkhut bookmarks update https://audiophile.fm/intense-radio -g "audio,stream,radio" -R

# Append to existing note
linkhut bookmarks update https://audiophile.fm/intense-radio -n "New note content"

# Change privacy setting
linkhut bookmarks update https://macthemes.garden/ -g 'macos, themes' --private

Deleting Bookmarks

This command deletes a bookmark identified by its URL. It first shows the bookmark details and then asks for confirmation before deleting. Use the --force option to skip the confirmation prompt.

alt text

# Delete with confirmation prompt
linkhut bookmarks delete https://www.depthofml.in

# Delete without confirmation
linkhut bookmarks delete https://www.depthofml.in --force

Reading List Operations

Manage Items in your reading list with ease. You can add items to your reading list, mark them as read, or toggle their status. While toggling, you can also add notes and tags to the items.

alt text

# show 5 most recent reading list items
linkhut reading-list

# show most recent n reading list items
linkhut reading-list --count 10

# Add a bookmark to your reading list
linkhut reading-list https://example.com --to-read

# Mark item as read with tags and notes
linkhut reading-list https://example.com --read -g "python, cli" -n "Good read, shows the power of CLI tools"

Managing Tags

Allows you to rename or delete tags across all bookmarks. This is useful for maintaining consistency in your tagging system.

alt text

Renaming Tags

alt text

# Rename a tag across all bookmarks
linkhut tags rename old-tag-name new-tag-name

Deleting Tags

alt text

# Delete a tag from all bookmarks (with confirmation)
linkhut tags delete tag-name

# Delete a tag without confirmation
linkhut tags delete tag-name --force

Help and Documentation

# Get general help
linkhut --help

# Get help for a specific command group
linkhut bookmarks --help

# Get help for a specific command
linkhut bookmarks add --help

Development

Please refer to the development guide for information on contributing to this project.

License

This project is licensed under the terms of the LICENSE file included in the repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkhut_cli-0.2.1.tar.gz (957.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkhut_cli-0.2.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file linkhut_cli-0.2.1.tar.gz.

File metadata

  • Download URL: linkhut_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 957.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for linkhut_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eb272bea72a5495c388e3f9a67285f07b537ca97a00551be18d87ce280dd0df8
MD5 688db14d90878f363bacf04d8de27cc3
BLAKE2b-256 9b84c3f8bfc2a5170705c50149cf83fc8ad0d67976e0b526b8c71f5d5ea3f97e

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkhut_cli-0.2.1.tar.gz:

Publisher: publish.yml on Shubxam/linkhut-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linkhut_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: linkhut_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for linkhut_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 435f1a5dbdec10b80eaf68f1e301796667d0a6984c5bf8dae259e544e685b812
MD5 99b051bcd8200b07074f5e78d52d97a1
BLAKE2b-256 33e3b59aa8f7a5c62628bb59f047ebb4014f9c7c89217223cbe0024c145b94f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkhut_cli-0.2.1-py3-none-any.whl:

Publisher: publish.yml on Shubxam/linkhut-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page