clawhub-multi
v0.3.0
Published
Thin clawhub wrapper that supports multiple SkillHub registries from one machine with isolated per-registry tokens.
Downloads
489
Maintainers
Readme
clawhub-multi
A thin wrapper around clawhub that lets you talk to multiple SkillHub / ClawHub registries from the same machine without their tokens stomping on each other.
Why
The stock clawhub CLI stores one API token in a single config file, keyed only by the most recently used registry. The moment you clawhub login against a different registry, the previous token is overwritten.
clawhub-multi fixes that by deriving an independent config file per registry URL (SHA‑256 of the URL → ~/.clawhub-multi/<hash>.json). You can be logged into your company's private SkillHub, the public ClawHub, and a customer's instance simultaneously — pick which one each command targets via --registry or the CLAWHUB_MULTI_REGISTRY env var.
It also defaults --dir to ~/.claude/skills for install, so Claude Code users don't have to type that path every time.
Everything else is forwarded verbatim to clawhub. All subcommands (login, install, search, update, uninstall, list, whoami, inspect, publish, ...) work the same.
Install
# one-off
npx clawhub-multi install my-skill --registry https://your.skillhub.com --token <PAT>
# or globally
npm i -g clawhub-multi
clawhub-multi install my-skill --registry https://your.skillhub.com --token <PAT>Usage
One-shot install (implicit login)
Pass --token on any command and the wrapper runs an implicit clawhub login first, then continues with your command. First install + login is a single line:
npx clawhub-multi install my-skill \
--registry https://your.skillhub.com \
--token <PAT>Subsequent commands against the same registry don't need --token — it's already stored in ~/.clawhub-multi/<hash>.json:
npx clawhub-multi install another-skill --registry https://your.skillhub.comExplicit login (if you prefer two steps)
npx clawhub-multi login --token <PAT> --registry https://your.skillhub.com
npx clawhub-multi install my-skill --registry https://your.skillhub.comReduce typing with env vars
export CLAWHUB_MULTI_REGISTRY=https://your.skillhub.com
# First time only:
CLAWHUB_MULTI_TOKEN=<PAT> npx clawhub-multi install my-skill
# After that:
npx clawhub-multi install another-skill
npx clawhub-multi search foo
npx clawhub-multi listPick an agent (default: claude)
--agent maps to a well-known skills directory without you having to remember the path:
| --agent | Skills dir |
|---|---|
| claude (default) | ~/.claude/skills |
| codex | ~/.codex/skills |
# One-off
npx clawhub-multi install my-skill --agent codex --token <PAT>
# Persist via env
export CLAWHUB_MULTI_AGENT=codex
npx clawhub-multi install my-skill
npx clawhub-multi list # also targets codex dirAny install, update, uninstall, or list call gets the right --dir injected automatically based on --agent.
Fully custom dir
If your agent isn't in the built-in list, pass --dir directly — it overrides --agent:
npx clawhub-multi install my-skill --dir ~/.my-custom-agent/skillsSwitching between registries
# Company internal SkillHub
npx clawhub-multi install internal-tool --registry https://skillhub.acme.internal
# Public ClawHub
npx clawhub-multi install public-skill --registry https://clawhub.ai
# Both tokens persist independently. No re-login needed.Env vars
| Variable | Purpose |
|---|---|
| CLAWHUB_MULTI_REGISTRY | Default registry URL when --registry is not on the command line. |
| CLAWHUB_MULTI_TOKEN | Token for implicit login. Safer than passing --token on the command line (which leaks into shell history). |
| CLAWHUB_MULTI_AGENT | Default agent for --dir resolution (claude or codex). Default: claude. |
All clawhub env vars (CLAWHUB_WORKDIR, CLAWHUB_SITE, ...) still work — only CLAWHUB_REGISTRY and CLAWHUB_CONFIG_PATH are managed by this wrapper.
Security note: putting
--token <PAT>on the command line leaves the token in your shell history. For scripting, preferCLAWHUB_MULTI_TOKENfrom a secret store, or runloginonce and drop the flag from subsequent commands.
How it works
$ npx clawhub-multi install foo --registry https://example.com
│
▼
clawhub-multi (this package)
│
│ CLAWHUB_REGISTRY=https://example.com
│ CLAWHUB_CONFIG_PATH=~/.clawhub-multi/<sha256(url)[:12]>.json
│ injects --dir ~/.claude/skills if absent
▼
spawns: clawhub install --dir ~/.claude/skills foo --registry https://example.comRoughly 60 lines of code. Read bin/clawhub-multi.js.
License
MIT
