LogoRobo.js

Configuration

Customize the @robojs/cli plugin's build behavior.

Configuration

The @robojs/cli plugin works with zero configuration out of the box. For advanced use cases, you can customize the plugin's behavior through its config file.

Plugin config

Create a plugin configuration file at config/plugins/robojs/cli.ts:

config/plugins/robojs/cli.ts
export default {
  // Plugin options go here
}
config/plugins/robojs/cli.mjs
export default {
  // Plugin options go here
}

How it works

The @robojs/cli plugin is a build-time only plugin. It has no runtime lifecycle hooks — it only runs during robo build:

  1. Route discovery — Robo scans src/cli/ for command files
  2. Manifest generation — Commands are indexed with metadata (description, options, parent-child relationships)
  3. Code generation — The build/complete hook generates .robo/build/cli.js
  4. Executable output — The generated file is marked as executable (chmod 755)

Route config

The plugin's route definition controls how files are scanned and processed:

Prop

Type

Generated entry point

After robo build, the plugin generates .robo/build/cli.js. This file:

  • Has a #!/usr/bin/env node shebang for direct execution
  • Imports all command handlers from the build output
  • Registers each command with the Command class from robo.js/cli.js
  • Reads name, version, and description from your package.json
  • Includes auto-generated help via the -h / --help flag

Next steps

On this page