@metasession.co/devaudit-cli
v0.1.58
Published
DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.
Downloads
8,074
Readme
devaudit — the Metasession SDLC CLI
Single-binary, cross-platform tool for installing, maintaining, and operating the Metasession SDLC across consumer projects. Bundled with the framework templates it ships (
../sdlc/).
This is the source of @metasession.co/devaudit-cli (binary name: devaudit). It is under active development — see tracking issue #1 and the full design in ../docs/devaudit-cli/.
Install
npx is the canonical zero-install invocation — pulls the latest version on first run:
npx @metasession.co/devaudit-cli@latest --help
npx @metasession.co/devaudit-cli@latest install ../path/to/your-project
npx @metasession.co/devaudit-cli@latest updatePrefer a permanent install? Run once, then the short forms work everywhere:
npm install -g @metasession.co/devaudit-cli
devaudit --help
devaudit install ../path/to/your-project
devaudit updateRequires Node ≥ 22. Native binaries (no Node runtime needed) are on the roadmap.
Status — v0.1.1
Working
devaudit --help/--versiondevaudit doctor— checksnode(>=22),git,gh,jq,curlare on PATHdevaudit status [path]— readssdlc-config.jsonfrom a consumer project, prints stack/host/slug/source-dirs, and reports which framework files are presentdevaudit install [path]— native TS, 11-step interactive onboarding undersrc/install/(auth-probe → detect-stack → prompts → write-config → project → api-key → github → hooks-bootstrap → branch-protection → sync-templates → done-report). Replaces the formerscripts/sdlc-onboard.sh(removed); no shell-out.devaudit update <version> <paths...>— native TS, multi-project template sync undersrc/update/. Reads each consumer'ssdlc-config.json, copies framework files, firesbeforeSync/afterSyncplugin hooks. Replaces the formerscripts/sync-sdlc.sh(removed); no shell-out.devaudit push <slug> <req-id> <type> <file>— uploads evidence to the portal (port ofupload-evidence.sh; file or directory; retries on 429/5xx with backoff)devaudit auth login— interactive PAT paste flow; validates against the portal; stores at~/.config/devaudit/auth.json(mode 0600)devaudit auth logout— wipes the cached tokendevaudit auth status— verifies the cached token (orDEVAUDIT_USER_TOKENenv var) by callingGET /api/projectsdevaudit plugin list— discovers plugins in~/.config/devaudit/plugins/, validates manifests, reports load statedevaudit plugin install <source>— npm-name or Git URL; clones / installs / validates / registersdevaudit plugin remove <name>— deregisters and rm-rfs the plugin directorydevaudit plugin update— git-pulls each plugin directory
40 vitest tests across 8 test files; all green on Linux + macOS + Windows.
Stubbed (exit code 1 + helpful pointer)
These need workstream B (portal-side) prereqs before they can do anything real:
devaudit org list / switch / policy list|apply / report— needs portal RBAC + org endpointsdevaudit config get / set / list— config file already exists, just no CLI surface yetdevaudit upgrade— self-update; needs distribution channel established first (Step 2 of trajectory — native binaries via brew/scoop/curl)
Develop locally
cd cli
npm install --legacy-peer-deps # the framework's polyglot adapter set doesn't peer-clean cleanly with strict node>=22
npm run build # tsup → dist/index.js (ESM, bundled)
./bin/devaudit.js --help # try the CLI
./bin/devaudit.js doctor # check your local environmentProject structure
cli/
├── package.json # @metasession.co/devaudit-cli, ESM-only, node >=22
├── tsconfig.json # strict TS
├── tsup.config.ts # ESM bundle config
├── vitest.config.ts # test runner
├── bin/
│ └── devaudit.js # shebang + dynamic import of dist/index.js
└── src/
├── index.ts # commander entry — registers all commands
├── commands/
│ ├── doctor.ts # real implementation
│ └── stub.ts # helper for not-yet-implemented commands
└── lib/
├── logger.ts # consola wrapper, --json + --verbose aware
└── version.ts # CLI version constantWhy a CLI (it replaced the original bash scripts)
- Cross-platform native (Linux/macOS/Windows; no WSL requirement)
- JSON output mode on every command for CI
- Interactive UX comparable to Vercel/Supabase/Firebase/GH/Railway CLIs
- Plugin extensibility (
@metasession.co/devaudit-plugin-sdkdefines the contract;@metasession.co/devaudit-plugin-prisma+@metasession.co/devaudit-plugin-evidence-exportare first-party reference implementations) - Organisation-level features: policy-as-code, RBAC, centralised reporting
- Single-binary distribution via Node SEA (no Node runtime required on the user's machine) — on the roadmap
