# Quickstart for Codex

Connect Codex to Astris, then ask it to deploy your app.

## Create a key

[Sign in to the Console](https://api.astris.run/console/sign-in) and create a key on the API keys page. Astris shows a key only once, so copy it now. See [Keys](/docs/keys).

## Connect the Astris MCP

Add this to your Codex config file.

```
[mcp_servers.astris]
url = "https://api.astris.run/mcp"
bearer_token_env_var = "ASTRIS_API_KEY"
tool_timeout_sec = 180
```

Set `ASTRIS_API_KEY` to the key. The file names that variable. It does not contain the key.

## Install the Astris Skill

The Skill tells Codex how to use the Astris MCP: what to check before a deploy, and in which order to call the tools.

```
$skill-installer https://github.com/astris-labs/astris-skill/tree/main/skills/astris
```

## Deploy your first app

Ask Codex to deploy your repository to Astris. With the Skill, it calls `whoami` to read your next step, `preflight` to check the repository, and then `deploy` with a project name, an app name, the Git URL and the branch.

If your account has no plan yet, the API refuses the deploy with [upgrade_required](/docs/errors/upgrade_required). Choose a plan on the Billing page in the Console, then ask again.

## Or deploy with the Astris CLI

The Astris CLI needs Node 22 or later.

```
npm install --global @astris-labs/cli
```

```
astris login
```

`astris login` asks `Paste your Astris API key:` and prints `Logged in.` when the API accepts the key. The CLI also reads the key from `ASTRIS_API_KEY` when that variable is set.

```
astris deploy --project <project> --name <app> --git-url <repository> --branch <branch> --wait
```

With `--wait`, the command prints `done`, `error`, `cancelled` or `still running, check status`. Then see [Apps](/docs/apps) and [Domains](/docs/domains).
