
octo
io.github.quadnix/octo
Teaches an AI agent Octo, signs it in to Octo, and runs the project's own Octo CLI for it.
Documentation
Octo
Infrastructure as code written as intent: you describe an app and what it needs, modules turn that into Terraform, and your own Terragrunt applies it. Users start at octo.quadnix.com.
Octo is in
0.x. Version1.xwill mark it ready for production.
This README is a set of procedures for working on the repository. docs/ARCHITECTURE.md explains what exists, and
docs/CODING-STANDARDS.md how to add to it.
Requires Node 20 or newer, Terraform or OpenTofu 1.6 or newer, and Terragrunt 1.0 or newer. The integration suites also need Docker, and the e2e suites AWS credentials.
A — Set up this machine
Once.
corepack enable
pnpm install
pnpm run prepare
prepare installs the pre-commit hook, which runs the format check, lint, the build with its type check, the
circular-dependency check, the secrets spec and the docs code-block check.
B — Build, lint and test
pnpm run build
pnpm run lint
pnpm test
octo-aws-cdk, octo-event-listeners, octo-build and octo-templates import octo from its dist, and
octo-templates imports octo-aws-cdk the same way. Rebuild what you changed before testing what depends on it, or
the suite runs against the old code and still passes.
pnpm run build also type-checks every package, tests included, through each package's check:types.
octo-mcp's build reads apps/octo-docs/build/mcp-source.json, which the docs site's build writes, and the site's
build reads the other packages' dist. On a fresh clone, build in that order:
pnpm exec nx run-many -t build --exclude=@quadnix/octo-mcp
# then build the site: apps/octo-docs/README.md B
pnpm run build
Rebuild the site after changing a page or JSDoc, for octo-mcp to ship the change; a local build reads whatever site
build is on disk.
pnpm run format writes what pnpm run format:check checks. Lint does not check formatting.
pnpm run lint:fix sorts imports, members and keys. A flag passed through pnpm run is written without --: pnpm
forwards the separator, and the script then drops the flag.
C — Run integration tests
Integration specs run real Terraform; octo-templates' start LocalStack in Docker.
pnpm run test:integration
D — Run an e2e suite
Every e2e suite reaches a live AWS account. octo-aws-cdk's plan and apply nothing; octo-templates' create real
resources and tear them down.
-
Copy the
.env.defaultsbeside the suite to.envand fill in real values..envis ignored. -
Build the packages the suite imports:
npx nx run-many -t build --projects=octo,octo-event-listeners,octo-aws-cdk -
Run one spec, by path, from its package:
cd packages/octo-templates NODE_OPTIONS=--experimental-vm-modules npx jest --runTestsByPath src/<template>/main.e2e-spec.ts
Never pnpm run test:e2e — it runs every suite live at once. A template suite is one sequence: its first test applies
the stack, the last tears it down, so run the whole file. Never combine -u with -t: jest then deletes the snapshots
of every test it skipped. Never commit while a suite runs: the pre-commit hook deletes every dist.
E — Run the octo-mcp journeys and knowledge eval
Both run claude -p on your own Claude sign-in, so every run costs usage; packages/octo-mcp/README.md says what they
measure.
-
Build in the order B gives: every package but
octo-mcp, the docs site (apps/octo-docs/README.mdB), then what the agent runs:npx nx run-many -t build --projects=octo,octo-event-listeners,octo-aws-cdk,octo-build,octo-mcp -
From
packages/octo-mcp:pnpm run journeys --runs 1 --only table-key-change pnpm run knowledge-eval --only design-kv-table,recover-run-died pnpm run search-eval
search-evalis free; run it after any change to the builders or the index.- A knowledge-eval run stops at $1.00 and a journeys run at $0.50;
--stopAtDollarschanges the cap. - A paid run asks only the questions and journeys a change touches, with
--only, unless a full run is asked for, and only with a question you need answered before building further. --runs 1is a smoke check. Judge a journey regression only on--runs 3, of the journeys it flagged, and keep a baseline only from such a run: add--baseline, and commitbaseline.jsonwith the changes it measures. Keep baselines on Haiku, the default model.- Docker must run: a run that asks a project question, or runs a journey in the knowledge-eval project, first records that project on a LocalStack of its own, on port 4577.
- Transcripts land in
test/journeys/results/andtest/knowledge-eval/results/, which are ignored. Read one before running again.
F — Release
- Merge to
mainwith PR titles per.github/jobs/validate-pr-title.job.sh. The commit type sets the bump:chorereleases nothing. - Run
pnpm run check:changelog, which names the next version, and write its entry inapps/octo-docs/docs/reference/changelog.mdxfrom every change a user sees since the last release tag. An entry written before the release is rewritten whole: the check passes on any entry with the version's heading. - Only when the release is told to check prices, otherwise skip: check every
@costfigure inocto-aws-cdk's modules against AWS'sus-east-1price files (pricing.us-east-1.amazonaws.com/offers/v1.0/aws/<service>/current/us-east-1/index.json), or the service's pricing page where the file is over 50 MB, and correct each figure that drifted. - Run the Manual Release workflow on
main. It stops on a failed site build, anocto-mcpbuild that finds nomcp-source.json, or a version without a changelog entry;docs/ARCHITECTURE.mdsays what it publishes.
Environment variables
Everything outside the code that governs how this repository behaves. A suite's .env is read through env-smart,
falling back to the .env.defaults beside it.
| Variable | Set by | What it does |
|---|---|---|
AWS_ACCOUNT_ID | a suite's .env | The account every e2e suite plans or applies into. |
AWS_REGION_ID | packages/octo-aws-cdk/test/.env | The region the module e2es plan into. Template suites hardcode us-east-1. |
OCTO_DEFINITION_FILE_PATH | the user, or a create-app project's scripts | The octo.yaml every lifecycle command boots from. OctoCliUtility sets it for the template suites. A relative path is resolved once against the working directory, so run-action callbacks find it. |
OCTO_JOURNAL_COMMAND_ID | JournalEventListener | The running command's id, set for every process it starts, so a run-action that Terraform starts mid-apply names that apply as parentCommandId in its journal. |
TF_VAR_OCTO_PROJECT_ROOT | TerraformUtility, unless already set | The working directory, so terraform.localPath() paths resolve inside Terragrunt's cache copy of a folder. |
TG_LOG_CUSTOM_FORMAT | TerraformUtility, always | Terragrunt's log line layout, its default without the time, since the journal records when each line arrived. |
TG_LOG_FORMAT | TerraformUtility, always unset | Unset for every Terragrunt process, so it cannot override TG_LOG_CUSTOM_FORMAT. |
TG_PROVIDER_CACHE | TerraformUtility, unless already set | 1, so Terragrunt shares one provider cache across folders. |
TG_TF_PATH | TerraformUtility, from --terraformBinary | Which Terraform or OpenTofu binary Terragrunt runs. |
NODE_OPTIONS | every package's test scripts | --experimental-vm-modules, which Jest needs to run ESM. Set it yourself when running jest directly. |
OCTO_GH_TOKEN | a repository secret | Checkout and push in Manual Release, and the tags and GitHub releases nx release creates. |
@quadnix/octo-mcpnpm install @quadnix/octo-mcp