|
| 1 | +# RB CLI Design |
| 2 | + |
| 3 | +**Status**: DRAFT / DESIGN ONLY |
| 4 | +**Scope**: Riverbraid command-line interface design |
| 5 | +**Implementation status**: NOT_IMPLEMENTED |
| 6 | +**Registry mutation**: NONE |
| 7 | +**Workflow mutation**: NONE |
| 8 | + |
| 9 | +## Executive summary |
| 10 | + |
| 11 | +The Riverbraid CLI (`rb`) is a proposed command-line interface for reducing friction for developers, reviewers, and auditors interacting with Riverbraid. |
| 12 | + |
| 13 | +It is intended to provide a unified interface for: |
| 14 | + |
| 15 | +- repository inspection |
| 16 | +- evidence packet generation and validation |
| 17 | +- bounded verification |
| 18 | +- drift monitoring |
| 19 | + |
| 20 | +This document is a design surface only. It does not implement the CLI. |
| 21 | + |
| 22 | +## Core principles |
| 23 | + |
| 24 | +- **Consistency**: commands, flags, and output formats should be standardized. |
| 25 | +- **Discoverability**: users should be able to find commands and understand usage quickly. |
| 26 | +- **Automation-friendly**: commands should support CI/CD and scripting. |
| 27 | +- **Mechanical honesty**: outputs should reflect the underlying deterministic process. |
| 28 | +- **Feedback-rich**: errors should be clear, concise, and actionable. |
| 29 | +- **Claim-bounded**: CLI output must not imply stronger claims than the executed command supports. |
| 30 | + |
| 31 | +## Proposed command tree |
| 32 | + |
| 33 | +```text |
| 34 | +rb |
| 35 | + repo |
| 36 | + evidence |
| 37 | + verify |
| 38 | + drift |
| 39 | +``` |
| 40 | + |
| 41 | +## `rb repo` |
| 42 | + |
| 43 | +Repository management and metadata inspection. |
| 44 | + |
| 45 | +| Command | Description | Example | |
| 46 | +|---|---|---| |
| 47 | +| `rb repo init <name>` | Initialize a Riverbraid-compatible repository structure. | `rb repo init my-new-gold` | |
| 48 | +| `rb repo clone <url>` | Clone a repository and perform initial setup. | `rb repo clone github.com/Riverbraid/Riverbraid-Core` | |
| 49 | +| `rb repo status` | Show local branch, cleanliness, and Riverbraid metadata. | `rb repo status` | |
| 50 | +| `rb repo list` | List Riverbraid repositories in the local workspace. | `rb repo list` | |
| 51 | + |
| 52 | +## `rb evidence` |
| 53 | + |
| 54 | +Evidence packet generation and validation. |
| 55 | + |
| 56 | +| Command | Description | Example | |
| 57 | +|---|---|---| |
| 58 | +| `rb evidence generate` | Generate an evidence packet for the current repository. | `rb evidence generate` | |
| 59 | +| `rb evidence validate <path>` | Validate an evidence packet against its schema. | `rb evidence validate ./evidence.json` | |
| 60 | +| `rb evidence publish <path>` | Publish an evidence packet to a configured destination. | `rb evidence publish ./evidence.json` | |
| 61 | + |
| 62 | +Boundary: `publish` must not imply certification, external audit, registry inclusion, or production readiness. |
| 63 | + |
| 64 | +## `rb verify` |
| 65 | + |
| 66 | +Verification execution. |
| 67 | + |
| 68 | +| Command | Description | Example | |
| 69 | +|---|---|---| |
| 70 | +| `rb verify local` | Run local verification checks for the current repository. | `rb verify local` | |
| 71 | +| `rb verify constellation` | Run configured constellation verification. | `rb verify constellation` | |
| 72 | +| `rb verify packet <path>` | Verify a specific evidence packet. | `rb verify packet ./external-packet.json` | |
| 73 | + |
| 74 | +Verification commands must exit nonzero on failure or ambiguity. |
| 75 | + |
| 76 | +## `rb drift` |
| 77 | + |
| 78 | +Drift monitoring and reporting. |
| 79 | + |
| 80 | +| Command | Description | Example | |
| 81 | +|---|---|---| |
| 82 | +| `rb drift check` | Check for detected drift in the local repository or constellation. | `rb drift check` | |
| 83 | +| `rb drift history` | Display history of detected drift events. | `rb drift history` | |
| 84 | +| `rb drift alert configure` | Configure alerts for drift detection. | `rb drift alert configure` | |
| 85 | + |
| 86 | +Boundary: drift detection does not automatically resolve drift. It creates an inspectable signal. |
| 87 | + |
| 88 | +## Output formats |
| 89 | + |
| 90 | +Every command should support: |
| 91 | + |
| 92 | +```text |
| 93 | +--format human |
| 94 | +--format json |
| 95 | +--format yaml |
| 96 | +``` |
| 97 | + |
| 98 | +Default output should be human-readable. Machine-readable output should be deterministic and schema-valid. |
| 99 | + |
| 100 | +## Exit code policy |
| 101 | + |
| 102 | +| Exit code | Meaning | |
| 103 | +|---|---| |
| 104 | +| `0` | Command completed and stated boundary was satisfied. | |
| 105 | +| `1` | Boundary violated or verification failed. | |
| 106 | +| `2` | Input/configuration error. | |
| 107 | +| `3` | Required dependency missing. | |
| 108 | +| `4` | Unsupported command or version. | |
| 109 | +| `5` | Ambiguous state; fail closed. | |
| 110 | + |
| 111 | +## Technical considerations |
| 112 | + |
| 113 | +Potential implementation languages: |
| 114 | + |
| 115 | +- Node.js for proximity to current JavaScript verifier surfaces. |
| 116 | +- Rust for performance, static binaries, and strong packaging discipline. |
| 117 | + |
| 118 | +The CLI should minimize dependencies and support cross-platform execution. |
| 119 | + |
| 120 | +## Future enhancements |
| 121 | + |
| 122 | +- external identity-provider integration for evidence publishing |
| 123 | +- visualization of drift and verification status |
| 124 | +- plugin architecture for custom verification logic |
| 125 | +- local-to-CI output comparison |
| 126 | + |
| 127 | +## Non-claim |
| 128 | + |
| 129 | +This document does not implement the CLI, create a release, define a production command surface, or claim any command exists today. |
0 commit comments