@driftgard/cli
v1.9.1
Published
Driftgard CLI — governance-as-code for AI compliance
Maintainers
Readme
@driftgard/cli
Governance-as-code CLI for DriftGard.
Use it to pull, validate, lint, test, promote, and activate Control Packs from your terminal or CI pipeline.
Install
npm install -g @driftgard/cliOr run directly:
npx @driftgard/cli helpConfigure
export DRIFTGARD_API_KEY=dg_your_api_key
export DRIFTGARD_PROJECT_ID=proj_xxxOptional:
export DRIFTGARD_BASE_URL=https://api.driftgard.comCommon Workflow
driftgard pull --format yaml --pack ./control-packs/prod.yaml
driftgard validate --pack ./control-packs/prod.yaml
driftgard lint --pack ./control-packs/prod.yaml
driftgard test --pack ./control-packs/prod.yaml
driftgard push --pack ./control-packs/prod.yamlCommands
| Command | Purpose |
| --- | --- |
| pull | Download the active Control Pack |
| push | Upload a local Control Pack as a new version |
| activate | Activate a specific Control Pack version |
| validate | Validate Control Pack structure offline |
| lint | Check for logical policy issues offline |
| test | Run Control Pack test cases |
| benchmark | Run CI benchmark thresholds |
| diff | Compare recent Control Pack versions |
| promote | Promote a Control Pack between projects |
Examples
Download active pack:
driftgard pull --format yaml --pack ./control-packs/prod.yamlValidate and lint:
driftgard validate --pack ./control-packs/prod.yaml
driftgard lint --pack ./control-packs/prod.yamlRun tests:
driftgard test --pack ./control-packs/prod.yamlPush a new version:
driftgard push --pack ./control-packs/prod.yamlPromote staging to production:
driftgard promote --from-project proj_staging --to-project proj_prod --activateRun a benchmark gate:
driftgard benchmark --max-violation-rate 0.05 --max-blocked 10CI Example
name: DriftGard Governance Check
on: [push]
jobs:
control-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx @driftgard/cli validate --pack ./control-packs/prod.yaml
- run: npx @driftgard/cli lint --pack ./control-packs/prod.yaml
- run: npx @driftgard/cli test --pack ./control-packs/prod.yaml
env:
DRIFTGARD_API_KEY: ${{ secrets.DRIFTGARD_API_KEY }}
DRIFTGARD_PROJECT_ID: ${{ secrets.DRIFTGARD_PROJECT_ID }}Documentation
License
MIT
