Skip to content

Rename -y flag to --non-interactive (-n) for clarity - #592

Draft
razor-x wants to merge 2 commits into
mainfrom
claude/non-interactive-flag-zttu78
Draft

Rename -y flag to --non-interactive (-n) for clarity#592
razor-x wants to merge 2 commits into
mainfrom
claude/non-interactive-flag-zttu78

Conversation

@razor-x

@razor-x razor-x commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

Refactored the CLI argument handling to replace the -y flag with a more descriptive --non-interactive (alias -n) flag. The -y flag is retained as a legacy alias for backward compatibility. This improves CLI usability by making the flag's purpose clearer to users.

Key Changes

  • New utility module (src/lib/util/cli-args.ts): Extracted argument parsing logic into a dedicated module with:

    • parseCliArgs(): Centralized argument parser with proper configuration for the new flag
    • isInteractive(): Helper function to determine if interactive mode is enabled
    • nonInteractiveFlags: Array of flag names that disable interactive prompts
  • Updated CLI entry point (src/bin/cli.ts):

    • Replaced inline parseArgs() call with parseCliArgs() from the new utility
    • Updated isInteractive calculation to use the new helper function
    • Added filtering logic to exclude non-interactive flags from command parameters
    • Updated help text and usage examples to reference --non-interactive instead of -y
  • Comprehensive test coverage (src/lib/util/cli-args.test.ts):

    • Tests for default interactive behavior
    • Tests for all flag variants (--non-interactive, -n, -y)
    • Tests to ensure flags don't consume subsequent arguments
  • Documentation updates (README.md):

    • Updated usage instructions to promote --non-interactive as the primary flag
    • Added example showing non-interactive usage
    • Clarified that -y is now a legacy alias

Implementation Details

  • The -y flag is maintained as a backward-compatible alias through minimist's alias configuration
  • Non-interactive flags are explicitly excluded from being passed as command parameters
  • The new utility module centralizes all CLI argument handling logic for better maintainability

https://claude.ai/code/session_01TxQCkfVypobQVA7DpF4jvx

claude added 2 commits July 29, 2026 02:53
Non-interactive mode was only reachable via the undocumented -y flag.
Add --non-interactive with a -n short flag as the documented spelling,
keeping -y working as an alias.

Interactivity flags are no longer forwarded to the API as request
parameters.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TxQCkfVypobQVA7DpF4jvx
-y skips the parameter review prompt when everything required was
already given, but still prompts for whatever is missing.
--non-interactive now never prompts: an incomplete command or a missing
required parameter exits 1 with a message naming what is missing.
It also skips the optional webview and action attempt poll prompts.

Give -y the long form --yes so it can be documented as its own flag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TxQCkfVypobQVA7DpF4jvx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants