Skip to content

Feat/cougr add into cli - #292

Open
mrteeednut007-dotcom wants to merge 3 commits into
salazarsebas:mainfrom
mrteeednut007-dotcom:feat/cougr-add-into-cli
Open

Feat/cougr add into cli#292
mrteeednut007-dotcom wants to merge 3 commits into
salazarsebas:mainfrom
mrteeednut007-dotcom:feat/cougr-add-into-cli

Conversation

@mrteeednut007-dotcom

Copy link
Copy Markdown

feat(cli): integrate cougr add into the canonical cli/ crate

Summary

This PR addresses the review feedback on #270: instead of shipping a competing standalone
cougr-cli/ crate, the cougr add subcommand is now integrated directly into the cli/ crate
introduced by #288 — giving users a single cougr binary with both new and add.

What changed

  • cli/src/commands/add.rs — the cougr add implementation (migrated from cougr-cli/src/add.rs)
  • cli/src/commands/catalog.rs — the pieces catalog parser (migrated from
    cougr-cli/src/catalog.rs)
  • cli/pieces.toml — the embedded piece catalog (moved from cougr-cli/pieces.toml)
  • cli/src/commands/mod.rs — exports add and catalog alongside the existing new
  • cli/src/main.rs — registers the Add subcommand next to New via clap
  • cli/Cargo.toml — added toml, serde, anstream, anyhow dependencies
  • cougr-cli/ — removed entirely

How it works

cougr add --list # show all available pieces
cougr add session-auth # copy piece into src/, update lib.rs
cougr add standards/pausable # nested piece support
cougr add hidden-hand -p ./mygame # explicit project root

Pieces are embedded in the binary via include_str!("../../pieces.toml") — same zero-dependency
model used by cougr new for templates.

Testing

All 40 tests pass — 34 unit tests + 6 integration tests:

test result: ok. 34 passed; 0 failed (unit)
test result: ok. 6 passed; 0 failed (integration)

Related

Implements the shadcn-style piece distribution pattern described in
docs/strategy/06-product-strategy.md.

- New cougr-cli workspace member (binary crate, cargo install cougr-cli)
- cougr add --list  — prints all available pieces with maturity tiers
- cougr add <piece> — copies a named piece into src/ as owned, editable source
- Conflict detection: refuses to overwrite existing files, shows preview
- Automatic mod declaration wiring into lib.rs (idempotent)

Pieces shipped in v1 (embedded in binary via pieces.toml):
  session-auth        [beta]         SessionManager lifecycle from session_arena
  hidden-hand         [experimental] hidden_cards ZK circuit from hidden_hand
  standards/pausable  [stable]       Pausable guard from src/standards/pausable.rs

11 unit/integration tests, all passing.
- Migrate add.rs, catalog.rs, and pieces.toml from cougr-cli/ into cli/
- Register Add subcommand alongside New in cli/src/main.rs
- Add toml, serde, anstream, anyhow dependencies to cli/Cargo.toml
- Remove the standalone cougr-cli/ crate (no longer needed)
- All 40 tests pass (34 unit + 6 integration)

Closes the concern raised in PR salazarsebas#270: the add subcommand now lives in
the canonical cli/ crate introduced by salazarsebas#288, not a competing crate.
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.

feat(cli): implement 'cougr add <piece>' component/system importer

1 participant