CLI Installation

Install and use the went CLI to scaffold and manage your applications.

Installation

Install went CLI

Use create-went-app to scaffold new applications:

# Create a new went application (recommended)
npx create-went-app@latest my-app

# Or install globally for shorter commands
npm install -g create-went-app
create-went-app my-app

Requirements: Node.js 18 or higher is required to run the went CLI.

Creating a New Project

Project Scaffolding

Create a new went application with all dependencies configured:

# Create a new project
npx create-went-app@latest my-app

# Navigate to project directory
cd my-app

# Start development server
npm run dev

What gets created:

  • • Next.js 15 application with App Router
  • • TypeScript configuration
  • • Prisma ORM with PostgreSQL schema
  • • NextAuth.js authentication setup
  • • Tailwind CSS and shadcn/ui components
  • • Environment variables template
  • • ESLint and Prettier configuration

Database Commands

Migration Commands

Initialize Database

# Initialize database with schema
went db migrate init

# Create and apply a new migration
went db migrate [migration-name]

Creates database tables based on your Prisma schema and applies migrations.

Generate Prisma Client

# Generate Prisma client after schema changes
went db generate

Regenerates the Prisma client with updated types after schema modifications.

Database Management

Database Studio

# Open Prisma Studio to browse and edit data
went db studio

Opens a web interface to view and edit your database data.

Reset Database

# Reset database (WARNING: Deletes all data)
went db reset

# Seed database with initial data
went db seed

Use with caution - reset will delete all existing data.

Development Commands

Common Development Tasks

Development Server

# Start development server with hot reloading
npm run dev

# Build for production
npm run build

# Start production server
npm run start

Code Quality

# Run ESLint
npm run lint

# Format code with Prettier
npm run format

# Type check with TypeScript
npm run type-check

CLI Configuration

Global Configuration

Configure went CLI preferences and defaults:

# View current configuration
went config list

# Set default database provider
went config set database postgresql

# Set default UI library
went config set ui shadcn

# Reset configuration to defaults
went config reset

Troubleshooting

Common Issues

  • Command not found: Ensure went CLI is installed globally
  • Database connection failed: Check DATABASE_URL in .env
  • Migration failed: Verify database is running and accessible
  • Permission denied: Run with appropriate permissions or use npx

Getting Help

# Get help for any command
went --help
went create --help
went db --help

# Check version
went --version

Updates

# Update to latest version
npm update -g @went/cli

# Check for updates
npm outdated -g @went/cli

Next Steps

Continue your journey with Went: