refactor(cli): restructure flat commands into 12 subcommand groups#585
Merged
Conversation
Collaborator
|
@codex please review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Collaborator
|
@wpfleger96 this LGTM! I'll check with @tlongwell-block to see how he's feeling |
tlongwell-block
approved these changes
May 14, 2026
… groups The CLI is becoming the primary agent tool surface (replacing MCP), but 52 commands in a flat alphabetical list is unusable for discovery. This restructure groups them hierarchically so `sprout --help` shows 12 domain groups and `sprout <group> --help` shows that group's subcommands with descriptions and examples. Breaking change — zero external consumers exist today. Key migrations: `sprout send-message` -> `sprout messages send`, `sprout approve-step --approved true` -> `sprout workflows approve`. Also deduplicates parse_event_id/parse_uuid into validate.rs, inlines the vestigial sign_and_submit_builder wrapper in channels.rs, and converts --approved from string to proper boolean flag.
The initial restructuring commit (9809ebe) was reviewed by 3 Claude specialists, Codex, Gemini, and the plan author. This commit addresses all 15 findings — 1 blocking bug, 10 should-fix, 4 optional. Critical: --approved flag used default_value_t which broke --no-approved negation. Changed to ArgAction::Set accepting --approved true/false. Added doc comments to all ~78 bare arg fields, value_enum types for --type/--visibility/--status, per-module dispatch() delegation (shrinking run() from 370 to 30 lines), social subcommand renames (publish-note→publish, get-event→event, etc.), subcommand name assertions in tests, and stale SPROUT_PUBKEY doc removal.
The subcommand-level --relay flag on `repos create` shadowed the global --relay flag (Sprout API endpoint). Renamed to --nostr-relay to avoid clap parsing ambiguity — these are NIP-34 preferred relays for repo discovery, not the Sprout relay URL.
Adds structured help text to the top-level sprout --help showing configuration env vars, exit code table, and JSON error format — useful for both humans and agents parsing CLI output programmatically.
Both branches added parse_uuid to validate.rs — keep the version with the more descriptive error message (includes parse error detail).
The channel field had "Workflow UUID" as its doc comment instead of "Channel UUID the workflow belongs to". Also adds missing doc comment on the workflow field.
7cc93c1 to
0048347
Compare
wpfleger96
added a commit
that referenced
this pull request
May 15, 2026
base_prompt.md now leads with the sprout CLI (12 subcommand groups from #585) rather than MCP tools, which are still available but secondary. Adds the @mention formatting rule (no bold/italic), get_feed type filtering, and a pointer to nest_agents.md for workspace conventions. Reverts the hardcoded model/provider on Solo, Kit, and Scout back to None. The agent binary's own default is the right choice here — pinning claude-sonnet-4-20250514 is opinionated and will go stale. Users who want a specific model can set it per-agent via the model picker.
wpfleger96
added a commit
that referenced
this pull request
May 15, 2026
base_prompt.md now leads with the sprout CLI (12 subcommand groups from #585) rather than MCP tools, which are still available but secondary. Adds the @mention formatting rule (no bold/italic), get_feed type filtering, and a pointer to nest_agents.md for workspace conventions. Reverts the hardcoded model/provider on Solo, Kit, and Scout back to None. The agent binary's own default is the right choice here — pinning claude-sonnet-4-20250514 is opinionated and will go stale. Users who want a specific model can set it per-agent via the model picker.
tlongwell-block
added a commit
that referenced
this pull request
May 15, 2026
* origin/main: (33 commits) dev-mcp: add view_image tool (#602) fix(relay,desktop): only advertise NIP-43 when enforced; probe pairing by supported_nips (#601) fix(desktop): derive unread state from NIP-RS + relay catch-up only (#599) docs(testing): rewrite TESTING.md for current API and CLI-first workflow (#597) fix(agent): fix OpenAI-compat request body serialization and max_tokens (#595) feat(desktop): per-persona and per-agent env var overrides (#594) fix(desktop): stop pinning agents to deprecated SPROUT_ACP_TURN_TIMEOUT (#592) fix(desktop): populate member_count in get_channels so channel browser shows real counts (#548) fix(desktop): autofocus message composer on channel/thread open (#572) refactor(cli): restructure flat commands into 12 subcommand groups (#585) feat(sdk): add builder functions for workflows, DMs, and presence (#589) feat(desktop): add message more-actions dropdown menu (#590) fix(mobile): preserve channel list across background/resume reconnection (#588) Redesign Home as an inbox (#582) fix(desktop): drive unread badges from live subscription, not refetched lastMessageAt (#581) fix(desktop): refine header scaling and shadow (#573) fix(desktop): keep day dividers below header (#574) Move agent activity below composer (#579) docs(nips): NIP-AE — Agent Engrams (#575) refactor: extract shared @mention resolver into sprout-sdk (#580) ... Signed-off-by: Tyler Longwell <tlongwell@squareup.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
sprout send-message→sprout messages send), acrossmessages,channels,canvas,reactions,dms,users,workflows,feed,social,repos,upload,pack///doc comment that renders in--helpoutput — no bare parameters remainvalue_enumfor--type(stream/forum),--visibility(open/private), and--status(online/away/offline) so clap rejects invalid values at parse time and--helpshows valid options--approvedflag onworkflows approve— was broken (--no-approvedrejected by clap). Now usesArgAction::Setaccepting--approved true/--approved falserun()match to per-moduledispatch()functions, shrinkingrun()to ~30 linesSocialCmdsubcommands to remove redundant prefixes:publish-note→publish,get-event→event,get-user-notes→notes,get-contact-list→contacts,set-contact-list→set-contactsparse_event_id/parse_uuidintovalidate.rs, removes redundantvalidate_uuid+parse_uuiddouble-parse from 13 call sites, inlines vestigialsign_and_submit_builderwrappersubcommand_names_are_stabletest asserting exact subcommand names per group (not just counts), preventing silent renamesSPROUT_PUBKEYdocumentation from README.md and TESTING.md (env var is not wired in CLI source)long_aboutto the top-levelsprout --helpwith configuration env vars, exit code table, and JSON error format — useful for both humans and agents parsing CLI output programmaticallyRebased on #589 — workflow, DM, and presence write commands now use
sprout_sdkbuilders instead of rawnostr::EventBuilder.workflows updategained a--channelflag (required by the updatedbuild_workflow_updatebuilder).Zero external consumers — this is the right moment for a breaking interface change before the CLI becomes the primary agent tool surface.