System Information
Strapi Version : 3.6.2
Operating System : Fedora
Database : Sqlite3
Node Version : v14.17.0
NPM Version : 6.14.13
Yarn Version : v1.22.10
Hello,
I found the docs to change the admin password @ cli, but nothing so far on how to CREATE the Admin user in the 1st place @ cli. It works ok from the browser, but I’d like to script it.
What’s the cli/shell method to create the STrapi Admin user?
Thanks,
Thad
4 Likes
Phero
February 14, 2022, 11:33am
2
Did you ever find out how to do it? I’d like to know as well.
I also would like to do the same for my requirement
boaz
February 28, 2022, 7:56am
4
You could automate the creation of the admin user by putting this snippet in the bootstrap function of your Strapi project.
Alternatively you could create your own CLI that runs this code.
mariot
November 18, 2022, 5:49pm
5
npm run strapi admin:create-user --firstname=YourFirstName --lastname=YourLastName --email=YourEmail --password=NewPassword
2 Likes
Important correction for all those coming here over Google:
npm run strapi admin:create-user -- --firstname=YourFirstName --lastname=YourLastName --email=YourEmail --password=NewPassword
With the two dashes before the options, they are given to admin:create-user instead of npm run
im facing same issue,anyone resloved this?
i need to create user using cli,i tried
npm run strapi admin:create-user --firstname=YourFirstName --lastname=YourLastName --email=YourEmail --password=NewPassword
npm run strapi admin:create-user – --firstname=YourFirstName --lastname=YourLastName --email=YourEmail --password=NewPassword
but getting starpi command not found