Integrate

Run Crystal Code from a script or CI job, or reference the engine from another front end.

Run one task

crystal run runs one task and exits. Use it from a script or from CI. On Windows the command is CrystalCode.

Shell
crystal run --workspace . "Fix the failing test."

GitHub Actions

crystal run needs no terminal, so a workflow can install Crystal Code, give it a task, and fail the job when the turn exits non-zero.

For a direct run without the integration package, the workflow below installs Crystal Code and gives it one task. Keep the provider key in repository secrets. It calls CrystalCode directly because a CI runner does not load the installer's shell alias.

GitHub Actions
name: Crystal Code review
on: pull_request
permissions:
  contents: read
jobs:
  review:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4
      - name: Install Crystal Code
        run: |
          curl --fail --location --show-error https://crystalcode.ink/install.sh | sh
          echo "$HOME/.crystal/binaries/code" >> "$GITHUB_PATH"
      - name: Review changes
        env:
          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
        run: |
          CrystalCode run --workspace . --workspace-trust off \
            --plan --duration 600 \
            "Review the changes on this branch and list the risks."

The example uses --plan for a read-only review, and --workspace-trust off because a CI directory cannot answer the trust prompt. It does not record the directory as trusted.

Headless run in the user guide

Provider credentials in the user guide

Build on the engine

The engine is a library. Another front end references it and does not copy it. You bring the model endpoint.