Skip to content

Comments

Add tiger-style CLI v1 with install/configure/doctor/bootstrap#3

Merged
robertguss merged 17 commits intomainfrom
codex/tiger-style-cli-v1
Feb 9, 2026
Merged

Add tiger-style CLI v1 with install/configure/doctor/bootstrap#3
robertguss merged 17 commits intomainfrom
codex/tiger-style-cli-v1

Conversation

@robertguss
Copy link
Owner

@robertguss robertguss commented Feb 9, 2026

Evidence Packet

Objective

  • Problem solved: Manual adoption/install flow is cumbersome and error-prone.
  • Intended outcome: Provide tiger-style CLI for repeatable install/configure/doctor/bootstrap workflow.

Risk Tier

  • Tier: 2
  • Rationale: New executable plus CI/release automation with cross-platform behavior.

Scope

  • Files/components changed: CLI crate, root Rust workspace, docs, workflows, and this evidence packet.
  • Explicitly excluded scope: replacing existing validator scripts with Rust implementation.

Red

  • Failing test(s): Three feature-slice RED tests are listed below.
    • Slice 1 (install baseline): install_writes_required_tree
    • Slice 2 (configure autodetect): configure_autodetect_sets_manifest_statuses
    • Slice 3 (doctor + bootstrap): bootstrap_installs_configures_and_passes_doctor
  • Command(s): Targeted RED commands are listed below.
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- install_writes_required_tree
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- configure_autodetect_sets_manifest_statuses
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- bootstrap_installs_configures_and_passes_doctor
  • Failure summary: Each RED stage failed for expected unimplemented behavior.
    • Test failed with install command is not implemented yet and exit code 2.
    • Test failed with configure command is not implemented yet and exit code 2.
    • Test failed with doctor checks failed because doctor returned unimplemented status.
  • Expected failure rationale: The implementation intentionally followed scaffold-first strict TDD.
    • The command surface was scaffolded first; install behavior had not been implemented yet.
    • Configure behavior and language autodetect had not been implemented yet.
    • Doctor validation behavior was intentionally deferred until this feature slice.

Green

  • Minimal implementation summary:
    • Slice 1 (install): embedded install assets, implemented file copy/create/overwrite paths,
      dry-run behavior, unix script permission setting, and conflict detection with diff previews.
    • Slice 2 (configure): implemented manifest mode handling (autodetect, all-active,
      all-inactive), language detection with directory exclusions, canonical manifest rendering, and
      AGENTS template creation/conflict handling.
    • Slice 3 (doctor + bootstrap): implemented structural checks, manifest parsing, active
      language tool checks, validator checks with strict/non-strict bash handling, machine-readable
      JSON output, and bootstrap orchestration with dry-run doctor skip.
  • Command(s): Targeted GREEN commands are listed below.
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- install_
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- configure_
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- doctor_
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml --test cli -- bootstrap_
  • Passing summary: All targeted GREEN test groups passed after minimal implementation.
    • Install integration tests passed (4 passed; 0 failed).
    • Configure integration tests passed (3 passed; 0 failed).
    • Doctor and bootstrap integration tests passed (4 passed; 0 failed across targeted runs).

Refactor

  • Structural improvements made:
    • Slice 1 (install): extracted shared action logging helper to remove duplicated output logic.
    • Slice 2 (configure): extracted shared status-label helper to remove duplicated mode rendering
      logic.
    • Slice 3 (doctor): replaced repeated per-tool checks with table-driven iteration.
  • Why behavior is unchanged: Refactors only reduced duplication and preserved behavior contracts.
    • Refactor touched only log-path structure and kept identical create/overwrite semantics.
    • Refactor touched only formatting logic in dry-run output and did not alter manifest decisions.
    • Refactor touched only control-flow structure for equivalent tool-check behavior.
  • Confirmation commands: Full-suite command used after each refactor stage is listed below.
    • cargo test --manifest-path tooling/tiger-style-cli/Cargo.toml

Invariants

  • Invariant assertions added/updated:
    • Existing files are never overwritten by default when contents differ (conflict exit code 3).
    • Manifest output always includes exact rust/python/typescript status lines.
    • doctor enforces tool presence only for active languages.
  • Boundary conditions covered:
    • Empty repository autodetect results in all languages inactive.
    • Existing custom AGENTS.md conflicts without --force.
    • bootstrap --dry-run writes nothing and skips doctor.
    • doctor --strict fails when bash is unavailable.

Security Impact

  • Threats considered: command execution safety, file overwrite safety, path traversal safety.
  • Mitigations: explicit command invocation, conflict-default fail, bounded traversal exclusions.
  • Residual risk: user may still apply --force; documented behavior required.

Performance Impact

  • Baseline measurement:
    • Manual install required multiple copy/chmod commands plus manual manifest edits.
  • Post-change measurement:
    • One command (tiger-style bootstrap) now performs install+configure+doctor in a single run.
  • Delta explanation:
    • CLI consolidates repeated manual operations, reducing operator steps and setup variance.

Assumptions

  1. GitHub releases are the canonical distribution channel for CLI binaries.
  2. Existing manual documentation remains fallback during initial CLI adoption.

Open Questions

  1. None.

Rollback Plan

  • Trigger conditions: incorrect install layout, unsafe overwrite behavior, invalid doctor pass/fail outcomes.
  • Rollback steps: revert CLI and workflow commits; retain existing docs/script-based installation flow.

Validation Commands

cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::undocumented_unsafe_blocks
cargo test --workspace --all-features
scripts/validate_tdd_cycle.sh --base HEAD~10
scripts/validate_evidence_packet.sh --file .evidence/EVIDENCE_PACKET.md

Summary by CodeRabbit

  • New Features

    • Tiger-style CLI: cross-platform installer/configurator with install, configure, doctor, and bootstrap commands; autodetects languages, supports dry-run, conflict previews, force overwrite, executable asset handling, and text/JSON health reports.
  • Documentation

    • Added CLI guide, test plan, evidence packet, and updated adoption docs and README to include the CLI workflow.
  • Chores

    • Workspace configured, .gitignore updated, CI and multi-platform release workflows added.
  • Tests

    • Comprehensive integration test suite covering install/configure/doctor/bootstrap, conflicts, dry-run, and force behaviors.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a new Rust "tiger-style" CLI v1 (install/configure/doctor/bootstrap), embedded assets and templates, language autodetection, conflict/diff reporting, integration tests, docs, CI and release workflows, and a Cargo workspace member to package and publish the CLI.

Changes

Cohort / File(s) Summary
Specification & Evidence
\.evidence/CLI_V1_TASK_PACKET.md, \.evidence/CLI_V1_TEST_PLAN.md, \.evidence/EVIDENCE_PACKET.md
New design, test plan, and evidence documents defining scope, acceptance criteria, tests, and rollout/rollback guidance for the CLI v1.
Docs & Adoption Guidance
docs/cli.md, docs/adopting-in-a-new-project.md, docs/README.md, README.md, contracts/ACTIVE_LANGUAGE_CONTRACTS.md
Adds CLI documentation, quickstart, command reference, adoption guidance promoting tiger-style CLI, and updates ACTIVE_LANGUAGE_CONTRACTS.md status.
CI / Release Workflows
\.github/workflows/cli-ci.yml, \.github/workflows/cli-release.yml
Adds multi-OS test workflow and a release workflow that cross-compiles, packages, and publishes multi-target CLI artifacts.
Workspace & Manifest
Cargo.toml, tooling/tiger-style-cli/Cargo.toml, \.gitignore
Adds Cargo workspace member for tooling/tiger-style-cli, crate manifest with dependencies, and ignores target/.
CLI Entrypoint & Parser
tooling/tiger-style-cli/src/main.rs, tooling/tiger-style-cli/src/cli.rs
New binary entry, AppError/exit codes, clap-based CLI (Install/Configure/Doctor/Bootstrap) and target validation helper.
Commands: install / configure / doctor
tooling/tiger-style-cli/src/install.rs, tooling/tiger-style-cli/src/configure.rs, tooling/tiger-style-cli/src/doctor.rs
Install: writes embedded assets with conflict detection, --force and dry-run semantics. Configure: autodetects languages, renders/writes ACTIVE_LANGUAGE_CONTRACTS.md and AGENTS.md with conflict handling. Doctor: validates paths/tools, runs validator scripts, emits Text/JSON reports.
Utilities: assets / detect / conflicts
tooling/tiger-style-cli/src/assets.rs, tooling/tiger-style-cli/src/detect.rs, tooling/tiger-style-cli/src/conflicts.rs
Asset embedding and collection, language autodetection and manifest parse/render, and conflict/diff preview generation with truncation and binary fallback.
Testing
tooling/tiger-style-cli/tests/cli.rs
Extensive integration tests covering install/configure/doctor/bootstrap flows, conflict/force behavior, dry-run semantics, and strict/JSON reporting.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant CLI as "tiger-style CLI"
    participant Install as "Install Module"
    participant Configure as "Configure Module"
    participant Doctor as "Doctor Module"
    participant FS as "Filesystem / Shell"

    User->>CLI: bootstrap --target /repo [--dry-run]
    CLI->>Install: run(InstallArgs)
    Install->>FS: ensure target exists
    Install->>FS: retrieve embedded assets
    Install->>FS: compare/write files (CREATE/OVERWRITE/SKIP) / collect conflicts
    Install-->>CLI: Result (ok | conflicts)
    CLI->>Configure: run(ConfigureArgs)
    Configure->>FS: autodetect_languages / render ACTIVE_LANGUAGE_CONTRACTS.md
    Configure->>FS: compare/write AGENTS.md (conflict handling)
    Configure-->>CLI: Result (ok | conflicts)
    alt not dry-run and previous ok
        CLI->>Doctor: run(DoctorArgs)
        Doctor->>FS: verify required paths
        Doctor->>Doctor: parse manifest, check tools
        Doctor->>FS: run validator scripts (via bash)
        Doctor->>FS: emit report (text/json)
        Doctor-->>CLI: DoctorReport (ok | failed)
    end
    CLI-->>User: exit (0 success, 2 validation failure, 3 conflicts, 1 unexpected)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hop with joy and tiny paws,
I plant the files and show the diffs,
I dry-run, force, and check with care,
A tiger-style CLI I proudly share,
Huzzah — a rabbit's dev-night cheer!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding the tiger-style CLI v1 with its four core commands (install/configure/doctor/bootstrap).
Description check ✅ Passed The description closely follows the template with all major sections completed: Objective, Risk Tier, Scope, Red/Green/Refactor evidence, Invariants, Security/Performance Impact, Assumptions, Rollback Plan, and Validation Commands.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/tiger-style-cli-v1

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 487b1a231f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@tooling/tiger-style-cli/src/configure.rs`:
- Around line 24-44: The dry-run message for AGENTS.md is ambiguous because it
prints "SKIP/OVERWRITE" whenever agents_path.exists() even though you already
compared file contents; compute and use a concrete flag (e.g., agents_exists and
agents_differs) from the earlier comparison (current != agents_template and
args.force) and then, in the args.dry_run branch, print "DRY-RUN SKIP:
AGENTS.md" when agents_exists && !agents_differs, "DRY-RUN OVERWRITE: AGENTS.md"
when agents_exists && agents_differs (and not forced differently), and keep
"DRY-RUN CREATE: AGENTS.md" when !agents_exists; reference agents_path,
agents_template, current, args.force, and args.dry_run to locate where to add
the boolean and change the println logic.

In `@tooling/tiger-style-cli/src/detect.rs`:
- Around line 28-55: autodetect_languages misses uppercase file extensions;
normalize the extension to lowercase before matching in autodetect_languages:
when you get ext from entry.path().extension().and_then(|v| v.to_str()), convert
it (e.g., ext = ext.to_ascii_lowercase() or ext.to_lowercase()) and then match
against "rs", "py", "ts", "tsx", "js", "jsx" to ensure case-insensitive
detection; update the match arm to use the lowercased variable and keep the rest
of the logic (status setting and is_complete check) unchanged.
🧹 Nitpick comments (4)
.evidence/CLI_V1_TEST_PLAN.md (1)

28-34: Consider varying repeated sentence starts for readability.
Optional editorial polish to avoid multiple consecutive lines starting with the same word.

Also applies to: 60-68

.evidence/EVIDENCE_PACKET.md (1)

66-68: Optional: rephrase repeated sentence starts for smoother flow.
Purely editorial; consider varying the sentence openings.

.evidence/CLI_V1_TASK_PACKET.md (1)

46-52: Minor wording tweak: “CLI interface” → “CLI”.
“CLI interface” is redundant; “CLI” is sufficient.

tooling/tiger-style-cli/src/detect.rs (1)

106-112: Consider deduplicating status_label with configure.rs.
There’s another status_label in tooling/tiger-style-cli/src/configure.rs; a shared helper would avoid drift.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/cli-ci.yml:
- Around line 13-16: The CI job "test" is disabled by the hard-coded condition
if: ${{ false }}, preventing the workflow from running; remove that line (the
if: ${{ false }}) from the "test" job so the job named test-${{ matrix.os }}
runs normally across OS matrix entries, ensuring the matrix-based tests execute
by default.
🧹 Nitpick comments (1)
.github/workflows/cli-ci.yml (1)

25-28: Both action versions are valid and will not cause CI failures.

actions/checkout@v5 (v5.0.1) is current and supported. However, actions/checkout@v6 (v6.0.2) is now the latest major version; consider updating if you want to stay on the newest version.

dtolnay/rust-toolchain@stable is the correct and recommended usage for installing the stable Rust toolchain.

@robertguss robertguss merged commit 15e79e1 into main Feb 9, 2026
@robertguss robertguss deleted the codex/tiger-style-cli-v1 branch February 9, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant