or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

build-time-integration.mdcli-commands.mdfeature-system.mdindex.mdutilities.md
tile.json

cli-commands.mddocs/

Command Line Interface

Interactive Ember CLI commands for managing optional features from the terminal. All commands work within Ember projects and provide validation, feature listing, and optional automated codemods.

Capabilities

Base Feature Command

Shows usage information and available commands.

/**
 * Base feature command that displays usage information
 */
interface FeatureCommand {
  name: 'feature';
  description: 'Prints the USAGE.';
  works: 'insideProject';
  run(): void;
}

Usage:

ember feature

This displays the usage message explaining all available feature commands.

List Features Command

Lists all available features for the current Ember version with descriptions and default values.

/**
 * Lists all available optional features
 */
interface FeatureListCommand {
  name: 'feature:list';
  description: 'List all available features.';
  works: 'insideProject';
  run(): void;
}

Usage:

ember feature:list

Example Output:

Available features:

  application-template-wrapper (Default: true)
    Wrap the top-level application template (application.hbs) with a `<div class="ember-view">` element.
    More information: https://github.com/emberjs/rfcs/pull/280

  template-only-glimmer-components (Default: false)
    Use Glimmer Components semantics for template-only components (component templates with no corresponding .js file).
    More information: https://github.com/emberjs/rfcs/pull/278

Enable Feature Command

Enables a specific optional feature with optional automated codemod execution.

/**
 * Enables a specific optional feature
 */
interface FeatureEnableCommand {
  name: 'feature:enable';
  description: 'Enable feature.';
  works: 'insideProject';
  availableOptions: [
    {
      name: 'run-codemod';
      type: Boolean;
      description: 'run any associated codemods without prompting';
    }
  ];
  anonymousOptions: ['<feature-name>'];
  run(commandOptions: { runCodemod?: boolean }, args: string[]): Promise<void>;
}

Usage:

# Enable feature with interactive prompts
ember feature:enable template-only-glimmer-components

# Enable feature and automatically run codemods
ember feature:enable template-only-glimmer-components --run-codemod

# Enable feature and skip codemods  
ember feature:enable template-only-glimmer-components --no-run-codemod

Behavior:

  • Validates that the feature exists and is available for the current Ember version
  • Updates config/optional-features.json with the new setting
  • Runs optional callback function for advanced features (e.g., file generation)
  • Prompts user for codemod execution unless --run-codemod or --no-run-codemod is specified

Disable Feature Command

Disables a specific optional feature with optional automated codemod execution.

/**
 * Disables a specific optional feature
 */
interface FeatureDisableCommand {
  name: 'feature:disable';
  description: 'Disable feature.';
  works: 'insideProject';
  availableOptions: [
    {
      name: 'run-codemod';
      type: Boolean;
      description: 'run any associated codemods without prompting';
    }
  ];
  anonymousOptions: ['<feature-name>'];
  run(commandOptions: { runCodemod?: boolean }, args: string[]): Promise<void>;
}

Usage:

# Disable feature with interactive prompts
ember feature:disable jquery-integration

# Disable feature and automatically run codemods
ember feature:disable application-template-wrapper --run-codemod

Shared Command Functionality

All feature commands inherit shared functionality for validation, configuration management, and feature manipulation.

Feature Availability Check

/**
 * Check if a feature is available in the current Ember version
 * @param feature - Feature definition object
 * @returns Whether feature is available
 */
_isFeatureAvailable(feature: FeatureDefinition): boolean;

Configuration File Management

/**
 * Ensure config/optional-features.json exists, create if missing
 * @returns Path to the configuration file
 */
_ensureConfigFile(): string;

Feature Setting

/**
 * Set a feature's enabled state and run optional codemods
 * @param name - Feature name
 * @param value - Whether to enable (true) or disable (false)
 * @param shouldRunCodemod - Whether to run associated codemods
 */
_setFeature(name: string, value: boolean, shouldRunCodemod?: boolean): Promise<void>;

Error Handling

Commands provide clear error messages for common issues:

  • Invalid feature name: Shows available features when an unknown feature is specified
  • Version incompatibility: Warns when a feature requires a newer Ember version
  • Configuration errors: Validates JSON structure and feature values
  • File system errors: Handles missing directories and permission issues

Example Error Output:

Error: template-only-glimmer-components is only available in Ember 3.1 or above.
Error: unknown-feature is not a valid feature.

Available features:
  application-template-wrapper (Default: true)
  ...