feat: add cougr-cli with cougr add command - #270
Open
mrteeednut007-dotcom wants to merge 2 commits into
Open
Conversation
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.
|
@mrteeednut007-dotcom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
5 tasks
Owner
Owner
|
This looks like a solid |
Author
|
fixed check |
Author
|
drop points please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: cougr add — shadcn-style piece distribution for Cougr projects
Implements cougr add as described in docs/strategy/06-product-strategy.md. Adds a new cougr-cli
workspace member (binary crate, cargo install cougr-cli) that copies named, self-contained
pieces from the example catalog into a user's project as owned, editable source — no opaque
dependency, no manual copy-paste.
What was added
cougr-cli/ — new binary crate wired into the workspace
cougr add --list — prints all available pieces with one-line descriptions and maturity tiers:
session-auth [beta ] Session-key auth: approve once, play frictionlessly...
hidden-hand [experimental] Hidden-card ZK proof flow: init a table, verify deal
proofs...
standards/pausable [stable ] Emergency pause/unpause guard backed by persistent
storage...
cougr add — copies piece files into src/, appends pub mod declarations to lib.rs, and
prints exactly what was written.
Conflict handling — if a target file already exists, the command refuses to overwrite it,
prints the full verbatim content that would have been written (so the user can diff manually),
and exits non-zero. Running cougr add twice never silently clobbers local edits.
Pieces shipped in v1
All piece source is embedded in the binary at compile time via include_str!("../pieces.toml") —
no runtime network calls, no remote registry.
┌──────────────┬──────────┬────────┐
│ Piece │ Maturity │ Source │
├──────────────┼──────────────┼─────────────────────────────────────────────────────────────┤
│ session-auth │ Beta │ examples/session_arena — SessionManager lifecycle (approve │
│ │ │ → tap → renew → fallback) │
├────────────────────┼──────────────┼───────────────────────────────────────────────────────┤
│ hidden-hand │ Experimental │ examples/hidden_hand — init_table / verify_deal via │
│ │ │ circuits::hidden_cards │
├────────────────────┼──────────────┼───────────────────────────────────────────────────────┤
│ standards/pausable │ Stable │ src/standards/pausable.rs — ContractPausable newtype │
│ │ │ over cougr_core::ops::Pausable │
└────────────────────┴──────────────┴───────────────────────────────────────────────────────┘
Testing
11 unit and integration tests, all passing (cargo test -p cougr-cli). Tests cover: file
creation for each piece, lib.rs mod wiring, double-add conflict detection, unknown piece error
messaging, and missing src/ directory detection.
Definition of done
closes #245