Install and index local history

Install ctx, create local storage, discover sources, import history, and run a first search.

Install the CLI

The canonical installer for the standalone search CLI is https://ctx.rs/install. It installs the binary, installs the bundled agent-history skill, and runs ctx setup by default so discovered local history is inventoried and indexing begins. Daemon maintenance is enabled by default, so eligible setup runs request the ctx-owned background daemon after setup output.

macOS and Linux:

curl -fsSL https://ctx.rs/install | sh

Windows PowerShell:

irm https://ctx.rs/install.ps1 | iex

Use --no-setup on Unix or -NoSetup on Windows for install-only CI, packaging, or review flows. Install-only mode skips both the skill step and history indexing unless you pass a skill target explicitly. It also guarantees that the installer does not initialize the data root or write config.toml:

curl -fsSL https://ctx.rs/install | sh -s -- --no-setup

To keep setup but opt out of daemon autostart for that run, use --no-daemon, -NoDaemon, or CTX_INSTALL_NO_DAEMON=1:

curl -fsSL https://ctx.rs/install | sh -s -- --no-daemon
& ([scriptblock]::Create((irm https://ctx.rs/install.ps1))) -NoDaemon

Machine-readable setup output is not a daemon opt-out. --json changes the output contract only; automation that must suppress background maintenance must also pass --no-daemon or set CTX_INSTALL_NO_DAEMON=1.

The installer downloads release metadata and the ctx binary, then verifies release metadata and SHA-256 checksums before installing artifacts. It also writes a managed install marker so ctx upgrade can apply signed CLI updates, installs generated man pages unless --no-man or CTX_INSTALL_NO_MAN=1 is used, and installs ctx-agent-history-search unless --no-skill or CTX_INSTALL_NO_SKILL=1 is used. Target a specific skill folder with --skill-agent codex, repeat --skill-agent, or use --all-skill-agents; Windows exposes the same controls as -NoSkill, -SkillAgent, and -AllSkillAgents. Hosted binaries are published for Linux x64, Linux ARM64, macOS, and Windows. Setup and search do not send transcript text, prompts, or indexed search content to a model API. See the Privacy Policy before installing when you need strict command-metadata controls.

An eligible fresh interactive install starts the anonymous 14-day ctx pro trial automatically after Core setup. No account or payment card is required. Use --no-pro-trial, PowerShell -NoProTrial, or CTX_INSTALL_NO_PRO_TRIAL=1 for an explicit Core-only install. CI, unattended, machine-readable, no-setup, no-daemon, and managed rerun paths remain Core-only. Starting the trial is a documented network exception to local setup: it contacts the first-party trial service and stores installation-bound state in the operating system's native key store. See the Privacy Policy.

Uninstall the managed CLI

Use the standalone hosted uninstaller and choose whether to keep or delete local Pro data. Both choices preserve Core history under the ctx data root.

On macOS or Linux, choose one:

curl -fsSL https://ctx.rs/uninstall | sh -s -- --keep-data
curl -fsSL https://ctx.rs/uninstall | sh -s -- --delete-data

On Windows PowerShell, choose one:

$uninstall = [scriptblock]::Create((irm https://ctx.rs/uninstall.ps1))
& $uninstall -KeepData -NonInteractive
$uninstall = [scriptblock]::Create((irm https://ctx.rs/uninstall.ps1))
& $uninstall -DeleteData -NonInteractive

The keep-data choice preserves local Pro state for a later reinstall. The delete-data choice removes all user-deletable local Pro state tied to this data root. A small installation-bound anti-rollback watermark may remain in the selected credential vault; it contains no graph key, transcript content, account token, or entitlement body, and trial eligibility is not reset.

On macOS and Linux, the uninstaller removes only verified installer-owned CLI files and digest-bound integrations. On Windows, it removes the verified executable and marker, known installation-scoped upgrade coordination files, and the exact install-directory entry from the user PATH. Agent skills installed during Windows setup remain and must be removed separately. Modified or unowned files are preserved on every platform.

When working from source on any supported host:

scripts/bazelw build //crates/ctx-cli:ctx --config=release
install -d "$HOME/.local/bin"
install -m 0755 bazel-bin/crates/ctx-cli/ctx "$HOME/.local/bin/ctx"

Create local storage

ctx setup
ctx status

Setup creates the configured ctx data root, initializes self-contained Tantivy Core storage, discovers known provider history paths, catalogs local history sources, imports discovered native provider sources, optimizes the local search index, and prints next steps. Implicit installer setup does not write config.toml merely to persist default settings. The default data root is ~/.ctx. JSON changes setup output, not daemon policy. The setup JSON reports deferred autostart intent under background_indexing.daemon_autostart; use ctx daemon status --json for the resulting process state. ctx setup --no-daemon is a one-run opt-out, while ctx daemon disable is durable.

Use a different root for tests:

ctx --data-root /tmp/ctx-demo setup
CTX_DATA_ROOT=/tmp/ctx-demo ctx status

Setup is local with respect to provider history and storage. It does not write to source repositories, call model APIs, or require API keys. Trial activation is the explicit first-party network exception described above. For official installer-managed binaries, only daemon maintenance performs signed background auto-upgrade checks; ordinary foreground commands do not trigger automatic upgrades. The updater does not collect provider history.

Set up your agent

The installer runs the bundled agent-history skill installer by default. To refresh the skill manually:

ctx integrations install skills

See Install the ctx skill for agent targeting, project installs, and manual fallback instructions.

ctx sources
ctx import --all
ctx search "failed migration"
ctx show session <ctx-session-id>
ctx show event <ctx-event-id> --window 3

Use JSON output for scripts and exact field extraction:

ctx sources --json
ctx import --resume --json
ctx search "sqlite migration failed" --workspace ctx --json
ctx show session <ctx-session-id> --format json
ctx show event <ctx-event-id> --format json

Use repeatable --term when you need to search several explicit words or phrases:

ctx search --term "sqlite migration" --term rollback --term cursor

Built-in docs and upgrades

ctx docs search "upgrade"
ctx docs show cli-reference
ctx docs man --print ctx
ctx upgrade status
ctx upgrade check

ctx docs is embedded in the binary. ctx upgrade works only for official installer-managed binaries with a matching sidecar marker; source builds and package-manager installs stay unmanaged.