feat: pass through extra args after -- to forge script#60
Conversation
Support `treb run <script> -- --skip-simulation` and similar patterns where additional flags need to be forwarded to the underlying forge script command. Args after -- are captured by cobra's ArgsLenAtDash(), threaded through RunScriptParams → RunScriptConfig → ForgeAdapter.buildArgs(), and appended to the end of the forge command line. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces support for passing additional arguments to the Forge script using a Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/CLI
participant Runner as CLI Runner
participant UseCase as RunScript UseCase
participant Adapter as Forge Adapter
participant Forge as Forge Command
User->>Runner: Run script with -- args
activate Runner
Runner->>Runner: Parse args, split at --
Runner->>Runner: Validate script reference
Note over Runner: Extract passthrough args
Runner->>UseCase: RunScript(PassthroughArgs)
deactivate Runner
activate UseCase
UseCase->>UseCase: Build RunScriptConfig
Note over UseCase: Include PassthroughArgs in config
UseCase->>Adapter: Execute with config
deactivate UseCase
activate Adapter
Adapter->>Adapter: Build command args
Note over Adapter: Append PassthroughArgs after -vvvv
Adapter->>Forge: Execute command
deactivate Adapter
Forge-->>User: Command output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
forge scriptcommand via--separator--are captured by cobra, threaded through the use case layer, and appended to the forge command lineUsage
Test plan
go test ./internal/...)treb run <script> --dump-command -- --skip-simulationshows--skip-simulationat end of forge commandtreb run <script> -- --skip-simulationactually passes flag to forge🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
--delimiter in the CLI--separator are now forwarded to the forge command during execution