Skip to main content

Add Custom Commands

Atmos can be easily extended to support any number of custom CLI commands. For example, imagine you wanted to add a command like atmos reload-database, you can do that with custom commands.

Custom commands are defined in the commands section in atmos.yaml CLI configuration file.

TIP:

Refer to Atmos Custom Commands for more information about Atmos Custom Commands

In this Quick Start guide, we'll define two custom commands to list the Atmos stacks in the infrastructure and the components in the stacks.

atmos.yaml

# Custom CLI commands
commands:
- name: ip
description: Return my current IP
steps:
- curl -s https://ifconfig.me
- echo

# Use Nested Custom Commands
- name: "github"
commands:
- name: "status"
description: This command returns the number of stargazers for a GitHub repository
steps:
- curl -s https://www.githubstatus.com/api/v2/status.json | jq -r .status.description

Run the following Atmos command to get the current GitHub status.

>
atmos github status
All Systems Operational

Run the following Atmos command to retrieve your current public IP address.

>
atmos ip
13.37.13.37

Want to go deeper on this topic?

Custom commands can accept flags, arguments, and even advanced templating. Learn More