Skip to content

feat: add consistent --yes/-y and --no flags for non-interactive mode - #55

Merged
neuromechanist merged 1 commit into
devfrom
feature/yes-flags
Jan 21, 2026
Merged

neuromechanist merged 1 commit into
devfrom
feature/yes-flags

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Created modular confirm utility (src/lib/confirm.ts) for consistent confirmation handling
  • Added -y, --yes to skip confirmation and proceed
  • Added -n, --no to skip confirmation and decline (useful for CI/CD automation)
  • Standardized confirmation messages ("Skipped" for --no, "Cancelled" for user decline)

Commands Updated

Command --yes --no
auth login -y, --yes -n, --no
auth logout -y, --yes -n, --no
admin approve -y, --yes -n, --no
admin revoke -y, --yes -n, --no
admin regenerate-iam -y, --yes -n, --no
admin doi create -y, --yes -n, --no
admin revert -y, --yes -n, --no
sandbox reset -y, --yes -n, --no
dataset upload -y, --yes --no only*

*Note: -n is already used by --name in dataset upload

Implementation

The new confirm() and confirmWithInput() utilities provide:

  • Consistent --yes/--no flag handling
  • Type-safe options via ConfirmOptions interface
  • Clear result types: "confirmed" | "declined" | "cancelled"

Test Plan

  • Build passes
  • Test nemar auth logout -y (auto-confirms)
  • Test nemar admin approve user -n (auto-declines)
  • Test interactive mode (no flags)

Closes #34

- Created confirm utility (src/lib/confirm.ts) for consistent confirmation handling
- Added -y/--yes to skip confirmation and proceed
- Added -n/--no to skip confirmation and decline (for CI/CD automation)
- Updated commands: auth login, auth logout, admin approve, admin revoke,
  admin regenerate-iam, admin doi create, admin revert, sandbox reset,
  dataset upload (--no only, -n taken by --name)
- Standardized confirmation messages (Skipped vs Cancelled)

Closes #34
@neuromechanist
neuromechanist merged commit 8b0d750 into dev Jan 21, 2026
@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR55

Version: 0.3.6-PR55.75d9fa3
Commit: 75d9fa3


🤖 Updated on each push.

This branch was previously deployed

1 inactive deployment
npm — 75d9fa33 Deployed Jan 21, 2026 by neuromechanist
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.

1 participant