Agent Skill and capability overview
xops-agent teaches Skill-capable AI assistants (such as Claude Code, Codex, and Cursor) how to operate XOps CLI. After reading the skill instructions, the assistant runs xops commands directly in its own command environment and inspects the results.
Skill and MCP are independent workflows—using the Skill does not require running xops mcp serve or registering MCP tools.
Quick installation and usage
First install XOps in the assistant's command environment and prepare SSH configuration, trusted host keys, and accessible credentials. Then install the Skill:
npx skills add https://github.com/wentf9/xops-cli --skill xops-agentFor manual installation, copy the complete skills/xops-agent/ directory into your client's skill directory, keeping SKILL.md and references/ intact (updating files in this repository checkout does not automatically update copies installed elsewhere).
Once installed, you can ask the assistant to handle tasks in plain language:
- “Use xops-agent to check disk usage on all hosts tagged
weband list any failed nodes.” - “Read
web-01's application config, change the port, and verify the updated file.” - “Distribute the local
assetsdirectory to hosts taggedwebwithout overwriting existing files.” - “Forward remote port 3000 through
web-01, verify the web page, then close the tunnel.” - “Turn these deployment steps into a Playbook and preview targets and step order with
--dry-runfirst.”
On-demand reference files inside the Skill:
| File | Contents |
|---|---|
references/inventory.md | Hosts, identities, tags, credentials, and offline-store maintenance |
references/execution.md | Single-host/batch commands, scripts, Playbooks, and interactive terminals |
references/files.md | Reading/writing files, directory operations, SCP/SFTP, and transfer verification |
references/networking.md | Tunnel process management and network connectivity |
CLI capability overview
| Area | CLI entry points | Typical Skill workflow |
|---|---|---|
| Initialization & OpenSSH import | init | Check existing config; initialize or import ~/.ssh/config when needed |
| Hosts, identities, aliases & tags | host, identity | Query nodes, bulk-import CSV, add/edit/delete records, and manage tags |
| Credentials & offline vaults | credential, identity credential | Check store health, configure credentials, and run requested migrations, rotations, recovery, or cleanup |
| SSH connections & elevation | ssh, exec --sudo | Select identity, port, and ProxyJump; allocate a terminal or escalate via sudo/su |
| Single-host & batch commands | exec | Select targets by host, tag, or host file, bound concurrency, and inspect per-host output |
| File reading, writing & directories | exec, batch sftp | Read bounded content, write/append, list, create, copy, move, and remove |
| File & directory transfers | scp, sftp | Upload, download, relay between hosts, distribute by tag, set overwrite policy, and verify |
| SSH tunnels & proxies | ssh -L/-R/-D -N | Track tunnel processes/sessions, verify listeners and target services, stop, and confirm release |
| Declarative orchestration | play | Combine shell, script, copy, ensure, and template steps; preview with --dry-run before running |
| Interactive terminal UI | tui | Visual terminal management, SSH sessions, and real-time monitoring |
| Service administration & discovery | mcp serve/recover, version, help, completion | Manage MCP services when explicitly requested or inspect CLI help |
Note:
host import --templateexports a blank CSV template rather than your existing inventory. See the command reference andxops <command> --helpfor full options.
Execution semantics and operational boundaries
- Native passthrough default (
server): Ordinary commands are sent directly to the remote SSH shell without an implicitbash -l -cwrapper. Write command syntax for the target's actual shell (Windows hosts no longer require Bash just for default commands). - Explicit interpreters and inheritance: Global config, nodes, Playbook
settings.execution, and steps all acceptexecution. Explicitbash,sh,zsh,fish,powershell,pwsh, orcmdadapters require a compatiblelaunch_dialectdescribing the remote outer shell (not the assistant's local OS).--no-loginretains its non-login Bash compatibility meaning. - Scripts and on-demand probing: Local scripts require a supported interpreter and known launch dialect (allowlisted
sh/bash/zsh/fishshebangs select the interpreter but do not prove a POSIX outer dialect; scripts without a reliable interpreter or with a UTF-8 BOM fail before execution). Playbookscript/ensuresteps without a shebang and SFTPexecwith a nonemptycwdprobe unspecified execution settings on demand and cache the result per connection; explicit interpreters (includingserver) are never overridden (savedserver/cmdderives a temporary CMD adapter for SFTPcwd, while other explicitserversettings reject a nonemptycwd). - Entry-point combinations & flags: Explicit CLI execution flags on
exec(--interpreter,--launch-dialect,--login-shell) combine with--shell(scripts),--sudo,--stream, and--out-dir(scripts and elevation supportbash/sh/zsh/fish); explicit execution flags onsshare supported across Linux, macOS, and Windows by validating host I/O capabilities.host addandhost importsupport--interpreter,--launch-dialect, and--probe/--no-probeduring enrollment. - Local environment & paths: Local file paths and listener ports belong to the machine running
xops(a container or remote sandbox is not the user's desktop). Interactive and batch SFTP both parse single/double quotes and backslash escapes—paths with spaces can be enclosed in quotes or backslash-escaped.
Mapping MCP tools to CLI commands
When operating through the Skill, the assistant runs the CLI commands in the right column directly:
| MCP tool | Equivalent CLI workflow |
|---|---|
nodes | xops host list (optionally with --tag) |
terminal (session: "once") | xops exec --host NODE -c COMMAND (optionally with --sudo); directory operations also use target-native commands via exec |
terminal (named persistent session) | No direct equivalent; each CLI exec is independent, use the interactive xops ssh terminal when needed |
file (read/write/patch/stat) | Target-native read/write commands via exec, or batch sftp; use scp for large or binary files |
gui | No CLI equivalent |
Stdio transfer (push/pull) | Upload/download files and directories with xops scp or batch sftp |
HTTP transfer (prepare_push/prepare_pull/status/cancel) | Transfer directly with xops scp, check the exit status and destination file, and cancel by stopping the owned process |
Stdio tunnel (create/list/status/stop) | xops ssh -L/-R -N (CLI also supports -D SOCKS5; manage lifecycle via the owned process/session) |
Lifecycle and authorization differences: The CLI does not create MCP transfer IDs, tunnel IDs, or TTLs, and there is no
xops tunnel listcommand; killing a transfer process does not roll back bytes already written. Skill-driven CLI commands follow the assistant's own command-execution authorization—clarify targets, overwrite scope, or network exposure first whenever they are ambiguous.