Install
openclaw skills install @abhhfcgjk/work-over-sshopenclaw skills install @abhhfcgjk/work-over-sshWork on a remote Git repository while the agent runs locally. Use the local OpenSSH client for inspection and commands, and apply reviewed Git patches for edits. Do not require Codex, OpenClaw, Hermes, SSHFS, or an agent runtime on the remote host.
Use scripts/remote_workspace.py for connection checks, bounded reads,
environment-aware commands, and checked patch application.
Before the first connection, read references/usage.md.
Require the invocation to state the SSH server, absolute remote project path,
and environment name or path. Accept none only when the project has no
dedicated environment. If any field is missing, ask for it before running SSH.
Use this skill when:
Do not use this skill when the repository is already available locally or when the platform's native remote-project integration is installed and preferred.
Local requirements declared in metadata:
sshpython3Remote requirements:
sed and mktemp.git for repository checks and patch application.conda only when a Conda environment is selected.Require key-based authentication or another non-interactive method already configured by the user. Never request or store passwords, private keys, tokens, or key contents.
Set HELPER once for the active runtime:
# OpenClaw / ClawHub
HELPER="{baseDir}/scripts/remote_workspace.py"
# Hermes Agent (use this assignment instead)
HELPER="${HERMES_SKILL_DIR}/scripts/remote_workspace.py"
Hermes expands ${HERMES_SKILL_DIR} when it loads the skill. OpenClaw expands
{baseDir}. Confirm test -f "$HELPER" before the first command.
Obtain:
none.Run the preflight:
python3 "$HELPER" check HOST /absolute/project
Completion criteria:
connected.cwd matches the requested project.git prints the repository root rather than not-a-repository.If preflight fails, report the exact SSH error. Do not change host keys, SSH configuration, authentication, or firewall settings without explicit user authorization.
Inspect pyproject.toml, requirements*.txt, environment.yml, conda.yml,
.python-version, .venv/, venv/, and project documentation. Use the
environment named by the user or documentation. Ask when several plausible
environments remain.
Each helper command creates a new SSH process. Supply the environment option on every Python, test, lint, or package command that needs it.
Use an absolute path or a path relative to the remote project root:
python3 "$HELPER" exec \
--venv .venv HOST /absolute/project -- \
python -c 'import sys; print(sys.executable)'
python3 "$HELPER" exec \
--venv .venv HOST /absolute/project -- \
python -m pytest
python3 "$HELPER" exec \
--conda-name app HOST /absolute/project -- \
python -c 'import sys; print(sys.executable)'
python3 "$HELPER" exec \
--conda-prefix /opt/conda/envs/app HOST /absolute/project -- \
python -m pytest
The helper uses conda run; it does not rely on activation persisting. If
conda is absent from the non-interactive SSH PATH, add
--conda-executable /absolute/path/to/conda before HOST.
Run Git inspection and patch operations without an environment option. Do not
source .env automatically or create, update, or install packages into an
environment unless the user requests it.
Prefer bounded, one-shot commands:
python3 "$HELPER" exec \
HOST /absolute/project -- git status --short
python3 "$HELPER" exec \
HOST /absolute/project -- rg -n PATTERN .
python3 "$HELPER" read \
HOST /absolute/project path/to/file --start 1 --end 240
Use exec ... -- sh -lc '...' only when pipes, redirects, expansion, or
compound shell syntax are necessary. Quote the whole shell program as one local
argument.
For an interactive program, start ssh -tt HOST in a persistent terminal and
send later input to that same session. Keep file inspection and editing in the
one-shot workflow unless interactivity is essential.
git status --short; completion means every pre-existing change is
identified.git apply.python3 "$HELPER" apply-patch \
HOST /absolute/project /local/change.patch
The helper sends the patch over stdin, runs git apply --check, and applies it
only when the check succeeds. It does not commit.
Do not edit remote files with sed -i, redirection, inline Python, or heredocs.
Do not overwrite an entire file when a focused patch is possible. Do not stash,
reset, clean, force-push, restart services, migrate data, or deploy unless the
user explicitly requests that action.
git diff --check and git diff --stat remotely.Completion means every modified file is accounted for and every requested validation result is reported, including failures or commands that could not run.
Read-only inspection and ordinary requested build/test commands are in scope. Treat package installation, privilege escalation, service control, deployment, database mutation, and destructive Git or filesystem operations as separate actions requiring clear user authorization.
Never weaken host-key checking. Never use StrictHostKeyChecking=no. Never
expose an SSH shell or agent server directly to the public network.
--venv, --conda-name, or
--conda-prefix to every environment-dependent command.git status --short first and preserve
unrelated changes.git apply --check.git diff --check passed or its failure was reported.