config

Configure local CLI settings.

The config command allows you to change Op CLI behaviors.

background_timeout

The background_timeout setting determines the number of seconds that an Op statement has to complete execution and return a result before a background job is created.

  • Default value: 5
  • Minimum value: 0
  • Maximum value: 30
op>
config set background_timeout 3
Set config[background_timeout]: 3

cli

cli.prompt

Changes the Op CLI terminal prompt. Accepts optional dynamic values.

op>
config set cli.prompt "op:${{auth.customer}}-${{auth-region}}-${{auth.cluster}}>"

cli.title

Set the terminal window title when using the Op CLI.

op>
config set cli.title "op:${{auth.user}}-${{auth.customer}}-${{auth-region}}-${{auth.cluster}}>"

hide

Hides the specified column.

op>
host
 ID | TYPE | NAME                | REGION    | AZ         | INSTANCE_TYPE
 1  | HOST | i-04044936c39eda37d | us-west-2 | us-west-2a | m5.large
 2  | HOST | i-0d3387a577ce97721 | us-west-2 | us-west-2b | m5.large
 3  | HOST | i-0e337ff0fc470d7fd | us-west-2 | us-west-2a | m5.large

Use hide to remove the instance_type field:

op>
config hide resources.fields.instance_type
op>
host
 ID | TYPE | NAME                | REGION    | AZ
 1  | HOST | i-04044936c39eda37d | us-west-2 | us-west-2a
 2  | HOST | i-0d3387a577ce97721 | us-west-2 | us-west-2b
 3  | HOST | i-0e337ff0fc470d7fd | us-west-2 | us-west-2a

list

Lists all current config settings in YAML format.

op>
config list
cli:
  prompt: op:${{auth.customer}}-${{auth.region}}-${{auth.cluster}}>
  title: ${{auth.user}}:${{auth.customer}}-${{auth.region}}-${{auth.cluster}}
debug: false
history_size: 100
json:
  show: false
logfile: ./op-session.log
table:
  alias:
    '': value
    exit_status: status
  color: true
  max_row_style: pager
  max_rows: auto
  sections:
  ...

set

Set a specific value, using dot-syntax based on the YAML config tree returned from list.

For example, by default the table.show property is set to true, so issuing most CLI commands returns a table result.

op>
pod
 ID  | TYPE | NAME                                  | REGION    | AZ
  11  | POD  | monitoring.test2c-node-exporter-5bzpm | us-west-2 | us-west-2a
  12  | POD  | kube-system.fluentd-gqnvp             | us-west-2 | us-west-2a
  13  | POD  | kube-system.aws-node-n8t5r            | us-west-2 | us-west-2a

However, using the set function you can set table.show to false to hide the table output entirely.

op>
config set table.show false
Now the pod Resource query displays nothing.
op>
pod

show

Displays the specified column.

op>
host
 ID | TYPE | NAME                | REGION    | AZ
 1  | HOST | i-04044936c39eda37d | us-west-2 | us-west-2a
 2  | HOST | i-0d3387a577ce97721 | us-west-2 | us-west-2b
 3  | HOST | i-0e337ff0fc470d7fd | us-west-2 | us-west-2a

Use show to display the instance_type field:

op>
config show resources.fields.instance_type
op>
host
 ID | TYPE | NAME                | REGION    | AZ         | INSTANCE_TYPE
 1  | HOST | i-04044936c39eda37d | us-west-2 | us-west-2a | m5.large
 2  | HOST | i-0d3387a577ce97721 | us-west-2 | us-west-2b | m5.large
 3  | HOST | i-0e337ff0fc470d7fd | us-west-2 | us-west-2a | m5.large

table

table.max_row_style

Valid values:

  • file: Default filename is table-data.txt
  • pager
  • truncate

table.max_rows

Determines the maximum number of rows displayed in the standard view. Exceeding this value shows the paginated view automatically.

Valid values:

  • integer
  • auto
  • off

timing

The timing flag shows the execution timing of issued Op commands. It is primarily used for debugging.

Valid values:

  • true
  • false

With timing enabled, commands display execution time in milliseconds:

op>
hosts
-- Executed Execute() in 150 ms --
 ID | TYPE | NAME                | REGION    | AZ
 1  | HOST | i-0e95acb5362fedaf5 | us-west-2 | us-west-2b
 2  | HOST | i-0d66949e63d67dd3e | us-west-2 | us-west-2c
 3  | HOST | i-0a626b11673eb6368 | us-west-2 | us-west-2a