Build ChatOps Workflows with the CTO.ai CLI

The CTO.ai ops CLI acts as the integration point between your command line workflows and the CTO.ai platform, providing a framework for implementing ChatOps-based workflows that integrate with your existing processes. It allows you to build, publish, and run Commands, Pipelines, and Services workflows from the comfort of your terminal, manage your Configs and Secrets stores, and invite members to your CTO.ai team.

Conversational Workflows

You can interact with our Developer Control Plane any number of ways—from threads on Slack, comments on GitHub pull requests, or the CTO.ai Dashboard—but if you prefer a more traditional command line experience for managing your infrastructure, you can use the CTO.ai CLI to abstract away much of the routine needed to deploy your application using Infrastructure-as-Code tooling.

Install and Configure Our CLI

Using our CLI requires that you have Node (≥16) and Docker installed on your local machine. The ops CLI itself is installed via NPM as a global package:

After the package for the CLI has finished installing, you can simply run the ops command to confirm that it has been installed.

Example output from running the `ops` CLI command with no subcommand or arguments.
Example output from running the `ops` CLI command with no subcommand or arguments.

You should see something like the above screenshot if our CLI has been installed correctly.

Using the CLI

To use the CTO.ai ops CLI, you will need to have an account on the CTO.ai platform. You can run ops account:signup to create a new account or ops account:signin to gain access to your existing account:

In either case, the CLI will redirect you to the CTO.ai Dashboard to access or create your account; once you sign in to an account, you will be directed to return to your terminal to use your signed-in account.

List of All Commands

For an in-depth explanation of what functionality is supported by the ops CLI, visit our CLI Commands page! Below is a summary of our CLI, with each command listed:

General Commands

ops help
List all available commands and usage instructions.
ops update
Update The Ops CLI.
ops whoami
Display your user information
ops generate:token
Generate a long live access token.
ops certs
Save an SSL certificate and key for your service
ops cleanup
Clean up locally cached docker images.

Workflow Commands

ops init
Create a new Workflow
ops list
Lists the Workflows you have in your team.
ops search
Search for workflows in our registry.
ops add
Add a workflow to your team.
ops build
Build your workflow for sharing.
ops publish
Publish a workflow to your team.
ops remove
Remove a workflow from your team.
ops run
Run a workflow from your team or the registry.
ops start
Start a service, pipeline or command on our cloud.
ops status
See the status of currently running cloud services
ops stop
Stop a service, pipeline or command running in The Ops Cloud

Team Commands

ops team:info
Shows basic team information for the team you are currently on.
ops team:switch
Switch your currently active team.
ops team:create
Create your team.
ops team:invite
Invite your team members.
ops team:join
Accept an invite to join a team.
ops team:leave
Leave current team.
ops team:list
Shows the list of your teams.
ops team:remove
Remove your team members.

Configs Commands

ops configs:list
List all the configs that are stored for the active team
ops configs:set
Add a new config key and value
ops configs:delete
Delete a config stored for the active team

Secrets Commands

ops secrets:list
List all the keys that are stored for the active team
ops secrets:set
Add a key and value
ops secrets:delete
Delete a secret stored for the active team
ops secrets:register
Register a secrets provider for a team
ops secrets:unregister
Unregister a secrets provider for a team