#Cloning new github project with openclaw setup
1 messages · Page 1 of 1 (latest)
NinaChan: yes, you can clone another GitHub project somewhere under the OpenClaw workspace, but I’d avoid mixing it directly into the same directory as the OpenClaw workspace files like AGENTS.md, SOUL.md, MEMORY.md, etc.
First, please check your version since setup details can differ:
openclaw --version
Recommended layout:
~/.openclaw/workspace/ # OpenClaw agent workspace / memory / instructions
~/.openclaw/workspace/projects/my-app/ # your new cloned project
# or cleaner:
~/projects/my-app/ # your project repo
If you want the project inside the OpenClaw workspace:
mkdir -p ~/.openclaw/workspace/projects
cd ~/.openclaw/workspace/projects
git clone <your-github-repo-url> my-app
cd my-app
If you want OpenClaw’s active working directory to be that project, set the workspace explicitly:
openclaw setup --workspace ~/projects/my-app
That will make OpenClaw seed/use workspace files there. Only do this if you’re okay with OpenClaw files living in that repo. Usually I prefer keeping OpenClaw’s memory workspace separate and putting code repos under a projects/ folder.
Important bits:
- Don’t clone your new project inside the OpenClaw source checkout unless you’re actually modifying OpenClaw itself.
- Don’t commit
~/.openclaw/openclaw.json, credentials, sessions, tokens, or auth files. - If Docker/WSL is involved, run the clone from the same Ubuntu/container environment where the Gateway/tools will operate, so paths match what the agent can see.
- If the workspace is already a git repo, cloning another repo directly at the root will make nested git weird. Use a subfolder.
Docs:
https://docs.openclaw.ai/concepts/agent-workspace
https://docs.openclaw.ai/cli/setup
https://docs.openclaw.ai/gateway/sandboxing
Send the output of openclaw --version and the path you currently cloned OpenClaw into, and I can give you the exact commands for your layout.
version output: OpenClaw 2026.5.12
path openclaw is cloned into: /home/metallicmay/.openclaw
NinaChan thanks, that helps.
With OpenClaw 2026.5.12 and /home/metallicmay/.openclaw, I’d keep your new project in a subfolder, not at the root of .openclaw.
Use this:
mkdir -p /home/metallicmay/.openclaw/workspace/projects
cd /home/metallicmay/.openclaw/workspace/projects
git clone <your-github-repo-url> my-project
cd my-project
Then ask OpenClaw to work on that project by giving the full path in your prompt, for example:
Work in /home/metallicmay/.openclaw/workspace/projects/my-project and inspect the repo.
I would not clone the new repo directly into:
/home/metallicmay/.openclaw
That directory also contains OpenClaw state/config/workspace data, and mixing a project repo into the root can get confusing quickly.
One important check: if you literally cloned the OpenClaw source repo into /home/metallicmay/.openclaw, that’s not the usual layout. Normally .openclaw is state/config, while source checkouts go somewhere like:
~/projects/openclaw
~/openclaw
For your app/code project, the safest setup is:
/home/metallicmay/.openclaw/workspace/ # OpenClaw instructions/memory
/home/metallicmay/.openclaw/workspace/projects/app # your cloned project
After cloning, run:
cd /home/metallicmay/.openclaw/workspace/projects/my-project
git status
If that works, you’re set. Docs for the workspace model are here: https://docs.openclaw.ai/concepts/agent-workspace
yes you're right the project is cloned into: /home/metallicmay/openclaw
but workspace is in .openclaw
where do i clone the new project?
Clone the new project somewhere separate from the OpenClaw source checkout.
Best choice:
mkdir -p /home/metallicmay/projects
cd /home/metallicmay/projects
git clone <your-github-repo-url> my-project
Then tell OpenClaw the project path when you ask it to work:
Work in /home/metallicmay/projects/my-project
That keeps the three things clean:
/home/metallicmay/openclaw # OpenClaw source repo
/home/metallicmay/.openclaw # OpenClaw config/state/workspace
/home/metallicmay/projects/my-project # your new app/repo
If your OpenClaw tools are sandboxed and can only see the workspace, use this instead:
mkdir -p /home/metallicmay/.openclaw/workspace/projects
cd /home/metallicmay/.openclaw/workspace/projects
git clone <your-github-repo-url> my-project
My recommendation: start with /home/metallicmay/projects/my-project. If OpenClaw says it cannot access that path, move/clone it under .openclaw/workspace/projects/ or adjust sandbox/workspace access later.
ok if i set up the project outside of openclaw in a separate directory, how do i configure openclaw to use that path? give me a sample configuration
Use agents.defaults.workspace if you want OpenClaw’s default working directory to be the new project.
Example project path:
/home/metallicmay/projects/my-project
Set it with the CLI:
openclaw config set agents.defaults.workspace "/home/metallicmay/projects/my-project"
openclaw config get agents.defaults.workspace
openclaw setup --workspace /home/metallicmay/projects/my-project
Or the equivalent in ~/.openclaw/openclaw.json is:
{
agents: {
defaults: {
workspace: "/home/metallicmay/projects/my-project",
},
},
}
Then restart the gateway so new sessions pick it up:
openclaw gateway restart
Important tradeoff: OpenClaw workspace files like AGENTS.md, SOUL.md, TOOLS.md, HEARTBEAT.md, and possibly memory files will now live in that project directory. That’s fine if this repo is your agent’s main working repo, but don’t commit private OpenClaw memory/instructions to a public project by accident.
If you want to keep OpenClaw memory separate, don’t change the config. Keep:
/home/metallicmay/.openclaw/workspace # OpenClaw memory/instructions
/home/metallicmay/projects/my-project # your code repo
Then just tell OpenClaw: Work in /home/metallicmay/projects/my-project. That’s the cleaner setup for most people.
Docs: https://docs.openclaw.ai/concepts/agent-workspace and https://docs.openclaw.ai/gateway/configuration-reference#agentsdefaultsworkspace
ok
how do i upgrade my version of openclaw first?
For your setup, use the built-in updater first. It should detect whether your install is npm/global or the source checkout.
Run this from WSL/container shell:
openclaw update --dry-run
openclaw update
openclaw doctor
openclaw health
If the gateway does not restart cleanly after the update, run:
openclaw gateway restart
openclaw health
Since you also have the source repo at /home/metallicmay/openclaw, if openclaw update says it cannot handle the install type, use the source/manual path:
cd /home/metallicmay/openclaw
git pull
pnpm install
pnpm build
openclaw gateway restart
openclaw doctor
openclaw health
Do not use clawdbot update for this; that’s a config modernization wizard, not the code/package updater.
Docs: https://docs.openclaw.ai/install/updating
If any command fails, paste the exact error plus which openclaw and openclaw --version.
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ pnpm install
Command 'pnpm' not found, did you mean:
command 'npm' from deb npm (9.2.0~ds1-2)
Try: sudo apt install <deb name>
That just means pnpm is not installed/enabled in that WSL/container environment yet.
First check Node:
node --version
OpenClaw source builds need Node 22+. If Node is OK, enable pnpm through Corepack:
corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
Then retry the source update/build:
cd /home/metallicmay/openclaw
git pull
pnpm install
pnpm build
pnpm ui:build
openclaw gateway restart
openclaw doctor
openclaw health
If corepack itself is missing or fails, use this fallback to install pnpm:
npm install -g pnpm
pnpm --version
I would avoid sudo apt install pnpm here; the apt package can lag behind and cause weird build issues.
Docs: https://docs.openclaw.ai/install and https://docs.openclaw.ai/install/updating
do i need to run these commands also through docker exec?
Run the update/build commands in the same environment that actually runs OpenClaw.
If your Gateway runs inside Docker, then yes, use docker exec into that container:
docker ps
docker exec -it <container-name-or-id> bash
cd /home/metallicmay/openclaw
node --version
corepack enable
corepack prepare pnpm@latest --activate
pnpm install
pnpm build
pnpm ui:build
openclaw gateway restart
If your Gateway runs directly in WSL Ubuntu and Docker is only installed/available, then do not use docker exec; run the commands directly in WSL, like you were doing at:
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$
Quick way to tell:
openclaw health
docker ps
which openclaw
If docker ps shows an OpenClaw container that is running your gateway, use docker exec. If not, stay in WSL. The key is: update the copy at /home/metallicmay/openclaw from the place where that path and the running openclaw command both exist.
$ node --version
Command 'node' not found, but can be installed with:
sudo apt install nodejs
That shell doesn’t have Node installed, so don’t continue with pnpm yet.
On Ubuntu/WSL, install Node 24 with NodeSource, not the default sudo apt install nodejs package:
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version
npm --version
Then enable pnpm:
corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
Then continue:
cd /home/metallicmay/openclaw
pnpm install
pnpm build
pnpm ui:build
openclaw gateway restart
openclaw doctor
openclaw health
If your OpenClaw gateway is actually running inside Docker, install/run these inside that container instead. If you’re just in normal WSL, run them in WSL.
$ corepack enable
corepack prepare pnpm@latest --activate
Internal Error: EACCES: permission denied, symlink '../lib/node_modules/corepack/dist/pnpm.js' -> '/usr/bin/pnpm'
at async Object.symlink (node:internal/fs/promises:1002:10)
at async EnableCommand.generatePosixLink (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23218:5)
at async Promise.all (index 0)
at async EnableCommand.execute (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23199:5)
at async EnableCommand.validateAndExecute (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:20278:22)
at async _Cli.run (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:21215:18)
at async Object.runMain (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23704:19)
Preparing pnpm@latest for immediate activation...
That’s a permissions issue: corepack enable is trying to create /usr/bin/pnpm, and /usr/bin is root-owned.
Use the user-local install path first:
mkdir -p ~/.local/bin
corepack enable --install-directory ~/.local/bin
corepack prepare pnpm@latest --activate
export PATH="$HOME/.local/bin:$PATH"
pnpm --version
Make the PATH permanent:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Then continue:
cd /home/metallicmay/openclaw
pnpm install
pnpm build
pnpm ui:build
If corepack enable --install-directory ~/.local/bin still fails, use the system-wide version:
sudo corepack enable
corepack prepare pnpm@latest --activate
pnpm --version
After that, restart/check OpenClaw:
openclaw gateway restart
openclaw doctor
openclaw health
completed these steps successfully now
Good. Next verify the upgrade actually landed and the gateway is healthy:
openclaw --version
openclaw doctor
openclaw health
If those look good, clone your actual project outside the OpenClaw source repo:
mkdir -p /home/metallicmay/projects
cd /home/metallicmay/projects
git clone <your-github-repo-url> my-project
cd my-project
git status
Then either keep OpenClaw’s workspace separate and prompt it with:
Work in /home/metallicmay/projects/my-project
or make that project the default workspace:
openclaw config set agents.defaults.workspace "/home/metallicmay/projects/my-project"
openclaw setup --workspace /home/metallicmay/projects/my-project
openclaw gateway restart
I’d use the first option unless you specifically want OpenClaw’s AGENTS.md/memory files inside that project repo.
I need help updating openclaw version first
Got it. Since your OpenClaw source checkout is /home/metallicmay/openclaw, do the source update path first.
Run these exactly from WSL/container shell where you installed Node + pnpm:
cd /home/metallicmay/openclaw
git status
git pull
pnpm install
pnpm build
pnpm ui:build
Then restart and verify:
openclaw gateway restart
openclaw --version
openclaw doctor
openclaw health
If git status shows local changes before git pull, stop and paste that output here first. Don’t reset/delete anything.
If openclaw --version still shows the old version after the build, paste:
which openclaw
openclaw --version
cd /home/metallicmay/openclaw && git rev-parse --short HEAD && git branch --show-current
That will tell us whether your shell is running the source checkout or a separate global OpenClaw install.
still seeing old version:
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -it openclaw-openclaw-gateway-1 which openclaw
/usr/local/bin/openclaw
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -it openclaw-openclaw-gateway-1 openclaw --version
OpenClaw 2026.5.12
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ cd /home/metallicmay/openclaw && git rev-parse --short HEAD && git branch --show-current
eb7f3b7b50
main
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$
That explains it: you’re checking the OpenClaw version inside the Docker gateway container. The container is still using the old baked image, so updating/building the host checkout won’t change /usr/local/bin/openclaw until you rebuild/recreate the Docker container.
From the repo root on WSL:
cd /home/metallicmay/openclaw
git status
git pull
docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
Then verify inside the container:
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose ps
docker compose logs --tail=80 openclaw-gateway
If your compose file uses the prebuilt image instead of local build, do this instead:
cd /home/metallicmay/openclaw
docker compose pull openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
Quick rule: since your running gateway is Docker, openclaw --version on the host and openclaw --version inside the container can be different. The one that matters for the running gateway is:
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
If the rebuild still shows 2026.5.12, paste the output of:
cd /home/metallicmay/openclaw
docker compose config | grep -A20 -B5 'openclaw-gateway'
git log -1 --oneline
grep '"version"' package.json | head
Docs: https://docs.openclaw.ai/install/docker and https://docs.openclaw.ai/install/docker-vm-runtime#updates
unexpected fault address 0xffade0
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0xffade0 pc=0xffade0]
goroutine 1 gp=0xc000002380 m=2 mp=0xc00007c808 [running]:
panic during panic
SIGBUS: bus error
PC=0x466449 m=2 sigcode=2 addr=0x1873f18
goroutine 0 gp=0xc000002c40 m=2 mp=0xc00007c808 [idle]:
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker compose up -d --force-recreate openclaw-gateway
SIGBUS: bus error
PC=0x46a815 m=4 sigcode=2 addr=0x1db3f30
goroutine 0 gp=0xc0001021c0 m=4 mp=0xc000100008 [idle]:
That SIGBUS is the Docker/Compose process crashing, not a normal OpenClaw build error. In WSL + Docker Desktop, I’d reset the Docker/WSL layer before touching OpenClaw further.
First, from WSL, collect the basics:
docker compose version
docker version
docker ps
df -h
free -h
If docker compose version itself crashes with SIGBUS, do this from Windows PowerShell:
wsl --shutdown
Then fully restart Docker Desktop, reopen Ubuntu/WSL, and try:
cd /home/metallicmay/openclaw
docker compose ps
docker compose up -d --force-recreate openclaw-gateway
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
If it still SIGBUSes, try disabling BuildKit for the compose operation:
cd /home/metallicmay/openclaw
DOCKER_BUILDKIT=0 docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
Also check Docker Desktop has enough resources allocated. For OpenClaw image rebuilds, I’d give it at least 4 GB RAM if possible, and make sure WSL disk space is not nearly full.
Paste the output of the first block (docker compose version, docker version, df -h, free -h) if it keeps crashing.
restarted and now working -
$ free -h
total used free shared buff/cache available
Mem: 7.7Gi 1.2Gi 4.9Gi 4.7Mi 1.8Gi 6.5Gi
Swap: 2.0Gi 0B 2.0Gi
now what do i run?
Great, memory looks fine now. Continue with the Docker gateway update/recreate path:
cd /home/metallicmay/openclaw
git status
git pull
docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
Then verify:
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose ps
docker compose logs --tail=80 openclaw-gateway
If the version is updated and the logs don’t show startup errors, run the health check through the compose CLI container:
docker compose run --rm openclaw-cli health
If git status shows local modified files before the pull, pause and paste that output first.
Getting this error:
62.97 [ERR_PNPM_JSON_PARSE] Unexpected end of JSON input while parsing empty string in /app/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64/package.json
That looks like the earlier crashed build left a corrupt/incomplete dependency inside the Docker build cache. Don’t touch your .openclaw state or volumes; just rebuild the image cleanly.
Run from the OpenClaw repo root:
cd /home/metallicmay/openclaw
docker compose build --no-cache openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
If the same @anthropic-ai/claude-agent-sdk-linux-x64/package.json parse error comes back, clear only Docker’s build cache and retry:
docker builder prune -f
docker compose build --no-cache openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
Then verify:
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose logs --tail=80 openclaw-gateway
Important: don’t run docker compose down -v here. -v can remove volumes/state, and we don’t need that for a corrupt build cache.
bus error again after clearing cache and rerunning build
At this point I’d stop trying to build locally. The SIGBUS is coming from Docker/WSL during image build, so use the prebuilt OpenClaw image instead.
From /home/metallicmay/openclaw, run:
cd /home/metallicmay/openclaw
export OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest
docker compose pull openclaw-gateway openclaw-cli
docker compose up -d --force-recreate openclaw-gateway
Then verify:
docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose ps
docker compose logs --tail=80 openclaw-gateway
If that works, make the image setting persistent by editing /home/metallicmay/openclaw/.env and setting:
OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest
Then future updates are just:
cd /home/metallicmay/openclaw
docker compose pull
docker compose up -d --force-recreate openclaw-gateway
Only go back to docker compose build if you specifically need a custom local image. For now, the prebuilt image avoids the WSL build crash entirely.
got it finally!
w$ docker exec -it openclaw-openclaw-gateway-1 openclaw --version
OpenClaw 2026.5.20
Nice, that’s the right version now.
Do one quick health check:
docker compose ps
docker compose run --rm openclaw-cli health
docker compose logs --tail=60 openclaw-gateway
If those look clean, you can move on to cloning your project. I’d use:
mkdir -p /home/metallicmay/projects
cd /home/metallicmay/projects
git clone <your-github-repo-url> my-project
Then prompt OpenClaw with:
Work in /home/metallicmay/projects/my-project
Since you solved the update path, please right-click the solution message → Apps → ✅ Mark Solution when you get a chance. That helps Answer Overflow index this for the next WSL/Docker person who hits the same build weirdness.