> ## 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 tasks

> List recent remote tasks from Codex cloud.

`listCodexCloudTasks` returns recent Codex cloud tasks from the connected ChatGPT workspace.

```ts automations/check-codex-tasks.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { listCodexCloudTasks } from "automate.ax/codex"

export default automation("Check Codex tasks", () => {
  onSchedule({ schedule: "*/5 * * * *" })
  const page = listCodexCloudTasks({
    environmentId: "env_abc123",
    filter: "current",
    limit: 10,
  })

  page.tasks
  page.cursor
})
```

Connect a Codex access token. `environmentId` optionally filters the results to one configured environment. `filter` accepts `current`, `archived`, or `all` and defaults to `current`; use `archived` to find a task before restoring it with `unarchiveCodexCloudTask`. `limit` accepts `1` through `20` and defaults to `20`. Pass a previous `cursor` to retrieve the next page. Optional second argument `{ account }` defaults to the project binding.

Each task includes its ID, ChatGPT URL, title, status, last update time, branch, environment label, archive state, attempt count, pull requests, and the latest attempt's changed-file and line counts. The list endpoint does not report a stable environment ID, so `environmentId` is `null`; use `getCodexCloudTask` when you need it. `status` is `pending`, `ready`, `applied`, or `error`.

<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>
