Skip to content

Latest commit

 

History

History
124 lines (85 loc) · 2.73 KB

File metadata and controls

124 lines (85 loc) · 2.73 KB

CLI Reference

Core Commands

clai cmd <natural language> (Coming Soon)

Convert natural language into a shell command via Claude CLI.

clai cmd "list all files in the current directory"
clai cmd "find all Python files modified today"

Note: This feature is not yet fully implemented.

clai ask <question> (Coming Soon)

Ask Claude a question with terminal context (cwd + shell).

clai ask "How do I find large files?"
clai ask --context "git status\nmake test" "What should I run next?"

Note: This feature is not yet fully implemented.

clai suggest [prefix]

Get suggestions for the current prefix. Falls back to shell history when the history daemon is unavailable. With an empty prefix, returns the cached AI suggestion.

clai suggest "git st"           # Top suggestion
clai suggest --limit 5 "git"    # Up to 5 suggestions
clai suggest --json "git"       # JSON output (includes risk field)

clai history [query]

Query command history stored in the clai database. By default, it uses the current session ID.

clai history                 # Recent commands (current session)
clai history git             # Commands starting with "git"
clai history --global        # Across all sessions
clai history --cwd /tmp      # Filter by working directory
clai history --status success
clai history --format json

clai on / clai off

Enable or disable suggestion UX globally (config) or for the current session.

clai off
clai on
clai off --session
clai on --session

Setup & Configuration

clai install

Install shell integration by writing a hook file and sourcing it from your rc file.

clai install
clai install --shell=zsh
clai install --shell=bash
clai install --shell=fish

clai uninstall

Remove shell integration lines from your rc file.

clai uninstall

clai init <shell>

Print the shell integration script to stdout and generate a session ID. Use this if you prefer eval in your rc file instead of clai install.

eval "$(clai init zsh)"
clai init fish | source

clai config [key] [value]

Get or set configuration values in ~/.clai/config.yaml.

clai config
clai config suggestions.enabled
clai config suggestions.enabled false

clai status

Show status for Claude CLI, shell integration, session ID, and the history daemon.

clai status

clai version

Print version, git commit, and build date.

clai version

Background Processes

  • History daemon (claid): gRPC daemon that stores history and serves session-aware suggestions. It is started by clai-shim when available. If claid is not installed, clai suggest falls back to your shell history.