Skip to content
Afara
Blog

Guides 1 min read

Running Afara in CI: a practical guide

Every command except the interactive shell works without a terminal. Here is how to fail a build when the code does something the ticket doesn't describe.

Afara Engineering, Engineering team

Afara’s CLI is built to run unattended. Without a terminal, every command behaves predictably:

  • afara prints help instead of opening the interactive shell.
  • afara generate uses all pending commits unless you pass --commits.
  • afara link requires --issue.
  • afara model lists the choices instead of asking, and commands that need a model use the backend’s default if none is set.

The check

The most useful CI step is a single line:

afara compare "card payment" --fail-on extra

--fail-on takes extra, missing, reordered or any. The command exits with a non-zero status while open findings of that kind exist. Findings someone has already accepted or resolved don’t count, so the gate only fires on things a person hasn’t looked at.

What the runner needs

  1. A credential. Sign in once with afara auth login and provide the resulting ~/.config/afara/credentials (or $XDG_CONFIG_HOME/afara/credentials) to the runner as a secret.
  2. An AI coding tool, installed and authenticated, for generate and compare: Claude Code, OpenAI Codex CLI or Gemini CLI. Choose one explicitly with --tool if more than one is installed.
  3. The pushed commit in the clone. compare runs your AI tool in a read-only checkout of the pushed commit so it can open the files the code wireframe cites. A shallow clone that doesn’t include it still works, but the judgement is made from the two graphs alone.

Too-thin stories

If the linked ticket describes fewer than four steps, there isn’t enough to compare. The result is recorded as too thin, with no AI involved, along with what the ticket is missing. It doesn’t fail the build, but it’s a good signal that the ticket needs work.

Keep reading

See Afara on one of your own features.

A 30-minute walkthrough with an engineer. Bring two repositories and a ticket, and see the context your agent would get.