refactor(ao-cli): split main.rs into modules (#50)#71
Merged
Conversation
Extract clap definitions to cli/args.rs, shared wiring (AutoScm, plugin selection, project resolution, printing, local issues, spawn helpers, browser, lifecycle notifier setup) under cli/, and one file per command area under commands/. Session restore/attach live under session/. Deduplicate notifier registration between watch and dashboard via cli/lifecycle_wiring.rs. Keep main.rs as tracing init plus command dispatch; move unit tests to src/tests.rs. Behavior and CLI surface are unchanged. Verified with cargo test -p ao-cli, cargo test --workspace, cargo clippy --workspace --all-targets. Refs: #50 Made-with: Cursor
Made-with: Cursor
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
Structural refactor of
crates/ao-cli: the previous monolithicmain.rs(~3.6k lines) is split into focused modules so ongoing TS→Rust CLI porting is easier to navigate and test.What changed
main.rs(~145 lines): crate docs, tracing init, clap parse, and command dispatch only.cli/:args.rs(all clap types),auto_scm.rs,plugins.rs(agent/runtime selection,MultiAgent, duplicate-issue error),agent_config.rs,project.rs,printing.rs,spawn_helpers.rs,local_issue.rs,browser.rs,lifecycle_wiring.rs(shared notifier setup).commands/: one module per command area (start,spawn,status,watch,send,pr,dashboard,kill,cleanup,doctor,review_check).session/:restore,attach.tests.rs: cross-module unit tests (unchanged assertions; imports updated).Behavior
No intentional changes to outputs, defaults, flags, or project resolution.
watchanddashboardnow share a singlenotifier_registry_from_confighelper to avoid duplicated wiring.Verification
cargo test -p ao-clicargo test --workspacecargo clippy --workspace --all-targetsao-rs --helpCloses #50
Made with Cursor