diff --git a/features/automation_profile_cli.feature b/features/automation_profile_cli.feature index ed081c27c..33f970903 100644 --- a/features/automation_profile_cli.feature +++ b/features/automation_profile_cli.feature @@ -20,6 +20,13 @@ Feature: Automation Profile CLI commands Then the automation-profile add should succeed And the automation-profile output should contain "Updated" + Scenario: Add profile with --update when profile does not exist warns and creates + Given a valid automation profile config YAML file + When I run automation-profile add with --config and --update + Then the automation-profile add should succeed + And the automation-profile output should contain "Warning" + And the automation-profile output should contain "Profile Added" + Scenario: Add profile conflict without --update Given a valid automation profile config YAML file And the custom profile "acme/strict" already exists diff --git a/src/cleveragents/cli/commands/automation_profile.py b/src/cleveragents/cli/commands/automation_profile.py index da6803375..1c5baab8e 100644 --- a/src/cleveragents/cli/commands/automation_profile.py +++ b/src/cleveragents/cli/commands/automation_profile.py @@ -236,6 +236,12 @@ def add_profile( ) raise typer.Abort() + if update and not existing: + console.print( + f"[yellow]Warning:[/yellow] Profile '{name}' does not exist. " + f"Creating new profile (--update flag has no effect)." + ) + if update and existing: profile = service.update_profile(name, config_data) title = "Profile Updated"