# CLI Reference

> Install and use the Aerostack CLI to scaffold, deploy, test, and manage projects from the terminal. Supports Cloudflare Workers and Node.js.

The Aerostack CLI is the primary tool for building, deploying, and managing your projects. It handles everything from scaffolding to production deployment.

## Installation

```bash
npm install -g @aerostack/cli
```

Or use it without installing:

```bash
npx aerostack init my-app
```

Verify your install:

```bash
aerostack --version
```

## Command Overview

| Command | Description |
|---------|-------------|
| [`aerostack init`](/cli/init) | Create a new project from a template |
| [`aerostack dev`](/cli/dev) | Start local development server |
| [`aerostack deploy`](/cli/deploy) | Deploy to Aerostack or your Cloudflare account |
| [`aerostack login`](/cli/auth-commands) | Authenticate with your Aerostack account |
| [`aerostack link`](/cli/auth-commands) | Link a local project to an Aerostack project |
| [`aerostack whoami`](/cli/auth-commands) | Show current auth and project status |
| [`aerostack add`](/cli/add) | Add a service or shared library |
| [`aerostack db`](/cli/database) | Manage databases and migrations |
| [`aerostack generate types`](/cli/generate) | Generate TypeScript types from your schema |
| [`aerostack secrets`](/cli/secrets) | Manage secrets for staging and production |
| [`aerostack test`](/cli/testing) | Run tests with Vitest + Workers runtime |
| [`aerostack mcp convert`](/cli/mcp-commands) | Convert an NPM MCP server to a Cloudflare Worker |
| [`aerostack skill`](/cli/skill-commands) | Install and publish skills |
| [`aerostack workspace`](/cli/workspace-commands) | Manage MCP workspaces |
| [`aerostack functions`](/cli/functions-commands) | Install community functions |
| [`aerostack ai`](/cli/ai-commands) | Run the AI agent with project context |
| [`aerostack index`](/cli/ai-commands) | Index your project for the AI agent |
| [`aerostack store`](/cli/store) | AI-powered schema and data seeding |
| [`aerostack migrate`](/cli/migrate) | Migrate an existing Cloudflare Worker to Aerostack |

## Common Workflows

```bash
# New project, deploy to Aerostack
aerostack init my-app
cd my-app
aerostack login
aerostack deploy --env staging

# New project, deploy to your own Cloudflare account
aerostack init my-app --template api --db d1
cd my-app
aerostack deploy --cloudflare

# Add a new service to an existing project
aerostack add function payments-api

# Database workflow
aerostack db migrate new add_products_table
# ... edit the SQL file ...
aerostack db migrate apply
aerostack generate types

# Install a skill from the marketplace
aerostack skill install johndoe/github-skill
```

Run `aerostack` with no arguments to launch the interactive welcome screen.
