| name | coder-workspace-management |
| description | Coder CLI commands for workspace management, templates, and platform operations |
| updated | "2026-01-15T00:00:00.000Z" |
Coder Workspace Management Skill
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.
What is Coder?
Coder is a self-hosted cloud development environment (CDE) platform that allows organizations to provision secure, consistent, and efficient remote development workspaces. Key features:
- Self-hosted: Deploy on your own cloud or on-premises infrastructure
- Terraform-based: Templates define infrastructure as code
- Multiple IDEs: VS Code, JetBrains, Jupyter, and more
- Kubernetes-native: Built for scalable containerized environments
- AI-Ready: Built-in support for AI coding agents (like Claude Code)
Core Concepts
| 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 |
Coder CLI Overview
The coder CLI is the primary interface for interacting with Coder deployments.
Basic Usage
coder [global-flags] <subcommand>
Global Flags
| 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) |
Authentication
coder login <deployment-url>
coder logout
coder whoami
Workspace Commands
Creating Workspaces
coder create --template="<template-name>" <workspace-name>
coder create --template="<template-name>" --var="key=value" <workspace-name>
coder create --template="<template-name>" --rich-parameter-file=params.json <workspace-name>
Workspace naming rules:
- Must start and end with a letter or number
- Only letters, numbers, and hyphens allowed
- 1-32 characters
- Case-insensitive (lowercase recommended)
- Cannot use
new or create as names
- Must be unique within your workspaces
Listing Workspaces
coder list
coder list owner:me
coder list status:running
coder list template:my-template
coder list owner:me status:running
Viewing Workspace Details
coder show <workspace-name>
coder stat
Starting and Stopping Workspaces
coder start <workspace-name>
coder stop <workspace-name>
coder restart <workspace-name>
Updating Workspaces
coder update <workspace-name>
coder update <workspace-name> --always-prompt
coder update <workspace-name> --dry-run
Workspace Lifecycle
coder rename <old-name> <new-name>
coder delete <workspace-name>
coder open <workspace-name>
coder ping <workspace-name>
Workspace Scheduling
coder schedule <workspace-name> <schedule>
coder schedule my-workspace "09:00-17:00 America/Los_Angeles"
SSH Access
coder ssh <workspace-name>
coder ssh <workspace-name> -- command
coder config-ssh
coder port-forward <workspace-name> <local-port>:<workspace-port>
Background Services
coder stat
coder speedtest <workspace-name>
Template Commands
Managing Templates
coder templates list
coder templates show <template-name>
coder templates init
coder template push <template-name> -d <directory>
coder template update <template-name> -d <directory>
Template Development
coder templates init
State Management
coder state pull <username>/<workspace-name>
coder state push <username>/<workspace-name>
Workspace Metadata
coder favorite <workspace-name>
coder unfavorite <workspace-name>
Auto-Update Management
coder autoupdate <workspace-name> enable
coder autoupdate <workspace-name> disable
Port Forwarding
coder port-forward <workspace-name> <local-port>:<workspace-port>
coder ssh -R <remote-port>:localhost:<local-port> <workspace-name>
Dotfiles Management
coder dotfiles <git-repository-url>
Tokens Management
coder tokens list
coder tokens create
coder tokens delete <token-id>
Server Operations
coder server
Troubleshooting Commands
Network Debugging
coder netcheck
Logs
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.
Common Issues
1. Workspace won't start after template update
coder update <workspace-name> --always-prompt
2. State corruption
coder state pull <username>/<workspace-name>
coder state push <username>/<workspace-name>
3. Connection issues
coder ping <workspace-name>
coder netcheck
Bulk Operations
Note: Bulk operations are a Premium feature.
Environment Variables
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"
Workspace Filtering Examples
coder list owner:me status:running
coder list outdated:true
coder list dormant:true
coder list has-agent:connecting
coder list owner:me status:running template:python-dev
Integration with Development Workflows
Pre-commit Hooks
coder ssh my-workspace -- npm test
CI/CD Integration
coder start ci-workspace --wait
coder ssh ci-workspace -- ./ci-script.sh
coder stop ci-workspace
Best Practices
- Use templates: Define environments in templates for consistency
- Schedule shutdowns: Reduce costs by auto-stopping idle workspaces
- Enable auto-update: Keep workspaces current with template changes
- Monitor resources: Use
coder stat to track workspace usage
- Use filters: Efficiently find and manage workspaces
- Secure tokens: Use environment variables for session tokens
Coder Tasks (AI Agents)
Coder supports AI coding agents running inside workspaces:
Additional Resources