ai-site
Zero-config solution for creating AI-powered Next.js websites using ai-functions
and ai-props
.
Features
- Zero-config setup requiring only a
site.config.{ts|js}
file - Automatic integration with
ai-functions
andai-props
- Pass-through commands to Next.js (dev/build/start)
- Default Next.js configuration and app directory templates
- Support for custom Next.js configuration and app directory
Installation
npm install ai-site
# or
pnpm add ai-site
# or
yarn add ai-site
Quick Start
- Install the package:
npm install ai-site
- Create a minimal
site.config.ts
in your project root:
export default {
name: 'My AI-Powered Site',
description: 'Generated with ai-site',
// other configuration options
}
- Run Next.js commands:
npx ai-site dev # Start development server
npx ai-site build # Build for production
npx ai-site start # Start production server
Configuration
The site.config.{ts|js}
file supports the following options:
export default {
// Basic site information
name: 'My AI-Powered Site',
description: 'Generated with ai-site',
// Custom Next.js configuration (optional)
nextConfig: {
// Your custom Next.js configuration
},
// Custom app directory path (optional)
appDir: './custom-app',
// AI functions configuration (optional)
aiFunctions: {
// AI functions configuration
},
// AI props configuration (optional)
aiProps: {
// AI props configuration
},
}
Custom Next.js Configuration
By default, ai-site
provides a standard Next.js configuration. If you need to customize it, you can:
- Add a
nextConfig
object in yoursite.config.{ts|js}
file - Create a
next.config.js
ornext.config.mjs
file in your project root
Custom App Directory
By default, ai-site
uses a template app directory. If you need to customize it, you can:
- Specify an
appDir
path in yoursite.config.{ts|js}
file - Create an
app
directory in your project root
CLI Commands
The ai-site
CLI supports the following commands:
npx ai-site dev
- Start the development servernpx ai-site build
- Build for productionnpx ai-site start
- Start the production server