Documentation

Dev Agent Export CLI

@scopedrift/cli is a small command-line tool that fetches signed Dev Agent Export bundles from scopedrift, verifies their signatures, and unpacks them into your repository. It's the bridge between the requirements you've captured in scopedrift and the coding agent that will implement them.

In AI-DLC terms (the AI-driven development lifecycle published by AWS), the bundle is the persistent context that the Inception phase hands to Construction: scope, requirements, decisions, glossary and architecture, signed and versioned, living in the repo where the coding agent and the delivery team read it.

Install

npm install --global @scopedrift/cli

The CLI runs on Node 20+. It is a thin client, no scopedrift credentials are stored in plain text on disk; access tokens live in your OS keychain (Windows Credential Manager / macOS Keychain / libsecret on Linux). When the keychain isn't available the CLI falls back to a config file under $XDG_CONFIG_HOME/scopedrift with 0600 permissions.

Authenticate

scopedrift login

This kicks off a device-code flow against your scopedrift workspace. Approve the device in the browser; the CLI receives a refresh token scoped to your account's active organization.

For CI or service-to-service usage you can mint a project-scoped service token from Settings → Project → Dev Export → Service tokens and export it as SCOPEDRIFT_TOKEN:

export SCOPEDRIFT_TOKEN=sdsv_…
scopedrift install --bundle <bundle-id>

Install a bundle

# from inside your repo root
scopedrift install --bundle <bundle-id> --target ./.scopedrift

The CLI:

  1. Downloads the bundle .tar from scopedrift's private storage bucket via a short-lived signed URL.
  2. Verifies the bundle's ed25519 signature against the org's published public key at /.well-known/scopedrift/orgs/<slug>/key.
  3. Confirms the bundle's sha256 matches the manifest.
  4. Unpacks the bundle into the target directory (default ./.scopedrift), preserving the canonical layout documented in @scopedrift/bundle-protocol.

The unpacked tree is safe to commit. Coding agents (Cursor, Claude Code, Aider, etc.) read the JSON files in ./.scopedrift/ as ground truth for what to build.

One-click install paths

Instead of running the CLI by hand, scopedrift can land a bundle in your repo by opening an issue or pull request:

Verify a bundle without installing

scopedrift verify ./scopedrift-bundle-v3.tar

Useful for CI gates that want to fail the build if a bundle wasn't signed by the expected org. verify exits non-zero if the signature is invalid, the public key has been retired, or the bundle has been tampered with.

Key rotation & revocation

Org admins can rotate the bundle signing keypair from Settings → Organization → Security. After rotation the previous key continues to verify existing bundles for a 30-day grace window before being retired. If a key is suspected compromised, revoke it explicitly from the same page; the CLI's verify command will refuse retired keys immediately.

Source & issue tracking

The CLI is open source under MIT. File issues, feature requests, or contributions at github.com/scopedrift/cli.