CLI Reference
Installation
The Distats CLI is used via npx and does not need to be installed globally:
npx distats-cli@latest <command>Commands
init
Initializes a new Distats Panel installation in the current directory.
npx distats-cli@latest initWhat it does:
- Verifies the target directory is empty (exits with an error if not)
- Clones the Distats Panel repository into the current directory
- Runs
npm installto install all dependencies - Runs
npm run buildto produce a production Next.js build - Generates
@distats_panel/config.jsonwith default values
Output files:
@distats_panel/config.json— your panel configuration@distats_panel/database.sqlite— created on first panel start
Run init inside an empty directory. The CLI will refuse to initialize
if existing files are detected to avoid overwriting your project.
create-user
Creates a new administrator account in the local SQLite database.
npx distats-cli@latest create-userWhat it does:
- Reads
@distats_panel/config.jsonto locate the SQLite database - Prompts for a username and password
- Hashes the password using Node.js
crypto.scryptwith a random salt - Inserts the record into the
userstable
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
The CLI only handles initialization. To start the panel after setup, use npm directly:
# Start the production server
npm start
# Or run in development mode (with hot-reload)
npm run devThe panel will be available at http://localhost:3000 (or whatever port Next.js assigns if 3000 is in use).