Nitrocloud LogoNitroStack
/api
/cli commands

CLI Commands Reference

Overview

The NitroStack CLI (@nitrostack/cli) provides commands for creating, developing, and building MCP server projects.

Installation

Bash
npm install -g @nitrostack/cli

Commands

nitrostack-cli init

Create a new NitroStack project.

Bash
nitrostack-cli init <project-name> [options]

Arguments:

ArgumentDescriptionRequired
project-nameName of the project directoryYes

Options:

OptionDescriptionDefault
--template <name>Template to usetypescript-starter

Templates:

  • typescript-starter - Basic MCP server with calculator example
  • typescript-oauth - OAuth 2.1 authentication with Duffel API
  • typescript-pizzaz - Map widgets with Mapbox integration

Example:

Bash
nitrostack-cli init my-project --template typescript-oauth

nitrostack-cli dev

Start development mode with hot reload.

Bash
nitrostack-cli dev [options]

Options:

OptionDescriptionDefault
--no-openDon't open browserfalse

What it starts:

  • MCP Server with file watching
  • Widget Server on port 3001 (if widgets exist)

Note: NitroStudio is now a standalone application and must be started separately.

Example:

Bash
nitrostack-cli dev

nitrostack-cli build

Build project for production.

Bash
nitrostack-cli build [options]

Options:

OptionDescriptionDefault
--output <dir>Output directorydist

What it builds:

  • Compiles TypeScript to JavaScript
  • Bundles widgets for production (if present)

Example:

Bash
nitrostack-cli build

nitrostack-cli start

Start the production server.

Bash
nitrostack-cli start [options]

Options:

OptionDescriptionDefault
--port <number>Server port3002

Example:

Bash
nitrostack-cli start --port 8080

nitrostack-cli install

Install dependencies in root and widgets directories.

Bash
nitrostack-cli install [options]

Options:

OptionDescriptionDefault
--skip-widgetsSkip widget installationfalse

What it does:

  1. Runs npm install in project root
  2. Runs npm install in src/widgets (if exists)

Example:

Bash
# Install all dependencies
nitrostack-cli install

# Install root only
nitrostack-cli install --skip-widgets

nitrostack-cli upgrade

Upgrade NitroStack packages to latest version.

Bash
nitrostack-cli upgrade [options]

Options:

OptionDescriptionDefault
--dry-runPreview changes without applyingfalse

What it updates:

  • nitrostack in root package.json
  • @nitrostack/widgets in src/widgets/package.json

Example:

Bash
# Upgrade packages
nitrostack-cli upgrade

# Preview changes
nitrostack-cli upgrade --dry-run

nitrostack-cli generate

Generate code scaffolds.

Bash
nitrostack-cli generate <type> [name] [options]

Types:

TypeDescription
moduleGenerate a complete module
toolGenerate a tool class
resourceGenerate a resource
promptGenerate a prompt
guardGenerate an auth guard
middlewareGenerate middleware
interceptorGenerate an interceptor
pipeGenerate a validation pipe
filterGenerate an exception filter
serviceGenerate a service class

Options:

OptionDescription
--module <name>Parent module for tool/resource/prompt
--output <path>Custom output path

Examples:

Bash
# Generate a module
nitrostack-cli generate module products

# Generate a tool in a module
nitrostack-cli generate tool search --module products

# Generate middleware
nitrostack-cli generate middleware logging

# Generate a guard
nitrostack-cli generate guard auth

npm Scripts

Projects include these npm scripts:

JSON
{
  "scripts": {
    "dev": "nitrostack-cli dev",
    "build": "nitrostack-cli build",
    "start": "nitrostack-cli start",
    "upgrade": "nitrostack-cli upgrade",
    "install:all": "nitrostack-cli install"
  }
}

Usage:

Bash
npm run dev          # Start development
npm run build        # Build for production
npm start            # Start production server
npm run upgrade      # Upgrade packages
npm run install:all  # Install all dependencies

Exit Codes

CodeDescription
0Success
1General error

Environment Variables

VariableDescriptionDefault
NODE_ENVEnvironment modedevelopment
MCP_SERVER_PORTMCP server port3002
WIDGET_PORTWidget server port3001
LOG_LEVELLogging levelinfo