GitHub Action
Nexrall ships a ready-made GitHub Action that installs the CLI and runs a prompt against your repository inside a workflow — useful for automated code review, applying a fix, or any one-shot task you want to run on every PR or on a schedule.
Basic usage
yaml
name: Nexrall Code Review
on:
pull_request:
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: nexrall/nexrall-code/packages/action@main
with:
prompt: "Review this PR for bugs, security issues, and style problems"
nexrall_token: ${{ secrets.NEXRALL_TOKEN }}Inputs
| Input | Required | Default | Description |
|---|---|---|---|
prompt | Yes | — | The instruction for the agent, e.g. "Fix the failing test in src/utils". |
nexrall_token | Yes | — | Your Nexrall API token, stored as a repository secret. |
model | No | claude-sonnet-5 | Model id — e.g. claude-sonnet-5 | gpt-5.4 | deepseek-v4-pro. |
working_directory | No | . | Directory the agent operates in — defaults to the repository root. |
output_file | No | — | Optional path to write the agent's final answer to a file, so a later step can read it (for example, to post it as a PR comment). |
Outputs
| Output | Description |
|---|---|
result | The agent's final response text. |
tool_calls | Number of tool calls the agent made. |
output_tokens | Output tokens used for this run. |
Setting up the token
- Get a Nexrall API token (sign in via the CLI or VS Code extension — see Nexrall CLI).
- In your repository, go to Settings → Secrets and variables → Actions and add a new secret, for example
NEXRALL_TOKEN. - Reference it in your workflow as
secrets.NEXRALL_TOKEN, as shown above.
Never put a token directly in a workflow file — always use a repository secret.
A more complete example: post the result as a PR comment
yaml
name: Nexrall Code Review
on:
pull_request:
permissions:
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: nexrall/nexrall-code/packages/action@main
id: nexrall
with:
prompt: "Review this PR for bugs and security issues. Be concise."
nexrall_token: ${{ secrets.NEXRALL_TOKEN }}
model: claude-opus-5
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `${{ steps.nexrall.outputs.result }}`
})Behavior
- The action installs the CLI automatically if it isn't already present in the runner.
- It always runs headless (structured
jsonoutput, auto-approve implied) — there's no one to answer an interactive permission prompt in CI. - Destructive-but-legitimate operations (dropping a table, force-pushing, and similar) are still blocked by default even in this mode — see Safety in headless mode if a specific workflow genuinely needs to allow them.
When to use this vs. the CLI directly
The Action is the simplest option if you just want "run one prompt against this repo in CI." If you need finer control — multiple steps, custom piping, reading stream-json output live — install the CLI directly in your workflow and call nex yourself; see Nexrall CLI → Headless / CI use.