Ops CLI Manual

CLI Manual

This is the manual for the ops CLI.

Name

ops - interact with the CTO.ai platform from your terminal

Synopsis

ops COMMAND [arguments]

Description

ops is the CLI that allows you to interactively run CTO.ai workflows, configure environment variables, and manage your team from the command line.

General Commands

This section highlights some important utility subcommands available through the CTO.ai ops CLI.

ops help
ops help COMMAND

List all available commands and usage instructions.

Arguments
COMMAND

name of the command to get help for

ops update

Update your local CLI to the latest version.

ops whoami

Display basic information about the current user, including the email and username associated with this account, as well as the name of the current active team.

ops generate:token

Generate a long live access token.

ops cleanup
ops cleanup WORKFLOW

Clean up locally cached docker images.

Arguments
WORKFLOW

the workflow to be cleaned up

Workflow Commands

Here is a short summary of the subcommands available through the CTO.ai ops CLI that can be used to manage and run your workflows.

Managing Workflows

ops init
ops init NAME

Create a new Workflow.

This command allows you to create new Commands, Pipelines, or Services workflows interactively from your command line. It will generate scaffolding code according to the options you select.

Arguments
NAME

name of the workflow to create or the GitHub URL of a template

Options
-j
--jobs

generate local template files for Pipeline jobs

-k
--kind =KIND

specify a command, pipeline, or service workflow

-t
--template =TEMPLATE

specify the name of the template to use

ops list

Lists the Workflows you have in your team.

ops search
ops search FILTER

Search for available workflows.

Search for workflows that have been published to your team or shared publicly in our Registry. Running this command without the optional FILTER argument will allow you to search for workflows interactively.

Arguments
FILTER

filters workflow results to include results with the FILTER in their name

ops add
ops add WORKFLOW_NAME

Add a Commands, Pipelines, or Services workflow to your team.

Use this command when you want to add a workflow to your team that is available through another team or our public registry. This will add the command from the public registry to your team.

Running this command without a WORKFLOW_NAME allows you to select a workflow to add interactively.

Arguments
WORKFLOW_NAME

name of the public workflow to add to your team

ops build
ops build PATH

Build your Commands, Pipelines, or Services workflows locally, to run or publish.

Arguments
PATH

path to the workflow to be built

Options
--nocache

don’t use cache when building image

--ops =WORKFLOWS

list of workflows from the ops.yml file to build

Usage Examples
ops build ./ops.yml --ops commandName pipelineName serviceName

This command will build the workflows named commandName, pipelineName, and serviceName from the ops.yml file in the local directory.

ops publish
ops publish PATH

Publish a local workflow to your current CTO.ai team.

Arguments
PATH

path to the workflow to be published

Options
-c
--changelog =MSG

provide a changelog message describing the changes being published

-o
--ops =WORKFLOWS

provide the list of workflows you wish to publish

--nocache

do not use cache when building the image

ops certs
ops certs CERTIFICATE_TYPE
ops certs CERTIFICATE_TYPE NAME_OR_PATH

Save an SSL certificate and key for your service. This is used to configure HTTPS for your CNAME.

Arguments
CERTIFICATE_TYPE

the type of certificate to save

NAME_OR_PATH

the name or path of the ops.yml which shold be used to save the certificate

Options
--cert-file =FILE

path to your certificate file

--key-file =FILE

path to your key file

ops remove
ops remove WORKFLOW

Remove a workflow from your CTO.ai team.

Arguments
WORKFLOW

name and version of the workflow to remove from your team (e.g. my-command:0.1.0). Do not pass a workflow version to this argument if using the --all flag.

Options
--all =ALL

remove all versions of a workflow from your current team

Running Workflows

ops run
ops run NAME_OR_PATH
ops run NAME_OR_PATH PARAMS

Run a workflow from your team or the registry.

If the workflow being run expects parameters, you can send them with this command.

Arguments
NAME_OR_PATH

name or local path of the workflow to run

PARAMS

optional parameters to send to the workflow

Options
-B
--batch

runs your workflow in non-interactive batch mode

-b
--build

build the workflow before running it

--nocache

do not use cache when building the image

ops start
ops start NAME_OR_PATH

Start a service, pipeline or command on our cloud.

Arguments
NAME_OR_PATH

name or local path of the workflow to run

ops status

See the status of currently running cloud services.

ops stop
ops stop RUNID

Stop a Command, Pipeline, or Service running on the CTO.ai platform.

Arguments
RUNID

the Run ID of the Command, Pipeline, or Service to stop

Account Commands

Here is a short summary of the subcommands available for managing your account on the CTO.ai platform.

ops account:reset

Reset your account password.

ops account:signin

Log in to your account.

Running this command triggers a browser-based signin flow that allows you to log in to your account as your would on the web, as well as sign in with OAuth providers like GitHub.

Options
-i
--interactive =INTERACTIVE

run in interactive mode

-p
--password =PASS

send your password as an optional argument

-u
--user =USER

send your username as an optional argument

-t
--team =TEAM

specify which team to sign in to

ops account:signout

Log out from your account.

ops account:signup

Creates an account from the CLI.

Running this command triggers a browser-based signup flow that allows you to create an account as your would on the web, as well as sign in with OAuth providers like GitHub.

ops account:support

Displays the methods you can use to contact our support team with questions.

Configs Commands

Here is a short summary of the subcommands available for managing your Configs Store on the CTO.ai platform.

ops configs:list

List all the keys that are in the Configs Store for the active team.

ops configs:set

Add a key-value pair to the Configs Store for the active team.

When this command is run without any arguments, it will interactively prompt you for a key. Then, it opens an editor to specify the value for this key-value pair, allowing you to specify values with complex content, like JSON objects.

The optional --key argument allows you to specify the key to set directly on the command line, without being prompted interactively.

The --from-file and --value arguments allow you to specify the value to set, from either an existing plaintext file containing the value (using --from-file) or directly on the command line (using --value).

Options
-f
--from-file =FILE

specify a file containing a value for this Config

-k
--key =KEY

the KEY representing the Config you wish to set

-v
--value =VALUE

directly specify a value to be set for this Config

ops configs:delete

Delete a Config stored for the active team

When this command is run without any arguments, it will interactively prompt you for the key of the Config to delete.

Options
-k
--key =KEY

specify the KEY of the Config to be deleted

Secrets Commands

Here is a short summary of the subcommands available for managing your Secrets Store on the CTO.ai platform.

ops secrets:list

List all the keys that are in the Secret Store for the active team.

The values of Secrets are kept hidden for security reasons.

ops secrets:set

Add a key-value pair to the Secret Store for the active team.

When this command is run without any arguments, it will interactively prompt you for a key. Then, it opens an editor to specify the value for this key-value pair, allowing you to specify values with complex content, like JSON objects.

The optional --key argument allows you to specify the key to set directly on the command line, without being prompted interactively.

The --from-file and --value arguments allow you to specify the value to set, from either an existing plaintext file containing the value (using --from-file) or directly on the command line (using --value).

Using the --value parameter isn’t recommended, as the value you specify will be visible in your shell history. Instead, use the --from-file parameter to specify the contents of a file as the Secret’s value.

Options
-f
--from-file =FILE

specify a file containing a value for this Secret

-k
--key =KEY

the KEY representing the Secret you wish to set

-v
--value =VAL

directly specify a value to be set for this Secret

ops secrets:delete

Delete a secret stored for the active team

When this command is run without any arguments, it will interactively prompt you for the key of the Secret to delete.

Options
-k
--key =KEY

specify the KEY of the secret to be deleted

ops secrets:register

Register a secrets provider for the active team.

This feature allows you to register your own HashiCorp Vault, which we will then use to manage Secrets for your team.

ops secrets:unregister

Unregister a secrets provider for the active team.

This feature allows you to unregister the custom Secrets provider from your active team.

Team Commands

Here is a short summary of the subcommands available for managing your team on the CTO.ai platform.

ops team:info

Shows basic team information for the current active team.

ops team:switch
ops team:switch TEAMNAME

Switch which team is currently active in your CLI context.

If you don’t pass the optional TEAMNAME argument, this command will present a list of teams you belong to and allow you to choose which one to switch to interactively.

Arguments
TEAMNAME

optionally pass the name of the team to switch to

ops team:create

Create a new team on the CTO.ai platform.

Options
-n
--name =NAME

the name of the team to be created

ops team:invite

Invite users to join your CTO.ai team.

Options
-i
--invitees =INVITEES

A comma-separated string of usernames or emails to invite to the team. We recommend surrounding the value in quotes.

ops team:join

Accept an invite to join a team.

ops team:leave

Remove yourself from the current active team.

ops team:list

Shows the list of your teams.

ops team:remove
ops team:remove MEMBER

Remove a user from your team.

Arguments
MEMBER

optionally pass the username of the team member to be removed