Account commands

List, add, change and remove the test accounts Re:agent signs in with.

These commands manage a project's test accounts, the accounts Re:agent, explorations and tests sign in with. Each one asks for what it still needs, so rehearsal accounts add alone walks you through a new account.

No flag takes a password. At a terminal you type it where nobody sees it. A script or a coding agent says where it is with --password-from, and --secret-key-from does the same for an authenticator's key. No line the CLI prints, no error and no JSON answer holds either.

  • env:NAME reads the environment variable NAME.
  • file:<path> reads the whole file, without its last line break. If others on the computer can read the file, the CLI says so and still reads it.
  • stdin reads what is piped in, such as from a password manager. Only one flag of a command can read it.
Terminal
# Answer each questionrehearsal accounts add# From a script, with the password already in TEST_PASSWORDrehearsal accounts add --label Owner --username owner@parcel.example --password-from env:TEST_PASSWORD --json# From a password managerop read op://Testing/Owner/password | rehearsal accounts add --label Owner --username owner@parcel.example --password-from stdin --json

Add --dry-run to see what a command would save. It asks its questions and reads the password, then saves nothing. Its answer never holds the password.

Reading accounts needs a sign-in with the testing:read scope and View projects. Adding, changing and removing them needs the testing:run scope and Manage projects, as the dashboard's form does.

rehearsal accounts list Link to rehearsal accounts list

List the test accounts Re:agent signs in with.

Each account shows how it signs in, which environments have it, and whether it has a mailbox where Rehearsal reads the codes and links your app sends. No password or secret key is ever shown.

Terminal
rehearsal accounts list [flags]
FlagDescription
--workspace <workspace-id>Workspace ID. Defaults to REHEARSAL_WORKSPACE_ID or rehearsal.config.json, then to your only workspace or the one you pick.
--project <project>Project ID, slug or name. Defaults to REHEARSAL_PROJECT_ID or rehearsal.config.json, then to the workspace's only project or the one you pick.
--limit <count>How many to return, 1 to 50. The default is 20.
--cursor <cursor>Continue from the cursor the last page returned.

Needs a sign-in with the testing:read scope and permission to read projects.

Terminal
# List the accountsrehearsal accounts list# Read them in a scriptrehearsal accounts list --json

rehearsal accounts show Link to rehearsal accounts show

Show one test account.

Shows how it signs in, any code it needs, its mailbox and its environments. No password or secret key is ever shown.

Terminal
rehearsal accounts show <account> [flags]
ArgumentDescription
<account>The account's name or ID, as rehearsal accounts list shows it.
FlagDescription
--workspace <workspace-id>Workspace ID. Defaults to REHEARSAL_WORKSPACE_ID or rehearsal.config.json, then to your only workspace or the one you pick.
--project <project>Project ID, slug or name. Defaults to REHEARSAL_PROJECT_ID or rehearsal.config.json, then to the workspace's only project or the one you pick.

Needs a sign-in with the testing:read scope and permission to read projects.

Terminal
# Show an accountrehearsal accounts show Owner# Read it in a scriptrehearsal accounts show <account-id> --json

rehearsal accounts add Link to rehearsal accounts add

Add a test account for Re:agent to sign in with.

It asks for what it still needs: a name, how the account signs in, its username and password, and which environments have it. Type the password when asked, where nobody sees it. In a script, say where it is with --password-from: env:NAME for an environment variable, file:<path> for a file, or stdin for what is piped in. A passwordless account gets a mailbox. Sign up in your app with that address, and Rehearsal reads the codes and links sent there.

Terminal
rehearsal accounts add [flags]
FlagDescription
--workspace <workspace-id>Workspace ID. Defaults to REHEARSAL_WORKSPACE_ID or rehearsal.config.json, then to your only workspace or the one you pick.
--project <project>Project ID, slug or name. Defaults to REHEARSAL_PROJECT_ID or rehearsal.config.json, then to the workspace's only project or the one you pick.
--label <name>What the account is called, such as Owner.
--role [<role>]What kind of user it is in your app, such as admin. The flag alone leaves the role out.
--sign-in <password|passwordless>How it signs in: with a password, or with a code or link sent by email. The default is password.
--username <username>The username or email it signs in with.
--password-from <place>Where its password is: env:NAME, file:<path> or stdin. The password itself is never a flag. Left out, a terminal asks for it unseen.
--code <none|authenticator|email>Where the code after the password comes from, if your app asks for one. The default is none.
--secret-key-from <place>With --code authenticator, where the secret key is: env:NAME, file:<path> or stdin. Left out, a terminal asks for it unseen.
--environment <environment>An environment that has this account: its ID, kind, host or computer name. Pass every, or leave it out, for every environment, those added later too. Repeat it for more than one.
--dry-runAsk and check everything, then stop before anything starts or changes, and say what would happen. Off by default.

Needs a sign-in with the testing:run scope and permission to manage projects.

Terminal
# Add an account, answering each questionrehearsal accounts add# Add one from a script, with the password in TEST_PASSWORDrehearsal accounts add --label Owner --username owner@example.com --password-from env:TEST_PASSWORD --json# Read the password from a password managerrehearsal accounts add --label Owner --username owner@example.com --password-from stdin --json# Add a passwordless account for staging onlyrehearsal accounts add --label Member --sign-in passwordless --environment staging# See what it would add, and add nothingrehearsal accounts add --label Member --sign-in passwordless --dry-run

rehearsal accounts change Link to rehearsal accounts change

Change a test account.

Only what you name changes. With no flags, it asks what to change, then asks for only that. The password changes only when you ask for it: type the new one when asked, or pass --password-from. How an account signs in never changes. To switch, remove the account and add another.

Terminal
rehearsal accounts change <account> [flags]
ArgumentDescription
<account>The account's name or ID, as rehearsal accounts list shows it.
FlagDescription
--workspace <workspace-id>Workspace ID. Defaults to REHEARSAL_WORKSPACE_ID or rehearsal.config.json, then to your only workspace or the one you pick.
--project <project>Project ID, slug or name. Defaults to REHEARSAL_PROJECT_ID or rehearsal.config.json, then to the workspace's only project or the one you pick.
--label <name>What the account is called, such as Owner.
--role [<role>]What kind of user it is in your app, such as admin. The flag alone leaves the role out.
--username <username>The username or email it signs in with.
--password-from <place>Where its password is: env:NAME, file:<path> or stdin. The password itself is never a flag. Left out, a terminal asks for it unseen.
--code <none|authenticator|email>Where the code after the password comes from now: none, authenticator or email.
--secret-key-from <place>With --code authenticator, where the secret key is: env:NAME, file:<path> or stdin. Left out, a terminal asks for it unseen.
--environment <environment>An environment that should have this account: its ID, kind, host or computer name. Pass every for every environment, those added later too. Repeat it for more than one.
--dry-runAsk and check everything, then stop before anything starts or changes, and say what would happen. Off by default.

Needs a sign-in with the testing:run scope and permission to manage projects.

Terminal
# Pick what to changerehearsal accounts change Owner# Replace the password from a filerehearsal accounts change Owner --password-from file:owner-password.txt --json# Check a new secret key, and change nothingrehearsal accounts change Owner --code authenticator --secret-key-from env:OWNER_TOTP_KEY --dry-run# Keep it to two environmentsrehearsal accounts change Owner --environment production --environment staging

rehearsal accounts remove Link to rehearsal accounts remove

Remove a test account.

Re:agent can no longer sign in as it, and runs still waiting to sign in as it are cancelled. A mailbox it has stops receiving mail.

Terminal
rehearsal accounts remove <account> [flags]
ArgumentDescription
<account>The account's name or ID, as rehearsal accounts list shows it.
FlagDescription
--workspace <workspace-id>Workspace ID. Defaults to REHEARSAL_WORKSPACE_ID or rehearsal.config.json, then to your only workspace or the one you pick.
--project <project>Project ID, slug or name. Defaults to REHEARSAL_PROJECT_ID or rehearsal.config.json, then to the workspace's only project or the one you pick.
--yesRemove it without asking first.
--dry-runAsk and check everything, then stop before anything starts or changes, and say what would happen. Off by default.

Needs a sign-in with the testing:run scope and permission to manage projects.

Terminal
# Remove an accountrehearsal accounts remove Owner# Remove it from a scriptrehearsal accounts remove <account-id> --yes --json# See which account it would removerehearsal accounts remove Owner --yes --dry-run