Skip to content

Exec Agent

The exec agent runs shell commands sequentially within a pipeline phase. Each command is executed via execSync with a 2-minute timeout, and output streams to the tmux pane for visibility.

Unlike other agents, the exec agent has no LLM involvement — it is purely deterministic. No role file is required. Use it for build steps, test suites, linting, deployments, or any shell-based automation that needs structured pass/fail reporting.


- name: test
agent: exec
commands:
- name: unit-tests
run: npm test
escalate_on_fail: true

The exec agent uses a commands array on the phase declaration. Each entry defines a named shell command to run.

FieldTypeRequiredDescription
namestringYesUnique phase name within the workflow
typestringNoDefaults to "standard"
agentstringYesMust be "exec"
depends_onstring[]NoUpstream phases that must complete before this phase runs
commandsCommand[]YesOrdered list of shell commands to execute
FieldTypeRequiredDefaultDescription
namestringYesDisplay name for the command (shown in logs and output)
runstringYesShell command to execute
escalate_on_failbooleanNofalseIf true, stop execution and escalate the phase immediately on failure

Commands execute in order. If escalate_on_fail is not set, a failing command is recorded but execution continues to the next command.


No agent-specific settings required.


{
"data": {
"results": [
{
"name": "unit-tests",
"pass": true,
"exit_code": 0,
"duration_ms": 4520
},
{
"name": "integration-tests",
"pass": false,
"exit_code": 1,
"duration_ms": 12300
}
],
"all_passed": false,
"total": 2,
"failed": 1
},
"text": "## Exec Results\n\n✓ unit-tests (4520ms)\n✗ integration-tests — exit code 1 (12300ms)\n\n1 of 2 commands failed."
}
FieldLocationDescription
resultsdata.resultsArray of per-command result objects
results[].namedata.results[]Command display name
results[].passdata.results[]Whether the command exited with code 0
results[].exit_codedata.results[]Process exit code
results[].duration_msdata.results[]Execution time in milliseconds
all_passeddatatrue if every command exited with code 0
totaldataTotal number of commands executed
faileddataCount of commands that exited non-zero
commands:
- name: check
run: 'test $(handoff.build.data.all_passed) = true'

Run build and test steps, then pass results to a review gate.

phases:
- name: build-and-test
agent: exec
commands:
- name: install
run: npm ci
- name: build
run: npm run build
escalate_on_fail: true
- name: unit-tests
run: npm test
- name: lint
run: npm run lint
- name: review
type: gate
agent: hug
depends_on: [build-and-test]
review:
reviewer: tech-lead
artifacts:
- src/**/*.ts

Example: Deploy with escalation on failure

Section titled “Example: Deploy with escalation on failure”

Run deployment commands where any failure immediately escalates the pipeline.

phases:
- name: implement
agent: cursor
- name: deploy
agent: exec
depends_on: [implement]
commands:
- name: docker-build
run: docker build -t myapp:latest .
escalate_on_fail: true
- name: docker-push
run: docker push registry.example.com/myapp:latest
escalate_on_fail: true
- name: k8s-apply
run: kubectl apply -f k8s/
escalate_on_fail: true

Use exec as a pre-check phase that feeds into a conditional workflow.

phases:
- name: validate
agent: exec
commands:
- name: schema-check
run: npx ajv validate -s schema.json -d config.json
- name: security-scan
run: npx audit-ci --moderate
- name: implement
agent: cursor
depends_on: [validate]

No setup required. The exec agent has no external dependencies — it runs commands using the system shell available in the pipeline environment.

cliq doctor agent exec always passes.