home / skills / medusajs / medusa-agent-skills / new-user

This skill creates an admin user in Medusa using provided email and password, reports results, and guides next steps.

npx playbooks add skill medusajs/medusa-agent-skills --skill new-user

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
793 B
---
name: new-user
description: Create an admin user in Medusa
argument-hint: <email> <password>
allowed-tools: Bash(npx medusa user:*)
---

# Create Admin User

Create a new admin user in Medusa with the specified email and password.

The user will provide two arguments:
- First argument: email address
- Second argument: password

For example: `/medusa-dev:user [email protected] supersecret`

Use the Bash tool to execute the command `npx medusa user -e <email> -p <password>`, replacing `<email>` with the first argument and `<password>` with the second argument.

Report the results to the user, including:

- Confirmation that the admin user was created successfully
- The email address of the created user
- Any errors that occurred
- Next steps (e.g., logging in to the admin dashboard)

Overview

This skill creates a new admin user in a Medusa project using the Medusa CLI. It accepts an email and password, runs the required Bash command, and returns a concise result summary with next steps. It is designed for use in development and local deployment workflows.

How this skill works

The skill runs the Bash command `npx medusa user -e <email> -p <password>` with the provided arguments to create an admin user. It captures the CLI output and any errors, then reports whether the creation succeeded, the created email, and relevant follow-up actions. If an error occurs, the skill surfaces the error text and suggests corrective steps.

When to use it

  • Setting up a new local Medusa instance and needing an admin account.
  • Onboarding developers who need admin access for testing and configuration.
  • Automating environment provisioning in scripts or CI jobs.
  • Recovering or recreating an admin account during development.

Best practices

  • Use a strong, unique password for admin accounts and rotate regularly in non-production environments.
  • Run the command from the Medusa project root so the environment and database config are correct.
  • Avoid creating real production admin accounts on public CI runners; use environment-specific credentials.
  • Check database connectivity and migrations before creating the user to prevent failures.
  • Log CLI output and errors for auditability and troubleshooting.

Example use cases

  • Create an admin for local testing: `/medusa-dev:user [email protected] supersecret`.
  • Provision demo environments with a default admin for QA access.
  • Add an admin account as part of a developer onboarding script.
  • Recreate admin after resetting the local database during development.

FAQ

What if the command fails?

Inspect the captured error message. Common issues include database connection problems, missing Medusa installation, or running outside the project root. Fix the underlying issue and retry the command.

Will this change production data?

If run against a production database, yes. Only run this against production when you intend to modify production users. Prefer environment-specific credentials and automation safeguards.