---
title: Code
description: Coding agents on code.lightning.ai.
canonical: 'https://lightning.ai/docs/cli/stable/command-details/code'
---
# Code {#code}

Coding agents on code.lightning.ai.

**Usage:**

```console
lightning code [OPTIONS] COMMAND [ARGS]...
```

## Commands {#code-commands}

| Command | Description |
| --- | --- |
| [`remove`](#code-remove) | Stop a coding tool from using code.lightning.ai. |
| [`setup`](#code-setup) | Set up a coding tool to use code.lightning.ai. |
| [`status`](#code-status) | Show which coding tools are set up for code.lightning.ai. |

## lightning code remove {#code-remove}

Stop a coding tool from using code.lightning.ai.

Removes the Lightning provider, the default model if it’s a Lightning one, and the API key saved in the tool’s config. The rest of the tool’s config is left alone.

**Usage:**

```console
lightning code remove [OPTIONS] {opencode|pi|codex|dsh|cursor}
```

### Arguments {#code-remove-arguments}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `TOOL` | `choice` | yes | No description provided. |

### Examples {#code-remove-examples}

```console
  lightning code remove opencode
```

## lightning code setup {#code-setup}

Set up a coding tool to use code.lightning.ai.

TOOL is one of opencode, pi, codex, dsh (DeepSeek Harness) or cursor. Lightning is added as a model provider without touching the rest of the tool’s config. The API key is read from LIGHTNING\_API\_KEY and saved in the tool’s config; no key is created. Cursor can’t be configured from outside, so for it the key is printed with the steps to add it in Cursor Settings.

Run it again to pick up new models.

**Usage:**

```console
lightning code setup [OPTIONS] {opencode|pi|codex|dsh|cursor}
```

### Arguments {#code-setup-arguments}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `TOOL` | `choice` | yes | No description provided. |

### Options {#code-setup-options}

| Option | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--model` | `TEXT` | no | `Sentinel.UNSET` | Make this the default model, e.g. glm-5.3. Without it, deepseek-v4.1-flash becomes the default only if you have none. |
| `--dry-run` | — | no | — | Show the changes without writing anything. |
| `--force`, `-f` | — | no | — | Replace a Lightning setup that lightning code didn’t make. |

### Examples {#code-setup-examples}

```console
  LIGHTNING_API_KEY=lit_sa_... lightning code setup opencode
  LIGHTNING_API_KEY=lit_sa_... lightning code setup codex --model glm-5.3
```

## lightning code status {#code-status}

Show which coding tools are set up for code.lightning.ai.

**Usage:**

```console
lightning code status [OPTIONS]
```

### Options {#code-status-options}

| Option | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--json` | — | no | — | Output as JSON. |

---

**Navigation**

- Parent: [Command details](/docs/cli/2026.11.04/command-details.md)
