---
title: CLI Reference
type: reference
summary: Full reference for every command available in the distats-cli package.
related:
  - /docs/getting-started
  - /docs/user-management
---

# CLI Reference



Installation [#installation]

The Distats CLI is used via `npx` and does not need to be installed globally:

```bash
npx distats-cli@latest <command>
```

***

Commands [#commands]

`init` [#init]

Initializes a new Distats Panel installation in the **current directory**.

```bash
npx distats-cli@latest init
```

**What it does:**

1. Verifies the target directory is empty (exits with an error if not)
2. Clones the Distats Panel repository into the current directory
3. Runs `npm install` to install all dependencies
4. Runs `npm run build` to produce a production Next.js build
5. Generates `@distats_panel/config.json` with default values

**Output files:**

* `@distats_panel/config.json` — your panel configuration
* `@distats_panel/database.sqlite` — created on first panel start

<Callout emoji="⚠️">
  Run `init` inside an **empty** directory. The CLI will refuse to initialize
  if existing files are detected to avoid overwriting your project.
</Callout>

***

`create-user` [#create-user]

Creates a new administrator account in the local SQLite database.

```bash
npx distats-cli@latest create-user
```

**What it does:**

1. Reads `@distats_panel/config.json` to locate the SQLite database
2. Prompts for a **username** and **password**
3. Hashes the password using Node.js `crypto.scrypt` with a random salt
4. Inserts the record into the `users` table

**Example session:**

```
? Enter username: admin
? Enter password: ••••••••••••
✔ User "admin" created successfully.
```

After this, you can log in at `http://localhost:3000` with those credentials.

***

Running the panel [#running-the-panel]

The CLI only handles initialization. To start the panel after setup, use npm directly:

```bash
# Start the production server
npm start

# Or run in development mode (with hot-reload)
npm run dev
```

The panel will be available at `http://localhost:3000` (or whatever port Next.js assigns if 3000 is in use).
