feat(segkit): add CLI skeleton with delegation layer for shell scripts#55
Merged
Conversation
Implements the segkit CLI with android/ios/rn subcommands that delegate to existing shell scripts. This is the foundation for incrementally converting shell scripts to native Rust — each subcommand passes args through to the corresponding .sh script while logging timing and errors to JSONL files in reports/. Includes: - Rust CLI with clap derive (android, ios, rn subcommands) - delegate.rs: script resolution, child process forwarding, JSONL logging - CI job (fmt + clippy + test) gated by path filtering - Rust toolchain (cargo, rustfmt, clippy) added to devbox - devbox scripts: segkit:build, segkit:test, segkit:clippy, segkit:check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a guard rejecting script names containing "..", "/", or "\" before using them in path construction. The input is currently hardcoded from main.rs but this satisfies defense-in-depth for the semgrep finding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Implements the segkit CLI with
android,ios, andrnsubcommands that delegate to existing shell scripts. This is the foundation for the shell-to-Rust migration — each subcommand passes args through to the corresponding.shscript while logging timing and errors to JSONL files.Changes
segkit android <args>delegates toandroid.sh, same foriosandrndelegate.rsresolves scripts via{PLATFORM}_SCRIPTS_DIRenv var or PATH, forwards stdout/stderr, logs timing and errors toreports/segkit-{timing,errors}.jsonlpr-checks.yml(fmt + clippy + test), gated by path filteringsegkit:build,segkit:test,segkit:clippy,segkit:fmt,segkit:check**/target/to.gitignoreWhy
This replaces the orphaned PR #50 (skeleton merged into a deleted branch) and combines it with the Phase 1.1 delegation layer. The delegation pattern lets us wire segkit into plugin.json scripts immediately while converting shell logic to Rust incrementally in follow-up PRs.
🤖 Generated with Claude Code