You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@stackbilt/cli is the OSS Charter package. It currently bundles two distinct surfaces in one binary:
Local governance (23 commands, purely local):validate, drift, blast, surface, audit, classify, score, doctor, init, setup, hook, bootstrap, telemetry, validate-ontology, why, serve, all adf-* subcommands. No network access, no credentials.
Commercial surface (4 commands, network-touching):login, architect, run, scaffold. These reach api.stackbilt.dev/engine and mcp.stackbilt.dev/api/scaffold, require a bearer token, and persist credentials to ~/.charter/credentials.json via charter login.
The bundling creates two problems:
Identity mismatch — the package README and repo description position Charter as a local-first governance tool, but charter login solicits a bearer token and writes it to disk. For a security review at a regulated-company adopter, that's the line that gets flagged — not that the tool can call an external API, but that it asks for and persists credentials.
OSS/commercial coupling — the OSS tarball contains commercial-endpoint URLs, bearer-token handling, and scaffold response types vendored from a contracts package. A fork that wants governance-only has non-trivial surgery to perform.
30-day telemetry signal (single active install): validate (14), doctor (7), adf.evidence (7), run (5), blast (5), audit (3), surface (3). architect and scaffold do not register. Commercial commands are ~10% of total usage — real, but not dominant enough to justify the identity coupling.
Proposal
Extract the commercial surface into a new npm package: @stackbilt/build.
Binary alias split at completion:
@stackbilt/cli → charter binary only (governance)
@stackbilt/build → stackbilt binary only (creation)
Package name matches the existing engine /build REST endpoint naming and is short enough to type.
Concrete moves
Files to relocate from packages/cli/src/ into the new package:
commands/login.ts
commands/architect.ts
commands/run.ts
commands/scaffold.ts
credentials.ts
http-client.ts
types/scaffold-contract-types.ts (vendored from @stackbilt/contracts)
Plus the associated tests in __tests__/:
credentials.test.ts
login.test.ts
auth-wiring.test.ts
What stays in @stackbilt/cli
All 23 governance commands plus serve (local stdio MCP server). No network access, no credential handling, no commercial endpoints referenced.
Receiving-repo options
The receiving home for @stackbilt/build's source is TBD. Three candidates already exist on the org:
Repo
Current purpose
Fit
Stackbilt-dev/stackbilt-engine
Deterministic stack builder — the /build endpoint's implementation
Strongest. The CLI is a thin client of this repo's server. Colocating CLI + server simplifies type sharing.
Stackbilt-dev/stackbilt-mcp-gateway
"OAuth + multi-product routing"
Plausible. Houses the gateway that run calls. Less direct fit than stackbilt-engine.
New repo
Dedicated CLI package
Clean boundary. More publishing ceremony to stand up.
Proposed:stackbilt-engine. It's where the server side of architect/run/scaffold already lives; putting the CLI beside it removes a cross-repo coupling and matches the pattern other engine-embedded CLIs use (e.g., wrangler in workers-sdk).
Stand up publish pipeline for @stackbilt/build (matching Charter's release flow — workflow .github/workflows/release.yml, automated npm publish on tag, CHANGELOG discipline).
Phase 2 — Stand up @stackbilt/build. New package in the chosen repo. Republish login, architect, run, scaffold there (with credentials.ts, http-client.ts, scaffold-contract-types). Initial version: 0.1.0 or match Charter's current versioning cadence. CLI binary: stackbilt. Tests port over.
Phase 3 — Cross-reference deprecation in @stackbilt/cli. In Charter minor release (proposed: 0.12.0), the 4 commands print a stronger deprecation notice pointing users to npm install -g @stackbilt/build. Commands still work; the notice is informational.
Phase 4 — Charter 1.0. Remove the 4 commands, credentials.ts, http-client.ts, and types/scaffold-contract-types.ts from @stackbilt/cli. Remove the stackbilt bin alias from packages/cli/package.json. Update CHANGELOG with migration guide. Major version bump.
Acceptance criteria for Charter 1.0
grep -r 'fetch(' packages/cli/src/ returns zero results (aside from test fixtures).
grep -r 'Authorization' packages/cli/src/ returns zero results.
No stackbilt.dev URL literals in @stackbilt/cli source.
packages/cli/package.json bin field contains only { "charter": "./dist/bin.js" }.
Root README rewritten to lead with governance; scaffolding references redirect to @stackbilt/build.
CHANGELOG [1.0.0] entry documents the split and upgrade path.
Open questions
Receiving repo:stackbilt-engine vs. stackbilt-mcp-gateway vs. new. Leaning stackbilt-engine (argued above).
stackbilt bin alias: keep in @stackbilt/cli for one additional release after Phase 2 (as a warning-printing shim that execs @stackbilt/build if installed), or remove immediately in Phase 4? The shim adds complexity for one release's worth of migration grace.
Versioning: does @stackbilt/build start at 0.1.0 or match Charter's current minor (e.g., 0.11.0)? Matching would signal "part of the same ecosystem"; starting at 0.1.0 would signal "new package."
Timing: is there a deadline for 1.0, or is it "when it's ready"? The telemetry data suggests no urgency from usage pressure — architect and scaffold are unused; run is 10%. 1.0 can land when governance commands feel stable, independent of this extraction.
Non-goals
Deprecating the scaffolding feature itself. run/architect/scaffold stay supported; they just live in the right package.
Context
@stackbilt/cliis the OSS Charter package. It currently bundles two distinct surfaces in one binary:Local governance (23 commands, purely local):
validate,drift,blast,surface,audit,classify,score,doctor,init,setup,hook,bootstrap,telemetry,validate-ontology,why,serve, alladf-*subcommands. No network access, no credentials.Commercial surface (4 commands, network-touching):
login,architect,run,scaffold. These reachapi.stackbilt.dev/engineandmcp.stackbilt.dev/api/scaffold, require a bearer token, and persist credentials to~/.charter/credentials.jsonviacharter login.The bundling creates two problems:
charter loginsolicits a bearer token and writes it to disk. For a security review at a regulated-company adopter, that's the line that gets flagged — not that the tool can call an external API, but that it asks for and persists credentials.30-day telemetry signal (single active install):
validate(14),doctor(7),adf.evidence(7),run(5),blast(5),audit(3),surface(3).architectandscaffolddo not register. Commercial commands are ~10% of total usage — real, but not dominant enough to justify the identity coupling.Proposal
Extract the commercial surface into a new npm package:
@stackbilt/build.Binary alias split at completion:
@stackbilt/cli→charterbinary only (governance)@stackbilt/build→stackbiltbinary only (creation)Package name matches the existing engine
/buildREST endpoint naming and is short enough to type.Concrete moves
Files to relocate from
packages/cli/src/into the new package:commands/login.tscommands/architect.tscommands/run.tscommands/scaffold.tscredentials.tshttp-client.tstypes/scaffold-contract-types.ts(vendored from@stackbilt/contracts)Plus the associated tests in
__tests__/:credentials.test.tslogin.test.tsauth-wiring.test.tsWhat stays in
@stackbilt/cliAll 23 governance commands plus
serve(local stdio MCP server). No network access, no credential handling, no commercial endpoints referenced.Receiving-repo options
The receiving home for
@stackbilt/build's source is TBD. Three candidates already exist on the org:Stackbilt-dev/stackbilt-engine/buildendpoint's implementationStackbilt-dev/stackbilt-mcp-gatewayruncalls. Less direct fit than stackbilt-engine.Proposed:
stackbilt-engine. It's where the server side ofarchitect/run/scaffoldalready lives; putting the CLI beside it removes a cross-repo coupling and matches the pattern other engine-embedded CLIs use (e.g.,wranglerinworkers-sdk).Prerequisites
STACKBILT_API_KEY+STACKBILT_API_BASE_URLsupport;charter logindeprecation notice. Lets users migrate before the commands move packages.@stackbilt/build(matching Charter's release flow — workflow.github/workflows/release.yml, automated npm publish on tag, CHANGELOG discipline).Migration phases
Phase 1 — Env-var bridge (landed in feat(cli): STACKBILT_API_KEY env var auth; deprecate charter login #111). Additive; no breakage.
charter loginemits deprecation notice.STACKBILT_API_KEYis the documented primary path.Phase 2 — Stand up
@stackbilt/build. New package in the chosen repo. Republishlogin,architect,run,scaffoldthere (withcredentials.ts,http-client.ts, scaffold-contract-types). Initial version:0.1.0or match Charter's current versioning cadence. CLI binary:stackbilt. Tests port over.Phase 3 — Cross-reference deprecation in
@stackbilt/cli. In Charter minor release (proposed: 0.12.0), the 4 commands print a stronger deprecation notice pointing users tonpm install -g @stackbilt/build. Commands still work; the notice is informational.Phase 4 — Charter 1.0. Remove the 4 commands,
credentials.ts,http-client.ts, andtypes/scaffold-contract-types.tsfrom@stackbilt/cli. Remove thestackbiltbin alias frompackages/cli/package.json. Update CHANGELOG with migration guide. Major version bump.Acceptance criteria for Charter 1.0
grep -r 'fetch(' packages/cli/src/returns zero results (aside from test fixtures).grep -r 'Authorization' packages/cli/src/returns zero results.stackbilt.devURL literals in@stackbilt/clisource.packages/cli/package.jsonbin field contains only{ "charter": "./dist/bin.js" }.credentials.ts,http-client.ts,types/scaffold-contract-types.tsdeleted.@stackbilt/build.[1.0.0]entry documents the split and upgrade path.Open questions
stackbilt-enginevs.stackbilt-mcp-gatewayvs. new. Leaningstackbilt-engine(argued above).stackbiltbin alias: keep in@stackbilt/clifor one additional release after Phase 2 (as a warning-printing shim that execs@stackbilt/buildif installed), or remove immediately in Phase 4? The shim adds complexity for one release's worth of migration grace.@stackbilt/buildstart at0.1.0or match Charter's current minor (e.g.,0.11.0)? Matching would signal "part of the same ecosystem"; starting at 0.1.0 would signal "new package."architectandscaffoldare unused;runis 10%. 1.0 can land when governance commands feel stable, independent of this extraction.Non-goals
run/architect/scaffoldstay supported; they just live in the right package./buildand/api/scaffoldbehavior is unchanged; only the client lives elsewhere.References