or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

build-system.mdcli-engine.mdconfiguration-management.mdindex.mdpackage-management.mdproject-management.mduser-interface.md
tile.json

tessl/npm-aurelia-cli

The command line tooling for Aurelia, providing project scaffolding, build tools, and development utilities for the Aurelia JavaScript framework.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/aurelia-cli@3.0.x

To install, run

npx @tessl/cli install tessl/npm-aurelia-cli@3.0.0

index.mddocs/

Aurelia CLI

The 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.

Package Information

  • Package Name: aurelia-cli
  • Package Type: npm
  • Language: JavaScript (Node.js)
  • Installation: npm install -g aurelia-cli or npm install aurelia-cli

Core Imports

const { 
  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";

Command Line Usage

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-element

The CLI automatically detects whether to use global or local installation based on:

  • Command type (new always uses global)
  • Presence of local aurelia-cli in node_modules
  • Current directory containing aurelia_project folder

Basic Usage

const { 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());

Architecture

The Aurelia CLI is built around several key components:

  • CLI Engine: Core command execution and dependency injection (CLI, CLIOptions)
  • Project Management: Project detection, configuration, and scaffolding (Project, ProjectItem)
  • Build System: Bundling, module loading, and asset processing (build module, Bundler)
  • User Interface: Interactive prompts and console output (UI, ConsoleUI)
  • Package Management: NPM and Yarn abstraction layers (NPM, Yarn)
  • Command System: Extensible command framework with built-in commands (new, generate, help, config)
  • Binary Entry Point: Cross-platform executable with Node.js version checking and automatic global/local CLI detection

Capabilities

CLI Engine

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;
}

CLI Engine

Project Management

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;
}

Project Management

Build System

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;

Build System

User Interface

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[]>;
}

User Interface

Package Management

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 {}

Package Management

Configuration Management

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;
}

Configuration Management

Types

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;
}