kelos-dev / kelos-dev/kelos

CLI UX: 'axon run --watch --dry-run' silently ignores --watch flag

Open
#198 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

actor/kelos generated-by-kelos kelos/needs-input kind/feature priority/backlog triage-accepted
Dominant language
Go
Stars
331
Forks
40
Avg merge
1d 21h
Merged PRs (30d)
70

Description

Problem

When using both `--watch` and `--dry-run` together with `axon run`, the `--watch` flag is silently ignored without any warning or error message.

Code location: `internal/cli/run.go:180-192`

Current Behavior
axon run -p "test" --secret dummy --watch --dry-run
# Prints YAML and exits immediately
# No warning that --watch is being ignored

The command succeeds but the `--watch` flag has no effect because dry-run exits early without creating any resources.

Why This is Confusing
  1. No feedback: Users don't know their flag was ignored
  2. Conflicting intent: `--watch` implies "create and watch", `--dry-run` means "don't create". These are mutually exclusive but the CLI doesn't communicate this.
  3. Silent failure: The user might think they'll see watch output after the YAML, but the command just exits
Expected Behavior

The CLI should detect this conflict and provide clear feedback. Two options:

Option 1: Error (Recommended)

axon run -p "test" --watch --dry-run
Error: cannot use --watch with --dry-run (dry-run does not create resources to watch)

Option 2: Warning

axon run -p "test" --watch --dry-run
Warning: --watch flag ignored when using --dry-run
apiVersion: axon.io/v1alpha1
...

Option 1 is clearer and prevents user confusion by failing fast.

Impact

  • User confusion: Users might wonder why watch isn't working
  • Wasted time: Users might wait expecting watch output that never comes
  • Poor error visibility: No indication that something unexpected happened

Suggested Fix

Add validation in the `RunE` function before processing:

if watch && dryRun {
    return fmt.Errorf("cannot use --watch with --dry-run (dry-run does not create resources to watch)")
}

Additional Context

  • This pattern should also be checked for other potentially conflicting flag combinations
  • Found during developer experience testing
  • Similar patterns exist in other CLI tools (e.g., kubectl warns about ignored flags)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/cli/run.go:180-192 and inspect the axon run RunE flow around dry-run handling. Reproduce the command with --watch and --dry-run, then add the requested conflict feedback before processing and verify that the command no longer silently exits without explaining the ignored flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.