# CLI reference

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/air/llms.txt).

The Air Context CLI is invoked as `jbcontext`. This page lists the most commonly used options for each command; run any command with `-h`/`--help` to see the full set.

## Global options

--version
: Show the installed version, build, and release channel.

--enable-local-logging
: Enable logging for commands that don't log by themselves, such as `logout` or `config`. Can also be enabled with the `JBCONTEXT_LOCAL_LOGGING` environment variable.

--ci
: `--ci` marks the run as unattended, for build agents: logs stream to stderr so that the build log keeps them, and `index` reports progress as plain log lines, uses all available CPU, and lifts the client-side repository size limits. It is a global option, so it goes before the command; the `JBCONTEXT_CI=true` environment variable does the same. The server lifts its own size limit only for runs authenticated with an organization service account.
:
:
:
: See [Index repositories in CI](context-ci.html).

Most commands also accept the following options, which aren't repeated in the sections below: `--project-path` (path to a local project), `--git-remote-url` (repository URL, overriding the repository ID derived from the project path), `--json-output` (output results as JSON), and `-v`/`--verbose` (raise the log level to DEBUG).

## Authentication

### jbcontext login

Log in with your JetBrains Account.

```BASH
jbcontext login
```

Run without options to log in with your JetBrains Account. If you're logged in to a JetBrains IDE or JetBrains Toolbox, the CLI can use that account; otherwise, you log in in the browser. For unattended use, the CLI also accepts token-based options; the most common one is described below, and the full list is in `jbcontext login --help`.

--jcp-org-service-id, --jcp-org-service-secret
: Authenticate with an organization service account (client ID and secret). Intended for CI and other unattended runs; the CLI mints and renews short-lived tokens itself. The CLI also picks the credentials up from the `JCP_ORG_SERVICE_CLIENT_ID` and `JCP_ORG_SERVICE_CLIENT_SECRET` environment variables, so no login step is needed.  See [Index repositories in CI](context-ci.html).

### jbcontext logout

Log out and clear stored credentials.

```BASH
jbcontext logout
```

--env
: Environment to log out from. If omitted, all sessions are cleared.

## Indexing and search

### jbcontext index

Index a project directory for semantic search.

```BASH
jbcontext index
```

--revision
: Specific revision to index. Defaults to `HEAD`.

--silent
: Suppress progress and success output; errors are still reported. Useful for hooks and background execution.

### jbcontext search

Search for code using semantic search.

```BASH
jbcontext search "your query"
```

--limit
: Number of results to return. Default 50.

-p, --path-filter
: File path filter for narrowing down the search scope.

--branch
: Limit search to a specific remote branch (case-insensitive, partial match).

--revision
: Limit search to a specific revision. By default, the snapshot indexed for the current branch is searched, falling back to the default branch and then to the most recent snapshot.

--enable-remote-logging
: Allow search operations to be logged on the server.

### jbcontext status

Show indexing status for the current repository.

```BASH
jbcontext status
```

### jbcontext remove-index

Remove your indexed snapshots for the current repository.

```BASH
jbcontext remove-index
```

-y, --yes
: Skip the confirmation prompt before removing (required with `--json-output`).

## Agent integration

### jbcontext setup-agent

Set up Air Context for AI coding agents: skills, subagents, hooks, instructions, and MCP. Run without options for an interactive setup, or select an agent and components explicitly. See [Agent integrations](context-agent-integrations.html) for what each component does.

```BASH
jbcontext setup-agent
```

--agent
: Specific agent to set up: `claude`, `codex`, `junie`, or `generic`.

--scope
: Where to install: `user` (default) or `project`.

--auto
: Install the recommended bundle: instructions, skills (except for OpenAI Codex), subagents and session hooks where supported, minimal MCP registration (Claude Code only), and execution-policy rules (OpenAI Codex only). Tool-watching hooks aren't included; add `--hooks`. This is the default when an agent is given without component flags.

--skills, --subagents, --hooks, --instructions, --mcp, --mcp-minimal, --rules
: Install exactly the selected components instead of the recommended bundle. `--mcp-minimal` registers the MCP server without switching the instructions to MCP-first guidance; `--mcp` does both.

--no-session-hooks
: Don't install the session hooks. Tool-watching hooks still follow `--hooks`.

--dump-auto
: Print the current `--auto` install plan for all recognized agents as Markdown and exit. Add `--print-instructions` to include the exact instruction block.

--strong
: Install instructions that strongly prioritize semantic search over text search.

--non-interactive
: Run without prompts (requires `--agent`).

### jbcontext remove-agent

Remove Air Context integration components from AI coding agents. Without component options, all components are removed.

```BASH
jbcontext remove-agent
```

--agent, --scope, --non-interactive
: Same meaning as for `setup-agent`. Without `--scope`, both user and project scopes are checked.

--skills, --subagents, --hooks, --instructions, --mcp, --rules
: Remove only the selected components.

### jbcontext mcp

Start an MCP server over stdio for AI agent integration. Normally registered in the agent's MCP configuration by `setup-agent` rather than run by hand.

```BASH
jbcontext mcp
```

--enable-remote-logging
: Allow search operations to be logged on the server.

## Insights

### jbcontext stats

Watch local search, repository, and indexing activity. Alias: `jbcontext dashboard`.

```BASH
jbcontext stats
```

--days
: Show stats for the last N days. Default 10; use 0 for all available history.

--errors
: Include recent error messages below the dashboard.

### jbcontext analyze

Estimate the cost and token saving Air Context brings to your mix of agent tasks. Reads local agent session data from Claude Code, OpenAI Codex, and Junie CLI.

```BASH
jbcontext analyze
```

--agent
: Restrict to one agent: `claude`, `codex`, or `junie`. Default: all agents.

--min-tool-calls
: Drop sessions with fewer total tool calls than N. Default 5.

## Maintenance

### jbcontext upgrade

Check for updates and upgrade the Air Context CLI to the latest version, refreshing the installed agents' skills, hooks, and instructions. Alias: `jbcontext update`.

```BASH
jbcontext upgrade
```

--check
: Only check for updates, don't install.

--force
: Force the upgrade even if already on the latest version.

--version
: Upgrade to a specific version instead of the latest.

--skip-agents
: Don't refresh the installed agents' prompts after the binary upgrade.

### jbcontext doctor

Run end-to-end self-tests: version, authentication, repository, index, and search.

```BASH
jbcontext doctor
```

### jbcontext send-feedback

Report an issue or send feedback; opens a pre-filled form in your browser. Use `--print-url` to print the form URL instead. Alias: `jbcontext report-issue`.

```BASH
jbcontext send-feedback
```

