PropelAuth CLI Reference

The PropelAuth CLI was built from the ground up to set up PropelAuth in your application as quickly and easily as possible.

CLI Framework Support

Currently the PropelAuth CLI supports the following frameworks:

  • Next.js - App Router
  • Next.js - Pages Router

We're just getting started with the CLI and will be adding support for more frameworks in the future.

CLI Installation

Begin by installing the PropelAuth CLI:

npm i -g @propelauth/cli

CLI Options

The PropelAuth CLI has the following options:

OptionDescription
-V or --versionShows the PropelAuth CLI version number
-h or --helpShows all available options and commands

CLI Commands

The PropelAuth CLI has the following commands:

CommandOptionsDescription
loginLogin to PropelAuth using an API Key. See documentation below for more information.
set-default-projectSet the default PropelAuth Project to use with the CLI. If no default project is set, you will be prompted to select a Project each time you run certain commands
setup[options] [directory]Set up PropelAuth authentication in your project
logoutLog the CLI out of PropelAuth
help[command]Display additional information about a command

setup Options

setup installs PropelAuth in your application. The setup command has the following options:

OptionsDescription
-f or --framework <framework>Specify the framework (nextjs-app, nextjs-pages)
[directory]The directory where your application is located. If not provided, current directory is used.

Logging into the PropelAuth CLI

Before you install PropelAuth in your application you first need to log into the CLI. If you haven't already created an account in PropelAuth, navigate to auth.propelauth.com to get started.

Once you have an account with PropelAuth, run this command to login to the CLI:

propelauth login

To login you'll be prompted to create and copy/paste a Personal API Key into your terminal.

┌  ⚡ PropelAuth Login


│  Please visit the following URL to create a personal API key:

●  https://auth.propelauth.com/api_keys/personal


◆  Enter your API key
# enter your API key here

You can create a Personal API Key by navigating to https://auth.propelauth.com/api_keys/personal and clicking + New API Key.

Create Personal API Key

Selecting a Default Project

Once your API Key is validated the CLI will prompt you to select a default project, if desired. If you select a default project, the CLI will not prompt you to select a project again until you repeat the login process or run the set-default-project command.


◇  ✓ Projects fetched successfully

◆  Select a project to use
│  ● Always ask which project to use (You will be prompted for each command)
│  ○ Acme Inc / New Project