use-native-credential-proxy
Skill4 starsChanged 6 months agoMITView on GitHub
Replace OneCLI gateway with the built-in credential proxy. For users who want simple .env-based credential management without installing OneCLI. Reads API key or OAuth token from .env and injects into container API requests.
- Reads credentials
- Installs packages
In this repository51 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- container/CLAUDE.mdCLAUDE.md
- add-amplifier-agentSkill
- add-atomic-chat-toolSkill
- add-codexSkill
- add-dashboardSkill
- add-deltachatSkill
- add-discordSkill
- add-emacsSkill
- add-gcal-toolSkill
- add-gchatSkill
- add-githubSkill
- add-gmail-toolSkill
- add-imessageSkill
- add-karpathy-llm-wikiSkill
- add-linearSkill
- add-macos-statusbarSkill
- add-matrixSkill
- add-mnemonSkill
- add-ollama-providerSkill
- add-ollama-toolSkill
- add-opencodeSkill
- add-parallelSkill
- add-resendSkill
- add-rtkSkill
- add-signalSkill
- add-slackSkill
- add-teamsSkill
- add-telegramSkill
- add-vercelSkill
- add-webexSkill
- add-wechatSkill
- add-whatsapp-cloudSkill
- add-whatsappSkill
- clawSkill
- convert-to-apple-containerSkill
- customizeSkill
- debugSkill
- get-qodo-rulesSkill
- init-first-agentSkill
- init-onecliSkill
- manage-channelsSkill
- manage-mountsSkill
- migrate-from-openclawSkill
- migrate-from-v1Skill
- migrate-nanoclawSkill
- qodo-pr-resolverSkill
- setupSkill
- update-nanoclawSkill
- update-skillsSkill
- x-integrationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 3 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Check if src/credential-proxy.ts is imported in src/index.ts:
- Very specific: line 20
If it shows an import for startCredentialProxy, the native proxy is already active.
- Very specific: line 28
If @onecli-sh/sdk appears, OneCLI is the active credential provider.
- Very specific: line 30
If neither check matches, you may be on an older version.
- Very specific: line 40
If upstream is missing, add it:
- Very specific: line 65
If the merge reports conflicts beyond pnpm-lock.yaml, resolve them by reading the conflicted files and understanding the intent of both …
- Distinctive: line 85
All tests must pass and build must be clean before proceeding.
- Very specific: line 111
Add it to .env:
- Very specific: line 121
Optional: If the user needs a custom API endpoint, they can add ANTHROPIC_BASE_URL=<url> to .env (defaults to https://api.anthropic.com).
- Distinctive: line 133
Run from your NanoClaw project root:
- Distinctive: line 139
Check logs for successful proxy startup:
- Very specific: line 153
"Credential proxy upstream error" in logs: Check that .env has a valid ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN.
- Very specific: line 169
Follow /setup step 4 to configure OneCLI credentials
- Very specific: line 170
Remove ANTHROPIC_API_KEY / CLAUDE_CODE_OAUTH_TOKEN from .env
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use Native Credential Proxy
This skill replaces the OneCLI gateway with NanoClaw's built-in credential proxy. Containers get credentials injected via a local HTTP proxy that reads from .env — no external services needed.
Phase 1: Pre-flight
Check if already applied
Check if src/credential-proxy.ts is imported in src/index.ts:
grep "credential-proxy" src/index.tsIf it shows an import for startCredentialProxy, the native proxy is already active. Skip to Phase 3 (Setup).
Check if OneCLI is active
grep "@onecli-sh/sdk" package.jsonIf @onecli-sh/sdk appears, OneCLI is the active credential provider. Proceed with Phase 2 to replace it.
If neither check matches, you may be on an older version. Run /update-nanoclaw first, then retry.
Phase 2: Apply Code Changes
Ensure upstream remote
git remote -vIf upstream is missing, add it:
git remote add upstream https://github.com/nanocoai/nanoclaw.gitMerge the skill branch
git fetch upstream skill/native-credential-proxy
git merge upstream/skill/native-credential-proxy || {
git checkout --theirs pnpm-lock.yaml
git add pnpm-lock.yaml
git merge --continue
}This merges in:
src/credential-proxy.tsandsrc/credential-proxy.test.ts(the proxy implementation)- Restored credential proxy usage in
src/index.ts,src/container-runner.ts,src/container-runtime.ts,src/config.ts - Removed
@onecli-sh/sdkdependency - Restored
CREDENTIAL_PROXY_PORTconfig (default 3001) - Restored platform-aware proxy bind address detection
- Reverted setup skill to
.env-based credential instructions
If the merge reports conflicts beyond pnpm-lock.yaml, resolve them by reading the conflicted files and understanding the intent of both sides.
Update main group CLAUDE.md
Replace the OneCLI auth reference with the native proxy:
In groups/main/CLAUDE.md, replace:
OneCLI manages credentials (including Anthropic auth) — run
onecli --help.
with:
The native credential proxy manages credentials (including Anthropic auth) via
.env— seesrc/credential-proxy.ts.
Validate code changes
pnpm install
pnpm run build
pnpm exec vitest run src/credential-proxy.test.ts src/container-runner.test.tsAll tests must pass and build must be clean before proceeding.
Phase 3: Setup Credentials
AskUserQuestion: Do you want to use your Claude subscription (Pro/Max) or an Anthropic API key?
- Claude subscription (Pro/Max) — description: "Uses your existing Claude Pro or Max subscription. You'll run
claude setup-tokenin another terminal to get your token." - Anthropic API key — description: "Pay-per-use API key from console.anthropic.com."
Subscription path
Tell the user to run claude setup-token in another terminal and copy the token it outputs. Do NOT collect the token in chat.
Once they have the token, add it to .env:
# Add to .env (create file if needed)
echo 'CLAUDE_CODE_OAUTH_TOKEN=<token>' >> .envNote: ANTHROPIC_AUTH_TOKEN is also supported as a fallback.
API key path
Tell the user to get an API key from https://console.anthropic.com/settings/keys if they don't have one.
Add it to .env:
echo 'ANTHROPIC_API_KEY=<key>' >> .envAfter either path
If the user's response happens to contain a token or key (starts with sk-ant- or looks like a token): write it to .env on their behalf using the appropriate variable name.
Optional: If the user needs a custom API endpoint, they can add ANTHROPIC_BASE_URL=<url> to .env (defaults to https://api.anthropic.com).
Phase 4: Verify
- Rebuild and restart:
pnpm run buildThen restart the service.
Run from your NanoClaw project root:
- macOS:
launchctl kickstart -k gui/$(id -u)/"$(. setup/lib/install-slug.sh && launchd_label)" - Linux:
systemctl --user restart "$(. setup/lib/install-slug.sh && systemd_unit)" - WSL/manual: stop and re-run
bash start-nanoclaw.sh
- Check logs for successful proxy startup:
tail -20 logs/nanoclaw.log | grep "Credential proxy"Expected: Credential proxy started with port and auth mode.
- Send a test message in the registered chat to verify the agent responds.
- Note: after applying this skill, the OneCLI credential steps in
/setupno longer apply..envis now the credential source.
Troubleshooting
"Credential proxy upstream error" in logs: Check that .env has a valid ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN. Verify the API is reachable: curl -s https://api.anthropic.com/v1/messages -H "x-api-key: test" | head.
Port 3001 already in use: Set CREDENTIAL_PROXY_PORT=<other port> in .env or as an environment variable.
Container can't reach proxy (Linux): The proxy binds to the docker0 bridge IP by default. If that interface doesn't exist (e.g. rootless Docker), set CREDENTIAL_PROXY_HOST=0.0.0.0 as an environment variable.
OAuth token expired (401 errors): Re-run claude setup-token in a terminal and update the token in .env.
Removal
To revert to OneCLI gateway:
- Find the merge commit:
git log --oneline --merges -5 - Revert it:
git revert <merge-commit> -m 1(undoes the skill branch merge, keeps your other changes) pnpm install(re-adds@onecli-sh/sdk)pnpm run build- Follow
/setupstep 4 to configure OneCLI credentials - Remove
ANTHROPIC_API_KEY/CLAUDE_CODE_OAUTH_TOKENfrom.env
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

