Private, cross-platform terminal memory for Linux, macOS, and Windows.
CI · MIT · Privacy · Changelog
Cmdtrail records terminal command metadata and helps you find what worked before. It keeps its database on your machine, redacts common secrets before storage, and never executes an old command without you explicitly copying it.
Shell history remembers text. It usually does not remember whether the command worked, how long it ran, which project it belonged to, or where you ran it.
Cmdtrail records that context so these questions have useful answers:
cmdtrail failed
cmdtrail search postgres
cmdtrail where uvicorn
cmdtrail project
cmdtrail fixcmdtrail fix is deterministic. It compares the latest failure with successful commands already stored on your machine. There is no model call and no cloud dependency.
Cmdtrail currently ships as an alpha. Rust 1.85 or newer is required.
git clone https://github.com/lemkyz/cmdtrail.git
cd cmdtrail
cargo install --path . --locked
cmdtrail init zshReplace zsh with bash, fish, or powershell. The init command installs both command recording and tab completion. Running it again is safe; existing Cmdtrail blocks are upgraded in place.
Open a new terminal, then verify the installation:
cmdtrail doctor
false
cmdtrail failedcmdtrail last Show the latest recorded command
cmdtrail failed Show recent failures
cmdtrail search <query> Search commands and project context
cmdtrail fix Find a previous successful command
cmdtrail where <query> Find where a command last succeeded
cmdtrail project Show useful commands for this project
cmdtrail project --all Include setup blocks and navigation commands
cmdtrail stats Show local command statistics
cmdtrail rerun <id> --raw Print a stored command; never execute it
cmdtrail pause Stop recording
cmdtrail resume Resume recording
cmdtrail status Show database and recording status
cmdtrail doctor Check the binary, database, and shell setup
cmdtrail init <shell> Install hooks and completions
For each accepted command, Cmdtrail stores:
- redacted command text
- working directory
- start time, finish time, and duration
- exit code
- shell and session identifier
- operating system
- executable name
- Git repository, root, and branch when available
Command output is not captured.
The database lives in the platform's standard local application-data directory:
- Linux:
~/.local/share/cmdtrail/cmdtrail.db - macOS:
~/Library/Application Support/dev.lemkyz.cmdtrail/cmdtrail.db - Windows:
%LOCALAPPDATA%\lemkyz\cmdtrail\data\cmdtrail.db
Exact paths are shown by cmdtrail status.
Redaction happens before SQLite insertion. Built-in rules cover common API-key assignments, bearer tokens, password and token flags, database password flags, Docker login passwords, GitHub tokens, and sk- style tokens.
Sensitive tools are ignored by default:
[privacy]
ignore_commands = ["pass", "gpg", "vault"]
ignore_directories = []Pause recording at any time:
cmdtrail pauseRead the full privacy model before using Cmdtrail in an environment with unusual secret formats.
Cmdtrail uses amber section headings, cyan context labels, green success markers, and red failure markers. Color is automatically disabled when output is redirected.
It also respects:
NO_COLOR=1 cmdtrail failed
CLICOLOR=0 cmdtrail stats| Platform | Recording shell support | CI |
|---|---|---|
| Linux | Zsh, Bash, Fish, PowerShell | Yes |
| macOS | Zsh, Bash, Fish, PowerShell | Yes |
| Windows | PowerShell | Yes |
Git Bash and Nushell are not part of the current alpha.
cargo fmt --all -- --check
cargo check --all-targets
cargo test --all-targets
cargo build --releaseTo inspect generated integration scripts:
cmdtrail hook zsh
cmdtrail completions zshThe visual rules are documented in docs/DESIGN.md.
- No command-output capture
- No cloud account or synchronization
- No natural-language model integration
- No automatic execution of stored commands
- Matching is intentionally conservative and may return no suggestion
MIT