bookmark-cli

Crates.iobookmark-cli
lib.rsbookmark-cli
version1.2.0
sourcesrc
created_at2024-09-22 13:29:01.706619
updated_at2024-11-24 12:08:50.74248
descriptionSimple bookmark tool
homepage
repositoryhttps://github.com/iced-penguin/bookmark-cli
max_upload_size
id1382973
size48,469
(iced-penguin)

documentation

README

bookmark-cli

A command-line tool for managing bookmarks of directories.

Overview

This tool aims to allow users to save paths to specific directories as bookmarks, making it easy to access them later. Users can add, search, list, and delete bookmarks.

Bookmarks are stored in a hidden file (~/.bookmarks).

demo

Requirements

  • rustc and cargo

Installation

cargo install bookmark-cli

Usage

Command Description
add Add a bookmark
delete Delete a bookmark
search Search for a bookmark
list List bookmarks
prune Delete all broken bookmarks
help Print this message or the help of the given subcommand(s)

Adding a Bookmark

bm add [bookmark path] [--tags tag1,tag2,...]

The bookmark path must be an absolute path.

If you do not specify [bookmark path], the current directory will be registered as a bookmark.

You can also add tags to the bookmark using the --tags option. Tags should be comma-separated.

Searching for a Bookmark

bm search

A search prompt will appear, allowing you to filter and select a bookmark.

Listing Saved Bookmarks

bm list

All bookmarks will be displayed.

Deleting a Bookmark

bm delete

A prompt will appear for you to select the bookmark you want to delete.

Deleting Broken Bookmarks

bm prune

All broken bookmarks, i.e. bookmarks that no longer exist, will be deleted.

Moving to a Bookmark

You can move to a selected bookmark by combining it with the cd command.

If you are using zsh, you can add a function to your ~/.zshrc.

For example:

function cb() {
  local -r dir=$(bm search)
  if [ -z "$dir" ]; then
    return 1
  fi
  cd "$dir" || return 1
}
Commit count: 70

cargo fmt