Deploy with Codex
Install the CLI, let the sandbox reach Gregale, deploy, read failures and roll back.
On this page
Codex can deploy, check and roll back your apps on Gregale by running the
gregale CLI, the same commands you would run yourself. This page sets that
up and shows what to ask for. The CLI's automation contract, scoped keys and
approvals are on Use Gregale from coding agents.
Install the CLI and sign in
curl -fsSL https://get.gregale.dev | sh
gregale login
gregale login opens your browser once; run it yourself, in your own
terminal. Codex then uses that login for every gregale command it runs.
Where nobody can open a browser, put a scoped key in Codex's environment as
FAAS_TOKEN instead; see
Give the agent its own key.
The CLI needs to reach Gregale over the network. If Codex runs commands in
its workspace-write sandbox without network access, allow it in
~/.codex/config.toml:
[sandbox_workspace_write]
network_access = true
Tell Codex how the project deploys
Codex reads AGENTS.md. Projects made with gregale init include one with
Gregale's deploy, check and rollback steps.
For an existing project, run this in its root:
gregale init --agents --name my-api
It adds a Gregale section to AGENTS.md; see
Project instructions for agents.
Deploy
Ask in your own words, for example:
Deploy this project to Gregale as my-api. Check what Gregale detects first, and verify the app answers after.
Codex then runs commands like these:
gregale deploy --dry-run
gregale --non-interactive --json deploy --name my-api
gregale --non-interactive --json release verify <deployment-id> --app my-api --path /
--dry-run shows the framework, start command and port Gregale detects, and
warns about problems such as a server bound to localhost. When a deploy
fails, the error names the cause, and Codex can read more with:
gregale --non-interactive --json app health my-api --errors
gregale logs my-api --since 15m
A new app can be private: its URL answers 401 until you open it. Ask Codex
to run gregale app update my-api --no-require-authn only if the app should
be public.
Roll back
The last deploy of my-api broke the checkout page. Roll it back.
gregale --non-interactive --json rollback my-api
The command returns when the previous release serves again. See Safe releases.
The MCP server (preview)
Gregale's hosted MCP server, in preview, gives Codex Gregale's tools without
the CLI. gregale mcp connect --client codex adds it, or add it yourself to
~/.codex/config.toml and sign in with codex mcp login gregale:
[mcp_servers.gregale]
url = "https://api.gregale.dev/mcp"
See Connect an agent to Gregale.
What Gregale learns
The CLI tells Gregale that it runs under Codex, so Gregale can see which
agents its customers use. It sends nothing else about the session. Set
DO_NOT_TRACK=1 to leave it out.
Spotted a problem on this page? Tell us