If you’ve been working with FusionAuth for a while, especially customizing themes or email messages, you might have wondered: “Is there an easier way to handle these operational tasks?”
It might be time to start using the FusionAuth command line interface (CLI) to help you with scripting, automation, and general FusionAuth operational tasks.
If you have cloud experience, think of the FusionAuth CLI as similar to the AWS CLI, but for FusionAuth. If you are a front-end engineer, think of it like npm scripts.
The FusionAuth CLI is built for developers, UX engineers, and DevOps teams who want to script common tasks and automate workflows, making their lives easier during development and when building CI/CD pipelines.
What Can The CLI Actually Do?
The FusionAuth CLI has been around for a couple of years now. While it doesn’t offer access to every single FusionAuth API, it does let you manage key functionality, including theme management, email template management and more.
The CLI is open source and we welcome PRs or suggested improvements.
Theme Management Made Easy
With the CLI, you can download and upload themes with a few simple commands. No more clicking through the admin UI when you want to version control, edit or update, your beautiful login pages.
The CLI is used by the FusionAuth Theme Helper project and pairs nicely with the theme history repo to help you apply changes to your advanced theme customizations as the hosted login pages improve with new releases.
Messages and Email Templates
Recently, we added the ability to manage messages alongside email templates. Huge shoutout to Drilon Ibrahimi, the community member who contributed to this feature!
For both of these, the CLI helps you manage the localization process. It makes it easy to manage your localized messages and templates in a directory or version controlled repository.
You can use the CLI to pull down the messages or templates, and edit them using localization specific tooling. You can also use the CLI to push them into your FusionAuth instance whenever they change.
User Import Testing
Need to test how FusionAuth handles 100,000 users? A million? 10 million?
The CLI now includes a fake user data generator powered by the Faker package.
It creates realistic-looking users, including data like names, email addresses, and birthdays. You can also register the users to a given application or add them to a group.
Here’s an example of a generated user:
[
{
"active": true,
"birthDate": "2025-09-11",
"data": {
"displayName": "Nathen Fritsch",
"favoriteColors": [
"#4d7753",
"#600a48"
]
},
"email": "example1000@example.com",
"encryptionScheme": "salted-pbkdf2-hmac-sha256",
"expiry": 1779327566647,
"factor": 24000,
"firstName": "Ardith",
"fullName": "Lamar Krajcik",
"imageUrl": "https://picsum.photos/seed/mxBuiZVaUr/640/480",
"insertInstant": 1759667126613,
"lastName": "Kreiger",
"memberships": [
{
"data": {
"externalId": "c0a80c34-2b74-4dcb-8ed7-d51f637fb7b9"
},
"groupId": "a730d8c9-d060-4016-935e-170a5baaa4c7"
}
],
"middleName": "Corey",
"mobilePhone": "1-830-679-3615 x573",
"password": "yjs0Mj2qttSprPgtTVb+iGNMc66yBawfO1GXVTR3z7g=",
"passwordChangeRequired": false,
"preferredLanguages": [
"en_US",
"en_GB"
],
"registrations": [
{
"applicationId": "85a03867-dccf-4882-adde-1a79aeec50df",
"data": {
"birthplace": "Stephanberg"
},
"insertInstant": 1761631190105,
"preferredLanguages": [
"en_US"
],
"username": "Raymundo_Metz40",
"verified": false
}
],
"salt": "k0eyvRy0S8lFp+IArLRGFJrm6dNM3tVGuAztU38lS3A=",
"timezone": "Australia/Darwin",
"twoFactor": {
"methods": [
{
"method": "sms",
"mobilePhone": "1-631-260-6813 x390"
},
{
"method": "email",
"email": "example1000@example.com"
}
]
},
"usernameStatus": "ACTIVE",
"username": "example1000",
"verified": true
}
]
Using this command lets you stress-test the import process with as many users as you like.
The Configuration Check
The CLI includes a common configuration check.
This is like a pre-flight checklist based on FusionAuth’s documented best practices and essential tasks. This checks for issues like:
- no API key set up
- no second admin user created
- no email server configuration
These tasks should be completed whenever you spin up an instance that is logged into by non-developer users, but definitely before you go live.
There may come a time when you’ll be happy to have an API key to undo a change you accidentally made in the admin UI, like locking your admin user account. Trust us.
Get Started
Ready to give the CLI a spin? You can find the FusionAuth CLI on npm and in our technical documentation.
As long as you have a modern version of node installed, you can run it like so:
npx fusionauth --help
Feeling adventurous and want to contribute? We’d love to see you over at the GitHub repo. Pull requests welcome and stars appreciated.
Happy scripting!