config command
Manage configuration settings for your ao-forge project.
Syntax
ao-forge config <subcommand> [options]
Subcommands
get
- Get configuration valueset
- Set configuration valuelist
- List all configurationvalidate
- Validate configurationreset
- Reset to defaultsshow
- Show configuration filehelp
- Show help information
get subcommand
Syntax
ao-forge config get <key> [options]
Examples
# Get specific value
ao-forge config get framework
# Get nested value
ao-forge config get ports.dev
# Get with default
ao-forge config get framework --default nextjs
set subcommand
Syntax
ao-forge config set <key> <value> [options]
Examples
# Set specific value
ao-forge config set framework nextjs
# Set nested value
ao-forge config set ports.dev 3001
# Set multiple values
ao-forge config set framework nextjs --set packageManager pnpm
list subcommand
Syntax
ao-forge config list [options]
Examples
# List all configuration
ao-forge config list
# List with format
ao-forge config list --format json
ao-forge config list --format yaml
# List specific section
ao-forge config list --section build
validate subcommand
Syntax
ao-forge config validate [options]
Examples
# Validate configuration
ao-forge config validate
# Validate with strict mode
ao-forge config validate --strict
# Validate specific file
ao-forge config validate --file ./config/custom.yml
reset subcommand
Syntax
ao-forge config reset [options]
Examples
# Reset to defaults
ao-forge config reset
# Reset specific section
ao-forge config reset --section build
# Reset with backup
ao-forge config reset --backup
show subcommand
Syntax
ao-forge config show [options]
Examples
# Show configuration file
ao-forge config show
# Show with format
ao-forge config show --format json
ao-forge config show --format yaml
# Show specific section
ao-forge config show --section deploy
Configuration Keys
Project Configuration
name
- Project nameversion
- Project versiondescription
- Project descriptionframework
- Framework (nextjs, nuxtjs)packageManager
- Package manager (npm, pnpm, yarn)
AO Process Configuration
luaFiles
- List of Lua filesautoStart
- Auto-start processesprocessName
- Default process nameprocesses
- Process configurations
Development Configuration
ports.dev
- Development server portports.ao
- AO process portports.monitoring
- Monitoring portdebug
- Debug modehotReload
- Hot reloading
Build Configuration
build.output
- Build output directorybuild.optimize
- Enable optimizationbuild.sourceMaps
- Generate source mapsbuild.minify
- Minify assets
Deployment Configuration
deploy.platform
- Deployment platformdeploy.environment
- Deployment environmentdeploy.domain
- Deployment domaindeploy.customDomain
- Custom domain
Configuration Examples
Basic Configuration
# ao.config.yml
name: 'my-ao-app'
framework: 'nextjs'
packageManager: 'pnpm'
luaFiles: ['counter.lua']
autoStart: false
ports:
dev: 3000
Advanced Configuration
# ao.config.yml
name: 'my-ao-app'
version: '1.0.0'
description: 'My AO-powered application'
framework: 'nextjs'
packageManager: 'pnpm'
# AO processes
luaFiles: ['counter.lua', 'token.lua']
autoStart: false
processName: 'my-process'
# Development
ports:
dev: 3000
ao: 8080
monitoring: 9090
# Build
build:
output: './dist'
optimize: true
sourceMaps: false
# Deployment
deploy:
platform: 'vercel'
environment: 'production'
domain: 'my-app.vercel.app'
Configuration Validation
Validation Rules
# Validation rules
validation:
required:
- framework
- packageManager
- luaFiles
optional:
- ports
- build
- deploy
types:
framework: ['nextjs', 'nuxtjs']
packageManager: ['npm', 'pnpm', 'yarn']
Validation Commands
# Validate configuration
ao-forge config validate
# Check for errors
ao-forge config validate --strict
# Fix configuration issues
ao-forge config fix
Environment-Specific Configuration
Development Configuration
# config/development.yml
ports:
dev: 3000
debug: true
hotReload: true
Staging Configuration
# config/staging.yml
ports:
dev: 3001
debug: false
hotReload: false
Production Configuration
# config/production.yml
ports:
dev: 3000
debug: false
hotReload: false
build:
optimize: true
minify: true
Configuration Management
Using Environment Variables
# Set environment variables
export AO_FRAMEWORK=nextjs
export AO_PACKAGE_MANAGER=pnpm
export AO_PORT=3000
# Use in configuration
ao-forge config set framework $AO_FRAMEWORK
ao-forge config set packageManager $AO_PACKAGE_MANAGER
ao-forge config set ports.dev $AO_PORT
Configuration Templates
# Use configuration template
ao-forge config template nextjs
# Use custom template
ao-forge config template --file ./templates/custom.yml
Error Handling
Common Errors
- Configuration not found
Error: Configuration file not found Solution: Run 'ao-forge config init' to create default configuration
- Invalid configuration
Error: Invalid configuration value Solution: Use 'ao-forge config validate' to check for errors
- Configuration not applied
Error: Configuration not applied Solution: Restart development server or reload configuration
Best Practices
Configuration Management
- Use version control for configuration files
- Document configuration options
- Validate configuration before deployment
- Use environment-specific configurations
- Keep secrets in environment variables
Security
- Never commit sensitive information
- Use environment variables for secrets
- Validate inputs in configuration
- Use secure defaults for production
- Regularly review configuration security
Related Commands
ao-forge init
- Create new projectao-forge dev
- Start development serverao-forge build
- Build for production