Skip to content

feat(segkit): add CLI skeleton with delegation layer for shell scripts#55

Merged
abueide merged 2 commits into
mainfrom
feat/segkit-phase1
May 1, 2026
Merged

feat(segkit): add CLI skeleton with delegation layer for shell scripts#55
abueide merged 2 commits into
mainfrom
feat/segkit-phase1

Conversation

@abueide

@abueide abueide commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the segkit CLI with android, ios, and rn subcommands that delegate to existing shell scripts. This is the foundation for the shell-to-Rust migration — each subcommand passes args through to the corresponding .sh script while logging timing and errors to JSONL files.

Changes

  • Added Rust CLI with clap derive — segkit android <args> delegates to android.sh, same for ios and rn
  • delegate.rs resolves scripts via {PLATFORM}_SCRIPTS_DIR env var or PATH, forwards stdout/stderr, logs timing and errors to reports/segkit-{timing,errors}.jsonl
  • Added segkit CI job to pr-checks.yml (fmt + clippy + test), gated by path filtering
  • Added Rust toolchain (cargo, rustfmt, clippy) to root devbox.json with scripts: segkit:build, segkit:test, segkit:clippy, segkit:fmt, segkit:check
  • Added **/target/ to .gitignore

Why

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

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>
@abueide abueide added the feature New feature or functionality label May 1, 2026
Comment thread segkit/src/delegate.rs
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>
@abueide abueide marked this pull request as ready for review May 1, 2026 22:14
@abueide abueide merged commit fb83ba8 into main May 1, 2026
19 checks passed
@abueide abueide deleted the feat/segkit-phase1 branch May 8, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant