@fusionauth/cli

raw JSON →
1.2.4 verified Sat Apr 25 auth: no javascript maintenance

@fusionauth/cli (v1.2.4) is a command-line tool for interacting with FusionAuth, an OIDC/OAuth authentication server. It enables downloading, uploading, and managing email templates, lambdas, and themes. This fork specifically fixes compatibility with Node.js 22, as the original package broke under that version. It is written in TypeScript and distributed as an npm package. Maintenance appears minimal (rare releases). Differentiators include watch functionality for live theme/email updates and environment variable support for API key and host.

error Error: Cannot find module '@oclif/core'
cause Missing dependencies due to npm install issues or incorrect Node version.
fix
Run 'npm install' in the project directory or use npx to auto-install.
error Error: Failed to authenticate: API key is missing
cause FUSIONAUTH_API_KEY environment variable not set or -k flag not provided.
fix
Set FUSIONAUTH_API_KEY environment variable or use -k option.
error Error: Connection refused to http://localhost:9011
cause FusionAuth server is not running on the specified host/port.
fix
Ensure FusionAuth is running and FUSIONAUTH_HOST is correctly set.
breaking Node.js versions below 19 not supported
fix Update Node.js to v19 or later (tested on 19 and 22).
gotcha Global install can cause conflicts with other global packages
fix Use npx @fusionauth/cli instead of global install.
deprecated Some commands may be renamed or removed in future versions
fix Check the documentation for the latest command list.
gotcha Environment variables FUSIONAUTH_HOST and FUSIONAUTH_API_KEY must be set or passed via -h and -k flags
fix Set the environment variables before running commands.
gotcha Forked from original FusionAuth CLI; may diverge in features
fix Use the original FusionAuth CLI if you need the official version; this fork only fixes Node 22 compatibility.
npm install fusionauth-cli
yarn add fusionauth-cli
pnpm add fusionauth-cli

Shows how to set environment variables and download all email templates using npx.

export FUSIONAUTH_HOST='http://localhost:9011'
export FUSIONAUTH_API_KEY='your-api-key'
npm i @fusionauth/cli
npx fusionauth email:download -t all