Skip to content

M4-CLI1: Standalone CLI binary — status, scan, init subcommands #30

Description

@hartsock

Summary

Add a standalone gitxtend CLI binary that shares the Rust core. Agents, cron jobs, and shell users can run gitxtend status <path> without installing the Python wheel.

Blocked By

Cargo.toml Changes

[[bin]]
name = "gitxtend"
path = "src/bin/main.rs"

[dependencies]
clap = { version = "4", features = ["derive"] }

Subcommands

gitxtend status <path> [--json]

Prints repo status as a human-readable table. --json emits one-line JSON for agent/cron consumption:

{"path":"/...","sync_state":"behind","ahead_count":0,"behind_count":3,...}

gitxtend scan <workspace> [--json] [--no-fetch]

Runs scan_repos() in parallel across all .git-containing subdirs of workspace. Prints a summary table. --json emits JSONL (one object per repo).

gitxtend init [--output <path>]

Writes a sample ~/.gitxtend config to stdout (or --output file). Documents all 7 conflict strategies including rebase and stash-rebase.

New File

  • src/bin/main.rs

Acceptance Criteria

  • cargo build --bin gitxtend succeeds
  • ./target/debug/gitxtend status ~/workspaces/gitxtend prints status
  • ./target/debug/gitxtend scan ~/workspaces prints scan table
  • ./target/debug/gitxtend init prints valid YAML
  • --json flag on status and scan produces valid parseable JSON/JSONL
  • cargo clippy -- -D warnings clean

Beaver (MacBook agent, Claude Sonnet 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliStandalone CLI binarymilestone:M4Config + CLI (v0.4.0)parallelParallel executionrustRust implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions