The [Supernova](https://supernova.io) CLI enables you to run specific tasks connected with Supernova from your CI/CD pipelines, from your action triggers (GitHub Actions and similar) or from your command line as well.

CLI is separated into different commands that you can use to automate certain aspects of working with Supernova. More command line options are coming as well, stay tuned for those!

### Installing CLI globally

You can install the CLI as global package, and make the CLI globally available under `> supernova` command to your command line. To install the CLI globally, just run one of the following commands:

```
npm install -g @supernovaio/cli
yarn global add @supernovaio/cli
```

You can now test that everything was properly set up by running the `supernova` command:

```
~ % supernova --version
> @supernovaio/cli/x.x.x ...
```

`Node 22` or newer environment is required to run the Supernova CLI.

### Updating CLI globally

You can update globally installed CLI by running npm update command on the package:

```
npm update -g @supernovaio/cli
yarn global upgrade @supernovaio/cli
```

This will upgrade the CLI to the latest version and make it immediately last default used version.

### Use cases

Following is the list of use cases for Supernova CLI. We will be adding more over time, stay tuned!

- [Host private storybook](https://developers.supernova.io/latest/supernova-cli/cli-commands/import-storybook-2PgA2h0o-2PgA2h0o)
- [Analyze code and push snapshots](https://developers.supernova.io/latest/supernova-cli/cli-commands/sync-tokens-studio-data/tokens-studio-101-bmB0dwM8)
- [Run exporters locally](https://developers.supernova.io/latest/supernova-cli/cli-commands/run-exporters-locally-B9r7rRrE)

### Changelog

Here you will find changelog for minor and major versions (and occasional notable changes in patch versions).

#### 2.2.0

- `supernova template-upload` command will now fail if it detects plain text NPM token in `.npmrc`. Use `--npmToken` flag to pass in NPM token as a Docker secret and consume it from the build process env (refer to `template-upload --help` for details)

#### 2.2.3

- `supernova code analyze` command now allows analyzing root repository package in a monorepo context

#### 2.2.4

- Fix private dependency packing lifecycle scripts

#### 2.2.5

- Improve `supernova code analyze` component detection for declaration-file components, namespace re-exports, monorepo project setup, and default prop filtering
