Coder CLI commands for workspace management, templates, and platform operations
/plugin marketplace add jovermier/claude-code-plugins-ip-labs/plugin install coder@ip-labs-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Comprehensive knowledge of Coder CLI commands for managing workspaces, templates, and the Coder platform. This skill enables you to help users interact with their Coder deployment from the command line.
Coder is a self-hosted cloud development environment (CDE) platform that allows organizations to provision secure, consistent, and efficient remote development workspaces. Key features:
| Component | Description | Analogy |
|---|---|---|
| Templates | Terraform blueprints defining dev environments (OS, tools, resources) | Recipe |
| Workspaces | Running environments created from templates | Cooked meal |
| Users | Developers who launch and work in workspaces | People eating |
| Tasks | AI-powered coding agents running inside workspaces | Smart kitchen appliance |
The coder CLI is the primary interface for interacting with Coder deployments.
coder [global-flags] <subcommand>
| Flag | Environment Variable | Description |
|---|---|---|
--url <url> | $CODER_URL | Coder deployment URL |
--token <string> | $CODER_SESSION_TOKEN | Authentication token |
-v, --verbose | $CODER_VERBOSE | Enable verbose output |
--no-version-warning | $CODER_NO_VERSION_WARNING | Suppress version mismatch warnings |
--global-config <path> | $CODER_CONFIG_DIR | Config directory (default: ~/.config/coderv2) |
# Log in to a Coder deployment
coder login <deployment-url>
# Log out
coder logout
# Check who you are authenticated as
coder whoami
# Create a workspace from a template
coder create --template="<template-name>" <workspace-name>
# Create with specific parameters
coder create --template="<template-name>" --var="key=value" <workspace-name>
# Create with rich parameters (JSON)
coder create --template="<template-name>" --rich-parameter-file=params.json <workspace-name>
Workspace naming rules:
new or create as names# List all workspaces
coder list
# List with filters
coder list owner:me
coder list status:running
coder list template:my-template
coder list owner:me status:running
# Available filters:
# - owner:me or owner:<username>
# - name:<workspace-name>
# - template:<template-name>
# - status:<status> (e.g., running, stopped, failed)
# - outdated:true
# - dormant:true
# - has-agent:connecting|connected|timeout
# - id:<uuid>
# Show workspace resources and connection info
coder show <workspace-name>
# Display resource usage for current workspace
coder stat
# Start a workspace
coder start <workspace-name>
# Stop a workspace
coder stop <workspace-name>
# Restart a workspace (stop then start)
coder restart <workspace-name>
# Update a workspace to latest template version
coder update <workspace-name>
# Force re-entry of template variables (useful for broken workspaces)
coder update <workspace-name> --always-prompt
# Update without starting
coder update <workspace-name> --dry-run
# Rename a workspace
coder rename <old-name> <new-name>
# Delete a workspace
coder delete <workspace-name>
# Open a workspace in browser
coder open <workspace-name>
# Ping a workspace (check connectivity)
coder ping <workspace-name>
# Schedule automated start/stop times
coder schedule <workspace-name> <schedule>
# Example: Mon-Fri, 9 AM to 5 PM UTC
coder schedule my-workspace "09:00-17:00 America/Los_Angeles"
# Start a shell into a workspace
coder ssh <workspace-name>
# Run a command in a workspace
coder ssh <workspace-name> -- command
# Configure SSH host entries
coder config-ssh
# Port forwarding
coder port-forward <workspace-name> <local-port>:<workspace-port>
# Show resource usage for current workspace
coder stat
# Run network speed test
coder speedtest <workspace-name>
# List templates
coder templates list
# Show template details
coder templates show <template-name>
# Create a template from examples
coder templates init
# Push a template to Coder deployment
coder template push <template-name> -d <directory>
# Update an existing template
coder template update <template-name> -d <directory>
# Initialize a new template from examples
coder templates init
# Available examples include:
# - Docker (container-based workspaces)
# - Kubernetes (pod-based workspaces)
# - AWS EC2 (full VM workspaces)
# - Terraform provider examples
# Pull Terraform state for debugging
coder state pull <username>/<workspace-name>
# Push modified state (CAUTION: can corrupt state)
coder state push <username>/<workspace-name>
# Used for manual Terraform state repairs
# Add workspace to favorites
coder favorite <workspace-name>
# Remove from favorites
coder unfavorite <workspace-name>
# Toggle auto-update policy for a workspace
coder autoupdate <workspace-name> enable
coder autoupdate <workspace-name> disable
# When enabled, workspace auto-updates to latest template version on start
# Forward ports from workspace to local machine
coder port-forward <workspace-name> <local-port>:<workspace-port>
# For reverse port forwarding, use SSH
coder ssh -R <remote-port>:localhost:<local-port> <workspace-name>
# Apply dotfiles repository to personalize workspace
coder dotfiles <git-repository-url>
# Automatically applied on workspace start if configured
# List personal access tokens
coder tokens list
# Create a new token
coder tokens create
# Delete a token
coder tokens delete <token-id>
# Start a Coder server
coder server
# Server flags include:
# --address <bind-address>
# --port <port>
# --tls-enable
# --tls-cert-file <path>
# --tls-key-file <path>
# Print network debug information
coder netcheck
# Tests DERP and STUN connectivity
Coder stores logs at these locations in workspaces:
| Service | Location |
|---|---|
| Startup script | /tmp/coder-startup-script.log |
| Shutdown script | /tmp/coder-shutdown-script.log |
| Agent | /tmp/coder-agent.log |
Logs are truncated at 5MB.
1. Workspace won't start after template update
# Re-enter template parameters
coder update <workspace-name> --always-prompt
2. State corruption
# Manual state repair (admin only)
coder state pull <username>/<workspace-name>
# Make changes
coder state push <username>/<workspace-name>
3. Connection issues
# Check connectivity
coder ping <workspace-name>
coder netcheck
Note: Bulk operations are a Premium feature.
# In the UI, select multiple workspaces and use Actions dropdown:
# - Bulk start
# - Bulk stop
# - Bulk update
# - Bulk delete
Key environment variables for Coder CLI:
export CODER_URL="https://coder.example.com"
export CODER_SESSION_TOKEN="<your-token>"
export CODER_VERBOSE=false
export CODER_CONFIG_DIR="~/.config/coderv2"
# Find my running workspaces
coder list owner:me status:running
# Find outdated workspaces
coder list outdated:true
# Find dormant workspaces
coder list dormant:true
# Find workspaces with agents connecting
coder list has-agent:connecting
# Combine filters
coder list owner:me status:running template:python-dev
# Example: Run tests in workspace before commit
coder ssh my-workspace -- npm test
# Start workspace for CI job
coder start ci-workspace --wait
# Run commands
coder ssh ci-workspace -- ./ci-script.sh
# Stop when done
coder stop ci-workspace
coder stat to track workspace usageCoder supports AI coding agents running inside workspaces:
# Tasks require templates with `coder_ai_task` resource
# View tasks in workspace UI under "Tasks" tab
# Tasks can be managed via Coder deployment UI
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Activates when the user asks about Agent Skills, wants to find reusable AI capabilities, needs to install skills, or mentions skills for Claude. Use for discovering, retrieving, and installing skills.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.