---
metadata:
  - name: generator
    content: Diplodoc Platform v5.66.0
alternate:
  - https://sourcecraft.dev/portal/docs/en/cli-ref/src-ycodex-install.md
  - https://sourcecraft.dev/portal/docs/ru/cli-ref/src-ycodex-install.md
  - href: https://sourcecraft.dev/portal/docs/en/cli-ref/src-ycodex-install.md
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/en/llms.txt?revision=r21973087
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt?revision=r21973087

# src ycodex install

Install Codex if it is not already installed.

Downloads the appropriate Codex binary for your platform and installs it
to the local app directory (~/.config/sourcecraft/bin/). Linux installations also
include the matching codex-resources/bwrap sandbox helper.

With src ycodex install, installs separately into the aistudio subdirectory. Linux/WSL
AI Studio installs contain sibling codex and bwrap; macOS/native Windows need
only Codex. Plain src codex continues to select upstream.

Existing installations are updated through shared startup prompts or
"src update --auto". This install command repairs missing or damaged license documents without replacing the binary.

## Usage

`src ycodex install [flags]`

### Examples

**Install the latest version**

`src codex install`

**Install AI Studio alongside upstream**

`src ycodex install`

### Inherited flags

| Flag | Description |
| --- | --- |
| `--aistudio` | Use native AI Studio authentication and backend instead of SourceCraft |
| `--env string` | Override Sourcecraft environment (use 'src envs' to list available) |
| `--json string` | Output JSON, optionally filtered (--json or --json=field1,field2) |
| `--json-compact string` | Output compact JSON, optionally filtered |
| `-R, --repo string` | Select another repository using OWNER/REPO format |
| `-V, --verbose` | Enable debug logging output |

### Learn more

Use `src ycodex install <subcommand> --help` for more information about a command.
