> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatGPT

> Connect the ChatGPT desktop app to an Ona environment over SSH.

<Note>This feature is in preview.</Note>

ChatGPT connects to Ona environments over SSH and runs tasks against the remote filesystem and shell.

For organizations that opt in, Ona provisions an authenticated `codex` command in the active Dev Container of each new environment. Codex uses the organization's Ona Intelligence or runner LLM integration. Ona does not install the command on the environment VM host.

## Prerequisites

1. The [ChatGPT desktop app](https://chatgpt.com/download/) installed.
2. The [Ona CLI](/docs/ona/integrations/cli) installed and authenticated.
3. Codex access in the ChatGPT account and workspace you want to use.

## Enable Codex provisioning

<Note>Organization secrets are available on the Enterprise plan. [Contact sales](https://ona.com/contact/sales) to learn more.</Note>

An organization administrator must enable provisioning before creating the environment:

1. Go to **Settings → Organization → Secrets**.
2. Create an **Environment variable** named `ONA_CODEX_CLI_PROVISIONING_ENABLED`.
3. Set its value to `true`.
4. Create a new environment, then connect ChatGPT to it.

Only the organization-scoped value `true` enables provisioning. The setting is disabled when it is absent or set to `false`; values from project, user, service account, or runner secrets do not enable it. Changing the setting does not add or remove Codex in an already-running Dev Container.

## Connecting to an environment

1. In the Ona dashboard, select **Open in ChatGPT**. Ona opens ChatGPT's SSH connections screen and shows the required commands.
2. Run the commands shown by Ona in a local terminal. They sign in to the Ona CLI, add the environment to your SSH configuration, and verify the SSH connection.
3. Select **Add environment in ChatGPT** in the Ona dialog.
4. In ChatGPT, enable the SSH connection and choose the project folder in the environment.

ChatGPT requires the `codex` command to be installed and authenticated in the selected SSH environment. With organization provisioning enabled, Ona provides it in the active Dev Container. See [Connect to an SSH host](https://learn.chatgpt.com/docs/remote-connections#connect-to-an-ssh-host) for the current ChatGPT requirements.

## Troubleshooting

<Accordion title="SSH config entry not found">
  Return to the Ona setup dialog and run `ona environment ssh-config` in a local terminal. Verify the connection using the environment-specific `ssh` command shown in the dialog, then select **Add environment in ChatGPT** again.
</Accordion>

<Accordion title="The Ona CLI has no active context">
  Run `ona login`, complete authentication in your browser, then rerun `ona environment ssh-config`.
</Accordion>

<Accordion title="The codex command is not available on the remote host">
  Confirm that an organization administrator created the organization environment variable `ONA_CODEX_CLI_PROVISIONING_ENABLED` with the value `true`. Codex provisioning does not delay Dev Container startup, so rebuild the Dev Container or create a new environment after provisioning finishes. Codex is available only in the active Dev Container, not on the VM host or in a recovery container. If the command remains unavailable, check the environment logs for Codex provisioning errors or contact your Ona administrator.
</Accordion>

<Accordion title="The codex command is available but fails to start">
  Check the environment logs for Codex provisioning errors. Ask your Ona administrator to confirm that the environment's organization or assigned runner has an OpenAI-compatible LLM integration, then rebuild the Dev Container or create a new environment to refresh its LLM route.
</Accordion>
