# Agents

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

Once JetBrains Central CLI is installed and you are logged in, you connect the agents you want to use. From then on you keep launching each agent the way you always have, and JetBrains Central CLI routes its requests through JetBrains Central. This page covers connecting and disconnecting agents, checking your usage, and seeing which agents you are allowed to use.

## Connect an agent

There are two ways to connect an agent, and you can mix them freely:

* Permanent connection

* One-off run

|   | Permanent connection | One-off run |
| --- | --- | --- |
| Command | `central add <agent>` | `central run <agent>` |
| Agent configuration | Modified, with a backup made first* | Left untouched |
| Applies to | Every future launch of the agent | That one session only |
| Undo | `central remove <agent>` | Nothing to undo |
| Best for | Day-to-day use | Trying it out, or keeping a direct-provider setup alongside |

* GitHub Copilot is configured through environment variables instead. JetBrains Central CLI also adds a marked block to your shell startup files and a session-start hook file, and makes no backup.

### Connect permanently

A permanent connection updates the agent's own configuration file (for GitHub Copilot, its environment variables), so every launch from then on is routed for you:

Claude Agent:

```BASH
central add claude
```

Codex:

```BASH
central add codex
```

Gemini CLI:

```BASH
central add gemini
```

Junie CLI:

```BASH
central add junie
```

Pi:

```BASH
central add pi
```

GitHub Copilot:

```BASH
central add copilot --provider=openai
central add copilot --provider=anthropic --model=claude-sonnet-5
```

`--provider` is required and selects the model provider: `openai` or `anthropic`. `--model` is optional. Without it, JetBrains Central CLI uses `gpt-5.6-luna` for OpenAI and `claude-opus-5` for Anthropic. In the interactive interface, JetBrains Central CLI asks you to pick a model instead.

Open a new terminal after connecting, so that Copilot picks up the new settings. To switch to another provider or model, disconnect Copilot and connect it again.

The models come from the built-in list of JetBrains Central CLI. Your organization's model settings in JetBrains Central don't apply to Copilot yet.

> **Warning:**
> On Windows, connecting Copilot overwrites `COPILOT_PROVIDER_API_KEY` and deletes `COPILOT_PROVIDER_BEARER_TOKEN` and `COPILOT_PROVIDER_HEADERS` in your user environment, without saving their previous values.

Procedure: Connect an agent from the interactive interface

1. Run `central`.

2. Select Add agents, then pick the agent. If only one agent is installed, the menu offers it directly (for example, Add Claude Agent).

The change is a narrow one. JetBrains Central CLI adds only the settings the agent needs to reach the proxy and leaves everything else in the file as it was. If the agent already has a configuration file, a timestamped copy is saved next to it first, so you can restore the file manually if needed. For example, for Claude Agent:

```TEXT
~/.claude/settings.backup.2025-02-08T14-30-45.json
```

For the files that JetBrains Central CLI changes for each agent, see [Where each agent is configured](cli-in-depth.html#agent-configuration-locations).

GitHub Copilot is the exception: it is configured through environment variables, and no backup is needed.

> **Note:**
> Connecting an agent also sets it up to start the proxy on its own whenever a session begins, so you never have to start the proxy by hand. The agent does that by running `central proxy start`, which means `central` has to be on your `PATH`. If it is not, the agent cannot start the proxy, and running the same command yourself fails for the same reason — the fix in both cases is to put `central` on your `PATH` ([See instruction](troubleshooting.html#central-not-on-path)).

### Route a single session (One-off run)

`central run` routes one session and writes nothing to the agent's configuration. The proxy starts automatically if it is not already running. Anything after `--` is passed straight to the agent:

```BASH
central run codex -- "explain this code"
```

For GitHub Copilot, specify the provider on every run, and optionally the model:

```BASH
central run copilot --provider=anthropic -- -p "explain this diff"
```

Because nothing is written to disk, an agent you have never connected keeps working exactly as before once the session ends.

## Use a connected agent

Launch the agent the way you always have:

Claude Agent:

```BASH
claude "explain this code"
```

Codex:

```BASH
codex "refactor this function"
```

Gemini CLI:

```BASH
gemini "review this PR"
```

Junie CLI:

```BASH
junie "refactor this function"
```

Pi:

```BASH
pi "explain this code"
```

GitHub Copilot:

```BASH
copilot -p "explain this diff"
```

Copilot starts with the model you selected when connecting it.

Your usual model picker still works, and the models you had available before remain available. Requests are authenticated with your JetBrains Account and billed to your JetBrains AI subscription, so no vendor API key is involved. If your [organization uses a
BYOK provider](https://www.jetbrains.com/help/air/ai-providers.html), that provider charges your organization directly instead. An agent that does not support your organization's BYOK provider cannot be used — [See which agents you can use](#available-agents).

## Disconnect an agent

To undo a permanent connection and put the agent back the way it was:

Claude Agent:

```BASH
central remove claude
```

Codex:

```BASH
central remove codex
```

Gemini CLI:

```BASH
central remove gemini
```

Junie CLI:

```BASH
central remove junie
```

Pi:

```BASH
central remove pi
```

GitHub Copilot:

```BASH
central remove copilot
```

Open a new terminal afterwards to finish disconnecting Copilot. On Windows, Copilot provider variables that you set yourself before connecting Copilot are not restored.

Procedure: Disconnect an agent from the interactive interface

1. Run `central`.

2. Select the Remove entry for that agent — for example, Remove Claude Agent.

Only the settings JetBrains Central CLI added are taken out. Proxy entries, hooks, and options you configured yourself are left in place, and the agent goes back to reaching its provider directly. The backup saved when you connected the agent is not restored; to restore it manually, see [What removal changes](cli-in-depth.html#agent-configuration-removal).

> **Note:**
> Disconnecting an agent does not uninstall it, and it does not sign you out. Your other connected agents keep working.

## Check your usage

To see how much of your AI allowance you have used:

```BASH
central limit
```

If you [log in](cli-setup.html#log-in) with your organization, the command shows the usage limit your organization set for you. If you use a personal JetBrains AI license, it shows the license's quota. Either way, the figures are in AI credits — how many you have used, how many remain, and the period they apply to.

Procedure: Check your usage from the interactive interface

1. Run `central`.

2. Go to More... | Quota — or More... | Limit, since that entry is named after whichever of the two applies to you.

## Check the current state

`central status` answers the three important questions: whether you are logged in, whether the proxy is running, and which agents are connected.

```BASH
$ central status
  ⣿ Auth    logged in (AI Pro)
  ⣿ Proxy   running on :19516
  ⣿ Agents  Claude Agent, Codex
```

This is the first thing to run when an agent behaves unexpectedly — see [Troubleshooting](troubleshooting.html).

## See which agents you can use

To list every supported agent along with its current state:

```BASH
central agents
```

Agents you cannot currently use are dimmed, with the reason next to them:

* Blocked by AI governance. Your organization's allow-list does not include this agent. It cannot be connected, and if it was connected before, it is disconnected automatically once it leaves the list. Administrators manage the list of [agents](https://www.jetbrains.com/help/jetbrains-console/ai-agents.html) in [AI policies](https://www.jetbrains.com/help/jetbrains-console/ai-policies-configure.html#agents-tab).

* Not supported with service accounts. The agent needs a personal account, so it is unavailable on a [service-account](https://www.jetbrains.com/help/jetbrains-console/service-accounts.html) session.

* Not supported with the <protocol> protocol. The agent does not work with the protocol your organization has provisioned — for example, when your organization uses a [BYOK provider that the agent does not support](https://www.jetbrains.com/help/air/ai-providers.html). You cannot use the agent while your [AI access comes from this organization](cli-setup.html#log-in).

For GitHub Copilot, the list also shows the provider and model you selected, for example `configured (OpenAI · gpt-5.6-luna)`. If part of Copilot's configuration is missing or was changed by hand, the list shows `inconsistent config`: [disconnect](#disconnect) Copilot and connect it again.

Procedure: See the list from the interactive interface

1. Run `central`.

2. Go to More... | Supported agents.

3. Select an agent to open its documentation in your browser.

The list shows whether each agent is installed and whether it is connected. Agents your session cannot use are grouped under Unsupported agents, with the reason beside each one. Blocked agents appear under Agents blocked by AI governance.

An agent that is installed but blocked by AI governance also appears on the main menu, dimmed, under Installed agents blocked by AI governance, so you can see why it is not offered without opening the list. Blocked agents you have not installed are not shown there.

> **Note:**
> Allow-lists apply only when your AI access comes from an organization. If your access comes from a license, every supported agent is available to you.

## Refresh the allow-list

JetBrains Central CLI keeps a local copy of your organization's agent allow-list so it can tell you what you may use without asking the server every time. The copy is refreshed when you log in, when you switch AI access source, and about once an hour while the proxy is running — so in normal use it stays current on its own. The same refresh also fetches the [MCP servers](review-mcp-servers.html) that your organization provides.

If your administrator has just changed the policy and you do not want to wait, refresh it yourself:

```BASH
central agents refresh
```

Procedure: Refresh from the interactive interface

1. Run `central`.

2. Go to More... | Supported agents | Refresh agent settings, which reports the result on the spot.

The entry is offered only when your organization manages agent settings — on an unmanaged session there is no policy to fetch, so it is absent.

A successful refresh updates the list immediately and disconnects any agent that is no longer allowed. If the refresh fails — for example, because you are offline — the previous list stays in force and nothing is disconnected. Run `central agents` afterwards to see the result.

## Review the request log

JetBrains Central CLI keeps a local record of every request it forwards on behalf of an agent. To read it:

```BASH
central log
```

An entry shows when the request was made, which agent made it, the platform path it reached, the HTTP method and status, and how long it took. Failed requests also carry the error message and a trace ID you can quote when you contact support. Prompts and responses are never recorded — the log holds metadata only, and it never leaves your machine. For the full list of recorded fields, see [Data collection](cli-data-collection.html).

Procedure: Browse the log from the interactive interface

1. Run `central`.

2. Go to More... | AI Logs.

There, `t` filters by time, `s` filters by success or error, `r` clears the filters, `R` reloads the data, `q` goes back to the menu, and the arrow keys page through the history.

The files live in `~/.jetbrains-central/analytics/`. JetBrains Central CLI keeps the five most recent, at 1000 entries each, and drops the oldest as new ones are written. To clear the history, delete the directory — it is recreated with the next request:

```BASH
rm -rf ~/.jetbrains-central/analytics
```

> **Note:**
> This log covers what your agents sent. The proxy daemon keeps a separate log of its own activity, which is the one to look at when the proxy itself misbehaves — see [Troubleshooting](troubleshooting.html).

## See also

### Related

[Commands](cli-commands.html) [Supported agents and features](cli-supported-agents-and-features.html) [Troubleshooting](troubleshooting.html)

