Skip to content

Commit b077357

Browse files
committed
feat: Add --app option to update command
Allows changing the app_type of a prompt via update: cam prompt update codex-test --app codex
1 parent e0f5f76 commit b077357

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

code_assistant_manager/cli/prompts_commands.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ def update_prompt(
156156
file: Optional[Path] = typer.Option(
157157
None, "--file", "-f", help="Read new content from file"
158158
),
159+
app: Optional[str] = typer.Option(
160+
None,
161+
"--app",
162+
"-a",
163+
help="App type (claude, codex, gemini, copilot)",
164+
),
159165
):
160166
"""Update an existing prompt."""
161167
manager = _get_prompt_manager()
@@ -165,13 +171,22 @@ def update_prompt(
165171
typer.echo(f"{Colors.RED}✗ Prompt '{prompt_id}' not found{Colors.RESET}")
166172
raise typer.Exit(1)
167173

174+
# Validate app type if provided
175+
if app and app not in VALID_APP_TYPES:
176+
typer.echo(
177+
f"{Colors.RED}✗ Invalid app type: {app}. Valid: {VALID_APP_TYPES}{Colors.RESET}"
178+
)
179+
raise typer.Exit(1)
180+
168181
# Update fields if provided
169182
if name:
170183
prompt.name = name
171184
if description:
172185
prompt.description = description
173186
if file and file.exists():
174187
prompt.content = file.read_text()
188+
if app:
189+
prompt.app_type = app
175190

176191
try:
177192
manager.update(prompt)

0 commit comments

Comments
 (0)