Command reference
This comprehensive reference covers all Aurelia CLI commands, their options, and usage patterns.
Global Commands
au new
Creates a new Aurelia project or plugin.
Syntax:
au new [project-name] [options]Options:
--plugin- Creates a plugin project instead of an application--here- Creates the project in the current directory--unattended- Uses default options without prompting--typescript- Uses TypeScript template--webpack- Uses Webpack bundler--require-js- Uses RequireJS module loader--system-js- Uses SystemJS module loader
Examples:
# Interactive project creation
au new my-app
# Create plugin project
au new my-plugin --plugin
# Create TypeScript app with Webpack
au new my-app --typescript --webpack
# Create project in current directory
au new --herePrerequisites:
Node.js v10.0.0 or higher
Git client
Available disk space (project templates ~50MB)
au help
Displays help information for CLI commands.
Syntax:
Examples:
au version / au -v
Displays the current CLI version.
Syntax:
Project Commands
These commands work within an Aurelia project directory.
au run
Builds and serves the application for development.
Syntax:
Options:
--env <environment>- Specifies environment (dev, stage, prod)--port <port>- Sets server port (default: 8080)--host <host>- Sets server host (default: localhost)--open- Opens browser automatically--hmr- Enables Hot Module Reload (Webpack only)--analyze- Runs webpack bundle analyzer (Webpack only)--extractCss- Extracts CSS to separate file (Webpack only)--watch- Watches for file changes and rebuilds--auto-install- Automatically installs missing packages (ESNext only)
Examples:
Environment Variables:
AURELIA_CLI_SILENCE_WARNINGS- Suppresses CLI warningsNODE_ENV- Sets Node.js environment
au build
Builds the application for production deployment.
Syntax:
Options:
--env <environment>- Specifies build environment--watch- Watches for changes and rebuilds--analyze- Analyzes bundle composition (Webpack only)--extractCss- Extracts CSS to separate file (Webpack only)
Examples:
Output:
Built files go to
dist/directorySource maps included based on environment configuration
au test
Runs the project's test suite.
Syntax:
Options:
--watch- Runs tests in watch mode--debug- Enables debug mode--coverage- Generates code coverage report--env <environment>- Specifies test environment
Examples:
Supported Test Frameworks:
Jest (default for new projects)
Karma + Jasmine
Protractor (e2e testing)
au generate
Scaffolds Aurelia resources using built-in generators.
Syntax:
Available Resources:
element- Custom elementattribute- Custom attributevalue-converter- Value converterbinding-behavior- Binding behaviortask- Gulp taskgenerator- Custom generator
Options:
--force- Overwrites existing files
Examples:
File Conventions:
Uses kebab-case for file names
Generates both view-model and template files for elements
Creates corresponding test files when test framework is configured
Advanced Commands
au install
Installs and configures Aurelia plugins and third-party packages.
Syntax:
Options:
--save- Adds to dependencies in package.json--save-dev- Adds to devDependencies--force- Forces reinstallation
Examples:
Auto-configuration:
Updates
aurelia.jsondependencies automaticallyConfigures known Aurelia plugins
Handles font and asset copying for UI libraries
au clear-cache
Clears build caches to resolve build issues.
Syntax:
What it clears:
Webpack module cache
TypeScript compilation cache
CLI bundler cache
Node modules cache
When to use:
After major dependency updates
When experiencing unexplained build errors
After switching between branches with different dependencies
Flag Reference
Environment Flags
Built-in Environments:
dev- Development (default)stage- Stagingprod- Production
Custom Environments: Create additional environment files in aurelia_project/environments/
Debug Flags
Webpack Projects:
--analyze- Bundle analyzer--extractCss- CSS extraction--hmr- Hot module reload
CLI Bundler Projects:
--watch- File watching--auto-install- Package auto-install
Compatibility Flags
Legacy Support:
--require-js- RequireJS loader--system-js- SystemJS loader
Platform Specific:
Windows: Use CMD or PowerShell (not Git Bash)
Docker: May need polling for file watching
Error Handling
Common Error Patterns
Installation Errors:
Build Errors:
Module Resolution Errors:
Troubleshooting Commands
Integration Commands
Git Integration
Docker Integration
CI/CD Integration
Performance Optimization
Build Performance
Development Performance
Best Practices
Command Usage
Always use specific environments:
Clear cache when in doubt:
Use generators for consistency:
Test before building:
Project Organization
Consistent naming:
Use kebab-case for generated resources
Follow CLI naming conventions
Environment configuration:
Keep environment-specific settings in environment files
Use
aurelia.jsonfor shared configuration
Dependency management:
Use
au installfor Aurelia packagesUpdate
aurelia.jsonfor complex dependencies
The Aurelia CLI provides a comprehensive toolset for managing Aurelia applications throughout their development lifecycle. Understanding these commands and their options enables efficient development workflows and troubleshooting capabilities.
Last updated
Was this helpful?