goto-remote-command
Project-native tool for running batch commands on remote servers.
Install
mkdir -p .claude/skills/goto-remote-command && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18597" && unzip -o skill.zip -d .claude/skills/goto-remote-command && rm skill.zipInstalls to .claude/skills/goto-remote-command
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use this skill in the goto/goterm project when an agent needs to execute remote commands over SSH with the goto CLI, debug batch remote execution, preserve raw stdout/stderr/exit status, or update remote-command docs, tests, or behavior.Key capabilities
- →Execute remote commands over SSH with `goto` CLI
- →Debug batch remote execution
- →Preserve raw stdout/stderr/exit status
- →Update remote-command documentation
- →Update remote-command tests
- →Update remote-command behavior
How it works
This skill uses the `goto` CLI to execute commands on remote hosts over SSH, preserving raw output and exit status. It supports batch execution and various authentication methods.
Inputs & outputs
When to use goto-remote-command
- →Run command on remote server
- →Debug batch execution
- →Execute uptime checks
- →Manage remote server connections
About this skill
Goto Remote Command
Purpose
Use goto as the project-native SSH command runner. Prefer it over ad hoc ssh, expect, or custom shell glue when the task is about this repo's remote command behavior.
Core Contract
- The command name is
goto;gotermis legacy naming only. - Batch mode is host-first:
goto <name|ip[:port]|expr|pattern> <cmd...>. - If no positional command and no
-cmdare provided, batch mode can read the command from stdin. - Batch mode must write only remote stdout to local stdout and remote stderr to local stderr.
- Batch mode must exit with the remote command's exit status.
- Local connection logs, host selection logs, and other agent narration must not mix into raw command output unless
-vis explicitly requested. initcmdsis interactive-only. Do not run it in batch mode.- Interactive mode uses PTY +
sess.Shell(). Batch mode usessess.Run(cmd)without PTY.
How To Execute Remote Commands
From this repository, build or run the CLI with normal Go tooling:
go run . <host> uptime
go run . -cmd='uname -a' <host>
echo 'df -h' | go run . <host>
go run . -j <jump-host> <host> uptime
go run . -cred=vm <host> uptime
go run . -setup-nopass -p=vm <host>
For an installed binary:
goto <host> uptime
goto -cmd='uname -a' <host>
echo 'df -h' | goto <host>
goto -j <jump-host> <host> uptime
goto -cred=vm <host> uptime
goto -setup-nopass -p=vm <host>
Use -v only when debugging the connection path, because it intentionally enables verbose local logs:
goto -v <host> uptime
Hosts And Auth
Primary config path:
~/.ssh/goto.yaml
Legacy fallback:
~/.goterm/config.yaml
Config shape:
creds:
- name: vm
user: root
pass: password
keypath: ~/.ssh/id_rsa
hosts:
- name: vm1
host: 10.47.120.11
cred: vm
port: 22
initcmds: "sudo su -\n"
Auth rules:
-poverrides the password for a single command.- If
-pmatches a configured credential name, reuse that credential's user, password, and keypath unless-useror-keypathexplicitly overrides them. -cred=<name>selects a configured credential for auth and fails if it does not exist.-show-cred=<name>prints credential info and exits.- If
-pdoes not match a credential name, treat the value as a plain password. -p base64:<value>decodes a base64 password.pass: base64:<value>is also supported in config.- If password is empty,
gotouses key-based auth. keypathis a private key path, for example~/.ssh/id_rsa, not a.pubfile.- Quote
pass:values ingoto.yamlwhen they contain YAML special characters such as%. - Inline targets can include user and port:
[email protected]:2222. -jenables a jump host. The jump host is resolved from local config or inlineuser@host:port.- Host config can set
jump: <name>as the default jump host for that target. - Explicit
-joverrides the host configjump. - Jump host auth is key-only; its config
passis ignored. - Do not read config from the jump host. Target and jump host config both come from the local config file.
Setup Nopass Login
Use setup mode to install the selected local public key on the target and create an OpenSSH config entry:
goto -setup-nopass -p=vm 10.47.120.11
goto -setup-nopass -force -p=vm 10.47.120.11
Known-good hhy example:
$ goto -setup-nopass -p=hhy 10.248.26.16
nopass login configured: 10.248.26.16 -> [email protected]:22
Behavior:
-setup-nopassappends the selected public key to remote~/.ssh/authorized_keysidempotently.- The selected key is the credential
keypath, explicit-keypath, or default~/.ssh/id_rsa. - The main
~/.ssh/configis given a top-levelInclude config.d/*line when missing. - Generated host entries are written one file per host/IP under
~/.ssh/config.d/<host>. - If the exact
Hostentry already exists in the main config or another included file, setup stops. -forcereplaces only the generated per-host file for that exact host; it does not overwrite manual config elsewhere.
Editing The Implementation
Important files:
main.go: CLI flags, host-first argument parsing, stdin command fallback, password decoding, exit-status propagation.nopass.go:-setup-nopasspublic-key installation and generated OpenSSH config entries.ssh/ssh.go: SSH session setup, jump host tunneling, interactive shell, batchRun, stdout/stderr wiring, key auth.config/config.go: config search order and host/credential lookup.README.md: user-facing examples should matchgoto -h.
When changing batch execution, keep the interactive and batch paths separate:
interactive: Start -> connect -> RequestPty -> Shell -> initcmds
batch: Run -> connect -> sess.Run(cmd)
Do not add wrappers that capture, reformat, prefix, trim, or summarize remote stdout/stderr unless the user explicitly asks for a new output mode.
Validation
Run focused local checks after editing:
go test ./...
go run . -h
go run . -V
For output-contract checks, use a real reachable host from the user's config when available:
goto <host> 'printf out; printf err >&2; exit 7'
echo $?
Expected behavior:
- stdout contains exactly
out. - stderr contains exactly
err. - local exit code is
7.
If no reachable host is available, state that remote validation was not run and report the local tests that did run.
Safety
- Do not invent hostnames, passwords, or private key paths.
- Do not print secrets from config or command flags.
- Ask before running destructive remote commands such as
rm, disk formatting, service restarts, or package upgrades unless the user has clearly requested that action. - Prefer read-only probes for diagnosis:
hostname,uptime,id,pwd,df -h,uname -a, or targetedsystemctl status.
When not to use it
- →Using ad hoc `ssh`, `expect`, or custom shell glue
- →Running `initcmds` in batch mode
- →When debugging connection path without `-v`
Limitations
- →The command name is `goto`; `goterm` is legacy naming only
- →Batch mode must write only remote stdout to local stdout and remote stderr to local stderr
- →`initcmds` is interactive-only; not for batch mode
How it compares
This skill provides a project-native `goto` CLI for remote command execution, ensuring consistent behavior and output preservation for debugging, unlike generic SSH clients or custom scripts.
Compared to similar skills
goto-remote-command side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| goto-remote-command (this skill) | 0 | 24d | Review | Intermediate |
| upgrading-golang | 1 | 4mo | Review | Intermediate |
| gentleman-system | 1 | 6mo | Review | Intermediate |
| agent-module-architecture | 2 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
upgrading-golang
chainloop-dev
Upgrades Go version across the entire Chainloop codebase including source files, Docker images, CI/CD workflows, and documentation. Use when the user mentions upgrading Go, golang version, or updating Go compiler version.
gentleman-system
Gentleman-Programming
System detection and command execution patterns for Gentleman.Dots. Trigger: When editing files in installer/internal/system/, adding OS support, or modifying command execution.
agent-module-architecture
TencentBlueKing
Agent 构建机模块架构指南(Go 语言),涵盖 Agent 启动流程、心跳机制、任务领取执行、升级更新、与 Dispatch 交互。当用户开发 Agent 功能、修改心跳逻辑、处理任务执行或实现 Agent 升级时使用。
gentleman-installer
Gentleman-Programming
Installation step patterns for Gentleman.Dots TUI installer. Trigger: When editing installer.go, adding installation steps, or modifying the installation flow.
go-agent-development
TencentBlueKing
Go Agent 开发指南,涵盖 Agent 架构设计、心跳机制、任务执行、日志上报、升级流程、与 Dispatch 模块交互。当用户开发构建机 Agent、实现任务执行逻辑、处理 Agent 通信或进行 Go 语言开发时使用。
opencode-cli
SpillwaveSolutions
This skill should be used when configuring or using the OpenCode CLI for headless LLM automation. Use when the user asks to "configure opencode", "use opencode cli", "set up opencode", "opencode run command", "opencode model selection", "opencode providers", "opencode vertex ai", "opencode mcp servers", "opencode ollama", "opencode local models", "opencode deepseek", "opencode kimi", "opencode mistral", "fallback cli tool", or "headless llm cli". Covers command syntax, provider configuration, Vertex AI setup, MCP servers, local models, cloud providers, and subprocess integration patterns.