Skip to content

Commit 90fc28a

Browse files
committed
Reorder CLI commands for better discoverability
Grouped commands logically: 1. Project setup: init 2. Core CRUD: create, show, list, update, delete, search 3. Workflow shortcuts: start, done, archive, mv 4. Bulk operations: bulk 5. Memory & Assets: memory, asset 6. Views & Reports: tui, suggest, roadmap 7. Agent integration: prime, context 8. GraphQL API: query, mutate, serve 9. Maintenance: doctor, migrate, undo 10. Import/Export: import-beans, export-beans
1 parent 3b89d74 commit 90fc28a

File tree

1 file changed

+109
-79
lines changed

1 file changed

+109
-79
lines changed

src/cli/commands.rs

Lines changed: 109 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pub struct Cli {
3232

3333
#[derive(Subcommand)]
3434
pub enum Commands {
35+
// =========================================================================
36+
// Project Setup
37+
// =========================================================================
3538
/// Initialize a new peas project
3639
Init {
3740
/// Use a custom prefix for pea IDs
@@ -43,6 +46,9 @@ pub enum Commands {
4346
id_length: usize,
4447
},
4548

49+
// =========================================================================
50+
// Core CRUD Operations
51+
// =========================================================================
4652
/// Create a new pea
4753
#[command(visible_alias = "c", visible_alias = "new")]
4854
Create {
@@ -182,20 +188,6 @@ pub enum Commands {
182188
dry_run: bool,
183189
},
184190

185-
/// Archive a pea (move to archive folder)
186-
Archive {
187-
/// Pea ID
188-
id: String,
189-
190-
/// Keep associated asset files instead of prompting to delete them
191-
#[arg(long)]
192-
keep_assets: bool,
193-
194-
/// Output as JSON
195-
#[arg(long)]
196-
json: bool,
197-
},
198-
199191
/// Delete a pea permanently
200192
Delete {
201193
/// Pea ID
@@ -224,6 +216,9 @@ pub enum Commands {
224216
json: bool,
225217
},
226218

219+
// =========================================================================
220+
// Workflow Shortcuts
221+
// =========================================================================
227222
/// Mark a pea as in-progress
228223
Start {
229224
/// Pea ID
@@ -244,38 +239,65 @@ pub enum Commands {
244239
json: bool,
245240
},
246241

247-
/// Execute a GraphQL query
248-
Query {
249-
/// GraphQL query string
250-
query: String,
242+
/// Archive a pea (move to archive folder)
243+
Archive {
244+
/// Pea ID
245+
id: String,
251246

252-
/// Variables as JSON
247+
/// Keep associated asset files instead of prompting to delete them
253248
#[arg(long)]
254-
variables: Option<String>,
249+
keep_assets: bool,
250+
251+
/// Output as JSON
252+
#[arg(long)]
253+
json: bool,
255254
},
256255

257-
/// Execute a GraphQL mutation (automatically wraps in 'mutation { }')
258-
Mutate {
259-
/// Mutation body (without 'mutation' keyword)
260-
mutation: String,
256+
/// Rename a ticket ID
257+
///
258+
/// Example: `peas mv abc12 xyz99` renames peas-abc12 to peas-xyz99
259+
#[command(name = "mv")]
260+
Mv {
261+
/// The old ID suffix (or full ID - prefix is stripped if present)
262+
old_id: String,
261263

262-
/// Variables as JSON
264+
/// The new ID suffix (or full ID - prefix is stripped if present)
265+
new_id: String,
266+
267+
/// Force rename even if suffix length or mode doesn't match config
263268
#[arg(long)]
264-
variables: Option<String>,
269+
force: bool,
265270
},
266271

267-
/// Start GraphQL HTTP server
268-
Serve {
269-
/// Port to listen on
270-
#[arg(short, long, default_value = "4000")]
271-
port: u16,
272+
// =========================================================================
273+
// Bulk Operations
274+
// =========================================================================
275+
/// Bulk update multiple peas at once
276+
Bulk {
277+
#[command(subcommand)]
278+
action: BulkAction,
272279
},
273280

274-
/// Output instructions for AI coding agents
275-
Prime,
281+
// =========================================================================
282+
// Memory & Assets
283+
// =========================================================================
284+
/// Manage project memory and knowledge
285+
Memory {
286+
#[command(subcommand)]
287+
action: MemoryAction,
288+
},
276289

277-
/// Output project context for LLMs
278-
Context,
290+
/// Manage ticket assets (files, images, documents)
291+
Asset {
292+
#[command(subcommand)]
293+
action: AssetAction,
294+
},
295+
296+
// =========================================================================
297+
// Views & Reports
298+
// =========================================================================
299+
/// Open the interactive TUI
300+
Tui,
279301

280302
/// Suggest the next ticket to work on
281303
Suggest {
@@ -290,18 +312,48 @@ pub enum Commands {
290312
/// Generate a Markdown roadmap from milestones and epics
291313
Roadmap,
292314

293-
/// Open the interactive TUI
294-
Tui,
315+
// =========================================================================
316+
// Agent Integration
317+
// =========================================================================
318+
/// Output instructions for AI coding agents
319+
Prime,
295320

296-
/// Migrate legacy config to new location (.peas/config.toml)
297-
///
298-
/// Alias for `peas doctor --fix` focused on config migration.
299-
Migrate {
300-
/// Dry run - show what would be migrated without making changes
321+
/// Output project context for LLMs
322+
Context,
323+
324+
// =========================================================================
325+
// GraphQL API
326+
// =========================================================================
327+
/// Execute a GraphQL query
328+
Query {
329+
/// GraphQL query string
330+
query: String,
331+
332+
/// Variables as JSON
301333
#[arg(long)]
302-
dry_run: bool,
334+
variables: Option<String>,
335+
},
336+
337+
/// Execute a GraphQL mutation (automatically wraps in 'mutation { }')
338+
Mutate {
339+
/// Mutation body (without 'mutation' keyword)
340+
mutation: String,
341+
342+
/// Variables as JSON
343+
#[arg(long)]
344+
variables: Option<String>,
345+
},
346+
347+
/// Start GraphQL HTTP server
348+
Serve {
349+
/// Port to listen on
350+
#[arg(short, long, default_value = "4000")]
351+
port: u16,
303352
},
304353

354+
// =========================================================================
355+
// Maintenance & Recovery
356+
// =========================================================================
305357
/// Check project health and suggest fixes
306358
///
307359
/// With --fix, also performs config migration (same as `peas migrate`).
@@ -311,22 +363,25 @@ pub enum Commands {
311363
fix: bool,
312364
},
313365

314-
/// Rename a ticket ID
366+
/// Migrate legacy config to new location (.peas/config.toml)
315367
///
316-
/// Example: `peas mv abc12 xyz99` renames peas-abc12 to peas-xyz99
317-
#[command(name = "mv")]
318-
Mv {
319-
/// The old ID suffix (or full ID - prefix is stripped if present)
320-
old_id: String,
321-
322-
/// The new ID suffix (or full ID - prefix is stripped if present)
323-
new_id: String,
368+
/// Alias for `peas doctor --fix` focused on config migration.
369+
Migrate {
370+
/// Dry run - show what would be migrated without making changes
371+
#[arg(long)]
372+
dry_run: bool,
373+
},
324374

325-
/// Force rename even if suffix length or mode doesn't match config
375+
/// Undo the last operation
376+
Undo {
377+
/// Output as JSON
326378
#[arg(long)]
327-
force: bool,
379+
json: bool,
328380
},
329381

382+
// =========================================================================
383+
// Import & Export
384+
// =========================================================================
330385
/// Import from a beans project
331386
#[command(name = "import-beans")]
332387
ImportBeans {
@@ -346,31 +401,6 @@ pub enum Commands {
346401
#[arg(default_value = ".beans-export")]
347402
output: String,
348403
},
349-
350-
/// Bulk update multiple peas at once
351-
Bulk {
352-
#[command(subcommand)]
353-
action: BulkAction,
354-
},
355-
356-
/// Manage project memory and knowledge
357-
Memory {
358-
#[command(subcommand)]
359-
action: MemoryAction,
360-
},
361-
362-
/// Manage ticket assets (files, images, documents)
363-
Asset {
364-
#[command(subcommand)]
365-
action: AssetAction,
366-
},
367-
368-
/// Undo the last operation
369-
Undo {
370-
/// Output as JSON
371-
#[arg(long)]
372-
json: bool,
373-
},
374404
}
375405

376406
#[derive(Subcommand)]

0 commit comments

Comments
 (0)