| Crates.io | cmdy |
| lib.rs | cmdy |
| version | 0.2.1 |
| created_at | 2025-05-10 05:23:31.265742+00 |
| updated_at | 2025-12-01 21:47:30.981463+00 |
| description | Lists and runs predefined command snippets |
| homepage | |
| repository | https://github.com/markjaquith/cmdy |
| max_upload_size | |
| id | 1668090 |
| size | 86,033 |
A simple CLI tool to manage, select, and execute predefined shell command snippets.
edit subcommand: open a snippet's source file in your $EDITORclip subcommand: copy a snippet's command to the system clipboardRequires Rust and cargo.
cargo install cmdy
$XDG_CONFIG_HOME/cmdy/commands or ~/.config/cmdy/commands)..toml files with snippet definitions (see Defining Snippets below).cmdy
cmdy edit — Launch your $EDITOR on the selected snippet's TOML file.cmdy clip — Copy the selected snippet's command string to your clipboard.--dir <DIRECTORY> — Specify a custom snippets directory (overrides default).-t, --tag <TAG> — Show only snippets tagged with <TAG> (can be repeated).-q, --query <QUERY> — Pre-populate the initial filter query for the interactive selector. This works with fzf and gum (PRs welcome for other filtering tools).--dry-run — Show the command that would be executed without actually running it. Useful for verifying commands before execution.Global settings are loaded from cmdy.toml in your config directory ($XDG_CONFIG_HOME/cmdy/cmdy.toml or ~/.config/cmdy/cmdy.toml).
Example cmdy.toml:
# Command used for interactive filtering
filter_command = "fzf --ansi --layout=reverse --border=rounded --height=50%"
# Additional snippet directories to scan
directories = ["/path/to/other/snippets"]
Create one or more .toml files in your snippets directory, using the [[commands]] table:
[[commands]]
description = "List all files with details"
command = "ls -lAh --color=auto"
tags = ["files", "list"]
[[commands]]
description = "Show current date and time"
command = "date '+%Y-%m-%d %H:%M:%S'"
Files without valid [[commands]] tables are skipped, and duplicate description names across files will error.
Clone the repo and build:
git clone https://github.com/markjaquith/cmdy.git
cd cmdy
cargo build
cargo test
Ensure you have fzf installed in your PATH for interactive selection.
# Run tests
cargo test
# Run linting
cargo clippy
# Format code
cargo fmt
# Run with debug output
RUST_LOG=debug cargo run
# Build release version
cargo build --release
# Check for security vulnerabilities
cargo audit
cmdy/
├── src/ # Source code
│ ├── main.rs # Entry point and CLI parsing
│ ├── config.rs # Configuration management
│ ├── types.rs # Data structures
│ ├── loader.rs # TOML file loading
│ ├── ui.rs # User interface and selection
│ └── executor.rs # Command execution
├── tests/ # Integration tests
├── examples/ # Example command files
├── .github/ # CI/CD workflows
└── Cargo.toml # Project manifest
# patch, or minor, or major
cargo release patch --no-publish --execute
git push --follow-tags
If a release fails CI on GitHub, delete the tag and retry:
git tag -d v0.1.X
git push origin :v0.1.X
# Fix the issue, then re-release
Distributed under the MIT License. See LICENSE for details.