Skip to content

Add mrt save-credentials command#286

Merged
clavery merged 4 commits intomainfrom
feat/mrt-save-credentials
Mar 29, 2026
Merged

Add mrt save-credentials command#286
clavery merged 4 commits intomainfrom
feat/mrt-save-credentials

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented Mar 24, 2026

Summary

  • Adds mrt save-credentials command to save MRT API credentials (username, api_key) to the ~/.mobify file
  • Supports --credentials-file override, --cloud-origin for alternate file paths (~/.mobify--<hostname>), and --yes to skip overwrite confirmation
  • Writes file with 0o600 permissions for security
  • Updates MRT docs and authentication guide to recommend the new command

Test plan

  • 8 unit tests covering write, permissions, path resolution, confirmation flow, --yes bypass, and JSON format
  • Manual: b2c mrt save-credentials --user test@example.com --api-key testkey creates ~/.mobify
  • Manual: Re-running without --yes prompts for confirmation
  • Manual: --cloud-origin https://cloud-staging.example.com writes to ~/.mobify--cloud-staging.example.com

clavery added 4 commits March 24, 2026 18:46
Adds a new command to save MRT credentials (username and API key) to the
~/.mobify file, replacing the manual echo/JSON workflow. Supports
--credentials-file override, --cloud-origin for alternate file paths,
and --yes to skip overwrite confirmation. File is written with 0o600
permissions.
Move the duplicated confirm() pattern to a shared prompts.ts module.
Use (y/N) format matching existing CLI conventions with default-no.
Replace duplicated readline-based confirm functions across 10 commands
with the shared confirm() from prompts.ts. The shared utility auto-appends
(y/N) or (Y/n) hints and supports configurable defaults.
@clavery clavery merged commit 5a6ab56 into main Mar 29, 2026
5 checks passed
@clavery clavery deleted the feat/mrt-save-credentials branch March 29, 2026 23:21
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