npm package: @squaredup/cli
Description: CLI tool for managing SquaredUp plugins
Author: SquaredUp
Latest version: 0.2.6

# @squaredup/cli

CLI tool for validating and deploying plugins to the [SquaredUp](https://squaredup.com) platform.

## Installation

```sh
npm install -g @squaredup/cli
# or
pnpm add -g @squaredup/cli
```

Requires Node.js 20 or later

## Authentication

Before deploying plugins you need to authenticate with your SquaredUp API key. You can generate one at [**app.squaredup.com → Settings → Advanced → API**](https://app.squaredup.com/settings/apiKeys).

**Interactive login** (prompts for key and region):

```sh
squaredup login
```

**Non-interactive login** (useful in CI):

```sh
squaredup login --apiKey <your-api-key> --region eu
```

| Option     | Values     | Default | Description            |
| ---------- | ---------- | ------- | ---------------------- |
| `--apiKey` | string     | —       | Your SquaredUp API key |
| `--region` | `us`, `eu` | `us`    | Target region          |

Check your current authentication status:

```sh
squaredup status
```

Log out and clear stored credentials:

```sh
squaredup logout
```

## Commands

| Command    | Status    | Description                              |
| ---------- | --------- | ---------------------------------------- |
| `login`    | Available | Authenticate with the SquaredUp platform |
| `logout`   | Available | Clear stored credentials                 |
| `status`   | Available | Show current authentication status       |
| `deploy`   | Available | Deploy a plugin to the platform          |
| `validate` | Available | Validate a plugin package or folder      |
| `list`     | Available | List deployed plugins for your tenant    |
| `delete`   | Available | Delete a deployed plugin by ID           |

### Global flags

| Flag        | Description                 |
| ----------- | --------------------------- |
| `--silent`  | Suppress all output         |
| `--debug`   | Enable verbose debug output |
| `--version` | Print CLI version           |
| `--help`    | Show help                   |

## Development

**Prerequisites:** Node.js ≥20, pnpm

```sh
git clone <repo>
cd plugin-cli
pnpm install
```

| Script | Command      | Description                          |
| ------ | ------------ | ------------------------------------ |
| Build  | `pnpm build` | Compile TypeScript to `dist/`        |
| Dev    | `pnpm dev`   | Watch mode — rebuild on file changes |
| Lint   | `pnpm lint`  | Run ESLint                           |
| Test   | `pnpm test`  | Run tests with Vitest                |

After building, you can run the CLI locally:

```sh
node dist/index.js --help
```

To use the `squaredup` command globally from your local checkout, link the package after building:

```sh
pnpm build
pnpm link --global
```

The `squaredup` command will now resolve to your local `dist/index.js`. To unlink when you're done:

```sh
pnpm unlink --global @squaredup/cli
```

## Credential storage

Credentials (API key, region, tenant name) are stored in the OS-specific user config directory managed by the [`conf`](https://github.com/sindresorhus/conf) package under the project name `squaredup-cli`. The config file is written with `0o600` permissions (owner read/write only).