CLI Reference
Complete guide to all ShellTime CLI commands
$ shelltime initGetting Started
shelltime initInitialize shelltime: authenticate, install hooks, start daemon, and configure AI code integrations. This is the recommended way to set up shelltime after installation.
--token, -tAuthentication token (skip browser auth)shelltime initshelltime authAuthenticate with shelltime.xyz. Opens a browser for login, or accepts a token directly.
--token, -tAuthentication token (skip browser auth)shelltime doctorDiagnose your shelltime setup. Checks system info, config validity, daemon status, and hook installation.
shelltime doctorCommand Tracking
shelltime trackinternalTrack user commands. This is called automatically by installed shell hooks — you do not need to run this manually.
--shell, -sShell type--sessionId, --idUnix timestamp of the session--command, --cmdCommand that was executed--phase, -pPhase: pre or post--result, -rExit code of last command--ppidParent process ID of the shell (for terminal detection)shelltime syncManually sync locally stored commands to the server. Useful if the daemon was offline or you want to force an immediate sync.
--dry-run, -drPreview what would be synced without sendingshelltime sync --dry-runshelltime lsList commands saved in local storage.
--format, -fOutput format: table or json (default: table)shelltime ls --format jsonshelltime gcClean internal storage to free up disk space.
--withLog, -wlAlso clean the log file--skipLogCreation, -slcSkip creating a new log file after cleanupSearch & AI
shelltime queryalias: qAsk AI for command suggestions based on a natural language prompt.
shelltime query "find all files modified in the last 24 hours"
shelltime q "show disk usage for current directory"shelltime rgalias: grepSearch your server-synced command history with powerful filters.
--format, -fOutput format: table or json (default: table)--limit, -lMaximum number of results (default: 50)--last-idStart after this command ID (for pagination)--shell, -sFilter by shell (bash, zsh, fish)--hostname, -HFilter by hostname--username, -uFilter by username--result, -rFilter by exit code (-1 means any)--main-command, -mFilter by main command (e.g., git, npm)--sinceFilter commands since date (2024, 2024-01, or 2024-01-15)--untilFilter commands until date (2024, 2024-01, or 2024-01-15)shelltime rg "docker" --shell zsh --since 2024-01
shelltime grep "git push" --main-command git --limit 10Shell Management
shelltime hooksManage shelltime shell hooks. Hooks are what enable automatic command tracking in your shell.
shelltime hooks installInstall shelltime hooks into your shell configuration files.
shelltime hooks uninstallRemove shelltime hooks from your shell configuration files.
shelltime aliasManage shell aliases. Import aliases from your shell configuration files to sync them with shelltime.
shelltime alias importImport aliases from shell configuration files.
--fully-refresh, --fullFully refresh all aliases instead of incremental import--fish-config, -fcFish config file path (default: ~/.config/fish/config.fish)--zsh-config, -zcZsh config file path (default: ~/.zshrc)shelltime dotfilesSync your dotfiles across machines. Supports nvim, fish, git, zsh, bash, ghostty, claude, starship, npm, ssh, kitty, and kubernetes configurations.
shelltime dotfiles pushPush local dotfiles to the server.
--apps, -aSpecify which apps to push (e.g., nvim,fish,git). If empty, pushes allshelltime dotfiles pullPull dotfiles from the server and save to local config.
--apps, -aSpecify which apps to pull. If empty, pulls all--dry-run, -nShow what would be changed without writing filesDaemon
shelltime daemonManage the shelltime background daemon. The daemon handles syncing commands to the server automatically.
shelltime daemon statusCheck the status of the shelltime daemon service.
shelltime daemon installInstall the shelltime daemon service.
shelltime daemon uninstallUninstall the shelltime daemon service.
shelltime daemon reinstallReinstall the daemon service (uninstall then install).
AI Integrations
shelltime ccClaude Code integration. Configure OpenTelemetry environment variables for tracking Claude Code usage.
shelltime cc installalias: -iInstall Claude Code OTEL environment configuration to shell config files.
shelltime cc uninstallalias: -uRemove Claude Code OTEL environment configuration from shell config files.
shelltime cc statuslineOutput statusline for Claude Code (reads JSON from stdin).
shelltime codexOpenAI Codex integration. Configure OTEL settings in Codex config for tracking usage.
shelltime codex installalias: -iInstall Codex OTEL configuration to ~/.codex/config.toml.
shelltime codex uninstallalias: -uRemove ShellTime OTEL configuration from ~/.codex/config.toml.
Configuration
shelltime configManage shelltime configuration.
shelltime config viewView current configuration.
--format, -fOutput format: table or json (default: table)shelltime schemaGenerate JSON schema for the config file. Useful for IDE autocompletion and validation.
--output, -oOutput file path (default: stdout)shelltime schema --output ~/.config/shelltime/schema.jsonshelltime webOpen the ShellTime web dashboard in your default browser.
Global Flags
These flags can be used with any command.
--version, -vPrint the version--help, -hShow help for any commandReady to get started?
Install the CLI and run shelltime init to set everything up.