clawhub list ignores CLAWHUB_WORKDIR environment variable #47

Closed
opened 2026-02-15 17:15:21 -05:00 by yindo · 1 comment
Owner

Originally created by @usimic on GitHub (Feb 2, 2026).

Bug Summary

The clawhub list command does not respect the CLAWHUB_WORKDIR environment variable, while clawhub install correctly uses it. This creates a mismatch where skills are installed to the correct location but cannot be listed.

Reproduction Steps

  1. Set the environment variable:

    export CLAWHUB_WORKDIR=/path/to/workspace
    
  2. Install a skill:

    clawhub install frontend-design
    

    Works - Skill installs to $CLAWHUB_WORKDIR/skills/

  3. Verify the skill is tracked:

    cat $CLAWHUB_WORKDIR/skills/.clawhub/lock.json
    

    Output shows:

    {
      "version": 1,
      "skills": {
        "frontend-design": {
          "version": "1.0.0",
          "installedAt": 1770055313794
        }
      }
    }
    
  4. Try to list installed skills:

    clawhub list
    

    Returns: "No installed skills" (incorrect)

Expected Behavior

clawhub list should check the same CLAWHUB_WORKDIR location that clawhub install writes to.

Actual Behavior

clawhub list appears to look in a different location (possibly ~/.clawhub/ or current working directory), missing the installed skills.

Environment

  • OS: macOS 15.2
  • Node.js: v24.13.0 (via nvm)
  • clawhub CLI: (latest from npm)
  • OpenClaw: v2026.2.1

Additional Context

  • The install command correctly respects CLAWHUB_WORKDIR and also honors --dir and --workdir flags
  • The lock.json file exists at the correct location with valid data
  • This appears to be an inconsistency in path resolution between install and list commands

Suggested Fix

Ensure clawhub list uses the same WORKDIR resolution logic as clawhub install:

  1. Check CLAWHUB_WORKDIR environment variable
  2. Fall back to OpenClaw workspace detection
  3. Fall back to current working directory

Labels

bug, cli

Originally created by @usimic on GitHub (Feb 2, 2026). ## Bug Summary The `clawhub list` command does not respect the `CLAWHUB_WORKDIR` environment variable, while `clawhub install` correctly uses it. This creates a mismatch where skills are installed to the correct location but cannot be listed. ## Reproduction Steps 1. Set the environment variable: ```bash export CLAWHUB_WORKDIR=/path/to/workspace ``` 2. Install a skill: ```bash clawhub install frontend-design ``` ✓ **Works** - Skill installs to `$CLAWHUB_WORKDIR/skills/` 3. Verify the skill is tracked: ```bash cat $CLAWHUB_WORKDIR/skills/.clawhub/lock.json ``` Output shows: ```json { "version": 1, "skills": { "frontend-design": { "version": "1.0.0", "installedAt": 1770055313794 } } } ``` 4. Try to list installed skills: ```bash clawhub list ``` ✗ **Returns:** "No installed skills" (incorrect) ## Expected Behavior `clawhub list` should check the same `CLAWHUB_WORKDIR` location that `clawhub install` writes to. ## Actual Behavior `clawhub list` appears to look in a different location (possibly `~/.clawhub/` or current working directory), missing the installed skills. ## Environment - OS: macOS 15.2 - Node.js: v24.13.0 (via nvm) - clawhub CLI: (latest from npm) - OpenClaw: v2026.2.1 ## Additional Context - The `install` command correctly respects `CLAWHUB_WORKDIR` and also honors `--dir` and `--workdir` flags - The `lock.json` file exists at the correct location with valid data - This appears to be an inconsistency in path resolution between `install` and `list` commands ## Suggested Fix Ensure `clawhub list` uses the same WORKDIR resolution logic as `clawhub install`: 1. Check `CLAWHUB_WORKDIR` environment variable 2. Fall back to OpenClaw workspace detection 3. Fall back to current working directory ## Labels bug, cli
yindo closed this issue 2026-02-15 17:15:21 -05:00
Author
Owner

@usimic commented on GitHub (Feb 2, 2026):

Investigation Update

After further investigation, I discovered the root cause was my environment setup, not a bug in clawhub list.

What Happened

I had two conflicting installations of clawhub:

Installation Version Location In PATH?
Homebrew 0.5.0 /opt/homebrew/bin/clawhub First in PATH
NVM (npm) 0.4.0 ~/.nvm/versions/node/v24.13.0/bin/clawhub Shadowed

The Confusion

  • My CLAWHUB_WORKDIR was set in shell config
  • clawhub install (v0.5.0 from Homebrew) worked correctly and wrote to $CLAWHUB_WORKDIR/skills/.clawhub/lock.json
  • clawhub list (also v0.5.0 from Homebrew) was actually looking in the right place
  • The "No installed skills" output was due to PATH confusion and version mismatch during troubleshooting

Resolution

Removing the Homebrew installation and using only the NVM-installed version resolved the confusion.

Suggestion for Documentation

Consider adding a note about avoiding multiple installations (Homebrew + npm) as this can cause confusing behavior. The CLAWHUB_WORKDIR feature works correctly when using a single installation source.

This issue can be closed — the CLI behavior is correct.

@usimic commented on GitHub (Feb 2, 2026): ## Investigation Update After further investigation, I discovered the root cause was **my environment setup**, not a bug in `clawhub list`. ### What Happened I had **two conflicting installations** of `clawhub`: | Installation | Version | Location | In PATH? | |--------------|---------|----------|----------| | Homebrew | 0.5.0 | `/opt/homebrew/bin/clawhub` | ✅ First in PATH | | NVM (npm) | 0.4.0 | `~/.nvm/versions/node/v24.13.0/bin/clawhub` | ❌ Shadowed | ### The Confusion - My `CLAWHUB_WORKDIR` was set in shell config - `clawhub install` (v0.5.0 from Homebrew) worked correctly and wrote to `$CLAWHUB_WORKDIR/skills/.clawhub/lock.json` - `clawhub list` (also v0.5.0 from Homebrew) was **actually looking in the right place** - The "No installed skills" output was due to **PATH confusion** and **version mismatch** during troubleshooting ### Resolution Removing the Homebrew installation and using only the NVM-installed version resolved the confusion. ### Suggestion for Documentation Consider adding a note about avoiding multiple installations (Homebrew + npm) as this can cause confusing behavior. The `CLAWHUB_WORKDIR` feature works correctly when using a single installation source. **This issue can be closed** — the CLI behavior is correct.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#47