3 unstable releases

0.3.1 Dec 15, 2024
0.3.0 Dec 15, 2024
0.2.0 Oct 8, 2023

#327 in Database interfaces

Download history 6/week @ 2024-09-21 2/week @ 2024-10-12 2/week @ 2024-11-02 2/week @ 2024-12-07 228/week @ 2024-12-14 8/week @ 2024-12-21

237 downloads per month

MIT license

46KB
1K SLoC

Rust 889 SLoC // 0.0% comments PowerShell 85 SLoC // 0.1% comments Zsh 20 SLoC Nushell 19 SLoC SQL 6 SLoC

Chest

Chest is a multi-platform CLI Command organizer inspired by hoard and built in Rust.

It allows you to save commands that are too complicated or long to remember. When you add a command to chest, it remembers:

  • a name for the command
  • the command
  • a description you provide

Next time you need a command, search for it using chest's search feature to quickly find it again.

Table of contents

Install

Current release: 0.3.1

Using crates.io

Set up a Rust toolchain using rustup, then run the following command.

cargo install chest-rs --locked --profile=dist

Using cargo-binstall

Install cargo-binstall, then run the following command.

cargo binstall chest-rs

Using Github Releases

Archive formats and script installers are available in Github Releases. Make sure the installed executable is in your PATH.

Shell Integration

Install chest as a plugin to enable deeper shell integration.

Nushell

Run the following command.

chest init nu | save ~/init-chest.nu

Then add the following to your Nushell config file.

source ~/init-chest.nu

Zsh

Add the following to your zsh profile.

source chest init zsh

PowerShell

Add the following to your PowerShell profile.

Invoke-Expression (& { (chest init powershell | Out-String) })

Usage

Add

In order to add a command to your chest database, use the following command.

chest add

You will be prompted to fill in the necessary information.

Update

In order to update a command in your chest database, use the following command.

chest update

You will be prompted to fill in the updated information.

Remove/Delete

In order to remove a command from your chest database, use the following command.

chest remove

You will be prompted for the name of the command to remove.

A delete alias is also provided.

chest delete

Once a command has been added to your chest, there are two ways to search for it.

Using the following command, the top 5 commands that match the query are returned.

chest search <QUERY>

Using the following command, a TUI opens that allows for interactive searching.

chest search --interactive

Optionally, a query can be added in order to populate the search box with an initial search term.

chest search --interactive <QUERY>

Finally, if chest is installed as a shell plugin, interactive search is available through a keybinding (default Ctrl-h). Additionally, if chest is invoked through the keybinding, confirming a selection adds the selected command to your next prompt.

Reset

If you get a database error after an update, it may be necessary to reset your saved commands. You can do so using the following command.

chest reset

Keybindings

Open from shell

<Ctrl-h>

Next or previous command in list

<Up-arrow> or <Down-arrow>

Select a command

<Enter>

Cancel selection and close chest

<Esc> or <Ctrl-c>

Dependencies

~57MB
~1M SLoC