Agents
This page is for AI coding agents that need to operate nax non-interactively. nax runs Netlify Agent Runner jobs for Claude, Gemini, and Codex, then records workflow state and artifacts for inspection, handoff, and follow-up runs.
Agent Runner jobs can spend Netlify resources and can create GitHub issues, comments, or workflow runs. Use --dry --force first unless the user explicitly asked for a real run.
Variables
Use explicit variables in scripts and agent plans:
PROJECT_ROOT=/path/to/repo
GITHUB_REPO=owner/name
NETLIFY_SITE_ID=site-id
BRANCH=mainRun commands from the project root unless a command accepts --project-root directly:
cd "$PROJECT_ROOT"Prerequisites
nax expects the host environment to have:
- Node 20+.
netlifyauthenticated with access to the target site.ghauthenticated when GitHub Actions setup, GitHub transport, or GitHub comments are needed.- A pushed branch when using
--branch.
Install
Use a global install when the agent will run multiple commands:
npm install -g netlify-agent-executor
nax --help
nax listUse npx for one-off execution when a global install is not desirable:
npx netlify-agent-executor@latest listInstall agent skills
Install the bundled nax-workflows skill into the local agent harness so future agents know how to operate the project workflows.
nax admin skills install \
--project-root "$PROJECT_ROOT" \
--provider codex \
--skill nax-workflowsUse the provider for the current harness:
nax admin skills install --project-root "$PROJECT_ROOT" --provider claude --skill nax-workflows
nax admin skills install --project-root "$PROJECT_ROOT" --provider cursor --skill nax-workflows
nax admin skills install --project-root "$PROJECT_ROOT" --provider gemini --skill nax-workflowsWhen maintaining a repo for multiple local agents:
nax admin skills install --project-root "$PROJECT_ROOT" --all-providers --skill nax-workflows
nax admin skills check --project-root "$PROJECT_ROOT" --all-providers --skill nax-workflows
nax admin skills update --project-root "$PROJECT_ROOT" --all-providers --skill nax-workflowsIf no provider directory exists and no provider is passed, nax installs into .claude/skills by default.
Initialize non-interactively
Preview first:
nax init \
--project-root "$PROJECT_ROOT" \
--repo "$GITHUB_REPO" \
--site-id "$NETLIFY_SITE_ID" \
--github-actions \
--dryInitialize a repo that already has a Netlify site:
nax init \
--project-root "$PROJECT_ROOT" \
--repo "$GITHUB_REPO" \
--site-id "$NETLIFY_SITE_ID" \
--github-actions \
--forceCreate and link a new Netlify site by name:
nax init \
--project-root "$PROJECT_ROOT" \
--repo "$GITHUB_REPO" \
--site-name my-netlify-site \
--create \
--github-actions \
--forceIf GitHub Actions secrets are managed outside nax, add --skip-secrets:
nax init \
--project-root "$PROJECT_ROOT" \
--repo "$GITHUB_REPO" \
--site-id "$NETLIFY_SITE_ID" \
--github-actions \
--skip-secrets \
--forceRun one-off Agent Runner jobs
Use nax run agent when the task does not need a full multi-step workflow.
cd "$PROJECT_ROOT"
nax run agent codex --prompt "Inspect the current branch for regressions." --transport netlify-api --forceUse another supported model when appropriate:
nax run agent claude --prompt "Propose a minimal fix for the failing tests." --transport netlify-api --force
nax run agent gemini --prompt "Check the docs for broken links and stale setup steps." --transport netlify-api --forceAdd branch and context when the target is not the current default:
nax run agent codex \
--branch "$BRANCH" \
--context "Focus on the auth callback and billing webhook changes." \
--prompt "Review this branch for bugs and missing tests." \
--transport netlify-api \
--forceUse a file for longer instructions:
nax run agent codex \
--context-file ./agent-context.md \
--prompt "Run the requested investigation and summarize concrete findings." \
--transport netlify-api \
--forceRun multi-step workflows
List available bundled and project-local workflows:
cd "$PROJECT_ROOT"
nax list --verboseDry-run the workflow shape before creating Agent Runner jobs:
nax run review --dry --forceRun the workflow:
nax run review --transport netlify-api --forceOverride the model set for a cheaper or more targeted run:
nax run review --models codex,claude --transport netlify-api --forceRun part of a workflow:
nax run review --step cross-review --transport netlify-api --force
nax run review --from-step synthesize --transport netlify-api --forceUse bundled workflows by id:
nax run security-audit --transport netlify-api --force
nax run documentation --transport netlify-api --force
nax run ideas --transport netlify-api --force
nax run do-next --transport netlify-api --forceInspect and hand off results
Use handoff to read the latest summary or pass it to another agent run:
nax handoff
nax handoff -c
nax handoff --workflow <workflow-run-id>
nax handoff --runner <runner-id>
nax handoff --session <session-id>For local Netlify API orchestration, resume or retry interrupted work:
nax run --retry <workflow-run-id>
nax admin sync lastAgent operating rules
- Prefer
--dry --forcebefore real runs. - Prefer
--transport netlify-apifor local orchestration, dashboard events, resume, and immediate handoff. - Prefer
--transport github-actionswhen the user wants hosted GitHub logs and team-visible automation. - Include
--branchwhen the user named a branch or PR. - Include
--contextor--context-filewhen the user supplied extra constraints. - Do not assume a final agent recommendation is correct; inspect artifacts and ask for human approval before merging code.
See also
- Get started for human-oriented setup.
- Run workflows for workflow execution flags.
- Workflow file reference for flow schema.
- Council pattern for multi-model workflow design.