Skip to content

CLI: drop -e short alias for --example (AI-hallucination trap) #1367

Description

@yamcodes

Summary

Drop the -e short alias for --example and make --example long-form only. The -e short flag is a semantic trap for AI agents and should be permanently reserved (never reassigned to --example again) in case we later want it for passing an explicit environment.

Problem

Across the broader CLI ecosystem (Docker, Kubernetes, standard Unix utilities), -e almost universally means --env / --environment. For a type-safe environment variable validation library, mapping -e to --example is a particularly sharp trap.

When an AI agent is asked to configure or override a variable, its training makes it instinctively reach for -e — e.g. arkenv init -e NODE_ENV=production. Today that silently binds to the unrelated --example project flag, which consumes the next token as the example name. The agent then observes behavior that doesn't match its intent, assumes a failure, and can get stuck in a retry/hallucination loop.

Current behavior

  • --example has a short alias -e (a value-kind flag).
  • arkenv init -e NODE_ENV=production is accepted and interpreted as "use example NODE_ENV=production", not as setting an environment variable.
  • The alias is advertised in arkenv --help and in the CLI docs flags table.

Desired behavior

  • --example works only in long form.
  • The -e short alias is removed. Passing -e (standalone or inside a bundle like -ye) falls through to the existing standard Unknown argument: -e error — failing fast with no incorrect action taken.
  • -e is treated as reserved: it must not be reassigned to --example (or any other flag) again, so it stays available for a future --env / --environment option.
  • Help output and CLI docs no longer list -e.

Acceptance criteria

  • arkenv init --example <name> continues to work exactly as before.
  • arkenv init -e <name> is rejected with the standard Unknown argument: -e error.
  • -e bundled with other short flags (e.g. -ye) is also rejected as an unknown argument.
  • arkenv --help no longer lists -e for --example; it shows --example with no short alias.
  • The CLI docs flags table no longer shows -e in the alias column for --example.
  • Existing tests covering the --example/-e alias are updated; new coverage asserts -e is unknown while --example still works.
  • A changeset is added: @arkenv/cli minor, documented as a BREAKING CHANGE (matching the precedent set when the -C/-a aliases were removed).

Out of scope

  • Actually introducing a --env / --environment option under -e. This issue only reserves -e; it does not implement a new flag.
  • Any change to -y, -q, -j, -H, or -h, which all align with standard Node/POSIX conventions.

Follow-up after merge

This lands on dev (v0) first. After the dev PR is merged, run /forward-port to adapt the change onto the v1 branch (packages/cli/src/**packages/arkenv/src/**, changeset key @arkenv/cliarkenv) so v1 keeps parity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @arkenv/cliIssues or Pull Requests involving the ArkEnv CLIenhancementNew feature or improvementready for agentFully specified, ready for immediate implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions