Files
coder/docs/reference/cli/index.md
T
Ehab Younes d807abc2e3 feat: honor --use-keyring together with --global-config (#32392)
An explicit --use-keyring flag or CODER_USE_KEYRING value now selects the
keyring backend even when --global-config points at a custom directory.
When --use-keyring is left at its default, a custom --global-config still
selects file storage so existing callers keep finding <dir>/session.

Removes the test-only RootCmd.UseKeyringWithGlobalConfig override and the
duplicate clitest.NewWithDefaultKeyringCommand helper.

Closes CLI-1, #29105
2026-11-20 19:02:08 +03:00

17 KiB
Generated

title, description, icon_path
title description icon_path
Command Line Reference for the Coder command-line interface, with usage and flags for every command. ./images/icons/terminal.svg

Usage

coder [global-flags] <subcommand>

Description

Coder — A tool for provisioning self-hosted development environments with Terraform.
  - Start a Coder server:

     $ coder server

  - Get started by creating a template from an example:

     $ coder templates init

Subcommands

Name Purpose
completion Install or update shell completion scripts for the detected or chosen shell.
dotfiles Personalize your workspace by applying a canonical dotfiles repository
external-auth Manage external authentication
login Authenticate with Coder deployment
logout Unauthenticate your local session
netcheck Print network debug information for DERP and STUN
notifications Manage Coder notifications
oauth2-provider Manage Coder OAuth2 provider settings
organizations Organization related commands
port-forward Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R".
publickey Output your Coder public key used for Git operations
reset-password Directly connect to the database to reset a user's password
secret Manage secrets
sharing Commands for managing shared workspaces
state Manually manage Terraform state to fix broken workspaces
templates Manage templates
tokens Manage personal access tokens
users Manage users
version Show coder version
autoupdate Toggle auto-update policy for a workspace
config-ssh Add an SSH Host entry for your workspaces "ssh workspace.coder"
create Create a workspace
delete Delete a workspace
favorite Add a workspace to your favorites
list List workspaces
logs View logs for a workspace
open Open a workspace
ping Ping a workspace
rename Rename a workspace
restart Restart a workspace
schedule Schedule automated start and stop times for workspaces
show Display details of a workspace's resources and agents
speedtest Run upload and download tests from your machine to a workspace
ssh Start a shell into a workspace or run a command
start Start a workspace
stat Show resource usage for the current workspace.
stop Stop a workspace
unfavorite Remove a workspace from your favorites
update Will update and start a given workspace if it is out of date. If the workspace is already running, it will be stopped first.
whoami Fetch authenticated user info for Coder deployment
support Commands for troubleshooting issues with a Coder deployment.
server Start a Coder server
provisioner View and manage provisioner daemons and jobs
ai-gateway Manage AI Gateway
agent-firewall Network isolation tool for monitoring and restricting HTTP/HTTPS requests
workspace-proxy Workspace proxies provide low-latency experiences for geo-distributed teams.
features List license features and entitlements
licenses Add, delete, and list licenses
groups Manage groups
prebuilds Manage Coder prebuilds
external-workspaces Create or manage external workspaces

Options

--url

Property Value
Type url
Environment $CODER_URL

URL to a deployment.

--debug-options

Property Value
Type bool

Print all options, how they're set, then exit.

--token

Property Value
Type string
Environment $CODER_SESSION_TOKEN

Specify an authentication token. For security reasons setting CODER_SESSION_TOKEN is preferred.

--no-version-warning

Property Value
Type bool
Environment $CODER_NO_VERSION_WARNING

Suppress warning when client and server versions do not match.

--no-feature-warning

Property Value
Type bool
Environment $CODER_NO_FEATURE_WARNING

Suppress warnings about unlicensed features.

--allow-redirects

Property Value
Type bool
Environment $CODER_ALLOW_REDIRECTS

Follow HTTP redirects from the server instead of returning an error. Following redirects may alter the request method and/or drop its body.

--header

Property Value
Type string-array
Environment $CODER_HEADER

Additional HTTP headers added to all requests. Provide as key=value. Can be specified multiple times.

--header-command

Property Value
Type string
Environment $CODER_HEADER_COMMAND

An external command that outputs additional HTTP headers added to all requests. The command must output each header as key=value on its own line. If a header value is a JWT, it will be refreshed based on the value in its exp field.

--force-tty

Property Value
Type bool
Environment $CODER_FORCE_TTY

Force the use of a TTY.

-v, --verbose

Property Value
Type bool
Environment $CODER_VERBOSE

Enable verbose output.

--flight-recorder-size

Property Value
Type int
Environment $CODER_FLIGHT_RECORDER_SIZE
Default 10

Number of log entries below the current log level to keep in memory and emit on errors. Set to 0 to disable the flight recorder.

--disable-direct-connections

Property Value
Type bool
Environment $CODER_DISABLE_DIRECT_CONNECTIONS

Disable direct (P2P) connections to workspaces.

--disable-network-telemetry

Property Value
Type bool
Environment $CODER_DISABLE_NETWORK_TELEMETRY

Disable network telemetry. Network telemetry is collected when connecting to workspaces using the CLI, and is forwarded to the server. If telemetry is also enabled on the server, it may be sent to Coder. Network telemetry is used to measure network quality and detect regressions.

--client-tls-ca-file

Property Value
Type string
Environment $CODER_CLIENT_TLS_CA_FILE

Path to a CA certificate file to trust for API and DERP connections.

--client-tls-cert-file

Property Value
Type string
Environment $CODER_CLIENT_TLS_CERT_FILE

Path to a client certificate file for mTLS authentication with API and DERP. Requires --client-tls-key-file.

--client-tls-key-file

Property Value
Type string
Environment $CODER_CLIENT_TLS_KEY_FILE

Path to a client private key file for mTLS authentication with API and DERP. Requires --client-tls-cert-file.

--use-keyring

Property Value
Type bool
Environment $CODER_USE_KEYRING
Default true

Store and retrieve session tokens using the operating system keyring. File-based storage is used when keyring usage is not supported on the current platform, or when --global-config is set and this option is not. Set to false to force file-based storage on supported platforms.

--global-config

Property Value
Type string
Environment $CODER_CONFIG_DIR
Default ~/.config/coderv2

Path to the global coder config directory.