Repository navigation
Move the CLI commands into types that own their dependencies - #198
Merged
Merged
Conversation
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
…command-types # Conflicts: # Sources/PrivateHeaderKitCLI/PrivateHeaderKitSSHGeneration.swift
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 20, 2026
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
The CLI's free functions become types that hold the process runner, console, and input they use.
CommandLineToolparses the arguments and runsGenerateCommand,GenerationWizard,SSHGenerateCommand,SearchCommand, orDecompileCommand. Command-line syntax, output text, and exit codes do not change.Details
PrivateHeaderKitCommand.swiftis split by role:CommandLineTool(entry point and exit-status mapping),GenerateCommand(options and request construction),HelperPlan,SimulatorSession, andSourceDiscovery. The wizard builds aGenerateCommandfor the chosen source and reuses its Simulator session and request.Consolepairs the standard-output and standard-error writers that every function took as two parameters.Options.ParsedCommand(arguments:)replacesparsePrivateHeaderKitCommand.PreparedGenerationnow holds the executor and the prepared plan. It was a pair of closures so that tests could substitute it, which no test does since Test CLI generation through the process runner instead of per-step closures #192.CommandLine.arguments[0]on its own, which is the same value in the CLI.runPrivateHeaderKitRawDumpand the functions around it), rendering, terminal input, and signal coordination stay free functions, and the types in those files keep thePrivateHeaderKitprefix.Consolewriters are@Sendable.Testing
swift test: all six test bundles pass.Foundationdump on macOS 27.2.1 is identical to the output before this change (1,023 files).--helpfor the root,generate,search, anddecompile, and seven invalid invocations print the same text and exit with the same status as before.🤖 Generated with Claude Code