zam 0.5.0

Enhanced shell history manager with sensitive data redaction
Documentation

zam(1) - shell history manager

CI License: MIT

SYNOPSIS

zam <command> [options]

DESCRIPTION

zam is a shell history manager with automatic sensitive data redaction, alias management, SQLite storage, and multi-host session tracking.

INSTALL

cargo install --path .

Or from crates.io:

cargo install zam

COMMANDS

log <command>       Log a command to history
search <term>       Search command history
recent              Show recent commands
frequent            Show most-used commands
import <shell>      Import history from zsh, bash, or fish
export              Export history (json, csv, tsv, plain)
stats               Display usage statistics
status              Show backend and configuration
clear               Clear history (with confirmation)
config              Manage configuration
validate            Test redaction patterns
shell <type>        Generate shell integration script
fzf                 Output commands for fzf integration
manage              Interactive history browser (TUI)
merge <db-file>     Merge another database
tokens              Manage stored redacted tokens
hosts               List tracked hosts
sessions            List shell sessions
alias               Manage shell aliases

OPTIONS

-c, --config <path>     Configuration file path
-v, --verbose           Verbose output
-q, --quiet             Suppress non-error output
    --no-color          Disable colored output
    --use-file          Force file-based backend

USAGE

# Log and search
zam log "git push origin main"
zam search "git"
zam search --regex "git (commit|push)"
zam search --fuzzy "dckr"
zam recent --count 10

# Shell integration (add to shell rc file)
zam shell zsh >> ~/.zshrc
zam shell bash >> ~/.bashrc
zam shell fish >> ~/.config/fish/config.fish

# Alias management
zam alias add ll "ls -la" "long listing"
zam alias list
zam alias export

# Import existing history
zam import zsh
zam import bash

# Merge from another machine
zam merge ~/backup/history.db

# Check status
zam status

CONFIGURATION

Default config file: ~/.zam.json

zam config --init       Generate default config
zam config --show       Print current config

Key settings: redaction patterns, search defaults, shell integration exclusions, import paths.

REDACTION

Automatically detects and redacts passwords, API keys, tokens, connection strings, bearer tokens, SSH keys, AWS credentials, and GitHub tokens.

Custom patterns can be added via configuration.

zam validate "pattern" --test "test string"

STORAGE

Default location: ~/.local/zam/

  • Database backend (default): zam.db -- SQLite with sessions, hosts, tokens
  • File backend (--use-file): zam.log -- structured log format

BUILDING

git clone https://github.com/fmeyer/zam.git
cd zam
cargo build --release
cargo test

LICENSE

MIT