code-server-ops-cli
v0.1.1
Published
CLI for code-server-ops. Cron-friendly inspection + Preview→Confirm mutations over a self-hosted code-server.
Downloads
500
Maintainers
Readme
code-server-ops-cli
Cron-friendly CLI (csops) for code-server-ops. Wraps the code-server-ops-agent REST API.

Install
npm install -g code-server-ops-cliConfigure
export CSOPS_URL=http://code-server-host:4242
export CSOPS_PASSWORD=your-agent-passwordUsage
# Inspect
csops terminals list --orphan-only --older-than 24h
csops extensions list --orphan-only
csops memory show
# Mutate (all commands show a preview; pass --yes to commit)
csops terminals kill 3355247 --yes
csops terminals kill-orphans --older-than 24h --yes
csops extensions gc --yes
csops memory restart-ext-host --yes
# Cron-friendly
csops terminals list --orphan-only --older-than 7d --json | jq '.[].pid' | \
xargs -I {} csops terminals kill {} --yes --jsonCommands
| Command | Description |
|---|---|
| terminals list [--orphan-only] [--older-than <dur>] [--json] | List shell-integration bashes. |
| terminals kill <pid> [--yes] [--json] | Preview → SIGKILL a single PID. |
| terminals kill-orphans [--older-than <dur>] [--yes] [--json] | Bulk kill orphans. |
| extensions list [--orphan-only] [--json] | List extension folders vs registry. |
| extensions gc [--yes] [--json] | Preview → rm -rf all orphan folders. |
| memory show [--json] | Print current ext-host RSS. |
| memory watch [-i <seconds>] | Poll and print on interval. |
| memory restart-ext-host [--yes] [--json] | Preview → SIGTERM ext host (code-server respawns it). |
Every destructive command runs a server-side Preview first and requires the --yes flag to commit with the returned confirmation token.
License
MIT. See LICENSE.
