Skip to content

feat(cli): wire documented-but-unrouted commands (secrets validate, env diff) - #28

Merged
sandstream merged 1 commit into
mainfrom
feat/wire-secrets-validate-env-diff
Jun 22, 2026
Merged

sandstream merged 1 commit into
mainfrom
feat/wire-secrets-validate-env-diff

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Why

A command-surface audit (every command in README/COMMANDS.md vs what cli.ts/commands/ actually route) found two documented commands that were routed nowhere — running them errored with "Unknown subcommand", while complete implementations sat orphaned and unimported (validateSecrets, diffEnvFiles). Classic "looks-real-but-unwired" — exactly the kind of thing a skeptic hits in the first 60 seconds and calls "vibe-coded".

This wires them so the docs are true.

Changes

  • kit secrets validate [--fix] [--auto] — verifies every key declared in [secrets.keys] resolves to a non-empty value. Real availability via resolveViaBackend (env/config short-circuit). Read-only by default, exits non-zero on missing/unfixable; --fix prompts interactively, --auto pulls from .env.template. Writes go through the existing gated backend writer (read-only mode still refuses them).
  • kit env diff --compare <env> — drift between .env.local and .env.<env>. Prints key presence + short value hashes only — never raw values, safe to run anywhere.
  • CLI integration tests for both (routing + exit codes).

Verification

  • Full npm run build clean (0 tsc errors).
  • New CLI integration tests pass (29/29 in cli.test.ts); env-diff/secrets-validate lib tests green (13/13).
  • End-to-end smoke:
    • kit env diff --compare staging → correctly shows keys only-in-local / only-in-staging / changed (hashes), exit 0.
    • kit secrets validate with one env key set, one missing → flags the missing key, exit 1.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

…nv diff

A command-surface audit (README/COMMANDS vs actual routing) found two commands
advertised in the docs but routed nowhere — running them errored, while complete
implementations sat orphaned (validateSecrets, diffEnvFiles).

- kit secrets validate [--fix|--auto]: verify every declared key resolves in its
  backend (real availability via resolveViaBackend; env/config short-circuits).
  Read-only by default, exits non-zero on missing/unfixable; writes go through the
  existing gated backend writer.
- kit env diff --compare <env>: drift between .env.local and .env.<env>; prints key
  presence + value hashes only, never raw values.

Adds CLI integration tests for both (routing + exit codes). Closes the
'documented command that does not run' launch-credibility gap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit be40aa0 into main Jun 22, 2026
15 checks passed
@sandstream
sandstream deleted the feat/wire-secrets-validate-env-diff branch June 22, 2026 07:40
@sandstream sandstream mentioned this pull request Jun 22, 2026
sandstream added a commit that referenced this pull request Jun 22, 2026
Cut 1.13.0 from the 11 PRs merged since v1.12.0. Backfilled the CHANGELOG
entries that landed without one (full-disk-encryption check #26, secrets
validate + env diff #28, .gitignore shared-memory fix #24, ~30k-line
dead-code flush #27/#30) and dated the section. Minor bump: all additive
or dead-code removal, nothing breaking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants