Skip to content

A dynamic command snippet manager for the Fish shell. Save complex commands with metadata, use templates with variables, and perform interactive searches using `fzf`.

License

Notifications You must be signed in to change notification settings

Code-Hive-Colombia/cmdvault.fish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cmdvault.fish

A dynamic command snippet manager for the Fish shell. Save complex commands with metadata, use templates with variables, and perform interactive searches using fzf.

asciicast

Prerequisites

The following tools must be installed:

Installation

Using fisher:

fisher install code-hive-colombia/cmdvault.fish

Keybindings

The plugin configures the following default bindings (using the Alt key to ensure compatibility across terminal emulators):

Key Action Description
Alt + S add-cmd Saves the current command line buffer.
Alt + A get-cmd Opens fzf to search and insert a saved command.
Alt + X get-cmd-run Opens fzf to search and execute a saved command.
Alt + R remove-cmd Opens fzf to select and delete a saved command.
Alt + E edit-cmd-file Opens the JSON storage file in your $EDITOR.

CLI Usage

You can also manage your vault directly via commands:

  • add-cmd [-n NAME] [-d DESCRIPTION]: Adds a command. If flags are missing, it will prompt for input. Supports Ctrl+C to cancel.
  • get-cmd: Triggers the interactive search and placeholder replacement.
  • remove-cmd [-n NAME]: Removes a command by name or opens a selector if no name is provided.
  • edit-cmd-file: Manual access to the serialized data.

Dynamic Templates (Key Replacement)

You can save commands containing placeholders using the %variable% syntax. When you retrieve the command, the extension will prompt you for a value for each placeholder.

Example:

  1. Save a command as: git commit -m "%message%"
  2. When selected via Alt + A, the shell will prompt: Value for 'message':
  3. Result: git commit -m "your custom message"

Configuration

The commands are stored in a JSON file located at: ~/.config/fish/commands_store.json

About

A dynamic command snippet manager for the Fish shell. Save complex commands with metadata, use templates with variables, and perform interactive searches using `fzf`.

Topics

Resources

License

Stars

Watchers

Forks

Languages