The command line tooling for Aurelia, providing project scaffolding, build tools, and development utilities for the Aurelia JavaScript framework.
npx @tessl/cli install tessl/npm-aurelia-cli@3.0.0The Aurelia CLI is the official command-line tooling for the Aurelia JavaScript framework, providing project scaffolding, build tools, and development utilities. It enables developers to create new Aurelia applications, manage project structure, configure builds, run development servers, and execute various development tasks through both CLI commands and programmatic APIs.
npm install -g aurelia-cli or npm install aurelia-cliconst {
CLI,
CLIOptions,
UI,
Project,
ProjectItem,
build,
Configuration,
reportWebpackReadiness,
NPM,
Yarn
} = require("aurelia-cli");For ES modules:
import {
CLI,
CLIOptions,
UI,
Project,
ProjectItem,
build,
Configuration,
reportWebpackReadiness,
NPM,
Yarn
} from "aurelia-cli";The Aurelia CLI provides both global and local installation options with automatic detection:
# Global installation
npm install -g aurelia-cli
# Use CLI commands
au new my-app
au generate component hello-world
au build --env prod
au help
# Local installation (in project)
npm install aurelia-cli
# Local commands take precedence
au build
au generate element my-elementThe CLI automatically detects whether to use global or local installation based on:
new always uses global)aurelia-cli in node_modulesaurelia_project folderconst { CLI, CLIOptions } = require("aurelia-cli");
// Create and run CLI instance
const cli = new CLI(new CLIOptions());
await cli.run("help", []);
// Use build system
const { build } = require("aurelia-cli");
await build.src(project).then(() => build.dest());The Aurelia CLI is built around several key components:
CLI, CLIOptions)Project, ProjectItem)build module, Bundler)UI, ConsoleUI)NPM, Yarn)Core command-line interface functionality for executing commands, managing options, and handling project context.
class CLI {
constructor(options?: CLIOptions);
run(command: string, args: string[]): Promise<void>;
}
class CLIOptions {
constructor();
getEnvironment(): string;
hasFlag(name: string, shortcut?: string): boolean;
getFlagValue(name: string, shortcut?: string): string | null;
}Project detection, configuration management, and scaffolding operations for Aurelia applications.
class Project {
static establish(directory: string): Promise<Project>;
constructor(directory: string, model: object, pack: object);
resolveGenerator(name: string): Promise<string>;
resolveTask(name: string): Promise<string>;
}
class ProjectItem {
constructor(name: string, isDirectory?: boolean);
add(...items: ProjectItem[]): ProjectItem;
create(relativeTo?: string): Promise<void>;
setText(text: string): ProjectItem;
}Comprehensive build and bundling system for Aurelia applications with module loading and asset processing.
const build = {
src(project: Project): Promise<Bundler>;
bundle(): Transform;
dest(options?: object): Promise<void>;
createLoaderCode(project: Project): Promise<string>;
createLoaderConfig(project: Project): Promise<object>;
clearCache(): Promise<void>;
};
function reportWebpackReadiness(options: WebpackOptions): void;Interactive console interface for prompts, logging, and user interaction with support for styled output.
class UI {}
class ConsoleUI extends UI {
constructor(cliOptions: CLIOptions);
log(text: string, indent?: number): Promise<void>;
question(text: string, options?: object): Promise<string>;
multiselect(question: string, choices: object[]): Promise<string[]>;
}Abstraction layer for package managers with support for NPM and Yarn operations.
class BasePackageManager {
constructor(executableName: string);
install(packages?: string[], workingDirectory?: string, command?: string): Promise<void>;
run(command: string, args?: string[], workingDirectory?: string): Promise<void>;
isAvailable(directory: string): boolean;
}
class NPM extends BasePackageManager {}
class Yarn extends BasePackageManager {}Configuration system for managing project settings and environment-specific options.
class Configuration {
constructor(options: object, defaultOptions?: object, environment?: string);
getValue(propPath: string): any;
isApplicable(propPath: string): boolean;
getAllOptions(): object;
}interface WebpackOptions {
host?: string;
port?: number;
https?: boolean;
public?: string;
publicPath?: string;
contentBase?: string | string[];
socket?: string;
historyApiFallback?: {
index?: string;
};
}
interface Transform {
// Node.js Transform stream interface
write(chunk: any): boolean;
end(): void;
pipe(destination: any): any;
}
interface Container {
// Aurelia dependency injection container
registerInstance(type: any, instance: any): void;
get(type: any): any;
}
interface ChildProcess {
// Node.js child process
pid: number;
stdin: any;
stdout: any;
stderr: any;
on(event: string, listener: Function): ChildProcess;
}