using-coder-clilisted
Install: claude install-skill shekohex/dotai
# Using Coder CLI
Pin the deployment, identity, and workspace before acting. The installed binary is the source of truth because Coder commands and flags vary by version.
## Process
1. Learn the current CLI before using an unfamiliar command:
```bash
command -v coder
coder version
coder --help
coder <command> --help
```
Do not guess syntax from examples when current help differs.
2. Pin the deployment and authenticated identity:
```bash
coder whoami
coder --url "$deployment_url" whoami
```
Inside a Coder workspace, inspect only non-secret context:
```bash
if [ -n "${CODER_WORKSPACE_NAME:-}" ]; then
printf 'deployment=%s\nworkspace=%s/%s\n' \
"${CODER_URL:-unknown}" \
"${CODER_WORKSPACE_OWNER_NAME:-unknown}" \
"$CODER_WORKSPACE_NAME"
fi
```
If authentication is missing, use `coder login <url>` in a user-visible interactive terminal. For automation, use an inherited `CODER_SESSION_TOKEN`. Never print, request, read from config, or place a token on the command line; never run `coder login token`.
This step is complete when the exact deployment URL and username are known.
3. Discover workspaces read-only first:
```bash
coder list
coder show "$workspace"
```
Default `coder list` scope is the current owner. Use `--all` only when the task requires other owners and the identity has permission. Use the exact returned identifier; prefer `owner/workspace` when ownership is not implicit.
For machine-readable inventory, filter before displaying it:
```bash
co