Project Scaffolding

Learn how to use ao-forge init effectively to create new AO-powered applications.

Basic Usage

# Interactive mode (recommended)
ao-forge init my-app

# Specify framework
ao-forge init my-app --framework nextjs
ao-forge init my-app --framework nuxtjs

# Use in existing directory
ao-forge init --path ./existing-directory

# Specify package manager
ao-forge init my-app --package-manager pnpm
ao-forge init my-app --package-manager yarn

Framework Options

Next.js

ao-forge init my-app --framework nextjs

Creates a Next.js application with:

  • App Router structure
  • TypeScript configuration
  • AO process integration
  • Tailwind CSS setup

Nuxt.js

ao-forge init my-app --framework nuxtjs

Creates a Nuxt.js application with:

  • Nuxt 3 structure
  • TypeScript configuration
  • AO process integration
  • Tailwind CSS setup

Package Manager Options

# npm (default)
ao-forge init my-app --package-manager npm

# pnpm
ao-forge init my-app --package-manager pnpm

# yarn
ao-forge init my-app --package-manager yarn

Advanced Options

# Skip installation
ao-forge init my-app --skip-install

# Use specific template
ao-forge init my-app --template custom

# Overwrite existing files
ao-forge init my-app --force

Project Templates

ao-forge comes with several built-in templates:

  • default - Basic AO application
  • dao - DAO-specific template
  • nft - NFT marketplace template
  • defi - DeFi protocol template
# Use a specific template
ao-forge init my-dao --template dao

Configuration

After creating your project, you can customize it using the ao.config.yml file:

luaFiles: ['counter.lua', 'token.lua']
packageManager: 'pnpm'
framework: 'nextjs'
autoStart: false
ports:
  dev: 3000
processName: 'my-process'

Best Practices

  1. Use descriptive names for your projects
  2. Choose the right framework for your needs
  3. Set up your package manager consistently
  4. Customize the configuration after creation
  5. Review the generated structure before starting development