Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
Show 21 variants Init { non_interactive: bool, main_branch: Option<String>, remote: Option<String>, }, Info { edit: bool, }, Update, Commit { type: Option<String>, scope: Option<String>, message: Option<String>, breaking: bool, breaking_description: Option<String>, tag: Option<String>, no_verify: bool, issue: Option<String>, body: Option<String>, message_file: Option<String>, body_file: Option<String>, include_projects: bool, }, Branch { type: Option<String>, name: Option<String>, issue: Option<String>, from_commit: Option<String>, }, Complete { type: Option<String>, name: Option<String>, }, Sync, Radar, Status, CurrentBranch, CheckBranches, GenerateManPage, Completion { shell: Shell, }, Changelog { from: Option<String>, to: Option<String>, unreleased: bool, }, Config { get_dod: bool, }, HeadSha, Undo { sha: String, no_push: bool, }, Note { message: Option<String>, show: bool, }, Task(TaskAction), Recover { selector: Option<String>, list: bool, }, Review { sha: Option<String>, trigger: bool, digest: bool, approve: Option<String>, concern: Option<String>, dismiss: Option<String>, message: Option<String>, since: String, reviewers: Option<Vec<String>>, },
}

Variants§

§

Init

Initialises the repository for Trunk-Based Development.

Fields

§non_interactive: bool

Accept defaults and skip all interactive prompts (non-interactive mode).

§main_branch: Option<String>

Set the main branch name (default: main).

§remote: Option<String>

Link a remote repository URL and push the initial commit.

§

Info

Shows the current tbdflow configuration.

Fields

§edit: bool
§

Update

Checks for a new version of tbdflow and updates it if available.

§

Commit

Commits changes to the current branch or ‘main’ if no branch is checked out.

Fields

§type: Option<String>

Commit type (e.g. ‘feat’, ‘fix’, ‘chore’, ‘docs’).

§scope: Option<String>

Optional scope of the commit.

§message: Option<String>

The descriptive commit message.

§breaking: bool

Mark this commit as a breaking change.

§breaking_description: Option<String>

Optionally provide a description for the breaking change.

§tag: Option<String>

Optionally add and push an annotated tag to this commit.

§no_verify: bool

Optional flag to skip verification of the checklist.

§issue: Option<String>

Optional flag for an issue reference.

§body: Option<String>

Optional multi-line body for the commit message.

§message_file: Option<String>

Read the commit subject from a file (‘-’ for stdin). Avoids shell escaping. Conflicts with –message.

§body_file: Option<String>

Read the commit body from a file (‘-’ for stdin). Avoids multi-line shell escaping. Conflicts with –body.

§include_projects: bool

Internal flag to do a global commit bypassing monorepo safety

§

Branch

Creates and pushes a new short-lived branch.

Fields

§type: Option<String>

Type of branch (e.g., feat, fix, chore). See .tbdflow.yml for allowed types.

§name: Option<String>

A short, descriptive name for the branch.

§issue: Option<String>

Optional issue reference to include in the branch name.

§from_commit: Option<String>

Optional commit hash on ‘main’ to branch from.

§

Complete

Merges a short-lived branch into ‘main’ and deletes it.

Fields

§type: Option<String>

Type of branch to complete, see .tbdflow.yml for allowed types.

§name: Option<String>

Name or version of the branch to complete.

§

Sync

Syncs with the remote, shows recent history, and checks for stale branches. When ci_check is enabled, checks trunk CI status before pulling.

§

Radar

Scans active remote branches for overlapping work that may cause merge conflicts.

§

Status

Shows the current git status.

§

CurrentBranch

Shows the current git branch name.

§

CheckBranches

Checks for stale branches (older than 1 day).

§

GenerateManPage

Generates a man page for the CLI.

§

Completion

Generates shell completion scripts.

Fields

§shell: Shell
§

Changelog

Generates a changelog from Conventional Commits.

Fields

§from: Option<String>

Generate from this git reference (tag or commit hash).

§to: Option<String>

Generate to this git reference (defaults to HEAD).

§unreleased: bool

Generate for all commits since the latest tag.

§

Config

Internal commands for configuration.

Fields

§get_dod: bool

Print the DoD checklist items to stdout.

§

HeadSha

Prints the short SHA of the current HEAD commit.

§

Undo

Reverts a commit on the trunk by its SHA. The panic button for trunk-based development.

Fields

§sha: String

The commit SHA to revert.

§no_push: bool

Skip pushing the revert commit to the remote.

§

Note

Logs an intent note (breadcrumb) during development. Notes are captured in a local .tbdflow-intent.json and included in the next commit message as an Intent Log.

Fields

§message: Option<String>

The note message to record.

§show: bool

Show the current intent log instead of adding a note.

§

Task(TaskAction)

Manages the current task context for the intent log.

§

Recover

Recovers a WIP snapshot from the safety log. Snapshots are captured automatically during notes and syncs.

Fields

§selector: Option<String>

Snapshot index or hash to restore.

§list: bool

List all available snapshots instead of restoring.

§

Review

Manages non-blocking post-commit reviews for trunk-based development.

Fields

§sha: Option<String>

Commit SHA to trigger a review for. If given without flags, triggers a review.

§trigger: bool

Trigger a review request for the current HEAD commit.

§digest: bool

Generate a digest of commits needing review.

§approve: Option<String>

Mark a specific commit as approved/reviewed (closes issue with review-accepted label).

§concern: Option<String>

Raise a concern on a commit (keeps issue open, adds review-concern label).

§dismiss: Option<String>

Dismiss a review (closes issue with review-dismissed label).

§message: Option<String>

Message for concern or dismiss (required with –concern or –dismiss).

§since: String

Time range for digest (e.g., “1 day ago”, “2024-01-01”).

§reviewers: Option<Vec<String>>

Override default reviewers (comma-separated GitHub usernames).

Trait Implementations§

Source§

impl Debug for Commands

Source§

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

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

impl FromArgMatches for Commands

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 Commands

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more