sshepherd
できること
AIエージェントが、パスワードや接続情報を見ることなく、SSH経由でリモートサーバーを操作できるようにします。サーバーの状態確認、Dockerなどのサービス管理、ファイルの編集、データベースへの問い合わせができます。
使う場面
- ✓サーバーが正常に動いているか(ディスク、メモリ、CPU)を確認したいとき。
- ✓Dockerのサービスを再起動したり、ログを見たりしたいとき。
- ✓サーバー上の設定ファイルを読んだり編集したりしたいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/sshepherd/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“「my-prod-server」の状態を確認して、「web-app」サービスを再起動してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
サーバーへの接続情報は、チャットの外で一度だけ設定します(エイリアスのような名前を付けます)。そのあとAIにそのエイリアスを使ってもらい、状態の確認やサービスの管理などの特定のコマンドを実行してもらいます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
sshepherd
Overview
sshepherd is a compiled Bun/TypeScript CLI that lets an agent operate a real remote server over SSH — health checks, docker/systemd service control, log tailing, config file edits, read-only Postgres introspection, and declarative deploys — without ever seeing a password, private key, hostname, username, or port. Every operation shells out to the system ssh binary through a single transport path and returns the same typed Envelope<T> (ok, alias, data, error), never a raw terminal dump. The agent passes only a name — an ssh alias, a Postgres target, or a deploy recipe — that resolves entirely outside the process.
When to Use This Skill
- Use when you need to check a remote server's health (disk, memory, CPU, ports, OOM history) without handing the agent SSH credentials.
- Use when working with remote docker or systemd services — listing, inspecting, or restarting them — or tailing their logs.
- Use when the user asks to read or edit a remote config file, run a declarative deploy from a named recipe, introspect a remote Postgres database read-only, or audit SSH/security posture on a box.
How It Works
Step 1: Declare targets once, outside any prompt
Every connection detail is declared ahead of time and never appears on the command line: ssh aliases in ~/.ssh/config, Postgres targets in ~/.config/sshepherd/targets.toml, deploy recipes in recipe TOML files. OpenSSH resolves the real HostName/User/Port/IdentityFile internally.
Step 2: Invoke a group + action by name
This repository does not ship the sshepherd executable. The user must install or build a reviewed upstream release outside the current workspace and provide its explicit absolute path. Verify it is an executable regular file, not a symlink, before use. Never auto-discover or execute ./dist/sshepherd from the repository being operated on.
sshepherd <group> <action> [positionals...] [--flag value]
Nine command groups — hosts, check, logs, services, deploy, config, db, files, security — 52 ops total. Output is JSON to stdout by default; add --pretty for a human-readable table/key-value view. The response only ever echoes back the alias it was given — there is no host/user/port/ip field anywhere in the response type, structurally.
Step 3: Discover the command surface
"/absolute/path/to/sshepherd" --help # list groups
"/absolute/path/to/sshepherd" check --help # list actions + flags for one group
Examples
Example 1: Server health overview
"/absolute/path/to/sshepherd" check overview lms-server
Returns a JSON envelope with disk, memory, CPU, listening ports, and OOM history for the host behind the lms-server alias — the agent never learns the host's address.
Example 2: Restart a docker service and tail its logs
"/absolute/path/to/sshepherd" services restart lms-server --name api
"/absolute/path/to/sshepherd" logs tail lms-server --name api --lines 100
Example 3: Read-only Postgres introspection
"/absolute/path/to/sshepherd" db tables prod
prod is a pg-target name that resolves to how to reach psql on a host — never a database password. psql runs inside the target container, authenticated by peer/trust/.pgpass already on the remote.
Best Practices
- ✅ Declare every alias/target/recipe ahead of time in
~/.ssh/config/targets.toml/ recipe TOML — never inline connection details. - ✅ Pass only names (alias, pg-target, recipe) to the CLI; let OpenSSH own authentication.
- ✅ Use
--prettyfor human review and default JSON output for machine parsing. - ❌ Don't try to inject a hostname, user, port, or password into a command — the CLI has no field for them.
- ❌ Don't reach for the
ssh2npm library or hand-rolled SSH; the whole point is delegating to the trusted systemsshbinary.
Limitations
- This skill does not replace environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, or safety boundaries are missing.
- Requires the system OpenSSH client and pre-declared aliases/targets/recipes; it cannot connect to a host that has not been configured outside the agent.
- Postgres access is read-only introspection by design.
Security & Safety Notes
…
よくある質問
AIに私のパスワードやSSHキーが見えてしまいますか?
いいえ。AIは、事前に設定した「エイリアス」だけを使います。実際の接続情報は、お使いのシステムが安全に管理します。
AIはどのサーバーにアクセスするかをどうやって判断しますか?
事前に設定ファイルでサーバーごとに「エイリアス」を定義しておきます。AIはこのエイリアスを使って、接続先のサーバーを判断します。
サーバー上で何でもできますか?
サービスの管理、ログの確認、ファイルの編集、データベースへの問い合わせができます。サーバーの状態を変える操作(再起動など)には、追加の確認が必要です。
詳細
作者による元の説明
Zero-knowledge SSH ops CLI — server health checks, docker/systemd control, log tailing, Postgres introspection, and declarative deploys, without ever exposing credentials to the agent.
人気
- GitHubのスター
- 48k
- ランキング
- #6302
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。