FusionAuth CLI
The FusionAuth command line interface (CLI) tool allows you to manipulate FusionAuth from the command line. The focus of the CLI is on allowing easy management of commonly modified customization code and markup, such as emails, themes or lambdas. It is not a full featured replacement for any of the client libraries, which wrap all of the API.
Prerequisites
The CLI tool requires node. It’s tested with version 22 but should work with modern versions of node.
Installation
You can install this tool using npm.
npm i -g @fusionauth/cli
Functionality
This tool allows you to easily retrieve and publish FusionAuth configuration from the command line. This includes:
- emails
- lambdas
- messages
- themes
The CLI is designed to work with complex version controlled configuration and includes support for localized content.
It also can be used to:
- generate fake user data suitable for the User Import API
- check an instance to see that suggested common configuration has been performed
Usage
Currently, the CLI supports the following commands:
- Common config check
fusionauth check:common-config- Checks to make sure common configuration settings are set.
- Emails
fusionauth email:download- Download a specific template or all email templates from a FusionAuth server.fusionauth email:duplicate- Duplicate an email template locally.fusionauth email:html-to-text- Convert HTML email templates to text, where the text template is missing.fusionauth email:upload- Upload a specific template or all email templates to a FusionAuth server.fusionauth email:watch- Watch the email template directory and upload changes to a FusionAuth server.fusionauth email:create- Create a new email template locally. Fake user generationfusionauth import:generate- Generate JSON for importing fake users for testing.
- Lambdas
fusionauth lambda:update- Update a lambda on a FusionAuth server.fusionauth lambda:delete- Delete a lambda from a FusionAuth server.fusionauth lambda:retrieve- Download a lambda from a FusionAuth server.
- Messages
fusionauth message:download- Download a specific message template or all message templates from a FusionAuth server.fusionauth message:upload- Upload a specific message template or all message templates to a FusionAuth server.
- Themes
fusionauth theme:download- Download a theme from a FusionAuth server.fusionauth theme:upload- Upload a theme to a FusionAuth server.fusionauth theme:watch- Watch a theme directory and upload changes to a FusionAuth server.
Examples
fusionauth theme:download -k <APIKEY> <themeid>
# modify your theme
fusionauth theme:upload -k <APIKEY> <themeid>
To learn more about the commands, use the --help switch.
fusionauth --help
Updating
To update to the most recent version, use npm update.
npm update -g @fusionauth/cli
Source Code
The FusionAuth CLI is open source and we welcome pull requests.
You can view the source code and the npm package.