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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List cloud environments

> List the remote environments configured for Codex cloud.

`listCodexCloudEnvironments` returns the Codex cloud environments available to the connected ChatGPT workspace.

```ts automations/list-codex-environments.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { listCodexCloudEnvironments } from "automate.ax/codex"

export default automation("List Codex environments", () => {
  onSchedule({ schedule: "0 9 * * 1" })
  const environments = listCodexCloudEnvironments({})

  environments[0]!.id
  environments[0]!.label
})
```

Each environment includes its stable `id`, display `label`, `isPinned` state, and current `taskCount`. Pass the ID to `startCodexCloudTask` or `listCodexCloudTasks`. Optional second argument `{ account }` defaults to the project binding.

<Warning>
  Codex Cloud does not currently provide an official public REST API. This
  action calls undocumented ChatGPT backend endpoints that may change without
  notice.
</Warning>
