Skip to content

Fix json flag issue interactive mode#86

Open
Shubham-Rasal wants to merge 4 commits intoresend:mainfrom
Shubham-Rasal:fix-json-flag-issue-interactive-mode
Open

Fix json flag issue interactive mode#86
Shubham-Rasal wants to merge 4 commits intoresend:mainfrom
Shubham-Rasal:fix-json-flag-issue-interactive-mode

Conversation

@Shubham-Rasal
Copy link

@Shubham-Rasal Shubham-Rasal commented Mar 13, 2026

Fixes #74


Summary by cubic

Treats the --json flag as non-interactive across the CLI to prevent prompts and require explicit flags, even in TTY sessions. Fixes inconsistent behavior and aligns output/error handling when --json is used. Fixes #74.

  • Bug Fixes

    • login: if --json and no --key, exit with missing_key; skip profile selection.
    • send: if --json, require --from; do not fetch domains or prompt.
    • prompts: confirmDelete, requireText/Select, and promptForMissing exit with confirmation_required or missing_flags in --json mode.
    • Guard all interactive branches with !globalOpts.json.
  • Tests

    • Added TTY-mode tests for login, send, and prompts to ensure no prompts, no domain fetch, and correct errors in --json mode.

Written for commit 6866e4d. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

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.

Remove interactive mode when using --json to improve jq support

1 participant