Repo Runner (run a GitHub project)
Goal: given a GitHub URL or a downloaded folder, get the project running as its docs intend, without guessing dangerously.
Inputs to ask for
- Repo source: GitHub URL (preferred) or local path
- Target:
dev(local dev server) /build/test - Constraints: allow installing deps? allow running postinstall scripts? allow Docker?
Safety rules (must follow)
- Treat repo code as untrusted.
- Before running
npm/pnpm/yarn install(or anycurl | bash), ask for confirmation. - Never paste or store secrets. If
.envis needed, ask user to provide values out-of-band.
Workflow
-
Clone / prepare workspace
- Clone to
<openclaw-workspace>/projects/<repo>(createprojects/if missing) - Typical workspace path is
$HOME/.openclaw/workspace, but don’t assume. - If already exists, ask before
git pullor deleting anything.
- Clone to
-
Find the canonical docs
- Prefer
README.md+docs/+CONTRIBUTING.md - Extract: prerequisites (Node/Python/Docker/Go/Rust), install steps, env vars, run command(s), ports.
- Prefer
-
Detect project type(s)
- From the
repo-runnerskill directory (typically<openclaw-workspace>/skills/repo-runner), run:bash scripts/detect_project.sh <repoDir> - A repo can match multiple types (e.g.
type=node+type=docker). Use docs to choose the canonical path.
- From the
-
Set up prerequisites
- Verify required runtimes exist (Node/pnpm/yarn, Python, Docker, Go, Rust)
- If missing, propose options (install locally, use Docker, or switch to a supported env)
-
Configure env
- If
.env.exampleexists, copy to.envonly after confirmation - Ask user to fill required keys
- If
-
Install dependencies (after confirmation, based on project type)
-
Node (when
package.jsonexists)- Prefer lockfile-safe commands:
pnpm install --frozen-lockfile(ifpnpm-lock.yaml)yarn install --frozen-lockfile(ifyarn.lock)npm ci(ifpackage-lock.json)
- If unsure, run:
bash scripts/suggest_node_commands.sh <repoDir>
- Prefer lockfile-safe commands:
-
Python (when
pyproject.toml/requirements.txtexists)- Create and use a virtualenv (don’t install into system Python).
- Typical patterns (follow docs first):
python -m venv .venv && source .venv/bin/activatepip install -r requirements.txt- If
pyproject.toml: use the tool specified by docs (commonlypoetry installorpip install -e .).
-
Rust (when
Cargo.tomlexists)cargo build/cargo test/cargo run(follow docs for features/flags)
-
Go (when
go.modexists)go test ./...go run .orgo build ./...(follow docs for main package path)
-
Docker (when
docker-compose.yml/Dockerfileexists)- Prefer the documented compose path when present:
docker compose up(ordocker-compose updepending on docs)
- Prefer the documented compose path when present:
-
-
Run
- Use the docs’ recommended run target (dev server, CLI, compose stack, etc.)
- Capture logs, detect common failures, iterate
Common outputs to report back
- Exact commands run (copy/paste friendly)
- URL/port to open
- Next steps (build/test) and known caveats