Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 16 variants Run { issues: Vec<i64>, common: Common, loop_flags: LoopFlags, triage_flags: TriageFlags, plan_out: PathBuf, no_worktrees: bool, }, Code { prompt: Vec<String>, common: Common, loop_flags: LoopFlags, triage_flags: TriageFlags, dry_run: bool, file_only: bool, plan_out: PathBuf, no_worktrees: bool, }, Followup { common: Common, loop_flags: LoopFlags, triage_flags: TriageFlags, file: Option<PathBuf>, screen_only: bool, file_only: bool, plan_out: PathBuf, no_worktrees: bool, }, Triage { issues: Vec<i64>, common: Common, plan_out: PathBuf, }, Resume { prs: Vec<i64>, common: Common, loop_flags: LoopFlags, next_actor: Option<String>, }, Checkin { items: Vec<i64>, common: Common, dry_run: bool, reply_only: bool, any_author: bool, again: bool, keep_worktrees: bool, }, Answer { items: Vec<i64>, common: Common, dry_run: bool, again: bool, }, Review { items: Vec<i64>, common: Common, dry_run: bool, max_rounds: Option<u32>, verdict: bool, recheck: bool, }, Brainstorm { topic: Vec<String>, common: Common, max_rounds: Option<u32>, ideas: usize, out: Option<PathBuf>, file_issues: bool, from: Option<PathBuf>, }, Split { items: Vec<i64>, common: Common, dry_run: bool, again: bool, }, Listen { items: Vec<i64>, common: Common, once: bool, dry_run: bool, since: Option<String>, }, Post { prs: Vec<i64>, repo: PathBuf, config: Option<PathBuf>, file: Option<PathBuf>, dry_run: bool, }, Init { out: PathBuf, force: bool, update: bool, }, Clean { repo: PathBuf, config: Option<PathBuf>, all: bool, pr_state: bool, }, Doctor { config: Option<PathBuf>, }, ScrubFilter,
}

Variants§

§

Run

Triage the issues, then work them in dependency order.

Fields

§issues: Vec<i64>

Issue numbers. Omit to take every open issue, up to –limit.

§common: Common
§loop_flags: LoopFlags
§triage_flags: TriageFlags
§plan_out: PathBuf

Where to write the triage plan.

§no_worktrees: bool

Work in the main checkout instead of an isolated worktree per issue.

§

Code

Turn a project prompt into a detailed issue, then run it through triage and the implementation and review loop to open a pull request.

One agent reads the repository and drafts the issue. Both agents then triage it just as they do for spar run. –limit and –min-number do not affect the newly filed issue.

Fields

§prompt: Vec<String>

What to build, fix, or improve. Quote a prompt containing flags.

§common: Common
§loop_flags: LoopFlags
§triage_flags: TriageFlags
§dry_run: bool

Print the drafted issue without filing it or starting a run.

§file_only: bool

File the issue and stop, leaving it for a later spar run.

§plan_out: PathBuf

Where to write the triage plan.

§no_worktrees: bool

Work in the main checkout instead of an isolated worktree per issue.

§

Followup

Work the follow-ups recorded in .spar/followups.md.

One agent reads every entry against the current checkout and rules on it: still there, already fixed, not worth it, or a duplicate. What survives is filed as an issue and worked like any other, which means both agents still triage it before anything is implemented. An entry that was filed or dropped leaves the queue and is kept in .spar/followups.done.md.

Takes no numbers: an entry has no number a person could type. –limit caps how many are taken, and –min-number does nothing here.

Fields

§common: Common
§loop_flags: LoopFlags
§triage_flags: TriageFlags
§file: Option<PathBuf>

Read this instead of .spar/followups.md.

§screen_only: bool

Print the verdicts and stop. Nothing is filed and no file is touched.

§file_only: bool

File the issues and stop, leaving them for a later spar run.

§plan_out: PathBuf

Where to write the triage plan.

§no_worktrees: bool

Work in the main checkout instead of an isolated worktree per issue.

§

Triage

Triage only. Writes the plan and touches nothing else.

Fields

§issues: Vec<i64>

Issue numbers. Omit to take every open issue, up to –limit.

§common: Common
§plan_out: PathBuf
§

Resume

Continue the review loop on existing PRs, including ones spar did not create.

Fields

§prs: Vec<i64>

Pull request numbers. Omit to take every open PR, up to –limit.

§common: Common
§loop_flags: LoopFlags
§next_actor: Option<String>

Which agent reviews next, overriding saved custody after the PR head changed.

§

Checkin

Answer the comments on a pull request, and act on the ones worth acting on.

Reads every comment somebody else left that has not been answered. Both agents judge each one. A change they both agree is right and belongs here is made, pushed, answered in its own thread, and the thread marked resolved. One they both judge wrong gets the reason and the thread is left open for you. One they disagree about is parked.

Fields

§items: Vec<i64>

Pull request numbers. An issue number resolves to its open PR. Omit to take every open PR, up to –limit.

§common: Common
§dry_run: bool

Print every reply and every change instead of posting or pushing.

§reply_only: bool

Answer in words only. Nothing is committed, pushed, or resolved.

§any_author: bool

Act on a comment from anyone, not only from somebody who can write to this repository.

§again: bool

Answer comments spar already answered, ignoring what it recorded.

§keep_worktrees: bool

Leave worktrees in place afterwards, for inspection.

§

Answer

Answer what an issue asks of you by name, and leave the rest to you.

Finds the places on the issue, its body and its comments, that mention you and have not been answered. One agent drafts an answer to each question put to you, with the code open; the other checks every one. A question of fact both agree on is answered in one comment, which mentions nobody. Anything that asks you to decide, commit, or give a view is never answered for you: it is listed, with what was found, in .spar/answers/issue-N.md. A mention is judged once.

Fields

§items: Vec<i64>

Issue numbers. Omit to take the open issues that mention you, up to –limit.

§common: Common
§dry_run: bool

Print the answer instead of posting it, and save it for spar post.

§again: bool

Judge mentions spar already judged, ignoring what it recorded.

§

Review

Review pull requests without changing them, including from a fork.

Both agents review independently, then rule on each other’s findings, then answer the objections. Nothing is committed, pushed, or merged.

Fields

§items: Vec<i64>

Pull request numbers. An issue number resolves to its open PR. Omit to take every open PR, up to –limit.

§common: Common
§dry_run: bool

Print the review instead of posting it.

§max_rounds: Option<u32>

Adjudication passes. 1 is two independent reviews with no cross-checking, 2 adds it, 3 adds a rebuttal on what they dispute.

§verdict: bool

Submit a formal review instead of a comment: approve when nothing blocks, request changes when a blocking finding stands. The verdict is derived from the findings, never asked of a model.

§recheck: bool

Take a second look instead of a first: rule on the findings the last review recorded, review only what landed since, and submit a verdict. A pull request with no posted review on record gets a first look.

§

Brainstorm

Brainstorm novel ways to reach a goal, by pairing pieces that exist.

The premise is that the parts of an answer usually exist already and have not been put together. Both agents take inventory of what exists and propose independently, then each builds on or challenges what only the other proposed, then what was challenged is defended or withdrawn and both rank what is left. The session is written to a local file. With no subject, the agents read the repository and brainstorm for it.

Takes words, not numbers. –limit, –min-number, and –base do nothing here.

Fields

§topic: Vec<String>

The subject, in as many words as it takes. Omit to brainstorm the repository itself.

§common: Common
§max_rounds: Option<u32>

Rounds. 1 is two independent proposals with nothing cross-checked, 2 adds the ranking, 3 puts a round of building and challenging between them, and more adds further rounds of that.

§ideas: usize

How many ideas to keep. The rest are listed with why they went.

§out: Option<PathBuf>

Write the session here instead of under .spar/brainstorms/.

§file_issues: bool

File each kept idea as an issue, or add it to one that covers it.

§from: Option<PathBuf>

File the ideas in a saved session instead of running one. Edit the file first; what is filed is what it says.

§

Split

Break an issue or a pull request into smaller ones.

One agent proposes the parts with the code open, the other rules on the proposal: accept, reject, or accept with named parts struck. Disagreement resolves toward not splitting.

An issue’s parts are filed as issues and the parent is rewritten into a checklist that points at them. A pull request’s parts each get their own branch and their own pull request, and the original is left open and otherwise untouched: split branches use create-only pushes, and the parent is never closed or rebased. A pull request from a fork is proposed in a comment rather than split.

It decomposes and stops. Nothing is triaged, implemented, or merged. Run the reported child numbers next, or enable decompose_trackers and run the issue parent.

Fields

§items: Vec<i64>

Issue or pull request numbers. Omit to go through every open issue and every open pull request, and split what is worth splitting.

§common: Common
§dry_run: bool

Print the proposal and write nothing.

§again: bool

Start a separate split even when one is recorded or retained. Does not resume retained branches.

§

Listen

Watch the repository and act on what happens, spending nothing while it waits.

Polls GitHub through gh for activity on pull requests spar has reviewed, for pull requests assigned to you or awaiting your review, and for mentions of you. A reviewed pull request gets a second look and a verdict when your review is requested again or you are mentioned on it, never for a push or a comment alone; a new one gets a review; a comment on a pull request you wrote gets spar checkin; a mention of you on an issue gets spar answer. Waiting costs no agent calls: only a review, a second look, a check-in, or an answer does.

With numbers, watches only those issues and pull requests and exits once every one is closed. Ctrl-C stops it after the call in flight is stopped; a second Ctrl-C stops it at once.

Fields

§items: Vec<i64>

Issue or pull request numbers to watch. Omit to watch the whole repository.

§common: Common
§once: bool

Poll once, act on what is due, and exit. For cron.

§dry_run: bool

Log every event and the action it would trigger, and trigger nothing.

§since: Option<String>

How far back to look on the first run: 30m, 2h, 1d. Later runs resume where they stopped.

§

Post

Post a review a dry run produced, without running the agents again.

spar review <pr> --dry-run saves what it produced. Read it, edit the file if you like, then post exactly that.

Fields

§prs: Vec<i64>

Pull request numbers whose saved review should be posted.

§repo: PathBuf
§config: Option<PathBuf>
§file: Option<PathBuf>

Post this file instead of the saved review.

§dry_run: bool

Print what would be posted and stop.

§

Init

Detect installed agent CLIs and write a spar.toml.

On an existing config, --update appends any settings it does not mention, which is how to pick up options added by a newer release.

Fields

§force: bool

Overwrite an existing config.

§update: bool

Append settings the existing config does not mention, as comments. Nothing already in the file is changed.

§

Clean

Remove worktrees, branches, and state whose PR is merged or closed.

Fields

§repo: PathBuf
§config: Option<PathBuf>
§all: bool

Remove every local worktree and local branch spar recorded, even for open PRs.

§pr_state: bool

Also delete state comments left on finished PRs.

§

Doctor

Check prerequisites and resolve each configured agent.

Fields

§config: Option<PathBuf>
§

ScrubFilter

Read a commit message on stdin and write the scrubbed version to stdout.

Used by git filter-branch, not by people.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.