Skip to content

Commit 0b8fdfe

Browse files
factorydroidechobt
authored andcommitted
fix(cli): add detailed --help documentation for agent create command
Fixes bounty issue #1396 The 'cortex agent create --help' command previously only displayed 'Create a new agent interactively' without explaining what fields the interactive wizard would ask for. This commit adds: - Comprehensive long_about text documenting required vs optional fields - after_help with usage examples - Enhanced doc comments on CreateArgs fields explaining their purpose - Value names for better help output clarity
1 parent 2bc943f commit 0b8fdfe

1 file changed

Lines changed: 48 additions & 5 deletions

File tree

cortex-cli/src/agent_cmd.rs

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@ pub enum AgentSubcommand {
2929
Show(ShowArgs),
3030

3131
/// Create a new agent interactively.
32+
#[command(
33+
long_about = "Create a new agent interactively.\n\n\
34+
This command launches an interactive wizard that guides you through creating \
35+
a custom agent. You can also use command-line flags to pre-fill values or \
36+
skip the interactive prompts entirely with --non-interactive.\n\n\
37+
REQUIRED FIELDS:\n \
38+
- name: Unique identifier for the agent (alphanumeric, hyphens, underscores)\n\n\
39+
OPTIONAL FIELDS (prompted in interactive mode):\n \
40+
- description: What this agent does\n \
41+
- mode: primary (user-facing), subagent (invoked by others), or all (both)\n \
42+
- system_prompt: Instructions that define the agent's behavior\n \
43+
- allowed_tools: Which tools the agent can use (default: all)\n \
44+
- denied_tools: Which tools the agent cannot use\n \
45+
- temperature: Creativity level 0.0-2.0 (lower = more focused)\n \
46+
- model: Override the default language model\n \
47+
- color: Hex color code for UI display (e.g., #22c55e)",
48+
after_help = "EXAMPLES:\n \
49+
# Interactive mode (recommended for first-time users)\n \
50+
cortex agent create\n\n \
51+
# Create with name pre-filled\n \
52+
cortex agent create --name my-helper\n\n \
53+
# Non-interactive with minimal required fields\n \
54+
cortex agent create --name my-agent --non-interactive\n\n \
55+
# AI-generated agent from description\n \
56+
cortex agent create --generate \"A Rust expert focused on memory safety\"\n\n\
57+
AGENT FILE LOCATION:\n \
58+
Agents are saved to ~/.fabric/agents/<name>.md\n\n\
59+
For more information, see: cortex agent show <name>"
60+
)]
3261
Create(CreateArgs),
3362

3463
/// Remove a user-defined agent.
@@ -69,28 +98,42 @@ pub struct ShowArgs {
6998
/// Arguments for create command.
7099
#[derive(Debug, Parser)]
71100
pub struct CreateArgs {
72-
/// Agent name (if not provided, interactive mode will prompt).
101+
/// Agent name [REQUIRED in non-interactive mode].
102+
///
103+
/// Unique identifier for the agent. Must contain only alphanumeric
104+
/// characters, hyphens, and underscores. If not provided, interactive
105+
/// mode will prompt for it.
73106
#[arg(short, long)]
74107
pub name: Option<String>,
75108

76-
/// Agent description.
109+
/// Brief description of what this agent does.
110+
///
111+
/// Used in agent listings and help text. Defaults to "Custom agent: <name>".
77112
#[arg(short, long)]
78113
pub description: Option<String>,
79114

80115
/// Agent mode: primary, subagent, or all.
81-
#[arg(short, long)]
116+
///
117+
/// - primary: User-facing agent, appears in main agent selection
118+
/// - subagent: Can only be invoked by other agents
119+
/// - all: Available as both primary and subagent
120+
#[arg(short, long, value_name = "MODE")]
82121
pub mode: Option<String>,
83122

84-
/// Skip interactive prompts and use defaults.
123+
/// Skip interactive prompts and use defaults for optional fields.
124+
///
125+
/// Requires --name to be specified. Uses default values for description,
126+
/// mode (primary), and system prompt.
85127
#[arg(long)]
86128
pub non_interactive: bool,
87129

88130
/// Generate agent using AI from a natural language description.
131+
///
89132
/// Example: --generate "A Rust expert that helps with memory safety and performance"
90133
#[arg(short, long, value_name = "DESCRIPTION")]
91134
pub generate: Option<String>,
92135

93-
/// Model to use for AI generation (default: gpt-4o).
136+
/// Model to use for AI generation.
94137
#[arg(long, default_value = "gpt-4o")]
95138
pub model: String,
96139
}

0 commit comments

Comments
 (0)