Open MercatoDocsSearch docsAPI reference

CLI

mercato auth add-user

Add a confirmed account to an existing organization. Choose the organization and roles before running the command so the user lands in the right workspace.

yarn mercato auth add-user creates a new user, hashes the provided password, and links the account to roles in the same tenant as the organization.

Usage

yarn mercato auth add-user \
  --email "<user@email>" \
  --password "<password>" \
  --organizationId <uuid> \
  [--roles role1,role2]

Aliases:

Behavior

  1. Loads the organization (and its tenant) by ID.
  2. Creates a confirmed user with the supplied credentials bound to the organization and tenant.
  3. For each role in --roles:
    • Ensures the role exists (creating it if missing and scoping it to the tenant).
    • Creates a UserRole link.
  4. Prints the new user’s UUID.

Example

Set OM_USER_PASSWORD in your shell from your password manager before running the command.

ORG_ID=$(yarn mercato auth list-orgs | awk 'NR==5 {print $1}')
yarn mercato auth add-user \
  --email [email protected] \
  --password "$OM_USER_PASSWORD" \
  --organizationId "$ORG_ID" \
  --roles admin,employee

Output:

User created with id 7c2a91be-7f06-4c6e-9c28-2507a5e5992e

Troubleshooting

Previous: API keys CLI · Next: mercato auth list-orgs