feat(cli): expose CLI dispatch as importable pkg/cli entry point#30
Merged
Conversation
Move command dispatch from cmd/pkgsafe (package main) to the exported pkg/cli package. cmd/pkgsafe becomes a thin shim calling cli.Execute. This gives downstream distributions — specifically the private pkgsafe-enterprise superset binary — an importable public surface, since everything else in the module lives under internal/ and cannot be consumed across module boundaries. Mechanical move: run() -> cli.Run (exported), new cli.Execute translates exit-code errors; tests move with the package unchanged. No command behavior changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PkgSafe Dependency GateDecision: ALLOW Counts
Warn / Block FindingsNo blocked or warning dependencies found. Recommended ActionAll scanned packages are allowed by policy. Governance Evidence
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/pkgsafe(package main) into an exportedpkg/clipackage;cmd/pkgsafebecomes a thin shim callingcli.Execute(os.Args[1:]).internal/, which is not importable across Go module boundaries — sopkgsafe-enterprisecould not consume the public core at all.pkg/cliis the minimal stable public surface that lets the enterprise superset binary embed the identical command set.run()→ exportedcli.Run, newcli.Executetranslates exit-code errors to process exit codes; tests moved with the package (same directory depth, testdata paths unchanged). No command behavior changes.Validation
go build ./...,go vet ./...,gofmtclean.go test ./...pass;go test -raceon moved package pass.scripts/check-public-boundary.shpasses — this adds interface surface only, no premium implementation.Intended release: v1.1.0 (new exported API, no breaking changes).
🤖 Generated with Claude Code