Skip to main content

Overview

The feathers generate command (alias: feathers g) is the main entry point for running Feathers code generators. It provides an interactive CLI for scaffolding various parts of your Feathers application.

Usage

Or using the shorthand:

Available Generators

The following generators are available:

app

Generate a new Feathers application

service

Generate a new service with database adapter

hook

Generate a hook for custom logic

connection

Add a new database connection

authentication

Add authentication to your application

Examples

Generate a new application

This launches an interactive prompt that guides you through creating a new Feathers application with your preferred configuration.

Generate a service

Creates a new service with database integration, schema validation, and test files.

Generate with alias

The g alias provides a shorter command for frequent use.

Interactive Mode

All generators run in interactive mode by default, prompting you for configuration options. You can also pass options via flags to skip prompts (see individual generator documentation).

Terminal Output Example

The CLI validates your inputs and provides helpful error messages if something goes wrong.

Common Options

While each generator has specific options, some patterns are common across generators:
  • Most generators support a --name flag to set the name non-interactively
  • Language (TypeScript/JavaScript) is inherited from your app configuration
  • All generators respect your project’s prettier and formatting settings

Next Steps

Generate an app

Learn about creating a new Feathers application

Generate a service

Add services to handle your data