Skip to main content

Introduction

The XyraPanel CLI (xyra) is a comprehensive command-line tool for managing your game server panel deployment. It provides streamlined workflows for building, deploying, and managing your XyraPanel instance through PM2.

Installation

Prerequisites

Before installing the CLI, ensure you have:
  • Node.js 18 or higher
  • pnpm package manager
  • PM2 process manager (for production deployments)

Global Installation

To make the xyra command available system-wide on your VPS:
pnpm link --global
After linking, you can run xyra from any directory.

Local Usage

If you prefer not to install globally, you can run commands directly from the project root:
pnpm xyra <command>

Quick Start

View Available Commands

Run the CLI without arguments to see the help screen:
xyra
██╗  ██╗ ██╗   ██╗ ██████╗  █████╗ ██████╗  █████╗ ███╗   ██╗███████╗██╗ v1.0.0
╚██╗██╔╝ ╚██╗ ██╔╝ ██╔══██╗██╔══██╗██╔══██╗██╔══██╗████╗  ██║██╔════╝██║ by @26bz & contributors
 ╚███╔╝   ╚████╔╝  ██████╔╝███████║██████╔╝███████║██╔██╗ ██║█████╗  ██║
 ██╔██╗    ╚██╔╝   ██╔══██╗██╔══██║██╔═══╝ ██╔══██║██║╚██╗██║██╔══╝  ██║
██╔╝ ██╗    ██║    ██║  ██║██║  ██║██║     ██║  ██║██║ ╚████║███████╗███████╗
╚═╝  ╚═╝    ╚═╝    ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝  ╚═╝╚═╝  ╚═══╝╚══════╝╚══════╝
──────────────────────────────────────────────────────────
Usage
  xyra <command> [options]

Core workflows
  deploy      • Build and reload/start via PM2
  pm2         • Process controls (start/reload/logs)
  build       • Nuxt build for Nitro output

Nuxt & tooling
  nuxt dev    • Nuxt dev server with HMR
  lint        • oxlint suite (fix/type-aware)
  fmt         • oxfmt formatters
  test        • Vitest run/watch/coverage
  db          • Drizzle schema helpers
  pwa         • PWA asset generation

Tip: run `pnpm link --global` to expose xyra everywhere on your VPS.

Common Workflows

Development

Start the development server with hot module replacement:
xyra nuxt dev

Production Deployment

Build and deploy to production in one command:
xyra deploy
This command will:
  1. Build the Nuxt application
  2. Attempt to reload the existing PM2 process
  3. If reload fails, start a new PM2 process

View Logs

Tail the PM2 logs for your running application:
xyra pm2 logs

Command Categories

The CLI organizes commands into logical groups:

Core Workflows

deploy

Build and deploy your application via PM2

pm2

Manage PM2 processes (start, stop, reload, logs)

build

Build the Nuxt application for production

Development Tools

nuxt

Nuxt runtime helpers (dev, preview, generate)

lint

Code linting with oxlint

fmt

Code formatting with oxfmt

test

Run tests with Vitest

Database & Assets

db

Database schema migrations with Drizzle

pwa

Generate PWA assets

Configuration

PM2 Ecosystem File

Most PM2-related commands reference an ecosystem configuration file. By default, the CLI looks for ecosystem.config.cjs in your project root. Example ecosystem file:
ecosystem.config.cjs
module.exports = {
  apps: [{
    name: 'xyrapanel',
    script: './.output/server/index.mjs',
    cwd: '/path/to/xyrapanel',
    instances: 1,
    exec_mode: 'cluster',
    env: {
      NODE_ENV: 'production',
      PORT: 3000
    },
    env_staging: {
      NODE_ENV: 'staging',
      PORT: 3001
    }
  }]
};

Environment Blocks

The CLI supports different PM2 environment blocks for various deployment stages:
  • env - Default production environment
  • env_staging - Staging environment
Specify the environment using the --env flag:
xyra deploy --env env_staging

Next Steps

Command Reference

Complete reference for all CLI commands

Deployment Guide

Learn about deploying XyraPanel to production
The CLI uses citty for command parsing and consola for beautiful terminal output.

Build docs developers (and LLMs) love