Skip to content

CLI reference

The hansard executable configures imports, manages the local runtime, searches the archive, and opens viewer surfaces. The installed command is the source of truth for its exact version:

Terminal window
hansard help
hansard help import
hansard <command> --help

Print the installed version with hansard --version.

Command Purpose
hansard init Configure storage, privacy, sources, optional initial import, watcher startup, and integrations.
hansard app Open the native macOS app when available, with a browser fallback.
hansard web Serve and open the local browser viewer.
hansard status Report archive, watcher, index, sync, and recent-write state.
hansard doctor Check dependencies, parser versions, source coverage, index state, autostart, and sync.

hansard init --dry-run previews setup without changing the machine.

Command Purpose
hansard import --source <source> Import one supported local source.
hansard import --sources <a,b,c> Import an explicit source list.
hansard import chatgpt [path] Run the guided ChatGPT export import or import a ZIP/folder.
hansard import claude-web [path] Run the guided Claude.ai export import or import a ZIP/folder.
hansard import claude-cloud Explicitly import Claude Code cloud and Remote Control sessions with read-only requests.
hansard import windsurf <path> Import downloaded Windsurf trajectory Markdown.
hansard import accounts List or rename web-export account labels.
hansard show <session-id> Print, open, or JSON-render one archived conversation.
hansard export <session-id> Copy a normalized session bundle, optionally including raw sources.
hansard delete <session-id> Remove the Hansard copy without touching provider history.

Example:

Terminal window
hansard import --sources codex-cli,claude,cursor --since all --dry-run
hansard export <session-id> --out ./session-export
Command Purpose
hansard history [query] List or search sessions with project, provider, tool, command, and time filters.
hansard deep-recall <question> Plan several searches, read selected complete sessions, and synthesize a cited answer through an authenticated Codex or Claude CLI.
hansard stats Summarize activity, models, tokens, tools, commands, skills, MCP servers, and spend estimates.
hansard behavior Compare a bounded activity period with the immediately preceding period.
hansard permissions suggest Suggest Claude Code Bash(...) allow rules from archived shell history.
hansard memory backup Snapshot supported provider memory stores.
hansard memory search <query> Search current archived memory content and metadata.
hansard memory list|show|export Browse or export memory records.

A bounded session read is safer for agents and scripts than returning a whole long transcript:

Terminal window
hansard show <session-id> --json --msg-limit 20
hansard show <session-id> --json --msg-offset 0 --msg-limit 8
Command Purpose
hansard watcher <start|stop|restart|status|logs> Manage background imports and scheduled work.
hansard watcher login <enable|disable|status> Manage the user-level login item.
hansard config <show|path|get|set|unset> Inspect or update configuration values.
hansard config setup Reopen setup preferences without importing history.
hansard config sources <list|edit|set|add|remove> Manage watcher/import source preferences.
hansard index <pause|resume|status|rebuild> Manage local search indexes.
hansard rebuild Re-derive viewer payloads from archived transcript and event files.
hansard redact <status|init|enable|disable|test> Configure and test normalized-data redaction.
hansard redact reapply Rewrite normalized archives with current redaction rules.
hansard classify <status|enable|disable|run|show|clear|cleanup> Manage optional LLM session classification.
hansard mcp serve Run the recall MCP server over standard input and output.
Command family Purpose
hansard sync Upload, receive, or run two-way sync against the configured remote.
hansard personal-sync Manage a private complete-archive sync profile across devices.
hansard team Manage signed shared policies, invites, members, and legacy raw cleanup.
hansard integrations add-to <agent> Add recall and continue-from integration to one supported agent.
hansard integrations recall [target] Install native recall command or skill files.
hansard notify slack Configure optional Slack summaries, threads, and digests.

These features can move archive content beyond the local machine. Review their help and privacy boundary before enabling them.

Command Purpose
hansard rebuild Refresh derived viewer payloads without reading provider sources.
hansard index rebuild Recreate search and list indexes from the archive.
hansard update Clear derived local archive/import state and reimport configured sources.
hansard restore-sources <provider> Restore missing individual provider source files from raw preservation.
hansard repair claude-code-backups Restore missing Claude Code files from raw backups.
hansard repair codex-subagent-prompts Opt in to model-mediated recovery of encrypted Codex child-agent messages.
hansard reset Remove local Hansard state and archive objects for fresh setup.
hansard uninstall Stop the watcher, disable autostart, and optionally remove local data.

See maintenance before running the destructive refresh or reset paths.

Options are command-specific; not every command accepts every option.

Option Meaning where supported
--json Print machine-readable output.
--since 30d|90d|all Limit an import, search, rebuild, or report window. Some commands also accept hours, minutes, or ISO dates.
--source <source> Select one import source.
--sources <a,b,c> Select several import sources.
--repo <repo-or-path> Filter by canonical repository, archive scope, working directory, or display path.
--provider <provider-or-alias> Filter by provider or source alias.
--tool <name> Filter by normalized tool name.
--command <head> Filter by parsed shell command head such as git commit.
--dry-run Preview writes or destructive targets on commands that support it.