# 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](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#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](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#cli-installation)

Begin by installing the PropelAuth CLI:

```bash
npm i -g @propelauth/cli
```

```bash
yarn global add @propelauth/cli
```

## [CLI Options](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#cli-options)

The PropelAuth CLI has the following options:

| Option | Description |
| --- | --- |
| `-V` or `--version` | Shows the PropelAuth CLI version number |
| `-h` or `--help` | Shows all available options and commands |

## [CLI Commands](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#cli-commands)

The PropelAuth CLI has the following commands:

| Command | Options | Description |
| --- | --- | --- |
| `login` |  | Login to PropelAuth using an API Key. See [documentation below](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#logging-into-the-propel-auth-cli) for more information. |
| `set-default-project` |  | Set 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 |
| `logout` |  | Log the CLI out of PropelAuth |
| `help` | `[command]` | Display additional information about a command |

## [`setup` Options](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#setup-options)

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

| Options | Description |
| --- | --- |
| `-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](https://docs.propelauth.com/reference/api/cli?ref=propelauth.mymidnight.blog#logging-into-the-propel-auth-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](https://auth.propelauth.com/en/signup) to get started.

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

```bash
propelauth login
```

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

```bash
┌  ⚡ 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](https://auth.propelauth.com/api_keys/personal) and clicking **+ New 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.

```bash
┌
◇  ✓ 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
└
```
