Menu Command
Create a dynamic CLI menu command.
The command.yaml
file
This file represents a dynamically created CLI command, a folder containing the command.yaml
file is treated as a CLI menu command of its own.
The content of the file dictates how the command will appear on the CLI menu and how to interact with it.
name: <command-name>
description: <command-long-description>
command:
use: <cli-usage>
short: <cli-short-description>
Task | Description |
---|---|
name |
Command name |
description |
Command description |
command.use |
CLI menu command usage keyword |
command.short |
CLI menu short description |
Example:
name: "Infrastructure team"
description: "Provisioning actions for: backoffice, developement and production"
command:
use: "team-infra"
short: "Infrastructure team provisioning actions"
Sub-commands preset
Every menu command derived from the command.yaml
file will contain a preset of sub-commands. Those sub-commands interact with the actions or workflows defined in the instructions.yaml
file of the respective folder.
Task | Description |
---|---|
run |
Run an action non-interactively |
select |
Select an action using an interactive menu |
status |
Check status validity of available actions |
Interactive command
The select
sub-command should be used when you wish to start an interactive menu selection for action or workflow.
Example:
anchor team-infra select
Non-interactive command
The run
sub-command should be used when you wish to run an action or workflow directly, skipping the selection menu.
Action:
anchor team-infra run backoffice --action=install-jenkins-master
Workflow:
anchor team-infra run backoffice --workflow=provision-jenkins-server-agents
run
command appears on every action or workflow information panel when using an interactive selection menu.