Okteto CLI Reference

The Okteto Command Line Interface is a unified tool to manage your cloud native environments.

Installation information is available here.

Synopsis

1
okteto [options] <command> <subcommand> [parameters]

Use okteto command --help for information on a specific command. The synopsis for each command shows its parameters and their usage. Optional parameters are shown in square brackets.

Options

--loglevel (debug, info, warn, error).

The amount of information outputted (defaults to warn).

Available commands

analytics

Enable / Disable analytics collection. Analytics are enabled by default.

1
okteto analytics [parameters]

Options

--disable Disables analytic collection

Okteto only collects information to help us understand how our users interact with the product. We don’t collect any personally identifiable information.

When you use the okteto CLI, the following information is collected:

  • The name of the action
  • A timestamp of when it was run
  • Your version of the CLI
  • Your OS
  • An anonymous machine ID (we use https://github.com/denisbrodbeck/machineid for this)
  • An action ID (to correlate multiple actions performed during a command’s execution).

Please reach out to us if you have any questions or concerns about the information collected.

create

Automatically creates the okteto manifest file. Okteto will scan the current folder and will create a default manifest file based on your programming language and platform.

1
okteto create

Options

--file (string) The path to the manifest file to create (default “okteto.yml”)

diagnostics

Generates a set of logs and diagnostic information. Please be sure to include the generated file when contacting the Okteto team.

The diagnostic bundle includes:

  • The logs generated by okteto and the file synchronization service
  • The configuration files generated by okteto
  • The name, paths and ports used by your active cloud development environments
  • The version of okteto, and the version of your OS

Neither your source code nor your deployment manifests are included in the diagnostics bundle. Please reach out to us if you have any questions or concerns about the information collected.

desk

Your work environment extended into your Kubernetes cluster. Extended documentation for this command is available here.

down

Deactivates your cloud native development environment, stops the file synchronization service, and restores your previous deployment configuration.

1
okteto down

The down command should be run from the folder where you ran okteto up.

exec

Executes the COMMAND directly in the active cloud native environment corresponding to the current folder. The command will fail if there’s no active environment.

1
okteto exec COMMAND

For more complex commands we recommend using a double dash (--) before the command parameter.

1
okteto exec -- COMMAND

The exec command should be run from the folder where you ran okteto up.

help

Displays the full help

1
okteto help

list

Displays the active cloud native development environments and their status

1
okteto list

The command will display the following information for each active environment:

  • Name: The name of the environment. It’s formed with the namespace, deployment and container used when creating the cloud development environment.
  • Source: The folder used by the environment.
  • Completion: The percentage of files synchronized.
  • Errors: File synchronization issues will be displayed here.

run

Runs a script from your okteto manifest file directly in the active cloud native environment corresponding to the current folder. The command will fail if there’s no active environment, or if the script is not declared in the manifest.

1
okteto run SCRIPT

The run command should be run from the folder where you ran okteto up.

Options

--file (string) The path to the manifest file (default “okteto.yml”)

up

Activate your cloud native development environment

1
okteto up

When you run okteto up, okteto will swap the specified deployment with your development environment. A development environment is a copy of your existing kubernetes deployment with the following improvements:

  • The container specified on your okteto manifest (or the first one, if none is specified) will be swapped with your development container
  • Automatic file synchronization from your machine to your development environment.
  • Automatic port-forwarding
  • Errors and logs are directly displayed in your terminal window

Once your cloud native development environment is active, you can execute commands directly in your cluster with okteto exec and okteto run. Run okteto down to restore your original deployment

Options

--file (string) The path to the manifest file (default “okteto.yml”)
--namespace (string) The kubernetes namespace to use (defaults to the current kube config namespace)

version

Displays the current installed version.

1
okteto version