wt-aegiscode
v0.1.0
Published
WT-AegisCode CLI — queue security scans and fetch SARIF / JUnit / JSON results from CI/CD or a local shell. Talks to a WT-AegisCode server's public API with a Bearer token.
Maintainers
Readme
wt-aegiscode
The WT-AegisCode CLI (aegis) — queue security scans and fetch results
(SARIF / JUnit / JSON) from CI/CD or a local shell. It talks to your
WT-AegisCode server's public API with a Bearer token; no browser needed.
Zero runtime dependencies — Node ≥ 18 built-ins only.
Install
npm install -g wt-aegiscode # then: aegis --help
# or, without installing:
npx --yes wt-aegiscode --helpQuick start
export AEGIS_SERVER=https://aegiscode.your-company.example
export AEGIS_TOKEN=<issue one at /admin/api-keys>
# Queue a scan, wait, fail (exit 2) if the quality gate fails
aegis scan https://github.com/acme/checkout.git --branch main --fail-on=qg
# Fetch results in the format your CI ingests
aegis report <scan-id> --format sarif --out results.sarif # PR-diff annotations
aegis report <scan-id> --format junit --out junit.xml # CI "Tests" tab
aegis report <scan-id> --format json # summary
# Deploy gate: has THIS exact commit passed a scan? (e.g. before promoting
# to production from another team's pipeline)
aegis check https://github.com/acme/checkout.git "$(git rev-parse HEAD)"Commands
| Command | Purpose |
| --- | --- |
| aegis scan <git-url> [--branch B] [--fail-on=qg] [--no-wait] | Queue a scan; polls until done by default |
| aegis status <scan-id> | One-line status |
| aegis report <scan-id> --format json\|sarif\|junit [--out FILE] | Fetch results |
| aegis check <git-url> <commit> [--fail-on=VERDICTS] | Deploy gate: verdict for an exact commit |
| aegis hook install [--path .] [--force] | Install a pre-commit secret scan |
| aegis hook run [--path .] | Scan staged files for secrets (hook entry point) |
| aegis prompts init --tool TOOL [--category C] [--path .] [--force] | Write AI secure-coding rules into the repo |
| aegis --help / aegis --version | — |
The hook and prompts commands are fully offline — no server or token.
They reuse the same secret-pattern set and prompt library as the platform, both
bundled with the CLI.
Pre-commit secret hook
Stop a hardcoded key from ever being committed — the inner-loop guard, no network round-trip:
cd your-repo
aegis hook install # writes .git/hooks/pre-commit (refuses to clobber;
# pass --force to overwrite an existing hook)
# from now on, every `git commit` scans the STAGED content of added/modified
# files. A CRITICAL/HIGH match (AWS key, GitHub/GitLab/Slack token, private key,
# DB connection string, …) blocks the commit with a file:line and a masked
# preview. Lower-severity findings are reported but don't block.
git commit -m "…" # blocked if a secret is staged
git commit --no-verify -m "…" # intentional bypass (NOT recommended)aegis hook run is what the installed hook calls; you can also run it by hand
to dry-run the staged scan. It exits 1 on a blocking hit, 0 otherwise.
Bootstrap AI-coding guardrails
Drop WT-AegisCode's secure-coding prompt pack into your repo as the rules file your AI tool reads — great for onboarding or CI:
aegis prompts init --tool claude # → CLAUDE.md
aegis prompts init --tool cursor # → .cursor/rules/aegiscode.mdc (with frontmatter)
aegis prompts init --tool copilot # → .github/copilot-instructions.md
aegis prompts init --tool cursor --category PQC # scope to one category
npx --yes wt-aegiscode prompts init --tool claude # zero-install one-linerRefuses to overwrite an existing rules file unless you pass --force.
Exit codes (CI contract)
| Code | Meaning |
| --- | --- |
| 0 | Completed; quality gate OK (if --fail-on=qg) |
| 1 | Error — network / auth / validation / scan FAILED |
| 2 | Quality gate FAILED (only with --fail-on=qg) |
aegis hook run follows the same convention: 0 = no blocking secret (commit
allowed), 1 = a CRITICAL/HIGH secret was found (commit blocked).
aegis hook install / aegis prompts init exit 1 on a write conflict
(an existing hook / rules file) unless --force is given.
aegis check (deploy gate)
aegis check <git-url> <commit> asks the server for a verdict on an exact
repo + commit (full 40-char SHA): PASSED, FAILED, NOT_SCANNED, or
SCAN_OBSOLETE (the last successful scan ran on a different commit). It uses
a gate-style exit mapping so your pipeline can tell "the gate said no" from
"we could not ask the gate":
| Code | Meaning |
| --- | --- |
| 0 | Verdict PASSED (or a verdict you excluded via --fail-on) |
| 1 | Gate failed — FAILED, NOT_SCANNED, or SCAN_OBSOLETE |
| 2 | Error — network / auth / validation (no verdict obtained) |
By default anything but PASSED exits 1. --fail-on takes a
comma-separated list drawn from failed, not-scanned, scan-obsolete,
all (a FAILED verdict always exits 1 regardless). For example
--fail-on=failed only gates on a failed quality gate and lets
never-scanned / re-scanned-needed commits through.
Config
| Flag | Env | Default |
| --- | --- | --- |
| --server URL | AEGIS_SERVER | http://localhost:3000 |
| --token TOKEN | AEGIS_TOKEN | — (required) |
Full pipeline recipes (GitHub Actions, GitLab CI, Jenkins, Azure DevOps, CircleCI) and troubleshooting: docs/CICD-INTEGRATION.md.
