openclaw - ✅(Solved) Fix [Bug]: ${XDG_CONFIG_HOME} is not process when installing a skill [1 pull requests, 11 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53628Fetched 2026-04-08 01:25:36
View on GitHub
Comments
11
Participants
3
Timeline
21
Reactions
0
Author
Timeline (top)
commented ×11cross-referenced ×3referenced ×3labeled ×2

When I try to install a skill using the clawhub the XDG_CONFIG_HOME variable is not interpreted

Root Cause

When I try to install a skill using the clawhub the XDG_CONFIG_HOME variable is not interpreted

Fix Action

Fixed

PR fix notes

PR #53718: fix(paths): expand env placeholders in resolveUserPath

Description (problem / solution / changelog)

Summary

Fix path resolution so environment placeholders are expanded before filesystem resolution.

This addresses issue #53628 where ${XDG_CONFIG_HOME} in configured path strings was treated as a literal directory name.

Changes

  • Add environment placeholder expansion in src/infra/home-dir.ts.
    • Support ${VAR_NAME} and $VAR_NAME forms.
    • Keep unknown placeholders unchanged.
    • Preserve existing ~ home expansion behavior.
  • Add tests in src/infra/home-dir.test.ts:
    • braced env placeholder expansion
    • bare env placeholder expansion
    • unknown placeholder passthrough

Why this fixes the bug

resolveUserPath delegates to resolveHomeRelativePath. After this change, inputs like:

  • ${XDG_CONFIG_HOME}/workspace/skills
  • $XDG_CONFIG_HOME/workspace/skills are resolved using process.env.XDG_CONFIG_HOME (or provided env), so skill installation no longer writes into a literal ${XDG_CONFIG_HOME} folder.

Testing

npx vitest run src/infra/home-dir.test.ts src/utils.test.ts

Result: pass (3 files, 51 tests).

Risk / boundaries

  • Scope is limited to path normalization helpers.
  • Unknown env placeholders are intentionally left unchanged.
  • Existing behavior for plain paths and tilde expansion is preserved.

Changed files

  • src/infra/home-dir.test.ts (modified, +22/-0)
  • src/infra/home-dir.ts (modified, +28/-10)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When I try to install a skill using the clawhub the XDG_CONFIG_HOME variable is not interpreted

Steps to reproduce

  1. Having a docker install
  2. Having the XDG_CONFIG_HOME set in the .env file
  3. trying to install npx clawhub@latest install Zernio-Api
  4. the output is ✔ OK. Installed Zernio-Api -> /app/${XDG_CONFIG_HOME}/workspace/skills/Zernio-Api

Expected behavior

The variable should be replaced by the value inside the .env file and so on the skill should be installed in the right folder

Actual behavior

When I do the install the skill is installed in a folder named ${XDG_CONFIG_HOME}. But when I look if the variable is known is the container : docker compose exec openclaw-gateway env | grep XDG I got the right value : XDG_CONFIG_HOME=/home/node/.openclaw

OpenClaw version

OpenClaw 2026.3.13

Operating system

Ubuntu 24.04.4 LTS

Install method

docker in a Hetzner VPS

Model

gemini-2.5-flash

Provider / routing chain

openclaw -> gemini

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the issue of the XDG_CONFIG_HOME variable not being interpreted, we need to ensure that the environment variable is properly expanded in the installation path.

Here are the steps to fix the issue:

  • Set the XDG_CONFIG_HOME environment variable in the Docker container.
  • Modify the installation command to properly expand the environment variable.

Example Code

We can achieve this by using the following command:

npx clawhub@latest install Zernio-Api --install-path=/app/${XDG_CONFIG_HOME}/workspace/skills/Zernio-Api

However, the above command will still not expand the variable. We need to use the shell to expand the variable:

npx clawhub@latest install Zernio-Api --install-path=/app/$(echo $XDG_CONFIG_HOME)/workspace/skills/Zernio-Api

Alternatively, you can also set the INSTALL_PATH environment variable in your .env file:

INSTALL_PATH=/app/${XDG_CONFIG_HOME}/workspace/skills

Then, in your docker-compose.yml file, you can reference this variable:

version: '3'
services:
  openclaw-gateway:
    ...
    environment:
      - INSTALL_PATH=${INSTALL_PATH}

In your installation command, you can then use the INSTALL_PATH environment variable:

npx clawhub@latest install Zernio-Api --install-path=$(echo $INSTALL_PATH)/Zernio-Api

Verification

To verify that the fix worked, you can check the installation path of the skill:

docker compose exec openclaw-gateway ls /app/${XDG_CONFIG_HOME}/workspace/skills

This should list the installed skill in the correct directory.

Extra Tips

Make sure to restart your Docker container after making any changes to the environment variables or the docker-compose.yml file. You can do this by running:

docker-compose restart

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The variable should be replaced by the value inside the .env file and so on the skill should be installed in the right folder

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING