Skip to content

feat(cli-tools): add OpenClaude support - #3317

Open
ntdatt812 wants to merge 1 commit into
decolua:masterfrom
ntdatt812:feat/openclaude-cli-1807
Open

ntdatt812 wants to merge 1 commit into
decolua:masterfrom
ntdatt812:feat/openclaude-cli-1807

Conversation

@ntdatt812

@ntdatt812 ntdatt812 commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1807.

OpenClaude is a coding-agent CLI that talks to OpenAI-compatible endpoints, so it can already reach 9Router — it just was not listed anywhere. The issue asks for the entry plus working setup instructions.

Checked before starting: 30.6k stars, pushed today, @gitlawb/[email protected] on npm, and no open or closed PR here touches it. It is a different project from the existing openclaw entry; both now sit side by side, which a test pins.

The instructions had to be verified, not assumed

I installed openclaude 0.28.0 and drove it against a stub endpoint that logs what it receives. The obvious guide is wrong:

OPENAI_BASE_URL=... OPENAI_API_KEY=... OPENAI_MODEL=... openclaude -p "say pong"
→ Not logged in · Please run /login
stub saw: GET /v1/models  auth=null       ← probe only, then it gives up

Adding --provider openai to the identical environment:

→ pong
stub saw: GET  /v1/models           auth=Bearer sk-env-only
          POST /v1/chat/completions auth=Bearer sk-env-only  model=cc/claude-sonnet-5

So the guide passes --provider openai, and a warning note says why. Without that flag a user following the instructions would hit a login prompt and reasonably conclude 9Router was at fault.

The code block also carries the PowerShell form, since export is not a Windows shell builtin.

Why configType is "guide"

My first cut used configType: "custom" with an openclaude-settings API route that wrote OpenClaude's .openclaude-profile.json. That was wrong for two reasons, both found before proposing it here:

  • DefaultToolCard renders "Coming soon..." for any tool without guideSteps, and every custom tool has a hand-written card behind it (OpenCodeToolCard, OpenClawToolCard, …). A custom entry with no card is an empty page.
  • Nothing would have called that route, so it would have shipped as dead code.

So the entry is data only. A one-click card driving the profile file is a reasonable follow-up — that path works too, I verified openclaude reads a written { profile: "openai", env: {...} } profile with no flag at all — but it belongs in its own PR with its own component.

Icon

The OpenClaude repo ships no image assets, so the icon is its GitHub organisation avatar, the mark it presents on GitHub and npm, resized to 128x128 to match the other icons under public/providers/. Colour #000000 matches that mark; #D97757 would have been wrong, that is Claude Code's entry.

Verification

8 tests in unit/openclaude-cli-tool-1807.test.js pin what the card actually needs: guideSteps present so it is not the "Coming soon" fallback, the {{baseUrl}} / {{apiKey}} / {{model}} placeholders DefaultToolCard substitutes, the three env var names, the --provider openai flag and its note, the PowerShell line, the apiKeySelector / modelSelector step types, the icon file existing at the path image points to, and openclaude staying distinct from openclaw.

Suite (npx vitest run unit translator) against current master: 1778 to 1786 passed, 93 failed before and after, failing sets byte-identical (comm -13 empty). npx eslint clean.

No i18n changes needed — CLI tool strings live directly in cliTools.js.

Closes decolua#1807. OpenClaude is a coding-agent CLI that speaks OpenAI-compatible
endpoints, so it can already reach 9Router — it just was not listed anywhere,
and the issue asks for the entry plus setup instructions.

Verified against openclaude 0.28.0 driven at a stub endpoint, because the
obvious instructions turn out to be wrong: exporting OPENAI_BASE_URL,
OPENAI_API_KEY and OPENAI_MODEL on their own gets "Not logged in · Please run
/login" and never sends an authenticated request. Adding --provider openai
makes the same env reach the endpoint with the right bearer token and model.
The guide and its warning note say so.

configType is "guide" rather than "custom": DefaultToolCard renders
"Coming soon..." for any tool without guideSteps, and every "custom" tool has
a hand-written card behind it.

Note this is a separate tool from the existing openclaw entry.
@ntdatt812
ntdatt812 force-pushed the feat/openclaude-cli-1807 branch from 24e960d to f32f950 Compare August 14, 2026 16:14
@ntdatt812

Copy link
Copy Markdown
Contributor Author

Closing this one: src/shared/constants/cliTools.js has moved +55/-35 upstream since I opened it, so the patch is drifting toward a conflict, and OpenClaude support is a feature rather than a fix — not the shape that gets picked up here. If OpenClaude is wanted in the CLI tools list, I am happy to redo it against current master.

@ntdatt812 ntdatt812 closed this Sep 9, 2026
@ntdatt812 ntdatt812 reopened this Sep 9, 2026
@ntdatt812

Copy link
Copy Markdown
Contributor Author

Reopening — I closed this on a wrong reason and want that on the record rather than quietly fixed.

I said the patch was "drifting toward a conflict" because src/shared/constants/cliTools.js had moved +55/-35 upstream since I opened it. That was inferred from the size of the drift, not measured. git merge-tree --write-tree origin/master <branch> reports no conflict at all, and GitHub had it as MERGEABLE the whole time.

The patch still applies cleanly and master still has no openclaude entry, so there is nothing wrong with it. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add OpenClaude CLI Support

1 participant