Skip to content

feat: implement @legioncodeinc/cli-kit v0.1.0 (PRD-001)#1

Merged
thenotoriousllama merged 3 commits into
mainfrom
feat/prd-001-cli-kit
Jul 8, 2026
Merged

feat: implement @legioncodeinc/cli-kit v0.1.0 (PRD-001)#1
thenotoriousllama merged 3 commits into
mainfrom
feat/prd-001-cli-kit

Conversation

@thenotoriousllama

Copy link
Copy Markdown
Contributor

Summary

Implements the zero-runtime-dependency CLI mechanism kit for the Apiary CLI suite, consolidating the stable cross-cutting mechanisms currently re-implemented (and drifting) across honeycomb, doctor, hive, and nectar.

Modules (6)

Module Exports Tests
exit-codes ExitCode enum (0/1/2), EXIT_OK/EXIT_ERROR/EXIT_USAGE, parseError(), declined() 15
color setColorEnabled(), disableColor(), isColorEnabled(), bold/dim/red/green/yellow/cyan/amber 25
arg-parser parseArgs(), FlagSpec, ParseOptions, ParsedArgs, ParseResult 51
shutdown finalizeOneShot() — Windows-safe process teardown 17
telemetry isTelemetryOptedOut(), forceOptOut(), resetOptOutOverride() 26
usage formatUsage(), UsageGroup, UsageInput 16
index (barrel) Re-exports all + VERSION 23 (integration)

173 tests passing. Build clean. npm pack --dry-run shows zero source/test/config leak.

AC Ledger: 44/45 VERIFIED

Module ACs Status
Module-wide (AC-1..AC-8) 8 7 VERIFIED, 1 PARKED
Color (AC-a1..AC-a7) 7 7/7 VERIFIED
Shutdown (AC-b1..AC-b6) 6 6/6 VERIFIED
Exit codes (AC-c1..AC-c6) 6 6/6 VERIFIED
Arg parser (AC-d1..AC-d9) 9 9/9 VERIFIED
Telemetry (AC-e1..AC-e9) 9 9/9 VERIFIED

AC-8 (Hive adoption) is PARKED — requires a cross-repo PR to legioncodeinc/hive. Tracked as BLK-1 in the execution ledger.

Close-out

  • Security: PASS — zero Critical/High findings. Zero runtime dependencies ("dependencies": {}). No PII, no secrets, no eval/child_process/fs in published code. Clean npm pack surface.
  • Quality: PASS — full traceability report at library/requirements/completed/prd-001-cli-kit/qa/prd-001-cli-kit-qa.md. Every AC traced to source + test.

Key design decisions (resolved during PRD review)

  • Node =22.5.0 floor, root-only exports (no subpaths)
  • Color: module-level singleton, disableColor() for --json seam
  • Shutdown: process._getActiveHandles() kept in try/catch, doc-only long-running exemption
  • Exit codes: declined() returns EXIT_OK (stdout), EXIT_DECLINED omitted entirely
  • Arg parser: --limit standard is min: 1, no array flags, --bool=false is usage error
  • Telemetry: isTelemetryOptedOut(toolName) ships (stateless env-only)

Related

Zero-runtime-dependency CLI mechanism kit for the Apiary CLI suite.
Six modules: color, exit-codes, arg-parser, shutdown, telemetry, usage.
173 tests passing. Security + QA close-out clean.

AC Ledger: 44/45 VERIFIED, 1 PARKED (AC-8 Hive adoption, cross-repo).

Modules:
- exit-codes: ExitCode enum (0/1/2), parseError(), declined()
- color: SGR helpers with NO_COLOR/FORCE_COLOR/TTY honors
- arg-parser: shared argv parser (collapses Nectar's 5 bespoke parsers)
- shutdown: Windows-safe process teardown (undici close + handle unref + backstop)
- telemetry: isTelemetryOptedOut(toolName) env resolver
- usage: grouped usage-table formatter

Refs: PRD-001, cli-contract.md, cli-parity-audit.md
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The head commit changed during the review from 7ea1268 to 3ebfe6e.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/prd-001-cli-kit

Comment @coderabbitai help to get the list of available commands.

thenotoriousllama and others added 2 commits July 8, 2026 08:49
Replicates the release pipeline from hive/doctor/honeycomb/nectar:
- ci.yaml: 3-OS gate (typecheck + test + build + pack)
- release-gate.yaml: AI changeset (Sonnet 5), patch auto-bump, minor gated
- release-approve.yaml: @thenotoriousllama 'Approved Release' comment bridge
- tag-on-merge.yaml: push vX.Y.Z tag on merge (via RELEASE_PAT)
- release.yaml: OIDC trusted publishing, release notes, Discord
- scripts/release/: ai-changeset, apply-bump, bedrock, discord-notify

Also adds 'typecheck' script to package.json.
@thenotoriousllama

thenotoriousllama commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Approved Release

@thenotoriousllama thenotoriousllama merged commit 8a0a52d into main Jul 8, 2026
5 of 6 checks passed
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