CLI Reference
Complete documentation for all shelltime CLI commands
Getting Started
shelltime initComplete initialization: authenticate, install hooks, start daemon, and configure AI code integrations.
$ shelltime init [--token <token>]| Flag | Default | Description |
|---|---|---|
--token, -t | - | Authentication token (will open browser if not provided) |
shelltime authAuthenticate with shelltime.xyz.
$ shelltime auth [--token <token>]| Flag | Default | Description |
|---|---|---|
--token, -t | - | Authentication token (will open browser if not provided) |
Command Tracking
shelltime trackTrack user commands. This is called automatically by shell hooks.
$ shelltime track [flags]| Flag | Default | Description |
|---|---|---|
--shell, -s | - | Shell name (bash, zsh, fish) |
--sessionId, --id | - | Unix timestamp of session |
--command, --cmd | - | Command that was executed |
--phase, -p | - | Tracking phase: "pre" or "post" |
--result, -r | - | Exit code of last command |
--ppid | - | Parent process ID |
shelltime syncManually sync local commands to the server.
$ shelltime sync [--dry-run]| Flag | Default | Description |
|---|---|---|
--dry-run, -dr | false | Simulate sync without side effects |
Data & Search
shelltime lsList locally saved commands with metadata.
$ shelltime ls [--format <table|json>]| Flag | Default | Description |
|---|---|---|
--format, -f | table | Output format |
shelltime gcClean and compact internal storage (garbage collection).
$ shelltime gc [flags]| Flag | Default | Description |
|---|---|---|
--withLog, -wl | - | Also clean log files |
--skipLogCreation, -slc | false | Skip log file creation |
shelltime rgalias: grepSearch server-synced commands with advanced filtering.
$ shelltime rg <search-text> [flags]| Flag | Default | Description |
|---|---|---|
--format, -f | table | Output format |
--limit, -l | 50 | Max results |
--last-id | - | Pagination: start after this ID |
--shell, -s | - | Filter by shell |
--hostname, -H | - | Filter by hostname |
--username, -u | - | Filter by username |
--result, -r | -1 | Filter by exit code (-1 for any) |
--main-command, -m | - | Filter by main command (e.g. git, npm) |
--since | - | Filter since date (e.g. 2024, 2024-01, 2024-01-15) |
--until | - | Filter until date |
Shell Integration
shelltime hooks installInstall shell hooks for automatic command tracking in bash, zsh, and fish.
$ shelltime hooks installshelltime hooks uninstallRemove shell hooks from bash, zsh, and fish.
$ shelltime hooks uninstallDaemon Management
shelltime daemon installInstall and start the background daemon service for fast syncing (<8ms latency).
$ shelltime daemon installshelltime daemon uninstallUninstall the daemon service.
$ shelltime daemon uninstallshelltime daemon reinstallReinstall the daemon (uninstall then install).
$ shelltime daemon reinstallshelltime daemon statusCheck daemon status, connectivity, version, uptime, and configuration.
$ shelltime daemon statusAI Features
shelltime queryalias: qQuery AI for command suggestions based on natural language.
$ shelltime query "describe what you want to do"shelltime webOpen the ShellTime web dashboard in your default browser.
$ shelltime webDiagnostics & Config
shelltime doctorCheck ShellTime setup and environment: system info, config validity, daemon status, hooks installation, and more.
$ shelltime doctorshelltime config viewView current configuration (sensitive fields are masked).
$ shelltime config view [--format <table|json>]| Flag | Default | Description |
|---|---|---|
--format, -f | table | Output format |
shelltime schemaGenerate JSON schema for the config file (for IDE autocompletion).
$ shelltime schema [--output <path>]| Flag | Default | Description |
|---|---|---|
--output, -o | - | Output file path (defaults to stdout) |
Dotfiles & Aliases
shelltime alias importImport aliases from shell configuration files.
$ shelltime alias import [flags]| Flag | Default | Description |
|---|---|---|
--fully-refresh, --full | false | Fully refresh instead of incremental import |
--fish-config, -fc | ~/.config/fish/config.fish | Fish config file path |
--zsh-config, -zc | ~/.zshrc | Zsh config file path |
shelltime dotfiles pushPush dotfiles to the server. Supported apps: nvim, fish, git, zsh, bash, ghostty, claude, starship, npm, ssh, kitty, kubernetes.
$ shelltime dotfiles push [--apps <app>...]| Flag | Default | Description |
|---|---|---|
--apps, -a | - | Apps to push |
shelltime dotfiles pullPull dotfiles from the server and apply locally.
$ shelltime dotfiles pull [flags]| Flag | Default | Description |
|---|---|---|
--apps, -a | - | Apps to pull |
--dry-run, -n | false | Show what would change without applying |
AI Coding Integrations
shelltime cc installInstall Claude Code OTEL environment configuration to shell config files.
$ shelltime cc installshelltime cc uninstallRemove Claude Code OTEL configuration from shell config files.
$ shelltime cc uninstallshelltime cc statuslineOutput formatted statusline for Claude Code status bar (reads JSON from stdin).
$ shelltime cc statuslineshelltime codex installInstall Codex OTEL configuration to ~/.codex/config.toml.
$ shelltime codex installshelltime codex uninstallRemove ShellTime OTEL configuration from ~/.codex/config.toml.
$ shelltime codex uninstall