Skip to content

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

InputRequiredDefaultDescription
promptYesThe instruction for the agent, e.g. "Fix the failing test in src/utils".
nexrall_tokenYesYour Nexrall API token, stored as a repository secret.
modelNoclaude-sonnet-5Model id — e.g. claude-sonnet-5 | gpt-5.4 | deepseek-v4-pro.
working_directoryNo.Directory the agent operates in — defaults to the repository root.
output_fileNoOptional 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

OutputDescription
resultThe agent's final response text.
tool_callsNumber of tool calls the agent made.
output_tokensOutput tokens used for this run.

Setting up the token

  1. Get a Nexrall API token (sign in via the CLI or VS Code extension — see Nexrall CLI).
  2. In your repository, go to Settings → Secrets and variables → Actions and add a new secret, for example NEXRALL_TOKEN.
  3. 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 json output, 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.

Built by Maxrall, Inc.