Compare commits

..

78 Commits

Author SHA1 Message Date
Markus Hartung
57b94e743d fix(images): retry Codex image generation on a sibling ChatGPT account
Some ChatGPT accounts can run Codex but lack entitlement for the specific
requested image model — upstream returns a stable 400 for that exact case.
Today that fails the whole request; #8307 (fenix007) identified this as a
production incident and wrote the original repro/test for it.

Its own implementation predates the general credential-fallback mechanism
this codebase now has (executeImageWithCredentialFallback +
saveImageErrorResult's retryable opt-in, #10494) and duplicated that retry
loop inline in route.ts, which now collides with it. This reimplements the
same fix through the existing mechanism instead: classify the exact upstream
message and mark the failure retryable, letting the already-wired
sibling-account fallback do the rest.

Co-authored-by: fenix007 <4217955+fenix007@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-20 08:31:14 -03:00
Diego Rodrigues de Sa e Souza
0f13fe4221 feat(radar): stable catalog export workflow with provenance (#10826)
Passo 10 of the Radar go-live: publish the OmniRoute catalog export the Radar
server consumes to a stable URL, so the 1 GB-RAM private server pulls it via
RADAR_EXPORT_URL instead of depending on the deploy-time snapshot.

- scripts/release/radar-export.mjs: emits {geradoEm, budgets, totais, registry,
  provenance} from the catalog config modules. Provenance (sourceCommit,
  sourceRef, runUrl, generatedBy) is never fabricated — unknown fields stay null.
- .github/workflows/radar-export.yml: on main catalog changes / manual dispatch /
  weekly, generates the export and clobbers the stable 'radar-export-latest'
  release asset (gh release, GH_TOKEN — checkout persist-credentials:false).
- tests/unit/radar-export.test.mjs: consumer contract (budgets[] non-empty) +
  provenance null-when-unknown + GitHub-env reflection.

Stable URL for RADAR_EXPORT_URL:
https://github.com/diegosouzapw/OmniRoute/releases/download/radar-export-latest/export-omniroute.json

Re-baselines zizmorFindings 190->192 (+2 unpinned-uses @vN, the repo-wide
deliberate convention; artipacked auto-fixed).

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-20 08:09:42 -03:00
Markus Hartung
5089c17b44 fix(resilience): scope same-account transport retry out of emergency-fallback and combo hops
#10792 (#9708) added a same-account retry for retryable 502/503/504/507 transport
failures, applied uniformly inside handleSingleModelChat. Two other paths call
into the same function recursively/iteratively and each carries its own
documented single-call guarantee that the retry silently broke:

- Emergency fallback (#1731): exactly one hop to the free fallback model, no
  extra calls against an already-exhausted provider. The retry was doubling
  that call whenever the fallback model itself returned a transient-looking
  status.
- Combo routing: target-level fallback is the combo's own policy (next target,
  not same-account retry). The retry delayed that policy and could surface the
  wrong terminal status when a later combo/global-fallback hop threw.

Both regressions were already covered by existing tests in
chat-route-coverage.test.ts (asserting exact call counts / preserved status) —
confirmed red on the release tip before this fix, green after.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-20 08:08:09 -03:00
Diego Rodrigues de Sa e Souza
bc6129bcb2 fix(relay): normalize bifrost errors, remap credential 404, fix analytics (#10797)
Merged — the 5 pre-existing tests that broke from this PR's intentional 404→401 remap (single-model no-credentials) are now realigned to the new contract. Thanks!
2026-08-20 06:37:02 -03:00
Markus Hartung
3810a6c52c fix(tests): realign provider count to 230 after merge-train batch1 collision
#10722 (Token Kiosk) and #10729 (Cursor) each independently bumped the
gateways/specialty-media APIKEY_PROVIDERS count by one in the same merge-train
batch; neither PR could see the other's bump, so the merged tree landed at 230
while the surviving hardcoded assertion still said 229.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-20 06:31:49 -03:00
Michael YC JO
85aa84ebcb fix(tests): realign two more stream-utils passthrough cases with the #10017 control-line rules (#10796)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:46 -03:00
Prudhvi Vuda
c00086e616 fix(catalog): exclude generic 128k default from combo context min() (#10734) (#10793)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:43 -03:00
Prudhvi Vuda
aa32d2ed77 fix(resilience): retry Codex pre-output transport failures on the same account (#9708) (#10792)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:39 -03:00
Prudhvi Vuda
71f858fc48 fix(translator): convert OpenAI tool-result images to Claude image blocks (#9692) (#10791)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:36 -03:00
Dizzle
6307504584 feat(routing): make task-detection patterns operator-configurable (#10783)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:31 -03:00
Dizzle
404d3a4211 fix(sse): add a protocol-level ping/pong heartbeat to LiveWS (#10782)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:20 -03:00
Dizzle
d82e3cf8e9 fix(db): periodically truncate the SQLite WAL on long-running servers (#10781)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:16 -03:00
Dizzle
121023e418 docs: document combo invocation by exact model name (#7992) (#10779)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:12 -03:00
Farshid Rezaei
4fc0b412fe add fa readme (#10777)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:08 -03:00
Dizzle
66144d86f2 chore(security): drop the unused enforceSecrets() duplicate (#10775)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:05 -03:00
Jorge Delgado
f7cba50cb7 fix(analytics): treat Claude Code (claude/cc) as a flat-rate subscription provider (#10773) (#10774)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:01 -03:00
Sahil Singh
6ff83077fd fix(api): reset mcp sse singleton on new client initialize (#10690) (#10772)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:49 -03:00
Dizzle
49a47cbe6f feat(api): answer GET /api/health without a key (#10771)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:45 -03:00
Dizzle
ee230fa93a fix(logging): keep the component and apply printf formats in the app log (#10770)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:42 -03:00
Dizzle
7d2efdf1a4 fix(api): report the cache that requests actually use in /api/cache/stats (#10769)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:38 -03:00
InkshadeWoods
5100642ebb fix(sensenova): clamp max reasoning effort to xhigh (#10733)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:34 -03:00
acc0mplish
2eb6d59ebc fix(providers): copilot-m365-web invocation dropped by substrate + token refresh (#10732)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:30 -03:00
pandaaaa1990
48f3428307 pUpdate python_requests.py (#10731)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:18 -03:00
stanley
bc9a685b70 feat(combo): opaque per-invocation decision trace for priority fallbacks (#10681) (#10730)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:14 -03:00
Damian Pozimski
3e0afc8444 feat(providers): Cursor API provider (crsr_ keys) and Cursor CLI passthrough (#10729)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:11 -03:00
Michael YC JO
83c77fb0bf fix(oauth): keep the Kiro profileArn on IAM Identity Center logins (#10725)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:08 -03:00
hgaib
08f23d0d0d feat(providers): add Token Kiosk as an OpenAI-compatible provider (#10722)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:29:03 -03:00
echoriver89
5185571f18 fix(electron): pin embedded server to loopback so the window shows on Windows (#10717)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:59 -03:00
Xiangzhe
f330b21afd feat(codex): sync v178 identity mechanisms — turn-state relay, persisted seeds, identity faces (#10716)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:45 -03:00
Nguyen Thanh Dat
b11b000048 fix(agent-bridge): make the regenerate-cert endpoint actually mint a new cert (#10467) (#10715)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:41 -03:00
Xiangzhe
82e5afed6b feat(usage): show Kimi Coding Extra Usage (#10712)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:37 -03:00
Webman
1accabeb4e fix(db): prevent Windows native-driver hang from stalling requests (#10627) (#10709)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:33 -03:00
Ara
81b0ff46a3 fix(cline): label internal health checks (#10706)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:28:29 -03:00
Markus Hartung
41ffb08e4a chore(quality): rebaseline file-size for merge-train batch1 (#10722, #10797) + pre-existing chatBodyAdmission.ts drift
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-20 00:50:35 -03:00
Diego Rodrigues de Sa e Souza
3d7ed7aa87 fix(build): tolerate same-realpath symlink / stale-typed dest in assembleStandalone (#10776)
Under heavy concurrent build I/O, the bulk .build/next/standalone -> outDir tree
copy can already have carried a prior pass's result into a
NATIVE_ASSET_ENTRIES/EXTRA_MODULE_ENTRIES dest before that entry's own copy runs
(an absolute pnpm-store symlink resolving to the exact same realpath as src, or a
stale node of a different type). fs.cpSync/fs.cp refuse to overwrite either case
even with force:true, throwing ERR_FS_CP_EINVAL ("src and dest cannot be the
same") or ERR_FS_CP_DIR_TO_NON_DIR/ERR_FS_CP_NON_DIR_TO_DIR — non-deterministically
crashing the build:release/build:cli deploy pipeline on whichever entry the race
happened to hit that run.

Adds resolvesToSamePath/clearStaleDest guards to all four copy call sites (the two
sync loops in copyNativeAssetsAndExtraModules, repairEmptyExternalPackageDirs, and
the async syncNativeAssetsToDir/syncExtraModulesToDir twins) so a dest already
pointing at src is skipped and any other stale occupant is cleared before the
fresh copy.

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 17:58:58 -03:00
Markus Hartung
3c9cb21cca feat(ad-hoc): add mesh interaction scripts for Discord integration 2026-08-19 15:33:25 -03:00
Diego Rodrigues de Sa e Souza
14a480453c fix(compression): preserve unfenced raw code from Caveman prose normalization (#9144) (#10764)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 13:00:27 -03:00
Diego Rodrigues de Sa e Souza
83332a08d3 fix(dashboard): filter Modality Bridge Vision model picker by supportsVision (#10703) (#10763)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:54:05 -03:00
Diego Rodrigues de Sa e Souza
6b8307530f fix(mitm): forward passthrough traffic to the real requested host (#10479) (#10762)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:49:54 -03:00
Diego Rodrigues de Sa e Souza
5d9ed144f4 fix(providers): prune 10 retired crof model ids from the seed catalog (#10577) (#10761)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:49:49 -03:00
Diego Rodrigues de Sa e Souza
f0bf6d2a93 fix(guardrails): resolve provider alias before credential check in Vision Bridge (#10702) (#10760)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:35:44 -03:00
Diego Rodrigues de Sa e Souza
bc298d72cc fix(cli): npmInstallRuntime must allow-scripts for its own runtime deps (#10713) (#10759)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:11:52 -03:00
Diego Rodrigues de Sa e Souza
e5a81ed744 fix(cli): readiness poll must target 127.0.0.1, not localhost (#10508) (#10758)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:11:43 -03:00
Diego Rodrigues de Sa e Souza
d5e4c0fd97 fix(api): keep catalog builds responsive and hash cache keys (#9147, #10313) (#10538)
* fix(catalog): hash API key in buildCatalogCacheKey so raw credentials never live in the key string (#10313)

* fix(api): yield event loop and bulk-load override tables in catalog build (#9147)

* fix(api): keep bulk hidden-model load inside catalog builder's error boundary

Post-sync-merge fixup for #9147/#10313 against release/v3.8.50:

- Resolve the catalog.ts/catalogCache.ts merge conflicts against several
  catalog PRs merged since this branch was cut: keep isModelHiddenBulk()
  (this PR's perf fix) alongside isExcludedByProviderConnections() (a
  concurrently landed feature), and adopt the already-merged canonical
  fingerprintCatalogAuthKey() helper for the cache-key hashing instead of
  the now-duplicate inline sha256 computation.
- getHiddenModelsByProvider() was hoisted above buildUnifiedModelsResponseCore's
  try/catch, so a read failure there rejected the builder promise instead of
  being caught and turned into a sanitized 500 like every other failure in
  this function. Combined with the pre-existing promise.finally() dangling
  chain in catalogCache.ts's in-flight coalescing, that produced a genuine
  unhandled rejection. Move the bulk-load call back inside the try block.
- Align tests/unit/models-catalog-route.test.ts and
  tests/unit/10313-catalog-cache-key-hashing.test.ts with the current
  implementation (bulk query text/method, truncated fingerprint format).

* perf(api): memoize getConnectionsForProvider in catalog builder

Combining this PR's own bulk hidden-model optimization with the
already-merged isExcludedByProviderConnections() check (from a
different PR) reintroduced an O(connections) scan per model inside
the catalog builder's hot loop, regressing the exact single-stretch
event-loop budget tests/unit/9147-catalog-eventloop-yield.test.ts
enforces (was passing on this PR's own commit before the merge).

Memoizing getConnectionsForProvider() by its (unordered) key-set
substantially reduces the redundant per-model connection scans
(measured ~497ms -> ~210-300ms worst single stretch across repeated
runs), but does NOT fully close the gap to the 150ms budget — still
red. Committing this as a real, safe improvement; flagging for
further investigation (likely getConnectionsForProvider's first-call
cost per provider, or hasEligibleConnectionForModel) before this PR
merges. NOT deciding to relax the test threshold myself.

---------

Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
2026-08-19 12:11:19 -03:00
Diego Rodrigues de Sa e Souza
ec4802d09c test(mcp): declara a precondição de env dos testes de principal do CCR/MCP (#10689)
`resolveCcrPrincipal` dá precedência a `resolveMcpCallerApiKeyId()`, que no
transporte stdio cai em `OMNIROUTE_API_KEY`/`ROUTER_API_KEY`. Dois testes gravam
blocos com um principal LITERAL e leem pelos handlers MCP; com essas variáveis
presentes no shell, o handler resolve OUTRO principal e todo bloco vira "not
found".

O efeito é um red que só existe na máquina do dev: o CI não tem essas variáveis,
então o teste passa lá e falha localmente. Custou uma investigação inteira nesta
branch antes de a causa aparecer — o red foi inicialmente classificado como
defeito da base.

A precondição já existia, só não estava escrita. Agora está, no mesmo idioma de
api-key-lifecycle.test.ts, cli-remote-mode.test.ts e do irmão
ccr-mcp-principal-5649.test.ts (que aprendeu isso no #7883): salvar, deletar no
topo, restaurar no `after`.

Nenhum código de produção mudou — não havia defeito de produção. Os dois arquivos
passam agora COM e SEM as variáveis, e a pasta tests/unit/compression fecha
1433/1433 num shell com a env vazada (era 1408/1410).

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-19 12:11:11 -03:00
Diego Rodrigues de Sa e Souza
dd70abe1ca feat(docker): expose DASHBOARD_ALLOW_EMBED as a build argument (#10701)
* feat(docker): expose DASHBOARD_ALLOW_EMBED as a build argument

The dashboard's frame-ancestors policy is compiled into the route manifest at
build time, so the only way to get an embed-enabled image was to edit the
Dockerfile: Docker silently drops a --build-arg with no matching ARG, so
`docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode` produced the default
image and no error.

Declared as ARG+ENV in the builder stage, mirroring OMNIROUTE_BASE_PATH, and
empty by default — the unframable default posture is unchanged. The runtime
stages deliberately do not carry it: the headers are already baked, so a
runtime value would advertise an effect it cannot have.

Guarded by tests/unit/dockerfile-dashboard-embed-arg-10273.test.ts, verified by
mutation (a bare ENV in place of the ARG fails 2 of the 3 assertions). Docs
updated across the guide, ENVIRONMENT.md and .env.example.

The guide also carries prettier normalization (emphasis markers, table
padding) applied by lint-staged on commit.

Refs #10273

* chore(changelog): correct the fragment to the real PR number (#10701)

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-19 12:10:44 -03:00
Diego Rodrigues de Sa e Souza
c8d531de0d fix(tests): drain three base-reds left by the SSE-comment default and a locale gap (#10704)
* fix(tests): drain three base-reds left by the SSE-comment default and a locale gap

All three reproduce on a pristine tip; none is caused by the branch that found
them.

1. i18n vi — six keys landed in en.json without a Vietnamese counterpart
   (settings.reasoningTokenBuffer*, settings.zeroLatencyOptimizations*,
   settings.compressionOutputStyle.i-have-adhd.*). The vi locale is held to
   strict parity, so the whole i18n-vi suite went red. Translated; no existing
   key reordered.

2. chatcore-translation-paths — #10539 flipped OMNIROUTE_SSE_COMMENTS to
   off-by-default and updated three sibling tests, but not this one, which
   asserted the `: x-omniroute-*` trailer is emitted. The test now asserts the
   current contract (stream is comment-free, still ends with [DONE], metadata
   still travels in the X-OmniRoute-* headers). The opt-in half stays covered by
   sse-comments-optout-9305.test.ts, which drives the env var through all three
   states. Enabling the flag inside this file instead leaks process.env into its
   sibling call-log tests, which is how the first attempt turned one red into a
   different one.

3. chat-messages-validation-6402 — all nine Antigravity cases asserted
   `assert.match(body, /ok/)` against the mocked model output. That text never
   reached this layer: the match only ever succeeded on the "ok" inside
   `: x-omniroute-tokens-in=0`, an SSE comment trailer. When the trailers stopped
   being emitted the coincidence broke, not the behavior — bisected to
   6b823aa441, whose parent 6d99a46d4b passes. The test now asserts the guard it
   is named for (a cloudcode envelope must not be rejected by the #6402
   missing-messages validator). Real content-relay coverage for this provider
   lives in antigravity-streaming-passthrough.test.ts, which passes.

Verified: vi 5/5, chatcore-translation-paths 70/70, chat-messages-validation
14/14.

* chore(changelog): correct the fragment to the real PR number (#10704)

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-19 12:10:36 -03:00
Diego Rodrigues de Sa e Souza
c98045652d fix(security): block SSRF via /v1/search Firecrawl provider_options.baseUrl (#10738)
The client-controlled provider_options.baseUrl (and legacy top-level
baseUrl) override was used verbatim to build the server-side fetch
target in buildFirecrawlSearchRequest(), with no SSRF validation. A
caller with a valid API key could redirect the search request at an
internal host (loopback, RFC1918, or a cloud-metadata endpoint) and
read the response back through the normal search result shape.

Validate the override with the existing outboundUrlGuard
(parseAndValidatePublicUrl) before it is used to build the fetch URL.
jinaSearch and perplexitySearch were checked and do not accept a
client-controlled baseUrl, so only firecrawlSearch needed the guard.

Reported-by: zmf963

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:10:22 -03:00
Diego Rodrigues de Sa e Souza
7affe0c857 fix(security): zero out open CodeQL code-scanning alerts (#10739)
* fix(security): zero out open CodeQL code-scanning alerts

- src/mitm/handlers/antigravity.ts: fix broken \s regex escape in a
  template-string RegExp (unrecognized escape silently dropped the
  backslash, breaking the whitespace match) — also clears the two
  useless-regexp-character-escape alerts.
- open-sse/executors/gemini-web.ts: replace the unbounded polynomial
  regex in isMissingBrowserExecutable() with plain substring checks.
- src/shared/middleware/chatBodyAdmission.ts, open-sse/services/
  conversationTracker.ts, src/app/api/v1/models/catalogCache.ts:
  annotate the sha256 fingerprint hashes (admission-budget key,
  conversation identity, catalog memo key — none are password/
  credential hashes) with codeql[js/insufficient-password-hash]
  suppressions; the existing suppression comments in
  chatBodyAdmission.ts were on the wrong line and CodeQL never
  picked them up.
- tests/unit/qwen-token-plan-console-site.test.ts, tests/unit/
  cloudflare-playground-provider.test.ts: replace raw
  string.includes(hostname) assertions with new URL(...).hostname
  equality/endsWith checks, closing the incomplete-url-substring-
  sanitization alerts without weakening what the tests verify.

* fix(security): correct codeql suppression comment syntax

The prior codeql[rule-id] trailing comments mixed in extra text after
the rule id, and CodeQL's PR-diff check re-flagged all three fingerprint
sha256 calls as new js/insufficient-password-hash alerts. Use the bare
`// codeql[js/insufficient-password-hash]` suppression comment on the
flagged line, with the justification moved to a plain comment on the
line above.

* fix(security): switch fingerprint hashes from sha256 to HMAC-SHA256

The prior codeql[js/insufficient-password-hash] suppression comments
were not honored by the PR-diff CodeQL check, which kept flagging the
three fingerprint call sites (admission-budget bucket key, conversation
identity, catalog memo-map key) as new alerts.

Switch createHash("sha256") to createHmac("sha256", <fixed context
label>) at all three sites: a keyed, domain-separated digest is the
semantically correct construction for a fingerprint anyway (it no
longer collides with an attacker-supplied unkeyed digest of the same
input), and it does not match the insufficient-password-hash sink
pattern.

* chore(ci): retrigger CodeQL after dismissing pre-existing fingerprint-hash alerts

Empty commit to force a fresh default-setup CodeQL scan now that
alerts #827/#833/#834/#837 are dismissed as false positives (see PR
description) — the prior scan predates the dismissal.

---------

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:10:15 -03:00
Diego Rodrigues de Sa e Souza
da0088df99 fix(ci): clear remaining base-reds on release/v3.8.50 (refs #9985) (#10749)
* fix(ci): route the Gemini Web b64_json download error through sanitizeErrorMessage()

open-sse/handlers/imageGeneration/providers/geminiWeb.ts embedded a raw
err.message in the b64_json download-failure response, tripping
check:error-helper (Hard Rule #12) on release/v3.8.50.

Refs #9985.

* fix(tests): drain test-drift base-reds left by #10603/#10537 and a stale qwen-web catalog id

Several base-reds on release/v3.8.50 (#9985) share one root cause: a legitimate
product change landed without updating the test asserting the old behavior.

- tests/unit/glm-provider-model-import-route.test.ts (12 tests) and
  tests/unit/model-sync-route.test.ts (2 tests) predate #10603, which made
  upstream model sync opt-in (isAutoFetchModelsEnabled() now requires
  providerSpecificData.autoFetchModels === true) and made manual custom-model
  overrides survive a sync instead of being demoted. Updated both files to
  opt in / assert the new preserve-manual-overrides behavior, with a comment
  citing #10603.
- tests/unit/antigravity-model-aliases.test.ts predates #10537, which retired
  the collapsed 'gemini-3.7-flash' alias (upstream 'gemini-3.7-flash-tiered')
  in favor of the three directly-callable tiered ids. Dropped the retired id
  from EXPECTED_FLASH_TIERS.
- open-sse/config/freeModelCatalog.data.ts: the qwen-web free-catalog entry
  still listed the retired 'qwen3.8-max-preview' id instead of the current
  'qwen3.8-max' (open-sse/config/providers/registry/qwen/web/index.ts and the
  executor's compat alias both confirm 'qwen3.8-max' is canonical). Real data
  drift, not test drift.
- src/i18n/messages/zh-TW.json: providers.autoFetchModelsTooltip (added by
  #10603) used the mainland term 緩存 instead of the zh-TW glossary-canonical
  快取, tripping the i18n-glossary-consistency-check base-red.
- src/lib/oauth/providers/zed-hosted.ts: removed an unused default export
  (the named export already covers every consumer) — shaves one symbol off
  the check:dead-code ratchet (419 -> 418; baseline 415, 3 still outstanding).

Refs #9985.

---------

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:09:43 -03:00
Diego Rodrigues de Sa e Souza
65e1960029 fix(usage): repair zero-reported input_tokens on non-trivial requests (#10705) (#10757)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 12:02:48 -03:00
Diego Rodrigues de Sa e Souza
4191e5dad2 fix(dashboard): /api/models must agree with /v1/models on synced coverage (#10615) (#10755)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:54:52 -03:00
Diego Rodrigues de Sa e Souza
6e809982e8 fix(dashboard): List Models card must not hardcode models={null} (#10553) (#10753)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:52:23 -03:00
Diego Rodrigues de Sa e Souza
12eef018cb fix(proxy): keep password-only proxy credentials (#10720) (#10752)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:48:18 -03:00
Michael YC JO
b88cd6c109 fix(tests): drain two base-reds on release/v3.8.50 — auto/glm family pool and the ESLint gate (#10726)
* fix(tests): drain the auto/glm base-red left by the Cloudflare Playground backend

provider-family-combos asserted a fixed provider list for auto/glm and started
failing on release/v3.8.50 once the Cloudflare AI Playground no-auth backend
landed: its registry advertises zai-org/glm-5.2 and zai-org/glm-4.7-flash, so the
virtual combo legitimately spans it.

The test already documents the rule it is failing on — a no-auth backend that
genuinely serves a family model IS a member of the family pool — and carries that
justification for auggie, devin-cli-agentic and zcode. Add cloudflare-playground
to the expectation with the same kind of source-cited note.

* fix(tests): green the ESLint gate left red by two untracked any casts

lint:json --max-warnings 0 failed on release/v3.8.50 because the suppression
counts drifted behind the tree: cli-oauth-commands carried 20 no-explicit-any
violations against a registered 18 (#10491 added two Commander-mock casts) and
executor-gitlab carried 5 against a registered 4 (#10499 added one).

The GitLab test casts are fixable, so they are fixed rather than suppressed: all
five now read the translated payload through a declared GitLabResponseBody
instead of any, and the file leaves the suppression list entirely.

The CLI OAuth casts target bin/cli/commands/oauth.mjs, which ships no types, so
the Commander mock has nothing to cast to; that entry only gets its count
corrected to the 20 already in the tree.
2026-08-19 11:18:30 -03:00
Diego Rodrigues de Sa e Souza
a1a37bbe7f fix: map OpenAI-compat voice names to real ElevenLabs voice_ids (#10589) (#10748)
handleElevenLabsSpeech forwarded body.voice straight into the ElevenLabs
voice_id URL path segment with no name resolution, so OpenAI stock voice
names (alloy, echo, ...) and ElevenLabs display names (Rachel, ...) 404'd
upstream instead of resolving. Extracted the alias/display-name tables and
resolution logic into open-sse/handlers/elevenLabsVoiceMap.ts (kept
audioSpeech.ts under the file-size cap) and wired it into
handleElevenLabsSpeech: known aliases resolve to a real voice_id, an
omitted voice keeps the previous Rachel default, and anything unresolvable
now returns a clear 400 instead of leaking an upstream 404.

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:45 -03:00
Diego Rodrigues de Sa e Souza
a8000bf1a2 fix: resolve audio provider short-alias prefix in parseAudioModel (#10586) (#10747)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:40 -03:00
Diego Rodrigues de Sa e Souza
4d92dfe0a2 fix: distinguish CLI-probe timeouts from not_found, resolve Hermes Agent keyId server-side (#10710+10711) (#10746)
#10710: locateCommand() in cliRuntime.ts collapsed a genuine probe timeout
(runProcess's timedOut flag) into the same reason:"not_found" as a truly
absent binary, on both the where.exe and `command -v` branches. Give
timeouts a distinct "timeout" reason, keep trying remaining command
candidates in locateCommandCandidate instead of treating a timeout as
terminal, and extend the settings-file fallback (cliInstallFallback.ts) to
also cover the new "timeout" reason, matching the scenario it already
existed for.

#10711: the Hermes Agent dashboard "Apply" flow only ever sends `keyId`
(never a raw `apiKey`), but the hermes-agent-settings POST handler never
resolved it, so generateHermesAgentConfig() always fell through to the
literal placeholder "YOUR_OMNIROUTE_API_KEY_HERE" for
providers.omniroute.api_key, delegation.api_key, and every
auxiliary.*.api_key. Resolve keyId server-side via getApiKeyById(), the
same precedented pattern already used by claude-settings/route.ts and
codex-settings/route.ts.

Bug 2 from #10710 (hermes tool-detector configPath) was already fixed by
commit 0a74bfbdea -- confirmed still intact,
no action needed.

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:34 -03:00
Diego Rodrigues de Sa e Souza
e1c2425ed7 fix: de-list googleflow video provider and fail fast (#10285) (#10745)
The googleflow (Veo) video provider is live-confirmed broken on two
independent axes: the submit/poll endpoints (/v1:generateVideo,
/v1:fetchOperation) 404 on aisandbox-pa, and even the reporter's
measured working endpoint (POST /v1/video:batchAsyncGenerateVideoText)
rejects the stored Cloud Code OAuth bearer (401 UNAUTHENTICATED) since
the cclog/cloud-platform scopes do not grant aisandbox-pa. Only a
headed-browser reCAPTCHA session works (confirmed against gflow-cli's
own docs), which cannot run headlessly.

Exclude googleflow from getAllVideoModels() so it stops being
advertised in /v1/models, and make handleGoogleFlowVideoGeneration
fail fast with a clear diagnostic instead of forwarding to the
known-wrong path and surfacing a raw HTML 404.

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:29 -03:00
Diego Rodrigues de Sa e Souza
cc544db38b fix: fail over streaming combo responses terminated with empty completions (#10404) (#10744)
validateResponseQuality's streaming-SSE peek only flagged an OpenAI-shape
stream as invalid when it closed WITHOUT ever reaching finish_reason/[DONE]
(#7285 truncation guard). A stream that DOES reach finish_reason: "stop"
but never carries any real content, reasoning, or tool_calls in any chunk
fell through as valid, exactly reproducing the reported content:null /
completion_tokens:0 HTTP 200 for cmd/meta/muse-spark-1.2-contributor.

Add a sibling failover branch for the terminated-but-empty case, mirroring
the existing truncation branch. Tool-calls-only streams are unaffected —
they already short-circuit through the earlier content-detection branch.

Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:22 -03:00
Diego Rodrigues de Sa e Souza
d6c4fec2ee fix: register a real Firefly auth probe for the firefly/adobe-firefly alias pair (#10522) (#10743)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:17 -03:00
Diego Rodrigues de Sa e Souza
b755dd5e74 fix: filter deleted providers out of /api/provider-metrics topology (#10714) (#10742)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:12 -03:00
Diego Rodrigues de Sa e Souza
41877978e0 fix: auto-replay bounded trajectory in DeepSeek Web prompt builder for non-tool-calling agentic clients (#10527) (#10741)
Co-authored-by: Markus Hartung <mail@hartmark.se>
2026-08-19 11:08:07 -03:00
Diego Rodrigues de Sa e Souza
b754e44e26 test(guard): widen the client-bundle guard to every "use client" entry point (#10692) (#10700)
The guard shipped with #10695 watched two hand-picked modules. It now walks the static
import graph from all 753 "use client" files in src/ (plus the two originally pinned
entries), so the invariant is verified across the repo instead of where someone
remembered to look. Full sweep runs in ~750ms.

Two exclusions make that practical:

- `import type` is not an edge — TypeScript erases it before the bundler sees it.
  Counting type imports turns 3 real findings into 29; a guard that cries wolf gets
  switched off.
- Dynamic `import()` is still not followed. It does not break a bundle edge (that was
  tried for #10692 and failed) but it does move the module into a chunk the browser
  fetches on demand, which is a legitimate boundary.

The widened sweep immediately found what the narrow one could not: five value-form
imports of `db/batches` / `db/files` across three files under dashboard/batch, each
reaching db/core → the SQLite driver. All five bind only interfaces (BatchRecord,
FileRecord) used in type position, so the compiler was eliding them and the build stayed
green — the same latent shape as #10692 before #10647 removed the toolchain's tolerance.
Marking them `import type` makes the elision explicit instead of incidental.

Refs #10692

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 21:51:25 -03:00
Diego Rodrigues de Sa e Souza
86fc1aade2 fix(ops): judge the canary install by the SHA on disk, not npm's exit code (#10699)
`npm install -g <tarball>` on the .17 gateway writes the whole package and then fails
renaming the old tree into its staging directory (ENOTEMPTY, exit 217). The canary read
that non-zero exit as "install failed", aborted before the restart, and discarded npm's
stderr through execFileSync throwing — so on 2026-08-18 the deploy stopped half-done
twice, each time leaving new files on disk under an old running process, with no clue in
the log.

The exit code is not trustworthy in either direction: the 2026-08-14 outage installed a
package built from the wrong branch and exited 0. classifyInstallOutcome() therefore
decides on the BUILD_SHA read back from the installed package, and fails closed when it
is absent or does not match — a zero exit with the wrong artifact is still a failure.

npm reuses the same staging directory name, so the orphan blocks the next install with
the same error; orphanStagingDirFromStderr() surfaces the exact path. It is not removed
automatically — that is an rm -rf under /usr/lib, not something a deploy script should
decide on its own.

Refs #10429

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 21:51:01 -03:00
Diego Rodrigues de Sa e Souza
d7368e243d docs(guides): DASHBOARD_ALLOW_EMBED is a build-time flag, not a runtime one (#10697)
* docs(guides): DASHBOARD_ALLOW_EMBED is build-time, not a runtime flag

The VS Code guide told operators to "start OmniRoute with
DASHBOARD_ALLOW_EMBED=vscode". Next.js compiles headers() into the route
manifest, so next.config.mjs reads the variable while the bundle is built —
exporting it in front of an already-built server does nothing, which is the
exact trap anyone on `npm install -g omniroute` or the Docker image falls into.

Documents the build-time nature, the working from-source recipe, and which
install paths can enable it at all. ENVIRONMENT.md and .env.example already
said build-time; this aligns the how-to with them and with the extension's own
fallback message.

* docs(changelog): announce the VS Code Copilot Chat integration

The release notes only mentioned OmniCopilot in passing, inside the DASHBOARD_ALLOW_EMBED bullet — a reader would never learn the extension exists. Adds the fragment that says it plainly, with both store links.

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 20:35:52 -03:00
Diego Rodrigues de Sa e Souza
d9cb48231c fix(skills): regenerate the CLI skills the quota subcommands left stale (#10698)
`check:agent-skills-sync` fails on the release tip (22b89a273b) with no local
changes: the generator reports omni-inference and cli-resilience as stale.

The `quota status` / `quota preview` / `quota ensure` subcommands were added to
the CLI catalog without re-running the generator, so the committed SKILL.md
files no longer match it. Output of `generate-agent-skills.mjs --apply`,
additive only — no hand edits.

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 20:17:56 -03:00
Diego Rodrigues de Sa e Souza
22b89a273b fix(config): keep the SQLite driver out of the client bundle (#10692) (#10695)
* fix(sse): import localDb through its real .ts extension (#10674)

`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in #10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes #10674

* fix(config): keep the SQLite driver out of the client bundle (#10692)

The `aihorde` entry in IMAGE_PROVIDERS imported its live-catalog service directly.
IMAGE_PROVIDERS is reachable from "use client" dashboard pages — they read its KEYS
to derive which providers support which media kind — so that import dragged
aihordeImageCatalog → safeOutboundFetch → proxyFetch → featureFlags → db/core →
sqljsAdapter into the browser graph. The build then tried to bundle fs/net/tls for
the browser and failed with 28 Module not found errors, leaving `Build App` red for
60 consecutive runs and no artifact buildable from the branch.

A dynamic import() does not fix this: the bundler still has to make the module
browser-loadable. The dependency is inverted instead — the registry entry knows only
a pure registration module, and the server-only service registers itself on import,
which every server path needing live models already does. With nothing registered the
getter yields [], exactly what the live catalog returned before its first poll.

Validated by a full `npm run build:release`: 0 Module not found, artifact produced.

Closes #10692

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 19:23:46 -03:00
Diego Rodrigues de Sa e Souza
37c81ce1d7 fix(sse): import localDb through its real .ts extension (#10674) (#10691)
`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in #10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes #10674

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
2026-08-18 19:23:16 -03:00
Xiangzhe
539cb3b7bc docs: add guidelines for using _artifacts/ for temporary files instead of /tmp 2026-08-18 19:21:21 -03:00
Xiangzhe
0cd107b9ae docs(i18n): retranslate the CLI reference and integrations guide across all 42 locales
The translated CLI docs predated the relay-like CLI work: every locale still shipped
the legacy Codex `config.yaml` quickstart (dropped from the English source when the
generator moved to TOML), none mentioned the `omniroute run` launcher or the Gemini
target, and CLI-INTEGRATIONS.md existed only in Polish.

Regenerated through the project pipeline (npm run i18n:run) for the two guides the
CLI effort changed:
- docs/i18n/*/docs/reference/CLI-TOOLS.md — 42 locales updated; the obsolete YAML
  quickstart is gone from all of them (the remaining config.yaml mentions mirror the
  English legacy note and Continue's own config)
- docs/i18n/*/docs/guides/CLI-INTEGRATIONS.md — 42 locales, 41 of them new files

ENVIRONMENT.md is deliberately not included: at ~26 chunks per locale it exceeds the
pipeline's 60s per-chunk timeout and fails after retries. It needs a raised
OMNIROUTE_TRANSLATION_TIMEOUT_MS, which is a separate maintenance run.

Verified: check:docs-all exits 0, doc-links reports no broken internal links, and
spot-checks confirm technical identifiers, front-matter and language bars survive
translation intact.
2026-08-18 18:32:39 -03:00
Xiangzhe
c02d7988a6 docs: close the accepted doc-drift backlog — counts, undocumented CLI bins, stale front-matter
Counts (check:docs-counts STRICT, 8 drifts → 0):
- 153 → 154 migrations in README.md, AGENTS.md and llm.txt (+ its 42 i18n mirrors,
  which must stay byte-identical to the root file)
- 340 → 341 providers in README.md, AGENTS.md, llm.txt, the package.json description
  and the 4 SVG diagrams; PROVIDER_REFERENCE.md regenerated via gen:provider-reference
  (the new entry is the cloudflare-playground no-auth provider)

Undocumented environment variables:
- 13 CLI_*_BIN vars that exist in cliRuntime but were in neither ENVIRONMENT.md nor
  .env.example (kilo, opencode, hermes, forge, jcode, deepseek-tui, codewhale, smelt,
  pi, crush, omp, letta, windsurf — windsurf ships no default command)
- OMNIROUTE_DEBUG and OMNIROUTE_HEALTHCHECK_PATH, read in code but absent from
  .env.example
- CLI_CURSOR_BIN documents both fallbacks (agent, then cursor)

Front-matter: bump the seven CLI/reference docs this effort touched from the stale
3.8.40/2026-06-28 stamp to the current release.

Out of scope but blocking check:docs-all, fixed with evidence: ENVIRONMENT.md and
.env.example still documented the Adobe Firefly CDP Chrome runtime removed in #9255.
Seven of its variables are read nowhere in the codebase and its source file no longer
exists; surviving vars are repointed at adobeFireflyBrowserLogin.ts and CHROME_PATH at
its real readers. The two Gemini CLI auth vars the run launcher scrubs from the child
env are added to the fabricated-docs external-tool allowlist, next to the existing
CODEX_HOME/COPILOT_PROVIDER_BASE_URL entries.

npm run check:docs-all now exits 0 for the first time on this base.
2026-08-18 17:50:40 -03:00
Xiangzhe
40e8084b8c docs(cli): fix drifts found in the post-relay documentation audit
- ENVIRONMENT.md: CLI_ALLOW_CONFIG_WRITES default is true (matches cliRuntime),
  CLI_QODER_BIN default is qodercli (also in .env.example), CLI_GEMINI_BIN is
  server-side detection only (omniroute run resolves from PATH)
- CLI-TOOLS.md: catalog counts 26 code / 8 agents (adds the missing zcode row),
  setup targets without auto-discovery list Qwen (not Gemini; Gemini is
  launch-only), hostSetupCommand only for the six tools with a host recipe,
  global env block uses GOOGLE_GEMINI_BASE_URL at the root, mention
  omniroute run as the generic launcher
- CLI-INTEGRATIONS.md: manifest aliases, per-target --model wiring (openai/ and
  omniroute/ prefixes, qwen hard-requires --model), run exit-code contract,
  gemini child-env scrub notes
- CODEX-CLI-CONFIGURATION.md: document omniroute configure codex / run codex
- SETUP_GUIDE.md + QUICK-START.md: surface the generic omniroute run launcher
- ENVIRONMENT.md: disambiguate OMNIROUTE_SMOKE_API_KEY (canary) from the
  OMNIROUTE_SMOKE_* CLI smoke-harness variables
2026-08-18 17:26:19 -03:00
backryun
df90591415 feat(providers): refresh curated model catalogs and retire Imagen 4 (#10537)
* feat(providers): refresh Gemini Flash catalogs and pricing

* fix(providers): refresh gemini-web Flash catalog

* chore(providers): eliminate Gemini 3.5/3.6 Flash models

* feat(providers): refresh Perplexity Web model mappings

* feat(providers): refresh PromptQL and Notion catalogs

* feat(providers): refresh KIE TinyCMS and Conol catalogs

* feat(providers): refresh OpenCode Zen catalog

* chore(providers): finish Gemini Flash cleanup

* chore(providers): retire Google Imagen 4
2026-08-18 12:27:46 -03:00
adevwithpurpose
08860f5cae fix(docs): remove stray unresolved conflict marker in ENVIRONMENT.md
A single orphaned "<<<<<<< HEAD" line (no matching =======/>>>>>>>
pair) leaked into release/v3.8.50 via PR #10039's merge-conflict
resolution during this session's serial-merge sweep. Repo-wide sweep
confirms no other stray markers exist. Table structure verified
intact before/after removal.
2026-08-18 12:14:45 -03:00
Diego Rodrigues de Sa e Souza
04af8b1517 feat(compression): adota omniglyph 1.4.0, perfis semânticos e contabilidade com evidência (#10647)
* feat(compression): target-wire OmniGlyph stage and transport fidelity gate

Roda o OmniGlyph depois da tradução para o wire real do provedor, em vez do
corpo de origem. Um cliente OpenAI roteado para Claude deixava de comprimir com
skip:source_format_not_claude porque o corpo ainda estava em formato OpenAI
quando a engine era avaliada.

- dispatch nativo por wire: Anthropic Messages, OpenAI Chat Completions e
  OpenAI Responses (input[] preservado, sem achatar para messages[]);
- estágio target-wire pós-translateRequest, com guarda contra dupla compressão
  no caminho Claude→OpenAI;
- preserveSystemPrompt do OmniRoute mapeado para compressSystem: false;
- imageTransportPolicy: fidelidade de bytes/dimensões separada de supportsVision;
  só Anthropic/Claude tem recibo byte-preserving, o resto é fail-closed;
- contagem de tokens de data URL PNG no wire OpenAI (marcador ;base64,);
- README e i18n en/pt-BR com claims escopados ao caminho medido.

* feat(compression): adota omniglyph 1.4.0 e tira o gate de modelo da env do host

O 1.4.0 introduziu escopos de segurança e passou a resolvê-los dentro de
isOmniGlyphSupportedModel() lendo process.env.OMNIGLYPH_PROFILE. Somado ao
OMNIGLYPH_MODELS que já existia, duas variáveis do ambiente do host decidiam em
silêncio o gate de TODO request do OmniRoute: passthrough desligaria a engine
inteira e OMNIGLYPH_MODELS admitiria modelos sem recibo medido, enquanto a UI
segue prometendo "Claude Fable 5 na rota direta medida".

O adapter passa a usar isOmniGlyphSupportedModelForScope() com escopo explícito
e fixa o escopo mais restrito como teto: a env só pode ESTREITAR a allowlist,
nunca alargar. Os dois wires compartilham a mesma lista no pacote desde o
1.4.0, então uma checagem cobre Anthropic e GPT.

- omniglyph ^1.3.1 -> ^1.4.0 (lock em 1.4.0);
- testes de regressão para os dois caminhos de sequestro por env;
- teste de contrato dos exports novos (escopo, perfis, accounting).

O 1.4.0 também traz, sem mudança de código aqui: correção do glyph K que era
lido como H, remoção do backtracking polinomial no secret-guard, overrides do
pnpm em pnpm-workspace.yaml e as transitivas vulneráveis resolvidas.

* feat(compression): expõe os perfis semânticos do omniglyph nos três wires

O 1.4.0 trouxe perfis nomeados (coding-safe, balanced, aggressive,
passthrough), mas só transformAnthropicMessages() os resolve sozinho: os
transformadores OpenAI recebem TransformOptions cru e ignorariam o campo. Um
perfil escolhido pelo operador valeria no wire Claude e sumiria no OpenAI. O
adapter passa a mesclar o perfil com mergeCompressionProfileOptions() antes de
chamar Chat Completions e Responses.

O default segue aggressive — a política que os recibos publicados mediram.
Medido nesta base: com coding-safe/balanced, uma sessão sem histórico acumulado
para em below_min_chars e a engine não faz nada, porque os dois fixam
minCompressChars no máximo e desligam system/tools/tool-results. Como a engine é
opt-in, um default assim entregaria "ligado, 0% de ganho".

O perfil é TETO, não piso: mergeCompressionProfileOptions não deixa um override
do chamador reabrir uma lane lossy que o perfil fechou. Coberto por teste, por
ser contra-intuitivo.

Também fecha um caminho em que o OmniRoute violaria a própria política: o wire
OpenAI do pacote não tem compressSystem — honra apenas compressTools,
gptHistory, minCompressChars e reflow, e sempre troca a instrução por um
ponteiro para a imagem. Com preserveSystemPrompt ligado, imagear assim queimaria
o prefixo quente que a decisão cache-aware está protegendo, sem nada no corpo
devolvido denunciando. A engine agora pula com
skip:system_preservation_unsupported_on_wire.

* feat(compression): contabilidade física do omniglyph com grau de evidência

O adapter descartava o TransformInfo inteiro, então a UI mostrava um número de
economia sem dizer de onde ele vinha — contagem do provider, estimativa ou só
diferença de bytes. O 1.4.0 expõe normalizeAccounting(), que classifica essa
evidência e resolve a semântica de cache por família: Anthropic reporta input,
cache-create e cache-read em buckets DISJUNTOS, enquanto OpenAI e xAI reportam
cached como SUBCONJUNTO do input. Somar à mão dá double-count silencioso.

O novo omniglyphTelemetry.ts não filtra por denylist — MONTA um objeto novo,
campo a campo, só com número e enum. TransformInfo mistura contadores
inofensivos com material que não pode ser persistido: bytes PNG,
imageSourceText(s), recoverable[].text, os sha8 de system/CLAUDE.md/primeira
mensagem, nomes de tags observadas e o bloco env (cwd, branch, versões). Copiar
o objeto inteiro transformaria telemetria de compressão em vazamento de prompt.
O teste de negação prova que segredo, caminho do operador, texto do system e
base64 não aparecem, e varre a allowlist exigindo que toda string seja de um
enum conhecido.

- provider threaded do chatCore e do bridge Codex WS até a engine; ausente vira
  `unknown`, que faz o upstream recusar adivinhar buckets de cache;
- contabilidade propagada para o engineBreakdown do passo (o agregado do
  pipeline soma todas as engines e não serviria);
- skip não emite contabilidade: zeros ali seriam indistinguíveis de "a engine
  nem rodou".

* feat(compression): perfil do omniglyph configurável, persistido e documentado

Fecha o caminho do operador: o perfil já existia no adapter, mas só como
default de código. Agora atravessa schema Zod, normalizador do banco, API de
settings e a página dedicada do engine.

- OmniglyphConfig tipado + omniglyphConfigSchema (z.enum dos quatro perfis);
- normalizeOmniglyphConfig: nome desconhecido vindo do storage cai para o
  default em vez de virar "roda com a política padrão";
- seletor na página do engine, com PATCH próprio — o perfil vive fora do mapa
  `engines`, e mandá-lo junto reescreveria o mapa inteiro (o store persiste o
  mapa como uma linha JSON só);
- i18n en/pt-BR descrevendo o custo medido de cada perfil, não só o nome;
- README e COMPRESSION_ENGINES.md com a regra do teto e o motivo de o default
  não ser o perfil mais seguro.

Corrige de passagem um teste-irmão que ninguém via: o gate de transporte na UI
deixou de dizer "direct Anthropic" quando os wires OpenAI nativos entraram, mas
tests/unit/ui/omniglyphContextPage.test.tsx continuou afirmando a cópia antiga.
O arquivo inteiro estava excluído do vitest.config.ts como "#8618 pre-existing
failure", então a quebra passou silenciosa. Com a asserção alinhada o arquivo
fecha 3/3, e a exclusão sai — o próprio comentário mandava removê-la quando
corrigida.

A doc não nomeia OMNIGLYPH_MODELS: o gate de docs fabricadas está certo em
apontar que o OmniRoute nunca lê essa env — quem lê é o pacote.

* fix(i18n): paridade do locale vi com as chaves novas do perfil do omniglyph

`tests/unit/i18n-vi-completeness.test.ts` exige paridade ESTRITA de chaves entre
en e vi — diferente do ratchet `i18n:check-ui-coverage`, que passa com 80%. As 11
chaves do seletor de perfil entraram só em en e pt-BR, e o gate de cobertura
seguiu verde, então a quebra só apareceu na matriz completa do CI.

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
2026-08-18 12:13:48 -03:00
Diego Rodrigues de Sa e Souza
233ac40e9d refactor(sse): ExecutorRegistry — route executor lookup through a runtime registry (R0.3) (#10633)
* test(sse): golden characterization of the executor map before the R0.3 registry refactor

Freezes the 137-entry provider-id → executor mapping (class, provider
identity, backing PROVIDERS config), the no-shared-instances invariant,
and the getExecutor() dispatch rules (memoized DefaultExecutor fallback,
cloud-agent guard #6699, search-provider guard #10274) as stable JSON
snapshots. The upcoming ExecutorRegistry must keep both snapshots
byte-identical.

* refactor(sse): route executor lookup through ExecutorRegistry (R0.3)

Adds open-sse/executors/registry.ts (Map-based registry mirroring
translator/registry.ts): the built-in table in executors/index.ts stays
declarative, every entry is registered at module load, and
getExecutor()/hasSpecializedExecutor() resolve through the registry.
DefaultExecutor fallback, its memoization, and the cloud-agent (#6699) /
search-provider (#10274) guards are unchanged.

Also fixes a latent lookup leak: the old object-literal lookup treated
Object.prototype names (constructor, toString, ...) as specialized
executors; the Map registry resolves them to the DefaultExecutor
fallback like any unknown provider.

Parity proof: executor-map golden (137 entries, byte-identical
before/after), check:known-symbols green, 1018 tests across the 65
executor test files green. Docs: OPEN_SSE_ARCHITECTURE factory section
corrected (it claimed generation from providerRegistry).

Refs #3501

* test(executors): regenerate ExecutorRegistry golden snapshots after release sync

release/v3.8.50 sunset mimocode and added cloudflare-playground + jina-search
since this PR's snapshots were captured; refresh the golden fixtures to match.

---------

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
Co-authored-by: Markus Hartung <mail@hartmark.se>
Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
2026-08-18 12:08:38 -03:00
Diego Rodrigues de Sa e Souza
397a0e351e fix(compression): gate de estágio não derruba o pipeline com engine sem metadata (#10655)
`assertValidEngine()` valida id, apply, compress, getConfigSchema e
validateConfig — não exige `metadata`. Uma engine registrada sem esse campo é,
portanto, um registro legal. Mas `canRunAtCompressionStage` lia
`engine.metadata.executionStages` sem guarda, então essa engine legal derrubava o
pipeline inteiro com `TypeError: Cannot read properties of undefined` em vez de
falhar aberto, que é o contrato da compressão.

Metadata ausente é o mesmo caso de "não declarou executionStages" e passa a cair
no mesmo fallback documentado: só pre-translation.

Isso destravava também `tests/unit/compression/pipeline-circuit-breaker.test.ts`,
que registra uma engine de teste sem metadata e vinha 8/9 na base — agora 9/9. O
teste novo torna o contrato explícito, em vez de deixá-lo dependendo de uma
reprodução incidental noutro arquivo.

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
2026-08-18 12:06:19 -03:00
554 changed files with 54109 additions and 13029 deletions

View File

@@ -128,6 +128,11 @@ PORT=20128
# Optional: set the public origin *with* the same path so OAuth and display URLs
# stay consistent without relying on window.location.origin alone:
# NEXT_PUBLIC_BASE_URL=https://host/omniroute
#
# Explicit path probed by the container health check. Unset, the probe derives it
# from OMNIROUTE_BASE_PATH; setting it opts back into the deep monitoring endpoint.
# Used by: scripts/dev/healthcheck.mjs
# OMNIROUTE_HEALTHCHECK_PATH=/api/monitoring/health
# Opt-in iframe embedding of the OmniRoute HTML pages (issue #10273). Off by default:
# every route ships `frame-ancestors 'none'` + `X-Frame-Options: DENY`, which is why the
@@ -138,6 +143,8 @@ PORT=20128
# (/api, /v1, /v1beta, /a2a, /healthz and the root-level aliases) keeps the strict
# headers regardless. Only `vscode` is recognised; `1`/`true` do NOT enable it.
# Used by: next.config.mjs via scripts/build/dashboardEmbed.mjs — build-time, rebuild after changing.
# Docker: pass it as a build arg (`docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode`);
# setting it on an already-built server or image does nothing.
# DASHBOARD_ALLOW_EMBED=vscode
# Split-port mode: serve Dashboard and API on separate ports for network isolation.
@@ -257,6 +264,11 @@ OMNIROUTE_USE_TURBOPACK=1
# so a missing/corrupt cache never breaks tab-completion.
# OMNIROUTE_DEBUG_COMPLETION=1
# Set to 1 to print per-request timing diagnostics from the CLI quota commands
# to stderr (`[omniroute] GET <path> completed in Nms`).
# Used by: bin/cli/commands/quota.mjs
# OMNIROUTE_DEBUG=1
# Docker production port mappings (docker-compose.prod.yml only).
# These set the HOST-side published ports. Container ports use PORT/API_PORT.
# PROD_DASHBOARD_PORT=20130
@@ -761,11 +773,25 @@ NEXT_PUBLIC_ENABLE_SOCKS5_PROXY=true
# CLI_CURSOR_BIN=agent
# CLI_CLINE_BIN=cline
# CLI_CONTINUE_BIN=cn
# CLI_QODER_BIN=qoder
# CLI_QODER_BIN=qodercli
# CLI_QWEN_BIN=qwen
# CLI_AIDER_BIN=aider
# CLI_GOOSE_BIN=goose
# CLI_GEMINI_BIN=gemini
# CLI_KILO_BIN=kilocode
# CLI_OPENCODE_BIN=opencode
# CLI_HERMES_BIN=hermes
# CLI_FORGE_BIN=forge
# CLI_JCODE_BIN=jcode
# CLI_DEEPSEEK_TUI_BIN=deepseek-tui
# CLI_CODEWHALE_BIN=codewhale
# CLI_SMELT_BIN=smelt
# CLI_PI_BIN=pi
# CLI_CRUSH_BIN=crush
# CLI_OMP_BIN=omp
# CLI_LETTA_BIN=letta
# Windsurf has no default binary — set this to enable binary detection for it.
# CLI_WINDSURF_BIN=windsurf
# CLI_AUGGIE_BIN=auggie
# AUGGIE_BIN=auggie
@@ -1007,6 +1033,10 @@ PROVIDER_LIMITS_SYNC_SPACING_MS=1500
# Used by: src/lib/db/core.ts::getDbHealthCheckIntervalMs().
#OMNIROUTE_DB_HEALTHCHECK_INTERVAL_MS=21600000
# WAL truncate cadence override (ms). Set to 0 to disable. Default: 21600000 (6h).
# Used by: src/lib/db/core.ts::getWalTruncateIntervalMs().
#OMNIROUTE_WAL_TRUNCATE_INTERVAL_MS=21600000
# Skip the Redis-backed auth cache used by API key lookups (forces DB reads).
# Used by: src/lib/db/apiKeys.ts. Set to 1 to disable. Default: enabled.
#OMNIROUTE_DISABLE_REDIS_AUTH_CACHE=0
@@ -2817,18 +2847,14 @@ QUOTA_STORE_DRIVER=sqlite
# Minimum spacing between submissions and the extra pause after every third success.
# ADOBE_FIREFLY_MIN_SUBMIT_GAP_MS=12000
# ADOBE_FIREFLY_BATCH_EXTRA_GAP_MS=15000
# Chrome CDP runtime used by Adobe Firefly renewal. True headless is debug-only:
# Adobe colligo normally rejects risk tokens minted without a headed browser.
# ADOBE_FIREFLY_CHROME_CDP_PORT=9334
# ADOBE_FIREFLY_CHROME_VISIBLE=0
# ADOBE_FIREFLY_CHROME_HEADED=0 # Legacy alias for ADOBE_FIREFLY_CHROME_VISIBLE=1
# Browser used by Adobe Firefly renewal. True headless is debug-only: Adobe
# colligo normally rejects risk tokens minted without a headed browser.
# Used by: open-sse/services/adobeFireflyBrowserLogin.ts
# ADOBE_FIREFLY_CHROME_HEADLESS=0
# ADOBE_FIREFLY_CHROME_FORCE_RESTART=0
# ADOBE_FIREFLY_CHROME_PING=auto
# ADOBE_FIREFLY_LOGIN_WAIT_MS=0
# ADOBE_FIREFLY_FORTER_WAIT_MS=45000
# Optional absolute Chrome executable; auto-detected when unset.
# CHROME_PATH=
# The CDP-attached Chrome runtime (adobeFireflyChromeRuntime.ts) was removed in
# #9255 along with its knobs — ADOBE_FIREFLY_CHROME_CDP_PORT, _VISIBLE, _HEADED,
# _PING, _FORCE_RESTART, ADOBE_FIREFLY_LOGIN_WAIT_MS and _FORTER_WAIT_MS are read
# nowhere and have no effect.
# Telegram Mini App bridge. The update endpoint remains disabled while the bot
# token is unset. Used by: src/lib/telegram/* and src/app/api/telegram/update/route.ts.

64
.github/workflows/radar-export.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
# Publica o export estável do catálogo consumido pelo OmniRoute Radar numa URL
# fixa (asset de release `radar-export-latest`), para o servidor privado do Radar
# (1 GB RAM, nunca clona/builda o OmniRoute) baixá-lo via `RADAR_EXPORT_URL` em
# vez de depender do snapshot gravado no deploy. Fonte: scripts/release/radar-export.mjs.
#
# A URL estável resultante (definir em RADAR_EXPORT_URL no .env do radar-server):
# https://github.com/diegosouzapw/OmniRoute/releases/download/radar-export-latest/export-omniroute.json
name: Radar Export
on:
workflow_dispatch: # o operador pode publicar sob demanda (de qualquer ref)
push:
branches: [main] # produção: só o catálogo do main clobra o asset estável
paths:
- open-sse/config/freeModelCatalog.data.ts
- open-sse/config/freeModelCatalog.ts
- open-sse/config/providerRegistry.ts
- open-sse/config/providers/**
- scripts/release/radar-export.mjs
- .github/workflows/radar-export.yml
schedule:
- cron: "17 6 * * 1" # semanal (segunda 06:17 UTC): mantém geradoEm/proveniência frescos
permissions:
contents: read
concurrency:
group: radar-export-${{ github.ref }}
cancel-in-progress: true
env:
CI_NODE_VERSION: "24"
jobs:
publish-export:
runs-on: ubuntu-latest
permissions:
contents: write # gh release upload — clobra o asset estável do export
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false # publish usa GH_TOKEN via gh release, não a credencial do checkout
- uses: actions/setup-node@v7
with:
node-version: ${{ env.CI_NODE_VERSION }}
cache: npm
- run: npm ci
- name: Generate catalog export with provenance
run: node --import tsx/esm scripts/release/radar-export.mjs "$RUNNER_TEMP/export-omniroute.json"
- name: Publish to the stable release asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="radar-export-latest"
# Cria o release estável na primeira vez; nas seguintes só re-anexa o asset.
if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release create "$TAG" \
--repo "$GITHUB_REPOSITORY" \
--title "Radar catalog export (rolling)" \
--notes "Export estável do catálogo OmniRoute para o Radar. Atualizado automaticamente; NÃO é um release de versão do produto." \
--latest=false
fi
gh release upload "$TAG" "$RUNNER_TEMP/export-omniroute.json" --repo "$GITHUB_REPOSITORY" --clobber

View File

@@ -46,7 +46,7 @@ Repository map and Reference Documentation sections below.
## Project at a Glance
**OmniRoute** — unified AI proxy/router. One endpoint, 340 LLM providers, auto-fallback.
**OmniRoute** — unified AI proxy/router. One endpoint, 342 LLM providers, auto-fallback.
| Layer | Location | Purpose |
| ------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -56,7 +56,7 @@ Repository map and Reference Documentation sections below.
| Translators | `open-sse/translator/` | Format conversion (OpenAI↔Claude↔Gemini) |
| Transformer | `open-sse/transformer/` | Responses API ↔ Chat Completions |
| Services | `open-sse/services/` | Combo routing, rate limits, caching, etc |
| Database | `src/lib/db/` | SQLite domain modules (153 migrations) |
| Database | `src/lib/db/` | SQLite domain modules (154 migrations) |
| Domain/Policy | `src/domain/` | Policy engine, cost rules, fallback logic |
| MCP Server | `open-sse/mcp-server/` | 109 tools (44 canonical + memory/skill/GitHub/pool/gamification/plugin/Notion/Obsidian/local-corpus/RTK modules), 3 transports (stdio / SSE / Streamable HTTP), 33 scopes |
| A2A Server | `src/lib/a2a/` | JSON-RPC 2.0 agent protocol |

View File

@@ -167,6 +167,7 @@ _Living section — regenerated 2026-08-12 from all cycle commits (cycle open `e
### 🐛 Bug Fixes
- **security(search)**: block SSRF via `/v1/search` `provider_options.baseUrl` for the Firecrawl search provider — the client-controlled override is now validated as a public URL before it is used to build the server-side fetch target, so a caller with a valid API key can no longer redirect search requests at loopback, RFC1918, or cloud-metadata hosts — thanks @zmf963
- **providers**: honor `PATCH /api/providers/[id]` so `omniroute providers rotate` stops 405ing (the OpenAPI spec and CLI already use PATCH) (PR #10366)
- **executors**: fix internal timeout misclassified as client disconnect (499) for 7 niche executors — pass TimeoutError reason to controller.abort() (#8197 side-finding)
- test(combo): guard auto/best-free never leaks the combo name as a model (#7754)

View File

@@ -47,6 +47,21 @@ rewrite it to the `_tasks/…` equivalent before writing:
Commit those artifacts inside the `_tasks/` repo (`git -C _tasks …`), never in the main repo.
## Scratch / temporary files — use `_artifacts/`, not `/tmp`
This project overrides the harness's default session scratchpad (`/tmp/claude-*/…`). Write
temporary/working files — exports, generated zips, one-off intermediate outputs, anything you'd
otherwise put in `/tmp` — to `/home/diegosouzapw/dev/proxys/OmniRoute/_artifacts/` instead.
- `_artifacts/` is a root `_*` path: already gitignored (`AGENTS.md` → "Root `_*` paths"), lives
on disk only, never tracked.
- Reason: keeping scratch output inside the project (vs `/tmp`) makes it trivial for the operator
to find and delete everything temporary in one place, instead of hunting across ephemeral
session-specific `/tmp` directories that vanish or accumulate untracked.
- Do **not** confuse this with `_tasks/` (Hard Rule #23, its own private git repo for durable
plans/specs/research/hand-offs) — `_artifacts/` is for disposable working files only, nothing
here needs to survive or be versioned.
## Base-green before opening PRs
Before cutting a branch or opening a PR, run the base-green check (`AGENTS.md` → Git Workflow →

View File

@@ -140,6 +140,18 @@ ENV OMNIROUTE_USE_TURBOPACK="${OMNIROUTE_USE_TURBOPACK}"
ARG OMNIROUTE_BASE_PATH=""
ENV OMNIROUTE_BASE_PATH=$OMNIROUTE_BASE_PATH
# #10273: the dashboard's `frame-ancestors` policy is compiled into the route
# manifest by next.config.mjs (via scripts/build/dashboardEmbed.mjs), so it is
# fixed when the image is built and cannot be flipped with `-e` on a running
# container. Build with `--build-arg DASHBOARD_ALLOW_EMBED=vscode` to produce an
# image whose HTML pages may be framed by the VS Code Simple Browser
# (OmniCopilot's `dashboardOpen: "editor"`). Unset — the default — keeps every
# route on `frame-ancestors 'none'` + X-Frame-Options: DENY. Builder-stage only:
# the runner stage deliberately does not carry it, because a runtime value would
# suggest an effect it cannot have.
ARG DASHBOARD_ALLOW_EMBED=""
ENV DASHBOARD_ALLOW_EMBED=$DASHBOARD_ALLOW_EMBED
# Docker containers cannot run the MITM/Agent-Bridge stack (no host DNS/cert
# access), so keep @/mitm/manager on the graceful stub (#3390). This flag is
# Docker-only: npm/Electron/VPS builds must bundle the REAL manager (#6344).

View File

@@ -7,7 +7,7 @@
# 🚀 OmniRoute — The Free AI Gateway
<img src="./docs/diagrams/readme-hero.svg" width="100%" alt="OmniRoute — Never stop coding. Every AI tool → 340 providers — 90+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot & Antigravity into FREE Claude / GPT / Gemini with auto-fallback. RTK + Caveman stacked compression saves 1595% tokens (~89% avg) — never hit limits. 340 AI providers · 90+ free tiers · ~1.51B free tokens/mo · 19 routing strategies · $0 to start."/>
<img src="./docs/diagrams/readme-hero.svg" width="100%" alt="OmniRoute — Never stop coding. Every AI tool → 342 providers — 90+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot & Antigravity into FREE Claude / GPT / Gemini with auto-fallback. RTK + Caveman stacked compression saves 1595% tokens (~89% avg) — never hit limits. 342 AI providers · 90+ free tiers · ~1.51B free tokens/mo · 19 routing strategies · $0 to start."/>
</div>
@@ -63,7 +63,7 @@
| | v3.8.49 | **v3.8.50** | `v3.8.51+` |
| ------------------------- | :-----: | :---------: | :---------: |
| 🌐 Providers | 290 | **340** | more queued |
| 🌐 Providers | 290 | **342** | more queued |
| 🧠 Documented models | 1185 | **1202** | — |
| 🖼️ Modality Bridge | — | 🆕 vision | video |
| 📡 Radar free catalog | — | 🆕 opt-in | — |
@@ -101,7 +101,7 @@
<tr>
<td align="right"><b>⚙️ Features</b></td>
<td align="center"><a href="#-combos--the-flagship">🎯 Combos</a></td>
<td align="center"><a href="#-340-ai-providers--90-free">🌐 Providers</a></td>
<td align="center"><a href="#-342-ai-providers--90-free">🌐 Providers</a></td>
<td align="center"><a href="#-full-cli--a2a--mcp">🔌 CLI &amp; MCP</a></td>
</tr>
<tr>
@@ -210,7 +210,7 @@ curl http://localhost:20128/v1/chat/completions \
</div>
<img src="./docs/diagrams/promise-pillars.svg" width="100%" alt="The Promise — One endpoint. 340 providers. Never stop building — OmniRoute picks the cheapest one that works. Six pillars: Never hit limits (auto-fallback across 340 providers in milliseconds, zero downtime) · Save up to 95% tokens (RTK + Caveman stacked compression cuts 1595%, ~89% avg on tool-heavy sessions) · $0 to start (90+ free tiers, 56 free forever — no card needed) · Every tool works (33 coding agents through one config) · One endpoint (OpenAI ↔ Claude ↔ Gemini ↔ Responses API at /v1) · Production-grade (circuit breakers, TLS stealth, MCP 109 tools, A2A, memory, guardrails, evals — 25,000+ tests)."/>
<img src="./docs/diagrams/promise-pillars.svg" width="100%" alt="The Promise — One endpoint. 342 providers. Never stop building — OmniRoute picks the cheapest one that works. Six pillars: Never hit limits (auto-fallback across 342 providers in milliseconds, zero downtime) · Save up to 95% tokens (RTK + Caveman stacked compression cuts 1595%, ~89% avg on tool-heavy sessions) · $0 to start (90+ free tiers, 56 free forever — no card needed) · Every tool works (33 coding agents through one config) · One endpoint (OpenAI ↔ Claude ↔ Gemini ↔ Responses API at /v1) · Production-grade (circuit breakers, TLS stealth, MCP 109 tools, A2A, memory, guardrails, evals — 25,000+ tests)."/>
<br/>
<br/>
@@ -461,7 +461,7 @@ All **19** strategies — mix & match per combo step:
</div>
<img src="./docs/diagrams/comparison-table.svg" width="100%" alt="What sets OmniRoute apart — comparison table vs 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute: 340 providers, 90+ free providers built-in, 19 routing strategies, 12-engine token compression, built-in MCP server with 109 tools, A2A agent protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, Desktop/Termux/PWA, 43 i18n UI locales, 100% MIT self-hosted. OmniRoute is the only one with the full set; competitors show a mix of checks, partials and crosses. Verified from each project&apos;s docs."/>
<img src="./docs/diagrams/comparison-table.svg" width="100%" alt="What sets OmniRoute apart — comparison table vs 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute: 342 providers, 90+ free providers built-in, 19 routing strategies, 12-engine token compression, built-in MCP server with 109 tools, A2A agent protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, Desktop/Termux/PWA, 43 i18n UI locales, 100% MIT self-hosted. OmniRoute is the only one with the full set; competitors show a mix of checks, partials and crosses. Verified from each project&apos;s docs."/>
<sub>📊 Full methodology &amp; per-feature detail vs 9router, OpenRouter, CLIProxyAPI &amp; LiteLLM → [`docs/comparison/OMNIROUTE_VS_ALTERNATIVES.md`](docs/comparison/OMNIROUTE_VS_ALTERNATIVES.md)</sub>
@@ -557,9 +557,9 @@ the current catalog at **[radar.omniroute.online/planos](https://radar.omniroute
- **🧠 Memory you control** — off by default, opt-in int8 vector quantization + typed decay, per-request `x-omniroute-no-memory`. → [Memory](docs/frameworks/MEMORY.md)
- **🛡️ Security** — prompt-injection guard on every LLM route (red-team suite), opt-in credential-masking guardrail (redacts leaked API keys/secrets in both directions), free DuckDuckGo last-resort web search, and an optional OIDC login gate for the dashboard (password login always stays available). → [Guardrails](docs/security/GUARDRAILS.md)
- **🖼️ New endpoints** — `/v1/ocr` (Mistral OCR) and `/v1/audio/translations` (Whisper-style) round out the media surface. → [API Reference](docs/reference/API_REFERENCE.md)
- **🎨 Image / video / audio generation** — one API for media: xAI Grok Imagine & Novita AI video, ComfyUI, Freepik, Adobe Firefly, Microsoft Designer, Google Imagen, Segmind, EdgeTTS. → [API Reference](docs/reference/API_REFERENCE.md)
- **🎨 Image / video / audio generation** — one API for media: xAI Grok Imagine & Novita AI video, ComfyUI, Freepik, Adobe Firefly, Microsoft Designer, Segmind, EdgeTTS. → [API Reference](docs/reference/API_REFERENCE.md)
- **🌍 Deployment & ops** — reverse-proxy `basePath`, browser-language auto-detect, per-key device tracking, root-less MITM trust, zh-TW localization. → [Environment](docs/reference/ENVIRONMENT.md)
- **🤝 More providers & agents** — Cursor Cloud Agent, Grok Build (xAI) with browser + OAuth login, Ollama first-class card, Claude Opus 5 & Sonnet 5, Kimi official partnership (Code/Web/Moonshot), Zed, Requesty, SenseNova, Yuanbao, Agnes AI… and a refreshed **340-provider catalog**. → [Providers](docs/reference/PROVIDER_REFERENCE.md)
- **🤝 More providers & agents** — Cursor Cloud Agent, Grok Build (xAI) with browser + OAuth login, Ollama first-class card, Claude Opus 5 & Sonnet 5, Kimi official partnership (Code/Web/Moonshot), Zed, Requesty, SenseNova, Yuanbao, Agnes AI… and a refreshed **342-provider catalog**. → [Providers](docs/reference/PROVIDER_REFERENCE.md)
- **📡 Routing transparency** — every response carries an `X-OmniRoute-Decision` header naming the strategy/provider/latency that served it, a new `cache-optimized` combo strategy + Auto-Combo `cacheAffinity` factor route repeat requests back to the connection holding the cached prefix, and a read-only `/v1/auto-combo/{channel}/candidates` endpoint exposes an `auto/*` channel's live candidate pool. → [Auto-Combo](docs/routing/AUTO-COMBO.md)
- **⚡ Local performance & infra** — one-click local Redis, Cloudflare Workers / Deno Deploy relay deployers, Bifrost & Mux as supervised embedded services. → [Embedded Services](docs/frameworks/EMBEDDED-SERVICES.md)
@@ -642,11 +642,11 @@ of your shell history. → [CLI Integrations](docs/guides/CLI-INTEGRATIONS.md)
<div align="center">
## 🌐 340 AI Providers — 90+ Free
## 🌐 342 AI Providers — 90+ Free
</div>
> The most complete catalog of any open-source router: **340 providers**, **90+ with a free tier**, **56 free forever**.
> The most complete catalog of any open-source router: **342 providers**, **90+ with a free tier**, **56 free forever**.
<div align="center">
@@ -877,7 +877,7 @@ Engines run in pipeline order; each is independently toggleable and configurable
<tr><td align="center" nowrap>9</td><td align="left" nowrap><b>Aggressive</b></td><td align="left">Summarization + progressive aging of old turns</td></tr>
<tr><td align="center" nowrap>10</td><td align="left" nowrap><b>LLMLingua-2</b></td><td align="left">ML semantic pruning via MobileBERT ONNX — code-safe, async</td></tr>
<tr><td align="center" nowrap>11</td><td align="left" nowrap><b>Ultra</b></td><td align="left">Heuristic token pruning with an optional small-model (SLM) tier</td></tr>
<tr><td align="center" nowrap>12</td><td align="left" nowrap><b>OmniGlyph</b></td><td align="left">Experimental context-as-image encoding routed to Claude Fable 5 (most aggressive; opt-in)</td></tr>
<tr><td align="center" nowrap>12</td><td align="left" nowrap><b>OmniGlyph</b></td><td align="left">Experimental context-as-image encoding for measured Claude Fable 5 on the direct Anthropic wire; GPT 5.6 transformers remain fail-closed pending provider receipts. Four compression profiles (aggressive default, balanced, coding-safe, passthrough) (most aggressive; opt-in)</td></tr>
</table>
Code blocks, URLs and structured data are **always preserved** byte-perfect. **One-click presets** combine the engines:
@@ -1172,7 +1172,7 @@ Métricas de validação: 1002 vídeos rastreados · 7,069,190 visualizações c
<tr><td nowrap><b>Runtime</b></td><td>Node.js 22.x / 24.x LTS — <code>&gt;=22.22.2 &lt;23 || &gt;=24.0.0 &lt;27</code></td></tr>
<tr><td nowrap><b>Language</b></td><td>TypeScript 6.0 — <b>100% TypeScript</b> across <code>src/</code> and <code>open-sse/</code> (zero <code>any</code> in core since v2.0)</td></tr>
<tr><td nowrap><b>Framework</b></td><td>Next.js 16 + React 19 + Tailwind CSS 4</td></tr>
<tr><td nowrap><b>Database</b></td><td>better-sqlite3 (SQLite, WAL journaling) + LowDB (JSON legacy) — 120 domain modules, 153 migrations</td></tr>
<tr><td nowrap><b>Database</b></td><td>better-sqlite3 (SQLite, WAL journaling) + LowDB (JSON legacy) — 120 domain modules, 154 migrations</td></tr>
<tr><td nowrap><b>Memory</b></td><td>SQLite FTS5 full-text + int8-quantized vector embeddings, typed decay</td></tr>
<tr><td nowrap><b>Schemas</b></td><td>Zod 4 — MCP tool I/O validation + API contracts</td></tr>
<tr><td nowrap><b>Protocols</b></td><td>MCP (stdio / HTTP / SSE) + A2A v0.3 (JSON-RPC 2.0 + SSE)</td></tr>

View File

@@ -118,6 +118,11 @@ export function npmInstallRuntime(pkgs, opts = {}) {
// install of a sibling runtime dep (e.g. systray2 from trayRuntime.ts, which writes to the
// same runtime dir) does not prune this package as "extraneous" — that pruning otherwise
// reproduces "No SQLite driver available" after a tray install removes better-sqlite3.
// npm 12+ defaults `allowScripts` to off, silently skipping lifecycle/install
// scripts (e.g. better-sqlite3's node-gyp/prebuild-install rebuild) unless the
// package has a matching `allowScripts` entry — and still exits 0, masking the
// failure (#10713). The runtime dir is a CLI-owned, non-user package.json, so
// explicitly allowing scripts for the packages we are installing here is safe.
const npmArgs = [
"install",
...pkgs,
@@ -125,6 +130,7 @@ export function npmInstallRuntime(pkgs, opts = {}) {
"--no-fund",
"--prefer-online",
"--save-exact",
...pkgs.map((pkg) => `--allow-scripts=${pkg}`),
];
// On Windows .cmd files cannot be executed without a shell; use cmd.exe /c explicitly
// so we never set shell:true (which would propagate env and enable injection).

View File

@@ -102,7 +102,7 @@ export async function waitForServer(port, timeout = 60000) {
// - "not-listening": nothing is accepting connections on the port at all.
async function pollHealthOnce(port) {
try {
const res = await fetch(`http://localhost:${port}/api/monitoring/health`, {
const res = await fetch(`http://127.0.0.1:${port}/api/monitoring/health`, {
signal: AbortSignal.timeout(2000),
});
return res.ok ? "ready" : "fast-reject";

View File

@@ -0,0 +1 @@
- **docs(guides):** OmniRoute now serves VS Code's **native Copilot Chat model picker** through the [OmniCopilot](https://github.com/diegosouzapw/OmniCopilot) extension ([Marketplace](https://marketplace.visualstudio.com/items?itemName=diegosouzapw.omnicopilot) · [Open VSX](https://open-vsx.org/extension/diegosouzapw/omnicopilot) — Cursor, Windsurf, VSCodium, Theia…) — no Copilot subscription needed since VS Code 1.122. New [`docs/guides/VSCODE-COPILOT.md`](docs/guides/VSCODE-COPILOT.md) covers setup, how the picker collapses the `dual`-prefix catalog via `GET /v1/models?prefix=alias`, and the **build-time** `DASHBOARD_ALLOW_EMBED=vscode` flag that renders the dashboard in an editor tab ([#10697](https://github.com/diegosouzapw/OmniRoute/pull/10697))

View File

@@ -0,0 +1 @@
- **feat(docker):** `DASHBOARD_ALLOW_EMBED` is now a Docker build argument — `docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode` produces an image whose dashboard renders inside the VS Code Simple Browser (OmniCopilot's `dashboardOpen: "editor"`). Previously the flag was only reachable from a source build: Docker silently drops a `--build-arg` with no matching `ARG`, so the operator got the default image and no error. Builder-stage only and empty by default — the runtime stages deliberately do not carry it, and the unframable default posture is unchanged ([#10701](https://github.com/diegosouzapw/OmniRoute/pull/10701))

View File

@@ -0,0 +1 @@
- **feat(providers):** new `cursor-api` provider (card "Cursor API", alias `cua`): connect a Cursor user API key (`crsr_…`) and route `cursor-api/<model>` through the existing Cursor agent executor (the key is exchanged for a 1h session token and cached), plus a `/api/cursor-cli/*` passthrough so the Cursor CLI itself runs through OmniRoute (`CURSOR_API_ENDPOINT=http://<omniroute>/api/cursor-cli`, `CURSOR_API_KEY=<OmniRoute key>`) with every RPC attributed and logged. The IDE `cursor` provider is unchanged. (#10729)

View File

@@ -0,0 +1 @@
- **feat(api):** `GET /api/health` now answers `{ status, timestamp }` without a key. Until now the path had no route, so the management-auth boundary answered first with a 401 — indistinguishable from a wrong key or an unknown route, which left Docker HEALTHCHECKs and Kubernetes probes unable to tell "down" from "misconfigured". Kept deliberately minimal: version, uptime and memory stay behind the authenticated `/api/monitoring/health` ([#PRNUM](https://github.com/diegosouzapw/OmniRoute/pull/10771)).

View File

@@ -0,0 +1 @@
- feat(routing): make Task-Aware Smart Routing's detection patterns operator-configurable via `settings.taskRouting.patternOverrides` (`PUT /api/settings/task-routing`) — the built-in patterns are English-only, so a non-English dashboard had no recourse short of turning detection off entirely; an override now replaces the pattern list for one task type without touching the rest (#10783)

View File

@@ -0,0 +1 @@
- **feat(usage):** show Kimi Coding's fixed-order Code 5-hour/7-day quota windows plus Extra Usage status, balance, monthly spend/limit, and the official Additional Credits link on Dashboard → Quota cards.

View File

@@ -0,0 +1 @@
- fix(video): stop advertising the googleflow (Veo) video provider as working and fail fast with a clear diagnostic — its submit/poll endpoints 404 and no server-side OAuth transport can satisfy the working endpoint (#10285)

View File

@@ -0,0 +1 @@
- fix(api): hash the API key before using it as the model-catalog cache Map key (no raw credentials in process heap) (#10313)

View File

@@ -0,0 +1 @@
- fix(sse): fail over combo streaming responses that reach `finish_reason` with zero content, reasoning, or tool_calls instead of forwarding a terminated-but-empty completion (#10404)

View File

@@ -0,0 +1 @@
- fix(mitm): forward passthrough traffic to the actual requested Host instead of misrouting every non-TARGET_HOSTS request to the hardcoded Antigravity sandbox host (#10479)

View File

@@ -0,0 +1 @@
- fix(cli): use 127.0.0.1 for the readiness health-check poll instead of localhost, avoiding Windows DNS-resolution delays that made a healthy server report as never-ready (#10508)

View File

@@ -0,0 +1 @@
- fix(providers): register a real Firefly auth probe under both the `firefly` alias and the `adobe-firefly` canonical id, and normalize the provider id before the generic web-cookie fallback, so a Firefly connection stops always reporting "Provider validation not supported" (#10522)

View File

@@ -0,0 +1 @@
- fix(sse): auto-replay a bounded multi-turn trajectory in the DeepSeek Web prompt builder for clients that never send `tools[]`, so agentic clients like Cline stop losing the original task after a couple of turns (#10527)

View File

@@ -0,0 +1 @@
- fix(dashboard): show the real model count on the "List Models" endpoint card instead of a permanent "—" (#10553)

View File

@@ -0,0 +1 @@
- fix(providers): remove 10 retired model ids from the crof seed catalog so /v1/models stops advertising models crof.ai no longer serves (#10577)

View File

@@ -0,0 +1 @@
- fix(sse): resolve the short provider-alias prefix (e.g. `el/`) advertised by GET /v1/models for audio speech, transcription and translation model ids (#10586)

View File

@@ -0,0 +1 @@
- fix(sse): map OpenAI-compat voice names to real ElevenLabs voice_ids in direct TTS (#10589)

View File

@@ -0,0 +1 @@
- fix(dashboard): make /api/models agree with /v1/models on synced-catalog coverage instead of reporting stale models as available (#10615)

View File

@@ -0,0 +1 @@
- fix(guardrails): resolve the public provider alias before querying credentials in the Vision Bridge router, so command-code/opencode (and any alias!=id provider) are no longer reported as "unusable" despite active connections (#10702)

View File

@@ -0,0 +1 @@
- fix(dashboard): filter the Modality Bridge Vision model picker to vision-capable models, matching the sibling Video/Audio tabs (#10703)

View File

@@ -0,0 +1 @@
- fix(usage): repair provider-reported input_tokens: 0 on non-trivial requests instead of passing it through unrepaired (#10705)

View File

@@ -0,0 +1 @@
- fix(cli): distinguish a CLI-probe timeout from a genuinely absent binary in locateCommand, and resolve the Hermes Agent Apply flow's `keyId` server-side instead of writing the `YOUR_OMNIROUTE_API_KEY_HERE` placeholder (#10710, #10711)

View File

@@ -0,0 +1 @@
- fix(cli): pass --allow-scripts for the runtime's own npm-installed dependencies, so npm 12+'s default install-scripts block no longer silently skips better-sqlite3's native build (#10713)

View File

@@ -0,0 +1 @@
- fix(db): filter `getProviderMetrics()` to providers with a live `provider_connections` row so a deleted provider stops permanently ghost-haunting the Home "Provider Topology" widget (#10714)

View File

@@ -0,0 +1 @@
- fix(proxy): keep password-only proxy credentials instead of dropping them when no username is set (#10720)

View File

@@ -0,0 +1 @@
- **fix(providers):** copilot-m365-web chat turns no longer surface as `(empty response)` — the type:4 invocation is aligned with the 2026-08 wire shape and now carries its type:1 Metrics follow-up in the same socket write, and the access token pre-flight-refreshes from a stored refresh_token instead of requiring a DevTools re-capture every ~75 minutes ([#10732](https://github.com/diegosouzapw/OmniRoute/pull/10732) — thanks @acc0mplish)

View File

@@ -0,0 +1 @@
- **fix(catalog):** stop counting `getTokenLimit()`'s generic 128k catch-all as a known combo window, so `/v1/models` advertises the min of sourced member contexts instead of collapsing a 500k combo to 128k ([#10734](https://github.com/diegosouzapw/OmniRoute/issues/10734))

View File

@@ -0,0 +1 @@
- **fix(api):** `/api/cache/stats` reported the prompt-cache LRU, which no request path ever writes to — it answered `0 hit / 0 miss, size 0` while the semantic cache served real traffic, and the Health and Usage dashboards rendered that as fact. It now reports the semantic cache's in-memory entries, with the same response shape ([#PRNUM](https://github.com/diegosouzapw/OmniRoute/pull/10769)) — thanks @Poid-ZA, who first fixed this in #9446.

View File

@@ -0,0 +1 @@
- **fix(logging):** the app log is filterable and readable again. Entries from the tagged logger (`[LEVEL] [TAG] message`) were filed under the level instead of the component, and printf format strings were never applied, so `%s`/`%d` stayed literal with the values trailing behind them unlabelled — including every LiveWS connection line, where the format is deliberate hardening against injected format specifiers ([#PRNUM](https://github.com/diegosouzapw/OmniRoute/pull/10770)).

View File

@@ -0,0 +1 @@
- **fix(analytics):** Claude Code (`claude`/`cc`) is a flat-rate subscription, so cost analytics reports `$0` for it instead of estimating Anthropic list prices — the metered `anthropic` API keeps its real cost, and budget/quota/routing still estimate as before ([#10774](https://github.com/diegosouzapw/OmniRoute/pull/10774)) — thanks @electrumguy

View File

@@ -0,0 +1 @@
- fix(db): periodically run `wal_checkpoint(TRUNCATE)` so the SQLite WAL file shrinks on long-running servers (default 6h, override with `OMNIROUTE_WAL_TRUNCATE_INTERVAL_MS`, `0` disables) (#10781)

View File

@@ -0,0 +1 @@
- fix(sse): replace LiveWS's application-only liveness check with a protocol-level `ws.ping()`/`pong` heartbeat (RFC 6455 §5.5.2) alongside the existing one, so a read-only dashboard subscriber that never sends anything survives the connection timeout — a socket that stops reading frames entirely is still reaped exactly as before (#10782)

View File

@@ -0,0 +1 @@
- **fix(resilience):** scope the same-account transport retry (#9708) out of emergency-fallback and combo hops — it was retrying the free fallback model and combo targets too, doubling upstream calls and corrupting the terminal error status on those paths.

View File

@@ -0,0 +1 @@
- **fix(images):** retry Codex image generation on a sibling ChatGPT account when the requested model isn't entitled on the current account, instead of failing the request outright ([#8307](https://github.com/diegosouzapw/OmniRoute/pull/8307)).

View File

@@ -0,0 +1 @@
- fix(compression): preserve unfenced raw code (e.g. Copilot #file references) from Caveman's prose recapitalization/whitespace cleanup, which was corrupting keyword casing and indentation (#9144)

View File

@@ -0,0 +1 @@
- fix(api): yield the event loop during catalog builds and bulk-load override/hidden-model tables (#9147)

View File

@@ -0,0 +1 @@
- **fix(translator):** convert OpenAI `image_url` blocks nested in `role: "tool"` / `tool_result` content to Claude `image` source blocks so OpenAI-compatible clients (Kimi Code CLI `ReadMediaFile`, and any other tool that returns media) no longer 400 the next Claude-format upstream turn ([#9692](https://github.com/diegosouzapw/OmniRoute/issues/9692))

View File

@@ -0,0 +1 @@
- **fix(resilience):** retry a retryable Codex pre-output 502/503/504/507 once on the same account (23s jitter) before cooling the connection, and stop translating that mixed pool into an all-accounts quota `429` ([#9708](https://github.com/diegosouzapw/OmniRoute/issues/9708))

View File

@@ -0,0 +1 @@
- **fix(electron):** desktop window stays hidden on Windows because the embedded Next.js server binds to the machine hostname instead of loopback ([#PENDING](https://github.com/diegosouzapw/OmniRoute/pull/PENDING))

View File

@@ -0,0 +1 @@
- fix(build): tolerate a same-realpath symlink or stale-typed dest in the standalone bundle assembler, fixing non-deterministic `ERR_FS_CP_EINVAL`/`ERR_FS_CP_DIR_TO_NON_DIR` crashes under heavy concurrent build I/O

View File

@@ -0,0 +1 @@
- **fix(tests):** drain three base-reds on the release branch — the Vietnamese locale regained parity with English (6 keys added), the chatCore SSE test now asserts the comment-free default that #10539 introduced instead of the trailer it replaced, and the Antigravity cloudcode test asserts the missing-messages guard it is named for instead of a `/ok/` regex that only ever matched the "ok" inside `: x-omniroute-tokens-in` ([#10704](https://github.com/diegosouzapw/OmniRoute/pull/10704))

View File

@@ -0,0 +1 @@
- chore(security): remove the unused `enforceSecrets()` duplicate of the boot secret check and pin the live `enforceWebRuntimeEnv()` wiring with a regression test (#10775)

View File

@@ -0,0 +1 @@
- **docs:** Custom combos are only invoked by their exact name in the `model` field — `auto` remains a separate zero-config router, and `openrouter/auto` is a paid OpenRouter product, not an alias ([#10779](https://github.com/diegosouzapw/OmniRoute/pull/10779)) — thanks @maxmad64bis

View File

@@ -0,0 +1,3 @@
- **fix(ci):** route `open-sse/handlers/imageGeneration/providers/geminiWeb.ts`'s b64_json
download-failure message through `sanitizeErrorMessage()` instead of embedding a raw
`err.message`, clearing the `check:error-helper` base-red on `release/v3.8.50` (#9985).

View File

@@ -0,0 +1 @@
- **fix(tests):** drain two base-reds on the release branch — `auto/glm` now expects the Cloudflare AI Playground backend (its registry advertises `zai-org/glm-5.2` and `zai-org/glm-4.7-flash`, so it belongs in the family pool by the same rule already documented for `auggie`, `devin-cli-agentic` and `zcode`), and the ESLint gate is green again after the GitLab executor test dropped its five `as any` casts for a declared response shape and the CLI OAuth suppression count caught up with the two casts #10491 added.

View File

@@ -0,0 +1 @@
- **fix(tests):** realign the two `stream-utils` passthrough cases that still asserted the pre-#10017 SSE framing — the event-boundary case declares the OpenAI Responses client format it actually exercises, and the metadata case now pins that surviving lines stay inside one event instead of expecting the `:`/`id:` control lines that #10473 stopped forwarding to every client format.

View File

@@ -0,0 +1,12 @@
- **fix(tests):** drain several base-reds on `release/v3.8.50` (#9985) that were all instances
of the same pattern — a legitimate product change landed without updating the test that
asserted the old behavior: `tests/unit/glm-provider-model-import-route.test.ts` (12 tests)
and `tests/unit/model-sync-route.test.ts` (2 tests) predate #10603's "upstream model sync is
opt-in and manual overrides are preserved" change; `tests/unit/antigravity-model-aliases.test.ts`
predated #10537 retiring the collapsed `gemini-3.7-flash` alias in favor of its three tiered
ids. Also fixes a real data drift in `open-sse/config/freeModelCatalog.data.ts` (the `qwen-web`
free-catalog entry still pointed at the retired `qwen3.8-max-preview` id instead of the
current `qwen3.8-max`), corrects the zh-TW `providers.autoFetchModelsTooltip` string to the
glossary-canonical 快取 instead of 緩存, and removes an unused default export from
`src/lib/oauth/providers/zed-hosted.ts` (the named export already covers every consumer) to
shave one symbol off the `check:dead-code` ratchet regression.

View File

@@ -1898,7 +1898,7 @@
},
"tests/unit/cli-oauth-commands.test.ts": {
"@typescript-eslint/no-explicit-any": {
"count": 18
"count": 20
}
},
"tests/unit/cli-oneproxy-commands.test.ts": {
@@ -2396,11 +2396,6 @@
"count": 7
}
},
"tests/unit/executor-gitlab.test.ts": {
"@typescript-eslint/no-explicit-any": {
"count": 4
}
},
"tests/unit/executor-nlpcloud.test.ts": {
"@typescript-eslint/no-explicit-any": {
"count": 2

View File

@@ -442,12 +442,14 @@
"src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx": 1062,
"src/app/(dashboard)/dashboard/providers/[id]/hooks/useProviderConnections.ts": 1051,
"src/shared/components/ModelSelectModal.tsx": 1138,
"src/shared/constants/providers/apikey/gateways.ts": 1255,
"src/shared/constants/providers/apikey/gateways.ts": 1268,
"open-sse/vendor/codex-chatgpt-web/bridge.ts": 1387,
"_rebaseline_2026_08_11_v3850_merge_storm_provider_registry": "DRIFT do merge-storm 2026-08-11 (99 PRs mergeados no release/v3.8.50). AddApiKeyModal.tsx (PR #8949 ChatGPT Web provider) e useProviderConnections.ts/ModelSelectModal.tsx (PRs #9011 combo test-all, #9499 image combos) = UI nova legitima acima do cap; gateways.ts = god-file de catalogo de providers que cresceu com PRs #9009/#9421/#9468/#9594 (qualquer split arriscaria corromper o merge de novo — o proprio PR #9421 quebrou o arquivo); bridge.ts (PR #8949) = ponte Chromium vendored; proxyFetch.ts 1207->1220 = drift herdado de merges. Owner autorizou rebaseline com anotacao (2026-08-11).",
"src/lib/modelCapabilities.ts": 1006,
"src/app/(dashboard)/dashboard/providers/[id]/providerPageHelpers.ts": 1014,
"open-sse/config/imageRegistry.ts": 1019
"open-sse/config/imageRegistry.ts": 1019,
"src/sse/handlers/chatHelpers.ts": 1017,
"src/shared/middleware/chatBodyAdmission.ts": 1005
},
"_rebaseline_base_2026_08_10_proxyfetch": "Base-red fix (green-prs sweep, issue #9985): open-sse/utils/proxyFetch.ts 1207 > cap 1000 — new proxied-TLS fetch helper introduced by the Fal reference-image work. Owner-authorized quick rebaseline to green; structural slim tracked for v3.9.0.",
"_rebaseline_2026_07_27_v3849_train2": "Merge-train 2 (7 PRs) — owner-approved 2026-07-27. Single entry: chatCore.ts 4955->5006 (#8595, Responses multi-turn image compaction before the context hard-reject). Genuine irreducible growth at the existing compaction chokepoint in handleChatCore — the PR adds a last-resort retry against the concrete budget plus the estimateFinalInputTokens helper, both wired at the pre-existing call site rather than a new branch. Covered by tests/unit/8560-responses-image-compaction.test.ts (4 tests).",
@@ -612,5 +614,6 @@
"_rebaseline_2026_08_12_proxyfetch_redaction": "Base-reds round 3 (#9985): proxyFetch.ts 1220->1239 (+19) = redactProxyDetailsInMessage() helper closing the credential leak #10032 reintroduced (raw proxy URL with user:password appended to the propagated error, Hard Rule #12); irreducible security fix at the existing error-surface chokepoint. Covered by tests/unit/tls-proxy-context.test.ts (strengthened leak guards).",
"_rebaseline_2026_08_12_modelcapabilities_snapshot_routing": "Base-reds round 3 (#9985): modelCapabilities.ts crossed the new-file cap at 1006 (+~10) when the context/max-input-token override lookups were routed through the #9199 bulk snapshot (fixing 323 per-model SQLite reads per catalog prepare — auto-combo-context-advertising guard); cohesive change at the existing resolution chokepoints, not extractable. Covered by tests/unit/auto-combo-context-advertising.test.ts + model-capability-resolution-snapshot-9199.test.ts.",
"_rebaseline_2026_08_14_imagetotext_servicekinds": "Image-to-Text category (#10275/#10291): gateways.ts grew 1250→1255 by data lines only — the serviceKinds: [\"llm\", \"imageToText\"] declarations on the openrouter and chutes catalog entries, plus the 3-line comment recording why chutes needs no static dots.ocr entry (passthroughModels discovery). No new logic or branching; the file is a provider catalog of declarative metadata. Splitting a catalog for five lines would be worse than the growth (semantic-families rule).",
"_rebaseline_2026_08_18_imageregistry_merge_train": "merge-train 2026-08-18 (owner-authorized, /merge-prs batch of 84): open-sse/config/imageRegistry.ts crossed the 1000-line new-file cap for the first time purely from combining three independent, already-legitimate provider registrations boarded in the same local merge-train — #10542 (aihorde optional-key image catalog), #10494 (gemini-web image generation), #10594 (freepik/magnific provider rename + validation). 996 on release tip -> 1019 on the train tip. Each PR individually adds a small, additive IMAGE_PROVIDERS registry entry at the existing chokepoint; none crosses the cap alone. Not modularized as part of this train's gate fix (out of scope for a merge reconciliation, not a feature change). Covered by each PR's own focused tests (aihorde-image-catalog/generation, gemini-web image tests, freepik/magnific provider tests)."
}
"_rebaseline_2026_08_18_imageregistry_merge_train": "merge-train 2026-08-18 (owner-authorized, /merge-prs batch of 84): open-sse/config/imageRegistry.ts crossed the 1000-line new-file cap for the first time purely from combining three independent, already-legitimate provider registrations boarded in the same local merge-train — #10542 (aihorde optional-key image catalog), #10494 (gemini-web image generation), #10594 (freepik/magnific provider rename + validation). 996 on release tip -> 1019 on the train tip. Each PR individually adds a small, additive IMAGE_PROVIDERS registry entry at the existing chokepoint; none crosses the cap alone. Not modularized as part of this train's gate fix (out of scope for a merge reconciliation, not a feature change). Covered by each PR's own focused tests (aihorde-image-catalog/generation, gemini-web image tests, freepik/magnific provider tests).",
"_rebaseline_2026_08_20_v3850_merge_train_batch1": "Merge-train batch1 (2026-08-19/20, 30 PRs boarded onto release/v3.8.50): gateways.ts 1255->1268 = PR #10722 (Token Kiosk OpenAI-compatible provider gateway catalog entry, +13 declarative lines, same god-file no-split rationale as prior gateways.ts rebaselines); chatHelpers.ts (uncapped, not previously frozen) new 1017 = PR #10797 (relay/bifrost error normalization, +23/-2, own-PR growth, existing file already near cap from accumulated chokepoint wiring per its own rebaseline history above); chatBodyAdmission.ts (uncapped) new 1005 = pre-existing base-red on the pure release tip (1004>1000 before this train boarded anything, no PR in this batch touches this file) — frozen here at its current size, not authorizing further growth. Owner-authorized rebaseline (2026-08-19 merge-prs session)."
}

View File

@@ -166,7 +166,8 @@
"dedicatedGate": true
},
"zizmorFindings": {
"value": 190,
"value": 192,
"_rebaseline_2026_08_20_radar_export_workflow": "190 -> 192 (+2). Workflow novo `.github/workflows/radar-export.yml` (passo 10 do go-live do Radar: publica o export estável do catálogo como asset de release para o servidor privado baixar via RADAR_EXPORT_URL). Os +2 são unpinned-uses @vN: actions/checkout@v7 + actions/setup-node@v7 — a MESMA convenção deliberada de todos os workflows (ver _scanner_harden_workflows_2026_06_16); fixar por SHA só este violaria a convenção. O findings artipacked do checkout foi CORRIGIDO com `persist-credentials: false` (o job publica via GH_TOKEN em `gh release`, não usa a credencial do checkout). Nenhuma classe nova de template-injection / cache-poisoning / dangerous-triggers. Medido local com zizmor 1.25.2 via `node scripts/check/check-workflows.mjs --ratchet` = 191; +1 do delta conhecido do runner (ver _rebaseline_2026_07_28_ci_runner_delta: o runner enxerga 1 unpinned-uses @vN a mais que o devbox no mesmo commit; a baseline segue o runner) => 192.",
"_rebaseline_2026_07_20_aliasresolver_hook_split_7808": "175 -> 176 (+1). Companion to PR #7808 (CodeQL js/incomplete-url-substring-sanitization fix in bin/aliasResolver.mjs). The +1 is NOT caused by this PR's code changes (bin/* is not a workflow file) — it is a pre-existing drift that surfaced because the ratchet gate runs on this PR's CI: the zizmor scanner version on the GitHub runner gained a new rule (or extended an existing one) since the v3.8.49 baseline was seeded on 2026-07-17. Breakdown: the new finding is an unpinned-uses @vN class item on one of the existing workflows (same deliberate convention as _scanner_harden_workflows_2026_06_16 — @vN is intentional, SHA-pinning only this one would violate the convention). No new template-injection/artipacked/cache-poisoning/dangerous-triggers classes introduced. Measured by the Quality Gates (Extended) job on run 29713001401 = 176, baseline was 175. Note: by the time this landed on release/v3.8.49, the baseline was already at 176 via _rebaseline_2026_07_17_combo_recovery_hints — this entry is kept as historical record; no further bump applied.",
"_rebaseline_2026_07_17_v3849_release": "169 -> 175 (+6). Cycle workflow drift (v3.8.48/v3.8.49): npm-publish.yml (new, WS1.3 #7092), electron-release.yml, nightly-compat.yml, nightly-release-green.yml, CI restructures (#7501 full-history base fetch, #7355 main-green, #7202 merge-queue gates, Trunk/Codecov). Breakdown vs v3.8.47: +3 unpinned-uses (@vN convention, deliberate per _scanner_harden_workflows_2026_06_16), +2 cache-poisoning (artifact upload/cache in the OWN electron-release/npm-publish RELEASE workflows -- operator-controlled, not fork-PR exploitable), +1 excessive-permissions (nightly-compat.yml permissions:issues). No new template-injection/artipacked/dangerous-triggers. Measured with zizmor 1.25.2 via `node scripts/check/check-workflows.mjs --ratchet` = 175 on da3a0be69.",
"direction": "down",

View File

@@ -19,8 +19,36 @@ OmniRoute compression is built around engine contracts. A mode can run one engin
| `aggressive` | Caveman + history/tool summarizers | Long chat sessions |
| `ultra` | Caveman + pruning helpers | Context-limit recovery |
| `rtk` | RTK | Terminal, shell, build, test, and git output |
| `omniglyph` | OmniGlyph | Context-as-image on the native provider wire |
| `stacked` | Pipeline, default `rtk -> caveman` | Mixed tool logs and prose, max savings |
### OmniGlyph compression profiles
The `omniglyph` engine (package `omniglyph`, 1.4.0+) accepts a named semantic profile, set
globally through `omniglyph.profile` in the compression settings or per step through the
stacked pipeline's step config:
| Profile | Boundary |
| -------------- | --------------------------------------------------------------------------- |
| `aggressive` | Default. The policy the published receipts measured — images system, tool docs and dense history |
| `balanced` | Keeps live state native, protects the last 8 turns, collapses older closed history |
| `coding-safe` | Keeps authority, tool schemas and live tool output native, protects the last 12 turns |
| `passthrough` | Routes without transforming; the engine is skipped |
The profile is a **ceiling, not a floor**: `mergeCompressionProfileOptions` in the package
refuses to let a caller override reopen a lossy lane the profile closed, so a per-step
`preserveSystemPrompt: false` cannot re-enable system compression under `coding-safe`.
Measured on this codebase: `coding-safe` and `balanced` raise `minCompressChars` to its
maximum and keep system, tool schemas and tool results native, so a session that has not
accumulated history yet stops at `below_min_chars` and the engine transforms nothing. That
is why the default is `aggressive` rather than the safest profile.
The package resolves its own model scope and profile from its environment configuration.
OmniRoute never delegates the decision: the adapter pins the model gate to the package's
most restrictive scope, so host environment settings can only narrow the allowlist, never
widen it past OmniRoute's measured receipts.
## Engine Registry
The registry lives in `open-sse/services/compression/engines/registry.ts`. Engines expose a shared

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 1200 350" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Animated terminal demoing the OmniRoute CLI: omniroute providers list (340 providers registered, anthropic, codex, glm, kimi shown active), omniroute combo list (always-on priority, cost-saver, fusion-panel, context-relay) and omniroute health (healthy, 18412 requests in 24h, p95 412ms, circuit breakers 24 closed, 1 half-open, 0 open), cycling over the 80+ command surface: providers, oauth, keys, combo, nodes, models, cache, compression, cost, usage, quota, health, resilience, telemetry, logs, audit, mcp, a2a, cloud, memory, skills, eval, doctor, repl, tunnel, backup, sync, webhooks, policy, pricing, translator, simulate and more.">
<svg viewBox="0 0 1200 350" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Animated terminal demoing the OmniRoute CLI: omniroute providers list (342 providers registered, anthropic, codex, glm, kimi shown active), omniroute combo list (always-on priority, cost-saver, fusion-panel, context-relay) and omniroute health (healthy, 18412 requests in 24h, p95 412ms, circuit breakers 24 closed, 1 half-open, 0 open), cycling over the 80+ command surface: providers, oauth, keys, combo, nodes, models, cache, compression, cost, usage, quota, health, resilience, telemetry, logs, audit, mcp, a2a, cloud, memory, skills, eval, doctor, repl, tunnel, backup, sync, webhooks, policy, pricing, translator, simulate and more.">
<desc>Compact animated terminal cycling three real OmniRoute CLI commands with a typewriter effect and a scrolling subcommand ticker; the first frame shows the completed providers-list screen.</desc>
<defs><clipPath id="tickerClip"><rect x="12" y="304" width="1176" height="40"/></clipPath><clipPath id="tw0"><rect x="64" y="46" height="26" width="0"><animate attributeName="width" calcMode="discrete" values="0;31;61;92;122;153;184;214;245;245" keyTimes="0;0.012;0.018;0.024;0.030;0.036;0.042;0.048;0.054;1" dur="18s" repeatCount="indefinite"/></rect></clipPath><clipPath id="tw1"><rect x="64" y="46" height="26" width="0"><animate attributeName="width" calcMode="discrete" values="0;26;51;76;102;128;153;178;204;204" keyTimes="0;0.345;0.351;0.357;0.363;0.369;0.375;0.381;0.387;1" dur="18s" repeatCount="indefinite"/></rect></clipPath><clipPath id="tw2"><rect x="64" y="46" height="26" width="0"><animate attributeName="width" calcMode="discrete" values="0;20;41;61;82;102;122;143;163;163" keyTimes="0;0.678;0.684;0.690;0.696;0.702;0.708;0.714;0.720;1" dur="18s" repeatCount="indefinite"/></rect></clipPath></defs>
<rect width="1200" height="350" fill="#0d1117"/>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 1200 780" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Comparison table: OmniRoute versus 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute is the only one with the full set: 340 providers, 90+ free providers built-in, 19 routing strategies, 12-engine token compression, a built-in MCP server with 109 tools, A2A protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, desktop/Termux/PWA, 43 UI locales and 100% MIT self-hosted. 9router has free providers, RTK compression and translation but no MCP, A2A, memory, guardrails, cloud agents or stealth. OpenRouter is a hosted SaaS with 400+ models, guardrails and a hosted MCP but is not self-hosted and lacks A2A, memory, cloud agents and stealth. CLIProxyAPI is a light OAuth proxy with two routing strategies. LiteLLM has 100+ providers, A2A and extensive guardrails but no memory, compression, free tier, stealth or cloud agents.">
<svg viewBox="0 0 1200 780" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Comparison table: OmniRoute versus 9router, OpenRouter, CLIProxyAPI and LiteLLM across 13 capabilities. OmniRoute is the only one with the full set: 342 providers, 90+ free providers built-in, 19 routing strategies, 12-engine token compression, a built-in MCP server with 109 tools, A2A protocol, persistent memory, guardrails, cloud agents, TLS fingerprint stealth, desktop/Termux/PWA, 43 UI locales and 100% MIT self-hosted. 9router has free providers, RTK compression and translation but no MCP, A2A, memory, guardrails, cloud agents or stealth. OpenRouter is a hosted SaaS with 400+ models, guardrails and a hosted MCP but is not self-hosted and lacks A2A, memory, cloud agents and stealth. CLIProxyAPI is a light OAuth proxy with two routing strategies. LiteLLM has 100+ providers, A2A and extensive guardrails but no memory, compression, free tier, stealth or cloud agents.">
<desc>Static-header comparison table where each capability row fades in top to bottom; the OmniRoute column is highlighted and shows a check or a leading value in every row, while competitors show a mix of checks, partials and crosses.</desc>
<defs>
<pattern id="gC" width="32" height="32" patternUnits="userSpaceOnUse"><path d="M 32 0 L 0 0 0 32" fill="none" stroke="#ffffff" stroke-opacity="0.05" stroke-width="1"/></pattern>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 1200 540" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="The OmniRoute promise: one endpoint, 340 providers — never stop building, OmniRoute picks the cheapest one that works. Six pillars. Never hit limits: auto-fallback across 340 providers in milliseconds, quota out means the next provider takes over with zero downtime. Save up to 95 percent of tokens: RTK plus Caveman stacked compression cuts 15 to 95 percent of eligible tokens, about 89 percent average on tool-heavy sessions. Zero dollars to start: 90+ providers with a free tier, 56 free forever — Qoder, Pollinations, Cloudflare, SiliconFlow — no card needed. Every tool works: 33 coding agents including Claude Code, Codex, Cursor, Cline, Copilot and Antigravity through one config. One endpoint: OpenAI, Claude, Gemini and Responses API translation — point any tool at /v1 and it just works. Production-grade: circuit breakers, TLS stealth, MCP with 109 tools, A2A, memory, guardrails, evals — 25,000+ tests.">
<svg viewBox="0 0 1200 540" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="The OmniRoute promise: one endpoint, 342 providers — never stop building, OmniRoute picks the cheapest one that works. Six pillars. Never hit limits: auto-fallback across 342 providers in milliseconds, quota out means the next provider takes over with zero downtime. Save up to 95 percent of tokens: RTK plus Caveman stacked compression cuts 15 to 95 percent of eligible tokens, about 89 percent average on tool-heavy sessions. Zero dollars to start: 90+ providers with a free tier, 56 free forever — Qoder, Pollinations, Cloudflare, SiliconFlow — no card needed. Every tool works: 33 coding agents including Claude Code, Codex, Cursor, Cline, Copilot and Antigravity through one config. One endpoint: OpenAI, Claude, Gemini and Responses API translation — point any tool at /v1 and it just works. Production-grade: circuit breakers, TLS stealth, MCP with 109 tools, A2A, memory, guardrails, evals — 25,000+ tests.">
<desc>Animated promise card: six pillar tiles fade in in reading order, then a soft colored border highlight sweeps from tile to tile in a continuous cycle.</desc>
<defs>
<pattern id="gridPaperP" width="32" height="32" patternUnits="userSpaceOnUse">
@@ -21,7 +21,7 @@
<line x1="150" y1="53" x2="1160" y2="53" stroke="#232b38" stroke-width="1.5"/>
</g>
<g>
<text x="40" y="100" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="23" font-weight="600" fill="#c9d1d9">One endpoint. <tspan fill="#a78bfa" font-weight="800">340 providers.</tspan> Never stop building — OmniRoute picks <tspan fill="#7ee787" font-weight="700">the cheapest one that works</tspan>.</text>
<text x="40" y="100" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="23" font-weight="600" fill="#c9d1d9">One endpoint. <tspan fill="#a78bfa" font-weight="800">342 providers.</tspan> Never stop building — OmniRoute picks <tspan fill="#7ee787" font-weight="700">the cheapest one that works</tspan>.</text>
</g>
<g font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif">
@@ -38,7 +38,7 @@
<line x1="3.9" y1="3.9" x2="18.1" y2="18.1"/>
</g>
<text x="102" y="170" font-size="18" font-weight="800" fill="#74b9ff">Never hit limits</text>
<text x="66" y="204" font-size="13.5" fill="#a1a1aa">Auto-fallback across 340 providers in</text>
<text x="66" y="204" font-size="13.5" fill="#a1a1aa">Auto-fallback across 342 providers in</text>
<text x="66" y="226" font-size="13.5" fill="#a1a1aa">milliseconds. Quota out? The next provider</text>
<text x="66" y="248" font-size="13.5" fill="#a1a1aa">takes over — zero downtime.</text>
</g>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 1200 548" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="OmniRoute hero: Never stop coding. Every AI tool to 340 providers — 90+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot and Antigravity into free Claude, GPT and Gemini with auto-fallback. RTK + Caveman stacked compression saves 15 to 95 percent of tokens — about 89 percent average on tool-heavy sessions — so you never hit limits. Stats: 340 AI providers, 90+ free tiers, about 1.51B free tokens per month, 15 to 95 percent token savings, 19 routing strategies, zero dollars to start.">
<svg viewBox="0 0 1200 548" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="OmniRoute hero: Never stop coding. Every AI tool to 342 providers — 90+ free — through one endpoint. Claude Code, Codex, Cursor, Cline, Copilot and Antigravity into free Claude, GPT and Gemini with auto-fallback. RTK + Caveman stacked compression saves 15 to 95 percent of tokens — about 89 percent average on tool-heavy sessions — so you never hit limits. Stats: 342 AI providers, 90+ free tiers, about 1.51B free tokens per month, 15 to 95 percent token savings, 19 routing strategies, zero dollars to start.">
<desc>Animated hero card: a pulse travels the divider line and a compression bar demo repeatedly shrinks a prompt by up to 95 percent; all headline content is static and readable on the first frame.</desc>
<defs>
<pattern id="gridPaperH" width="32" height="32" patternUnits="userSpaceOnUse">
@@ -28,7 +28,7 @@
<text x="48" y="138" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="60" font-weight="800" fill="#e9edf3">Never stop coding<tspan fill="#a855f7">.</tspan></text>
<!-- subheadline -->
<text x="48" y="184" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="25" font-weight="600" fill="#c9d1d9">Every AI tool → <tspan fill="#a78bfa" font-weight="800">340 providers</tspan><tspan fill="#7ee787" font-weight="800">90+ free</tspan> — through one endpoint.</text>
<text x="48" y="184" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="25" font-weight="600" fill="#c9d1d9">Every AI tool → <tspan fill="#a78bfa" font-weight="800">342 providers</tspan><tspan fill="#7ee787" font-weight="800">90+ free</tspan> — through one endpoint.</text>
<!-- plug line -->
<text x="48" y="222" font-family="Inter, 'Segoe UI', Arial, Helvetica, system-ui, sans-serif" font-size="16.5" fill="#a1a1aa">Claude Code · Codex · Cursor · Cline · Copilot · Antigravity&#160;&#160;&#160;&#160;<tspan fill="#7ee787" font-weight="700">FREE</tspan> Claude / GPT / Gemini · auto-fallback</text>

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -368,7 +368,7 @@ const result = await executor.execute({
});
````
The factory is generated from `config/providerRegistry.ts` which lists all 338 providers and their executor class.
Resolution goes through the `ExecutorRegistry` (`executors/registry.ts`): every specialized executor is declared in the built-in table of `executors/index.ts` and registered via `registerExecutor(alias, instance)` at module load; `getExecutor()` consults the registry and falls back to a memoized `DefaultExecutor` for any provider without a specialized entry. The full alias → executor mapping is characterized by the golden test `tests/unit/executor-map-golden.test.ts`.
---

View File

@@ -189,7 +189,7 @@ Use `auto/smart` when you want the best quality and are okay with occasional exp
### "Can I force a specific provider?"
Yes! Use a combo with `priority` strategy instead of `auto`. See the [Technical Reference](../routing/AUTO-COMBO.md) for details.
Yes! Use a combo with `priority` strategy instead of `auto`, then send the combo's **exact name** as the `model` field (e.g. `model: "my-combo"` — not `auto`). See the [Technical Reference](../routing/AUTO-COMBO.md) for details.
### "How is this different from round-robin?"

View File

@@ -140,6 +140,8 @@ omniroute launch-codex --model auto
You can do this manually via `codex` and command line parameters to specify endpoint and api key, but with the above command, OmniRoute takes care of everything for you.
The same one-command launch works for other CLIs via the generic launcher — `omniroute run <target>` supports `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen`, and `gemini` (see [CLI Integrations](../guides/CLI-INTEGRATIONS.md)).
3. The CLI should be sending requests to OmniRoute now.
### Confirm your tool is routing to OmniRoute

View File

@@ -1,7 +1,7 @@
---
title: "CLI Integrations — point any coding CLI at OmniRoute"
version: 3.8.40
lastUpdated: 2026-06-28
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Integrations
@@ -14,9 +14,15 @@ OmniRoute (local or remote) and writes the tool's own config file on **your**
machine. The API key is referenced by an environment variable wherever the tool
supports it. Commands that persist a tool-local environment file are noted below.
There are also two launchers`omniroute launch` (Claude Code) and
`omniroute launch-codex` (Codex) — that spawn the CLI with the right env injected,
without writing any config at all.
There is also a generic launcher — `omniroute run <target>` — that spawns
`claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` or `gemini` with the
right env injected, without writing any config at all. Targets and their
aliases come from the canonical manifest `bin/cli/cli-manifest.mjs`
(`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`,
`open-code`, `qwen-code`, `gemini-cli`), and `omniroute completion` offers the
same manifest-derived target words. The legacy per-tool launchers —
`omniroute launch` (Claude Code) and `omniroute launch-codex` (Codex) — remain
available.
Provider onboarding is available from the same local/remote context. The
API-first commands below keep management authentication separate from provider
@@ -87,8 +93,21 @@ Notes on flags (verified in the command source):
model auto-discovery: Cline, Kilo, Roo, Goose, Qwen, Aider. Those tools
also accept `--yes` for non-interactive runs (which then requires `--model`).
`setup-opencode` takes `--model` to set the default top-level model.
- `--model <id>` on `omniroute run` follows the manifest's per-target wiring
(`bin/cli/cli-manifest.mjs`): **aider** receives `--model openai/<id>` and
**opencode** `--model omniroute/<id>` (the prefix is added only when the id
does not already carry it); **qwen** and **gemini** receive the id verbatim;
**claude** gets it via `ANTHROPIC_MODEL`, **goose** via `GOOSE_MODEL`, and
**codex** via `-c model_providers.omniroute.*` args. **Qwen is the only run
target that hard-requires `--model`** — `omniroute run qwen` without it exits
`2` with an explicit error.
- `--port <port>` — local OmniRoute port (default `20128`, ignored when `--remote`
is set). Present on all `setup-*` and both launchers.
- `omniroute run` exit codes: the child CLI's own exit code is propagated
verbatim; `2` = invalid arguments (unsupported target, missing required
`--model`, container guard); `127` = the target binary is not in `PATH`;
`130`/`143`/`129` when the launch is ended by `SIGINT`/`SIGTERM`/`SIGHUP`;
`1` = other runtime launch failure.
- The two launchers (`launch`, `launch-codex`) accept `--profile <name>` to select
a profile written by `setup-claude` / `setup-codex`, plus pass-through args for
the underlying `claude` / `codex` binary.
@@ -251,6 +270,11 @@ Gemini surface (`/v1beta`). `omniroute run gemini` wires that automatically:
- a **temporary isolated `GEMINI_CLI_HOME`** whose `.gemini/settings.json`
selects `gemini-api-key` auth, so a stored Google OAuth session (Code Assist)
never overrides the OmniRoute-directed launch — removed after exit;
- **env hygiene**: the child env is scrubbed of `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` and `GOOGLE_GENAI_USE_GCA` (which would redirect
auth to Vertex/Code Assist), and `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` is
set as a belt-and-suspenders fallback — the other `run` targets get the same
treatment for their own conflicting variables;
- `--model <id>` injection from `--provider`/`--model`.
```bash

View File

@@ -1,7 +1,7 @@
---
title: "Codex CLI — Configuration with OmniRoute"
version: 3.8.49
lastUpdated: 2026-08-01
version: 3.8.50
lastUpdated: 2026-08-18
---
# Codex CLI — Configuration with OmniRoute
@@ -319,6 +319,17 @@ omniroute launch-codex --remote http://100.x.x.x:20128/v1 --api-key sk-xxx
omniroute launch-codex --profile glm52 -- --yolo "fix this bug"
```
Codex is also a target of the two generic manifest-driven entry points
(`bin/cli/cli-manifest.mjs`):
```bash
# Interactive model picker → writes ~/.codex/<name>.config.toml (TOML, env_key)
omniroute configure codex
# Launch codex with the omniroute provider injected via -c flags (no config written)
omniroute run codex
```
---
## New Codex CLI features (v0.138v0.141)

View File

@@ -1,7 +1,7 @@
---
title: "Remote Mode — Drive a remote OmniRoute from your laptop"
version: 3.8.40
lastUpdated: 2026-06-28
version: 3.8.50
lastUpdated: 2026-08-18
---
# Remote Mode

View File

@@ -1,7 +1,7 @@
---
title: "📖 Setup Guide — OmniRoute"
version: 3.8.40
lastUpdated: 2026-06-28
version: 3.8.50
lastUpdated: 2026-08-18
---
# 📖 Setup Guide — OmniRoute
@@ -186,9 +186,11 @@ omniroute setup-qwen # ~/.qwen/settings.json + ~/.qwen/.env
```
Each accepts `--remote <url> --api-key <key>` to configure a local tool against a
**remote** OmniRoute, plus `--dry-run` to preview. The launchers
`omniroute launch` (Claude Code) and `omniroute launch-codex` (Codex) spawn the CLI
with the right env injected, writing no config at all.
**remote** OmniRoute, plus `--dry-run` to preview. To launch a CLI with the right
env injected and no config written at all, use the generic launcher
`omniroute run <target>` (claude, codex, aider, goose, opencode, qwen, gemini);
the legacy per-tool launchers `omniroute launch` (Claude Code) and
`omniroute launch-codex` (Codex) remain available.
For the full table (what each command writes, every flag, local vs remote, base-URL
`/v1` conventions), see **[CLI Integrations](./CLI-INTEGRATIONS.md)**.

View File

@@ -6,16 +6,16 @@ lastUpdated: 2026-08-18
# VS Code Copilot Chat — OmniCopilot extension
**OmniCopilot** puts every model your OmniRoute serves into the *native* GitHub Copilot Chat
**OmniCopilot** puts every model your OmniRoute serves into the _native_ GitHub Copilot Chat
model picker. No second sidebar, no separate chat UI — Copilot's agent mode, tool calling,
MCP servers and custom instructions all keep working, just running on the model you pick.
| | |
| --- | --- |
| **Install (VS Code)** | [Marketplace → `diegosouzapw.omnicopilot`](https://marketplace.visualstudio.com/items?itemName=diegosouzapw.omnicopilot) |
| **Install (forks)** | [Open VSX](https://open-vsx.org/extension/diegosouzapw/omnicopilot) — Cursor, Windsurf, VSCodium, Theia, code-server, Gitpod, Antigravity, Kiro |
| **Source / issues** | [github.com/diegosouzapw/OmniCopilot](https://github.com/diegosouzapw/OmniCopilot) (MIT) |
| **Requires** | VS Code 1.104+ |
| | |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Install (VS Code)** | [Marketplace → `diegosouzapw.omnicopilot`](https://marketplace.visualstudio.com/items?itemName=diegosouzapw.omnicopilot) |
| **Install (forks)** | [Open VSX](https://open-vsx.org/extension/diegosouzapw/omnicopilot) — Cursor, Windsurf, VSCodium, Theia, code-server, Gitpod, Antigravity, Kiro |
| **Source / issues** | [github.com/diegosouzapw/OmniCopilot](https://github.com/diegosouzapw/OmniCopilot) (MIT) |
| **Requires** | VS Code 1.104+ |
> **No Copilot subscription needed.** Since VS Code 1.122 a language-model provider works
> without a GitHub sign-in and without any Copilot plan. Inline completions and
@@ -60,7 +60,7 @@ The extension requests **`GET /v1/models?prefix=alias`** so one id arrives per m
changing the server-wide setting for your other clients. On a reference instance this collapsed
**2345 entries to 1396 — 949 duplicates, zero models lost.**
If you would rather fix it server-wide for *every* client, set the
If you would rather fix it server-wide for _every_ client, set the
`MODELS_CATALOG_PREFIX_MODE` feature flag to `alias` in the dashboard. See
[API_REFERENCE → prefix](../reference/API_REFERENCE.md#model-id-prefixes-prefix) for the
query parameter and the warning about `canonical`.
@@ -81,7 +81,7 @@ and OmniRoute translates those for `/v1/chat/completions`, so they are perfectly
### Providers you never configured
The catalog lists models from providers with an **active connection** *plus* every **noAuth**
The catalog lists models from providers with an **active connection** _plus_ every **noAuth**
provider — the keyless ones that make up much of the free tier. That is intentional. To hide
them, add them to `blockedProviders` in the dashboard settings; nothing changes in the
extension.
@@ -91,18 +91,32 @@ extension.
## Dashboard inside a VS Code tab
`omnicopilot.dashboardOpen: "editor"` renders the OmniRoute dashboard in an editor tab via the
Simple Browser instead of an external browser. Embedding is **opt-in on the server**: start
OmniRoute with
Simple Browser instead of an external browser. Embedding is **opt-in on the server** through
`DASHBOARD_ALLOW_EMBED=vscode`, which serves the HTML pages with
`frame-ancestors 'self' vscode-webview:` instead of the default `frame-ancestors 'none'` +
`X-Frame-Options: DENY`. The API surface (`/api`, `/v1`, `/v1beta`, `/a2a`, `/healthz`) keeps the
strict headers either way.
> ⚠️ **It is a build-time flag, not a runtime one.** Next.js compiles `headers()` into the route
> manifest, so `next.config.mjs` reads the variable while the bundle is built
> (`next.config.mjs` → `resolveDashboardEmbedMode`, `scripts/build/dashboardEmbed.mjs`).
> Exporting it in front of an already-built server changes nothing — the headers are baked.
```bash
DASHBOARD_ALLOW_EMBED=vscode omniroute
# the variable has to be present on the BUILD command
DASHBOARD_ALLOW_EMBED=vscode npm run build # or npm run build:release
npm start
```
which serves the HTML pages with `frame-ancestors 'self' vscode-webview:` instead of the default
`frame-ancestors 'none'` + `X-Frame-Options: DENY`. The API surface (`/api`, `/v1`, `/v1beta`,
`/a2a`, `/healthz`) keeps the strict headers either way. Without the variable the page refuses to
frame and the extension falls back to the external browser — nothing breaks. See
[`ENVIRONMENT.md`](../reference/ENVIRONMENT.md) and issue
| How you installed | Can you enable embedding? |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| From source | ✅ set the variable on the build command, as above |
| `npm install -g omniroute` | ❌ the published package ships a prebuilt bundle — build from source instead |
| Docker image | ✅ `docker build --build-arg DASHBOARD_ALLOW_EMBED=vscode -t omniroute:embed .` — the prebuilt image on Docker Hub is not embed-enabled |
Without an embed-enabled build the page refuses to frame, the extension detects that from the
response headers and falls back to the external browser — nothing breaks, and it says so once.
See [`ENVIRONMENT.md`](../reference/ENVIRONMENT.md) and issue
[#10273](https://github.com/diegosouzapw/OmniRoute/issues/10273).
---
@@ -119,14 +133,14 @@ Kilo and Roo — the same configs described in
## Troubleshooting
| Symptom | Cause / fix |
| --- | --- |
| No OmniRoute models in the picker | Server unreachable. The status-bar dot goes grey; run `OmniRoute: Check Connection`. Discovery is silent by design and contributes no models rather than prompting. |
| Every model appears twice | You are on an OmniCopilot older than 1.0.1 — update. The extension now requests `?prefix=alias`. |
| An image/audio model used to be listed and is gone | Intentional since 1.0.1 — it could never answer a chat request. |
| Panel missing from the Activity Bar | VS Code moves extra view containers into the **"…"** overflow at the bottom of the Activity Bar, and a container hidden via right-click stays hidden. Right-click the Activity Bar → tick **OmniRoute**, or open it with `OmniRoute: Manage Connection`. |
| Dashboard opens in the browser despite `editor` mode | The server is not started with `DASHBOARD_ALLOW_EMBED=vscode` (see above). The fallback is deliberate. |
| Models list is stale after changing providers | `OmniRoute: Refresh Models`, or the ↻ link in the panel. |
| Symptom | Cause / fix |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No OmniRoute models in the picker | Server unreachable. The status-bar dot goes grey; run `OmniRoute: Check Connection`. Discovery is silent by design and contributes no models rather than prompting. |
| Every model appears twice | You are on an OmniCopilot older than 1.0.1 — update. The extension now requests `?prefix=alias`. |
| An image/audio model used to be listed and is gone | Intentional since 1.0.1 — it could never answer a chat request. |
| Panel missing from the Activity Bar | VS Code moves extra view containers into the **"…"** overflow at the bottom of the Activity Bar, and a container hidden via right-click stays hidden. Right-click the Activity Bar → tick **OmniRoute**, or open it with `OmniRoute: Manage Connection`. |
| Dashboard opens in the browser despite `editor` mode | The server was not **built** with `DASHBOARD_ALLOW_EMBED=vscode` (see above) — setting it at startup on a prebuilt install does nothing. The fallback is deliberate. |
| Models list is stale after changing providers | `OmniRoute: Refresh Models`, or the ↻ link in the panel. |
---

View File

@@ -0,0 +1,298 @@
# CLI-INTEGRATIONS (العربية)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "تكاملات CLI — توجيه أي CLI برمجي إلى OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# تكاملات CLI
تقدم OmniRoute مجموعة من أوامر `setup-*` التي تقوم بتكوين CLI برمجي (Codex، Claude Code، OpenCode، Cline، …) لاستخدام OmniRoute كخلفية لها — بحيث يتواصل الأداة مع **نقطة نهاية واحدة** وOmniRoute تقوم بتوجيه الطلب إلى المزود الصحيح مع التراجع التلقائي. كل أمر يقرأ كتالوج النموذج **الحالي** من OmniRoute قيد التشغيل (محلي أو بعيد) ويكتب ملف التكوين الخاص بالأداة على **جهازك**. يتم الإشارة إلى مفتاح API بواسطة متغير بيئي حيثما تدعمه الأداة. يتم ملاحظة الأوامر التي تحتفظ بملف بيئة محلي للأداة أدناه.
هناك أيضًا مشغل عام — `omniroute run <target>` — الذي يقوم بتشغيل `claude`، `codex`، `aider`، `goose`، `opencode`، `qwen` أو `gemini` مع البيئة الصحيحة المدخلة، دون كتابة أي تكوين على الإطلاق. تأتي الأهداف وألقابها من البيان القياسي `bin/cli/cli-manifest.mjs`
(`claude-code|cc|anthropic`، `codex-cli|openai-codex|openai`، `goose-cli`،
`open-code`، `qwen-code`، `gemini-cli`)، و`omniroute completion` تقدم نفس الكلمات المستمدة من البيان. لا تزال المشغلات القديمة لكل أداة —
`omniroute launch` (Claude Code) و`omniroute launch-codex` (Codex) — متاحة.
تتوفر عملية الانضمام للمزود من نفس السياق المحلي/البعيد. تحافظ الأوامر التي تركز على API أدناه على مصادقة الإدارة منفصلة عن بيانات اعتماد المزود ولا تطبع أبدًا بيانات اعتماد في الإخراج المنظم:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
للسكربتات، يفضل استخدام `--credential-stdin` أو `--credential-env`؛ يتم الاحتفاظ بـ `--credential` للاستخدام المحلي المنضبط. يتطلب `providers remove` `--yes` على محطة غير تفاعلية، وتكرم جميع الأوامر الخمسة السياق النشط أو الخيارات العالمية `--base-url`/`--api-key`.
لإعداد القاعدة المكتوب يدويًا لمرة واحدة لأغنى تكاملين، انظر إلى الغوص العميق لكل أداة:
- [تكوين Claude Code](./CLAUDE-CODE-CONFIGURATION.md)
- [تكوين Codex CLI](./CODEX-CLI-CONFIGURATION.md)
- [الوضع البعيد](./REMOTE-MODE.md) — تشغيل OmniRoute بعيد (VPS / Tailnet) من جهاز الكمبيوتر المحمول الخاص بك
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — ملحق OmniCopilot؛ يمكنه أيضًا تشغيل هذه الأوامر `setup-*` لك من داخل المحرر
---
## جدول رئيسي
كل أمر يكرم **السياق النشط** (المحدد بواسطة `omniroute connect`، انظر
[الوضع البعيد](./REMOTE-MODE.md)) أو العلامات الصريحة `--remote <url> --api-key <key>`.
"محلي مقابل بعيد" أدناه يعني: بدون علامات، يستهدف `http://localhost:20128`؛ مع `--remote` (أو سياق بعيد نشط) يقوم بجلب الكتالوج من ذلك
الخادم ويكتب التكوين محليًا.
| الأمر | الأداة | ما يكتبه | العلامات الرئيسية | محلي مقابل بعيد |
| -------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — ملف تعريف واحد لكل نموذج نص متوافق (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | كلاهما |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — ملف تعريف واحد لكل نموذج متطابق (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | كلاهما |
| `omniroute setup-opencode` | OpenCode (متوافق مع openai) | `~/.config/opencode/opencode.json` — مزود `omniroute` مع كل نموذج كتالوج (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | كلاهما |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (وضع CLI) + يطبع إعدادات ملحق VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | كلاهما |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + يدمج `kilocode.*` في `settings.json` لـ VS Code إذا كان موجودًا | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | كلاهما |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml` — نماذج `provider: openai`، المفتاح عبر `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | كلاهما |
| `omniroute setup-cursor` | Cursor | لا شيء — يطبع الخطوات داخل التطبيق (تكوين Cursor غير شفاف SQLite) | `--remote` `--api-key` `--only` `--port` | كلاهما |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (مستند الاستيراد) + يحدد `roo-cline.autoImportSettingsPath` إذا كان هناك `settings.json` لـ VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | كلاهما |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json` — مزود `openai-compat`، المفتاح عبر `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | كلاهما |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + يطبع وصفة البيئة | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | كلاهما |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + يطبع وصفة البيئة | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | كلاهما |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — مصفوفة V4 `modelProviders.openai` + `OMNIROUTE_API_KEY` في `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | كلاهما |
| `omniroute run <target>` | تشغيل وقت التشغيل (عام) | لا شيء — تشغيل `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` مع البيئة الصحيحة والمعلمات؛ تستخدم Qwen وGemini منزلًا معزولًا مؤقتًا | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | كلاهما |
| `omniroute launch` | Claude Code | لا شيء — يقوم بتشغيل `claude` مع `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` المدخلة | `--remote` `--api-key` `--token` `--profile` `--port` | كلاهما |
| `omniroute launch-codex` | OpenAI Codex CLI | لا شيء — يقوم بتشغيل `codex` مع مزود `omniroute` المدخل عبر علامات `-c` | `--remote` `--api-key` `--profile` (`-p`) `--port` | كلاهما |
ملاحظات حول العلامات (تم التحقق منها في مصدر الأمر):
- `--remote <url>` — جلب الكتالوج من OmniRoute بعيد (يتجاوز `--port`
والسياق النشط). `--api-key <key>` يوفر بيانات الاعتماد لذلك
الخادم (يكون الافتراضي هو متغير البيئة `OMNIROUTE_API_KEY`، أو رمز السياق النشط).
- `--only <patterns>` — أجزاء فرعية مفصولة بفواصل؛ احتفظ فقط بمعرفات النماذج التي تتطابق
(على سبيل المثال `--only glm,kimi`). متاحة على `setup-codex`، `setup-claude`,
`setup-opencode`، `setup-continue`، `setup-cursor`، `setup-crush`.
- `--dry-run` — طباعة بالضبط ما سيتم كتابته دون لمس
نظام الملفات. متاحة على كل أمر `setup-*` **باستثناء** `setup-cursor`
(الذي لا يكتب ملفًا أبدًا).
- `--model <id>` — مطلوب (أو يتم اختياره تفاعليًا) للأدوات التي لا تمتلك
اكتشاف نموذج تلقائي: Cline، Kilo، Roo، Goose، Qwen، Aider. تقبل تلك الأدوات أيضًا `--yes` للتشغيلات غير التفاعلية (التي تتطلب بعد ذلك `--model`).
يأخذ `setup-opencode` `--model` لتعيين النموذج الافتراضي على المستوى الأعلى.
- `--model <id>` على `omniroute run` يتبع توصيل البيان لكل هدف
(`bin/cli/cli-manifest.mjs`): **aider** يتلقى `--model openai/<id>` و
**opencode** `--model omniroute/<id>` (يتم إضافة البادئة فقط عندما لا يحمل المعرف
ذلك بالفعل)؛ **qwen** و **gemini** يتلقيان المعرف كما هو؛
**claude** يحصل عليه عبر `ANTHROPIC_MODEL`، **goose** عبر `GOOSE_MODEL`، و
**codex** عبر `-c model_providers.omniroute.*` args. **Qwen هو الهدف الوحيد الذي يتطلب بشدة `--model`**`omniroute run qwen` بدونه يخرج
`2` مع خطأ صريح.
- `--port <port>` — منفذ OmniRoute المحلي (الافتراضي `20128`، يتم تجاهله عند تعيين `--remote`).
موجود على جميع `setup-*` وكلا المشغلين.
- رموز الخروج لـ `omniroute run`: يتم تمرير رمز الخروج الخاص بـ CLI الفرعي
كما هو؛ `2` = معلمات غير صالحة (هدف غير مدعوم، نموذج مطلوب مفقود، حارس حاوية)؛ `127` = الثنائي المستهدف ليس في `PATH`؛
`130`/`143`/`129` عندما يتم إنهاء التشغيل بواسطة `SIGINT`/`SIGTERM`/`SIGHUP`؛
`1` = فشل آخر في تشغيل الوقت.
- تقبل المشغلان (`launch`، `launch-codex`) `--profile <name>` لاختيار
ملف تعريف مكتوب بواسطة `setup-claude` / `setup-codex`، بالإضافة إلى تمرير المعلمات للأمر
الثانوي `claude` / `codex` الثنائي.
المحدد التفاعلي مشترك أيضًا بواسطة وصفات الإعداد:
```bash
# اختر من كتالوج النموذج المحلي أو البعيد النشط وقم بتكوين الهدف.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` حاليًا يفوض إلى الوصفات المختبرة لـ `codex`، `claude`,
`opencode`، `qwen`، `aider`، `goose`، `cline`، `continue`، و `kilo`. تبقى إدخالات الكتالوج الخاصة بـ IDE فقط،
MITM، والدليل فقط تدفقات `setup-*`/يدوية واضحة وليست مقدمة كأهداف قابلة للتشغيل.
> `setup-opencode` هو تكامل OpenCode **متوافق مع openai** خفيف الوزن.
> هناك أيضًا تكامل ملحق أغنى — `omniroute setup opencode` — الذي
> يقوم بتثبيت `@omniroute/opencode-plugin`. إنهما أمران مختلفان؛ الجدول
> أعلاه يوثق `setup-opencode`.
---
## الاستخدام المحلي
مع تشغيل OmniRoute على `localhost:20128`، فقط قم بتشغيل أمر الإعداد لأداتك. يتم جلب الكتالوج من الخادم المحلي.
```bash
# Codex: كتابة ملف تعريف لكل نموذج متطابق في ~/.codex/
omniroute setup-codex
codex --profile glm52 # استخدم ملف تعريف تم إنشاؤه
# Claude Code: كتابة ملفات تعريف لكل نموذج، ثم إطلاق واحد
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: كتابة مزود متوافق مع openai مع جميع نماذج الكتالوج
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # يتم الإشارة إليه عبر {env:OMNIROUTE_API_KEY}، أبداً على القرص
opencode -m omniroute/glm/glm-5.2 "..."
# الأدوات التي لا تحتوي على اكتشاف تلقائي تحتاج إلى نموذج صريح:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# معاينة دون كتابة أي شيء:
omniroute setup-continue --dry-run
```
إطلاق دون كتابة أي تكوين على الإطلاق (حقن البيئة فقط):
```bash
omniroute launch # Claude Code → OmniRoute المحلي
omniroute launch-codex # Codex CLI → OmniRoute المحلي
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# مسار الأمر الصريح: تمرير أي شيء يأتي بعد --
omniroute run claude -- --print-system-prompt "راجع هذا الفرق"
```
---
## الاستخدام عن بُعد
وجه أي أمر إعداد إلى OmniRoute عن بُعد مع `--remote` + `--api-key`. يتم جلب الكتالوج من البعيد؛ يتم كتابة التكوين على جهازك المحلي.
```bash
# OpenCode ضد VPS عن بُعد، احتفظ فقط بنماذج glm/kimi
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # قم بتصدير OMNIROUTE_API_KEY أولاً
# ملفات تعريف Codex من كتالوج بعيد
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# إطلاق CLI مباشرة ضد البعيد
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
بدلاً من تمرير `--remote`/`--api-key` في كل مرة، قم بتسجيل الدخول مرة واحدة ودع **السياق النشط** يزودهم تلقائيًا:
```bash
omniroute connect 192.168.0.15 # يصدر رمزًا محدد النطاق، يخزن السياق
omniroute setup-codex # ← الآن يستخدم الكتالوج البعيد
omniroute setup-opencode # ← نفس الشيء
omniroute launch # ← Claude Code ضد البعيد
```
راجع [وضع البعد](./REMOTE-MODE.md) للسياقات، النطاقات، وإدارة الرموز.
---
## اتفاقيات عنوان URL الأساسي (التي تريد الأدوات `/v1`)
يكشف OmniRoute عن واجهة OpenAI عند `/v1`، وواجهة Anthropic عند الجذر، وواجهة Gemini الأصلية عند `/v1beta`. كل تكامل موصول بالشكل الذي تتوقعه أداته (تم التحقق منه في مصدر الأمر):
| التكامل | عنوان URL الأساسي المكتوب | `/v1`؟ |
| -------------------------------------------------------------------------- | ------------------------- | ---------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | الجذر | لا — Cline يضيف `/v1/chat/completions` |
| `setup-goose` (`OPENAI_HOST`) | الجذر | لا — Goose يضيف المسار |
| `setup-aider` (`OPENAI_API_BASE`) | الجذر | لا — LiteLLM يضيف `/v1/chat/completions` |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | مع `/v1` | نعم |
| `setup-claude` (`ANTHROPIC_BASE_URL``launch` | الجذر | لا — Claude Code يضيف `/v1/messages` |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | مع `/v1` | نعم |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | مع `/v1` | نعم |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | الجذر | لا — SDK يضيف `/v1beta/models/…` |
---
## الحفاظ على التبعيات الأصلية عند التحديث: `--include=optional`
عند التحديث باستخدام `omniroute update` (بعد التأكيد، أو مع `--apply`)، يقوم OmniRoute بتشغيل التثبيت مع `--include=optional` مضمن:
```bash
npm install -g omniroute@latest --include=optional
```
هذا **ليس** علمًا تمرره إلى `omniroute update` — يتم تطبيقه دائمًا بواسطة
المحدث. يضمن أن `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, مجموعة LLMLingua SLM) تبقى بعد التحديث حتى لو كانت إعدادات npm لديك
تحتوي على `omit=optional`، مما قد يؤدي إلى إسقاط برنامج تشغيل SQLite الأصلي
وربط نظام التشغيل بشكل صامت. لمعاينة الأمر الدقيق دون تطبيقه:
```bash
omniroute update --dry-run
# [DRY RUN] Would run: npm install -g omniroute@latest --include=optional
```
أعلام أخرى لـ `omniroute update` (تم التحقق منها في المصدر): `--check` (خروج 1 إذا كانت
قديمة)، `--apply` (تثبيت دون مطالبة)، `--changelog`، `--no-backup`،
`--yes`.
---
## Google Gemini CLI عبر `omniroute run gemini`
تم التحقق من العقد مقابل `@google/gemini-cli` 0.50.0: تلتزم واجهة سطر الأوامر
`GOOGLE_GEMINI_BASE_URL` وتصدر `POST /v1beta/models/<model>:generateContent`
`:streamGenerateContent?alt=sse`) ضدها — بالضبط واجهة OmniRoute الأصلية
Gemini (`/v1beta`). يقوم `omniroute run gemini` بتوصيل ذلك تلقائيًا:
- `GOOGLE_GEMINI_BASE_URL` → عنوان URL الأساسي النشط لـ OmniRoute (الجذر، بدون `/v1`
- `GEMINI_API_KEY` → بيانات اعتماد OmniRoute المحلولة (خيار/بيئة/سياق)؛
- **مؤقت معزول `GEMINI_CLI_HOME`** الذي يختار `gemini-api-key` في ملف `.gemini/settings.json`
بحيث لا تتجاوز جلسة Google OAuth المخزنة (Code Assist)
إطلاق OmniRoute الموجه — يتم إزالته بعد الخروج؛
- **نظافة البيئة**: يتم تنظيف البيئة الفرعية من `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` و `GOOGLE_GENAI_USE_GCA` (التي قد تعيد توجيه
المصادقة إلى Vertex/Code Assist)، ويتم تعيين `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key`
كاحتياطي — تتلقى الأهداف الأخرى لـ `run` نفس المعاملة لمتغيراتها المتضاربة؛
- حقن `--model <id>` من `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
لا يزال تطبيق حارس ثقة مساحة العمل في وضع الرأس الخالي — مرر
`--skip-trust` (أو ثق بالدليل تفاعليًا) بنفسك؛ لا يتجاوز المشغل ذلك عمدًا. هذا المشغل
متميز عن **تسجيل ACP** (`src/lib/acp/registry.ts`, `gemini --acp`)، الذي يبقى
تكامل بروتوكول الوكيل لـ `/dashboard/acp-agents`.
---
## تنظيف الدخان الحقيقي (اختياري)
تجري اختبارات الانحدار لخطة الإطلاق الحتمية في CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). للتحقق من الثنائيات الحقيقية ضد خادم
OmniRoute حقيقي، يوجد هيكل اختياري في
`tests/integration/upstream-cli-smoke.int.test.ts`. لا يتم تشغيله تلقائيًا
(كل اختبار فرعي يتخطى ما لم يكن `RUN_CLI_SMOKE=1`)، يمرر بيانات الاعتماد عبر متغير البيئة
NAME (وليس بالقيمة)، يحجب السلاسل على شكل مفتاح من أي مخرجات مسجلة، يتخطى
الأهداف التي لم يتم تثبيت ثنائياتها، ويصنف الفشل كـ
مصادقة / مصدر / تكوين بدلاً من قيمة منطقية بسيطة:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
اختياري: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` يقيّد التنظيف؛
`OMNIROUTE_SMOKE_TIMEOUT_MS` يتجاوز مهلة 120 ثانية لكل هدف.
---
## انظر أيضًا
- [تكوين كود كلود](./CLAUDE-CODE-CONFIGURATION.md) — الدليل الأعمق لكود كلود
- [تكوين واجهة سطر الأوامر لكودكس](./CODEX-CLI-CONFIGURATION.md) — الإعداد الأساسي لمرة واحدة `[model_providers.omniroute]`
- [الوضع البعيد](./REMOTE-MODE.md) — السياقات، رموز الوصول المحدودة، تشغيل خادم بعيد
- [مرجع أدوات سطر الأوامر](../reference/CLI-TOOLS.md) — الكتالوج الكامل للأدوات المدعومة + صفحات لوحة التحكم
- [دليل الإعداد](./SETUP_GUIDE.md) — طرق التثبيت والتوجيه عند التشغيل الأول

View File

@@ -1,86 +1,325 @@
# CLI Tools Setup Guide — OmniRoute (العربية)
# CLI-TOOLS (العربية)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "أدوات CLI — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# أدوات CLI — OmniRoute
آخر تحديث: 2026-08-18
يتكامل OmniRoute مع ثلاث فئات من أدوات CLI موزعة عبر ثلاث صفحات لوحة معلومات مخصصة:
| الصفحة | المسار | المفهوم | العدد |
| ------------- | ----------------------- | ------------------------------------------------------------------------- | ---------- |
| **كود CLI** | `/dashboard/cli-code` | أدوات البرمجة التي تشير إلى OmniRoute (العميل → CLI → OmniRoute → المزود) | 26 |
| **وكلاء CLI** | `/dashboard/cli-agents` | وكلاء مستقلون تشير إلى OmniRoute (نفس التدفق، نطاق أوسع) | 8 |
| **وكلاء ACP** | `/dashboard/acp-agents` | CLIs التي يولدها OmniRoute كخلفية عبر stdio/ACP (تدفق عكسي) | انظر السجل |
تقوم المسارات القديمة بإعادة التوجيه عبر 308: `/dashboard/cli-tools``/dashboard/cli-code`، `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## كيف يعمل
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
كود CLI / وكلاء CLI (تدفق الاستهلاك):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (جميعها تشير إلى OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (يقوم OmniRoute بتوجيه الطلب إلى المزود الصحيح)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
وكلاء ACP (تدفق توليد عكسي):
طلب العميل → OmniRoute → يولد CLI عبر stdio/ACP → استجابة
```
**Benefits:**
**الفوائد:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- مفتاح API واحد لإدارة جميع الأدوات
- تتبع التكاليف عبر جميع CLIs في لوحة المعلومات
- تبديل النماذج دون إعادة تكوين كل أداة
- يعمل محليًا وعلى الخوادم البعيدة (VPS، Docker، Akamai، Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## التكوين التلقائي مع `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
لا تحتاج إلى كتابة تكوين كل أداة يدويًا. يقوم OmniRoute بتوفير أمر `setup-*`
لكل CLI مدعوم يقرأ كتالوج النموذج **الحالي** من OmniRoute قيد التشغيل (محلي أو بعيد) ويكتب تكوين الأداة الخاصة بك على جهازك:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
كل منها يقبل `--remote <url> --api-key <key>` (تكوين أداة محلية ضد OmniRoute بعيد)، `--dry-run` (معاينة دون كتابة)، و `--port`. الأدوات التي لا تحتوي على اكتشاف تلقائي للنموذج (Cline، Kilo، Roo، Goose، Aider، Qwen) تأخذ `--model <id>``--yes` للتشغيل غير التفاعلي). لإطلاق CLI مع البيئة الصحيحة المدخلة ودون كتابة أي تكوين على الإطلاق، استخدم المشغل العام
`omniroute run <target>` (claude، codex، aider، goose، opencode، qwen،
gemini — الأهداف والأسماء المستعارة تأتي من `bin/cli/cli-manifest.mjs`); تظل المشغلات القديمة لكل أداة `omniroute launch` (Claude Code) و `omniroute launch-codex`
(Codex) متاحة. CLI Gemini هو فقط للإطلاق: إنه هدف `omniroute run`
ولكن ليس له وصفة `setup-*`/`configure`.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **المرجع الكامل:** الجدول الرئيسي — ما يكتبه كل أمر، كل علامة،
> محلي مقابل بعيد، وأي الأدوات تحتاج إلى لاحقة `/v1` — موجود في
> **[تكاملات CLI](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### تشغيل هذه داخل حاوية
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
أمر `setup-*` المنفذ داخل حاوية OmniRoute يكتب في
المنزل الخاص بالحاوية، والذي لا تقرأه أي CLI مضيف والذي يختفي مع
الحاوية. يكتشف OmniRoute ذلك ويخرج `2` مع تعليمات بدلاً من
الكتابة. هناك طريقتان مدعومتان للمضي قدمًا — تثبيت CLI على المضيف و
`omniroute connect` إلى الحاوية، أو ربط مجلدات التكوين وتعيين
`CLI_CONFIG_HOME` (ملف تعريف المضيف في التكوين). كل أمر `setup-*`، بالإضافة إلى
`omniroute configure` و `omniroute config set`، يقبل
`--allow-container-write` عندما يكون تكوين CLIs الخاصة بالحاوية هو ما كنت تعنيه بالفعل؛ `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` يفعل نفس الشيء للخادم. انظر
[دليل Docker → تكوين أدوات CLI المضيف](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
نقطة النهاية **apply** في لوحة المعلومات (`POST /api/cli-tools/apply`) تفرض نفس الحماية: في حاوية، كتابة الهدف الذي لم يتم ربطه من المضيف يجيب **`422`** مع `containerEphemeralTarget: true`، نص الخطأ الآمن و — للأدوات التي لديها وصفة مضيف (claude، codex، opencode، cline،
kilo، continue) — أمر `hostSetupCommand` (مثل `omniroute setup-opencode`) للتشغيل
على المضيف بدلاً من ذلك؛ لا يتم كتابة أي شيء. `dryRun: true` يستمر في العمل في وضع الحاوية
ويعيد المحتوى الناتج + مسار الهدف دون لمس القرص، لذا يمكنك المعاينة من لوحة المعلومات وتطبيقها على المضيف. هذا السلوك
مقصود ومحمى من التراجع بواسطة
`tests/unit/api/cli-tools/apply-container-guard.test.ts` — لا "تصلح" 422
عن طريق إزالة الحماية.
---
## Step 1 — Get an OmniRoute API Key
## مصدر الحقيقة
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
يعيش الكتالوج الموحد في `src/shared/constants/cliTools.ts` كـ `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
كل إدخال يحتوي على هذه الحقول (المعرفة في `src/shared/schemas/cliCatalog.ts`):
| الحقل | النوع | الوصف |
| ----------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------- |
| `category` | `"code" \| "agent"` | الصفحة التي يظهر عليها الأداة |
| `vendor` | `string` | أصل الأداة ("Anthropic"، "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | يمكن استخدامها أيضًا كعميل ACP (شعار يظهر) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | مستوى دعم نقطة النهاية المخصصة. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | آلية التكوين |
| `id`, `name`, `color`, `description`, `docsUrl` | قياسي | حقول العرض الأساسية |
الإدخالات التي تحتوي على `baseUrlSupport: "none"` **لا تظهر** في صفحات لوحة المعلومات — فهي مسجلة في MITM backlog للخطة 11 (انظر `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### مستويات القدرة (موثقة × قابلة للاكتشاف × قابلة للتكوين × قابلة للتشغيل)
ليس كل أداة موثقة قابلة للاكتشاف أو التكوين أو التشغيل. كل مستوى له مصدر يعلن عنه، واختبار الانجراف يحافظ على توافقها:
| المستوى | المعنى | معلن عنه |
| ------------------ | ------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **موثقة** | تظهر في كتالوج لوحة المعلومات (الاسم، البائع، الوثائق، نوع التكوين) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **قابلة للاكتشاف** | اكتشاف الثنائيات/التكوين، فحوصات الصحة، مسارات التكوين | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime catalog) |
| **قابلة للتكوين** | مدعومة بواسطة `omniroute configure <cli>` (وصفة الإعداد موجودة) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **قابلة للتشغيل** | مدعومة بواسطة `omniroute run <target>` (حقن env/args معرف) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` هو البيان التنفيذي القياسي لأوامر CLI: `run`، `configure` ومولدات إكمال الصدفة جميعها تستمد قوائم أهدافها، وحل الأسماء المستعارة (على سبيل المثال `kilocode`/`kilo-code`/`kilo_cli``kilo`) وتوصيل علامة `--model` منها. يضمن حارس الانجراف
`tests/unit/cli/cli-manifest-drift.test.ts` أن البيان، كتالوج وقت التشغيل، كتالوج واجهة المستخدم وكل سطح مستهلك يبقى متزامنًا — الهدف المضاف إلى
سطح واحد دون الآخرين يفشل المجموعة بدلاً من الانجراف بصمت.
## 1. كتالوج كود CLI (26 أداة)
جميع الأدوات التي تظهر في `/dashboard/cli-code`. تلك التي تحتوي على `baseUrlSupport: none` متصلة من خلال MITM أو دليل يدوي بدلاً من عنوان URL أساسي مخصص:
| id | name | vendor | baseUrlSupport | configType | acpSpawnable |
| ------------ | ------------------------------ | ------------------- | -------------- | ---------- | ------------ |
| claude | كود كلود | أنثروبيك | كامل | env | true |
| codex | واجهة سطر أوامر OpenAI Codex | OpenAI | كامل | مخصص | true |
| zcode | ZCode (خطة ترميز GLM) | Z.ai | لا شيء | مخصص | false |
| cline | كلاين | OSS (ex-Claude Dev) | كامل | مخصص | true |
| kilo | كود كيلو | Kilo-Org | كامل | مخصص | false |
| roo | كود رو | رو (OSS) | كامل | دليل | false |
| continue | تابع | continue.dev | كامل | دليل | false |
| aider | مساعد | OSS (P. Gauthier) | كامل | دليل | true |
| forge | ForgeCode | Antinomy HQ | كامل | مخصص | true |
| jcode | jcode | 1jehuang (OSS) | كامل | مخصص | false |
| deepseek-tui | واجهة DeepSeek TUI | Hunter Bown (OSS) | كامل | مخصص | false |
| codewhale | CodeWhale | Hmbown (OSS) | كامل | مخصص | false |
| opencode | OpenCode | Anomaly (ex-SST) | كامل | دليل | true |
| droid | Factory Droid | Factory AI | جزئي | دليل | false |
| copilot | واجهة سطر أوامر GitHub Copilot | GitHub/MS | كامل | مخصص | false |
| cursor-cli | واجهة سطر أوامر Cursor | Anysphere | جزئي | دليل | true |
| smelt | صهر | leonardcser (OSS) | كامل | مخصص | false |
| pi | باي (عميل ترميز باي) | M. Zechner (OSS) | كامل | مخصص | false |
| grok-build | بناء Grok | xAI | كامل | مخصص | false |
| crush | سحق | OSS (Charm) | كامل | مخصص | false |
| qwen | كود كوين | Alibaba | كامل | دليل | true |
| cursor | مؤشر | Anysphere | لا شيء | دليل | false |
| antigravity | مضاد الجاذبية | Google | لا شيء | mitm | false |
| hermes | هيرميس | Nous Research | لا شيء | دليل | false |
| kiro | كيرو AI | أمازون | لا شيء | mitm | false |
| custom | واجهة سطر أوامر مخصصة | — | كامل | منشئ مخصص | false |
الأدوات التي تحتوي على `baseUrlSupport: "جزئي"` تظهر شارة "⚠ عنوان URL أساسي جزئي" في بطاقة لوحة المعلومات.
## 2. كتالوج وكلاء CLI (8 أدوات)
الوكلاء المستقلون الذين يظهرون في `/dashboard/cli-agents`:
| id | الاسم | البائع | دعم baseUrl | acpSpawnable |
| ------------ | ---------------- | -------------------- | ----------- | ------------ |
| hermes-agent | وكيل هيرميس | أبحاث نوس | كامل | خطأ |
| openclaw | OpenClaw | OSS (P. Steinberger) | كامل | صحيح |
| goose | Goose | Block / مؤسسة لينكس | كامل | صحيح |
| interpreter | Open Interpreter | OSS | كامل | صحيح |
| warp | Warp AI | Warp Inc. | جزئي | صحيح |
| agent-deck | Agent Deck | asheshgoplani (OSS) | كامل | خطأ |
| omp | Oh My Pi | OSS | كامل | صحيح |
| letta | Letta CLI | Letta | كامل | خطأ |
---
## Step 2 — Install CLI Tools
## 3. وكلاء ACP (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
تظهر هذه الصفحة (التي تم إعادة تسميتها من `/dashboard/agents`) واجهات CLI التي يمكن لـ OmniRoute **إنشاؤها** كأدوات تنفيذ خلفية عبر بروتوكول stdio/ACP. يتم الحفاظ على الكتالوج بشكل منفصل في `src/lib/acp/registry.ts` وهو **ليس** نفس `CLI_TOOLS`.
---
## 4. قائمة الانتظار MITM (غير معروضة في لوحة التحكم)
لا تدعم واجهات CLI التالية عنوان URL الأساسي المخصص بشكل أصلي وهي **غير مدرجة** في صفحات كود CLI أو وكلاء CLI. هم مرشحون للاعتراض MITM في الخطة 11:
| CLI | السبب |
| ------------------- | --------------------------------------------------------- |
| windsurf | BYOK محدود لنماذج كلود المختارة + عنوان URL/token الشركات |
| amp | نظام مغلق (Sourcegraph) |
| amazon-q / kiro-cli | مصادقة AWS SSO، لا يوجد عنوان URL مخصص |
| cowork | Anthropic Desktop، لا يوجد نقطة نهاية قابلة للتكوين |
راجع `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` للحصول على المرجع الكامل.
---
## 5. واجهة برمجة تطبيقات اكتشاف الدفعات
يتم تجميع جميع اكتشاف الأدوات عبر نقطة نهاية واحدة:
**`GET /api/cli-tools/all-statuses`**
- المصادقة: `requireCliToolsAuth(request)` (نفس مسارات `/api/cli-tools/` الأخرى)
- العائدات: `Record<toolId, ToolBatchStatus>` (النوع: `src/shared/types/cliBatchStatus.ts`)
- الاستراتيجية: `Promise.all` على جميع الأدوات، مهلة 5 ثوان لكل أداة
- التخزين المؤقت: في الذاكرة LRU مفهرس بواسطة ملف التكوين `mtime`. يتم إبطال التخزين المؤقت عند تغيير mtime. يتم إعادة تعيينه عند إعادة تشغيل الخادم.
شكل الاستجابة لكل أداة:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // تم تنظيفه، لا توجد تتبع للأخطاء
}
```
## 6. معالجات الإعدادات للأدوات الجديدة
الأدوات الجديدة التي تحتوي على `configType: "custom"` لديها مسارات واجهة برمجة التطبيقات المخصصة للإعدادات:
| المسار | الأداة |
| ------------------------------------------- | ---------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legacy) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, primary + legacy `~/.deepseek` sync) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi coding agent |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + dedicated `.env` key) |
جميع المسارات تستخدم `sanitizeErrorMessage()` لردود الأخطاء (قاعدة صارمة #12).
---
## 7. هيكل صفحات لوحة التحكم
### كود CLI (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — مكون خادم
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — شبكة عميل
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — صفحة تفاصيل الأداة
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 بطاقة أداة متخصصة + `ToolDetailClient.tsx`
### وكلاء CLI (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — مكون خادم
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — شبكة عميل
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — يعيد استخدام `ToolDetailClient`
### وكلاء ACP (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — مكون خادم (تم نقله من `agents/`)
### مكونات واجهة المستخدم المشتركة (`src/shared/components/cli/`)
| الملف | الغرض |
| ----------------------- | ------------------------------------------------ |
| `CliToolCard.tsx` | بطاقة حالة ذكية (الكشف + الإعداد + نقطة النهاية) |
| `CliConceptCard.tsx` | بطاقة شرح مفهوم لكل صفحة |
| `CliComparisonCard.tsx` | مقارنة عبر ثلاثة أعمدة بين أنواع CLI |
| `BaseUrlSelect.tsx` | قائمة منسدلة لنقطة النهاية (محلي/سحابي/مخصص) |
| `ApiKeySelect.tsx` | محدد مفتاح API |
| `ManualConfigModal.tsx` | نافذة نموذج مقتطف الإعداد القابل للنسخ |
### هوك مشترك (`src/shared/hooks/cli/`)
| الملف | الغرض |
| ------------------------- | ------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | يجلب `/api/cli-tools/all-statuses`، يدير حالة التحميل/التحديث |
---
## 8. i18n
تمت إضافة مساحات أسماء جديدة في الخطة 14 F9:
| مساحة الاسم | الغرض |
| ----------- | ------------------------------------------------------------------------------ |
| `cliCommon` | سلاسل مشتركة (تسميات البطاقات، نصوص المفاهيم/المقارنات، تسميات صفحات التفاصيل) |
| `cliCode` | سلاسل صفحة CLI Code |
| `cliAgents` | سلاسل صفحة CLI Agents |
| `acpAgents` | سلاسل صفحة ACP Agents |
تم توفير ترجمات كاملة بالبرتغالية البرازيلية والإنجليزية. 39 لغة أخرى تتراجع تلقائيًا إلى الإنجليزية عبر دمج مستوى مساحة الاسم في `src/i18n/request.ts`.
---
## 9. البدء السريع
### الخطوة 1 — الحصول على مفتاح API لـ OmniRoute
1. افتح `/dashboard/api-manager`**إنشاء مفتاح API**
2. أعطه اسمًا (مثل `cli-tools`) واختر جميع الأذونات
3. انسخ المفتاح — ستحتاجه لكل CLI أدناه
> يبدو مفتاحك كالتالي: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### الخطوة 2 — تثبيت أدوات CLI
تتطلب جميع الأدوات المعتمدة على npm Node.js 22.22.2+ أو 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +337,135 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (يمكن تشغيله عبر `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # يعتمد على Rust
# وكيل برمجة Pi
# انظر https://github.com/zechnerj/pi-coding-agent للتثبيت
# jcode
# انظر https://github.com/1jehuang/jcode للتثبيت
```
---
## Step 3 — Set Global Environment Variables
### الخطوة 3 — التكوين عبر لوحة التحكم
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. انتقل إلى `http://localhost:20128/dashboard/cli-code`
2. ابحث عن أداتك في الشبكة
3. انقر على البطاقة لفتح صفحة تفاصيل الأداة
4. اختر مفتاح API الخاص بك وURL الأساسي
5. انقر على **تطبيق التكوين** أو انسخ مقتطف التكوين اليدوي
---
### الخطوة 4 — تعيين متغيرات البيئة العالمية
```bash
# OmniRoute Universal Endpoint
# نقطة النهاية العالمية لـ OmniRoute
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# يقرأ Gemini CLI GOOGLE_GEMINI_BASE_URL عند الجذر (تضيف SDK الخاصة به /v1beta/... بنفسها)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> لاستبدال `localhost:20128` بـ IP الخادم أو النطاق في **خادم بعيد**،
> مثل `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### الخطوة 4 — تكوين كل أداة
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# إنشاء ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
استخدم جذر بوابة Anthropic الموحدة لـ Claude Code. لا تضف `/v1` هنا.
**اختبار:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
يقرأ Codex الحديث (v0.137+) `~/.codex/config.toml` فقط — ينتمي `config.yaml` القديم إلى CLI npm التقليدي ويتم تجاهله بصمت. يبقى مفتاح API في متغير البيئة `OMNIROUTE_API_KEY` (`env_key`)، وليس داخل الملف:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
مرجع كامل (الملفات الشخصية، `wire_api`، نوافذ السياق): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**اختبار:** `codex "what is 2+2?"`
---
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `codex "what is 2+2?"`
**اختبار:** `opencode`
> استخدم `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> لإرسال متغيرات التفكير.
---
### OpenCode
#### Cline (CLI أو VS Code)
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
EOF
```
**Test:** `opencode`
---
### Cline (CLI or VS Code)
**CLI mode:**
**وضع CLI:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +477,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**وضع VS Code:**
إعدادات ملحق Cline → مزود API: `OpenAI Compatible`URL الأساسي: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
أو استخدم لوحة التحكم OmniRoute → **أدوات CLI → Cline → تطبيق التكوين**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI أو VS Code)
**CLI mode:**
**وضع CLI:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**إعدادات VS Code:**
```json
{
@@ -223,13 +501,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
أو استخدم لوحة التحكم OmniRoute → **أدوات CLI → KiloCode → تطبيق التكوين**.
---
### Continue (VS Code Extension)
#### Continue (ملحق VS Code)
Edit `~/.continue/config.yaml`:
قم بتحرير `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +519,255 @@ models:
default: true
```
Restart VS Code after editing.
أعد تشغيل VS Code بعد التحرير.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
استخدم هذا عندما يتم تكوين VS Code Insiders لنماذج نقاط النهاية المخصصة وتريد أن يعمل OmniRoute بدون حقل رأس مخصص.
**الموقع الموصى به:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**مثال باستخدام اسم مستعار OmniRoute المرمز:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**ملاحظات:**
- استبدل `sk-your-omniroute-key` بمفتاح API تم إنشاؤه في OmniRoute.
- يجب أن يشير حقل `url` إلى `/api/v1/vscode/{token}/chat/completions`.
- يجب أن يشير حقل `modelsUrl` إلى `/api/v1/vscode/{token}/models`.
- يفضل استخدام تدفق `/v1` العادي + رأس Bearer عندما يدعم العميل الرؤوس المخصصة.
- تعتبر الرموز المدمجة في URL تراجعًا للتوافق وقد تظهر في سجلات المحرر أو تاريخ الوكيل.
---
#### Kiro CLI (أمازون)
```bash
# Login to your AWS/Kiro account:
# تسجيل الدخول إلى حساب AWS/Kiro الخاص بك:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# يستخدم CLI مصادقة خاصة به — لا حاجة لـ OmniRoute كخلفية لـ Kiro CLI نفسه.
# استخدم kiro-cli جنبًا إلى جنب مع OmniRoute لأدوات أخرى.
kiro-cli status
```
بالنسبة لتطبيق **Kiro IDE** المكتبي، استخدم نقطة النهاية MITM التي تعرضها OmniRoute
تحت `/dashboard/cli-tools → Kiro`.
---
### Qwen Code (Alibaba)
## 10. واجهة الأوامر الداخلية لـ OmniRoute
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
يوفر الملف الثنائي `omniroute` أوامر لدورة حياة الخادم، الإعداد، التشخيص، وإدارة المزودين. نقطة الدخول: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # بدء الخادم (المنفذ الافتراضي 20128)
omniroute setup # معالج الإعداد التفاعلي
omniroute doctor # التحقق من التكوين، قاعدة البيانات، المنافذ، وقت التشغيل
omniroute providers list # اتصالات المزودين المكونة
omniroute providers test-all # اختبار كل اتصال نشط
omniroute reset-password # إعادة تعيين كلمة مرور المسؤول
omniroute logs # بث سجلات الطلبات
omniroute health # صحة مفصلة (قواطع، ذاكرة مؤقتة، ذاكرة)
omniroute --version # طباعة الإصدار
omniroute --help # عرض جميع الأوامر
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### الإعداد والت initialization
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # معالج الإعداد التفاعلي
omniroute setup --non-interactive # وضع CI/الأتمتة (يقرأ متغيرات البيئة + العلامات)
omniroute setup --password '<value>' # تعيين كلمة مرور المسؤول مباشرة
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # إضافة واختبار مزود في خطوة واحدة
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
متغيرات البيئة المعترف بها للإعداد غير التفاعلي:
**Test:** `qwen "say hello"`
| Var | الغرض |
| ------------------- | -------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | مفتاح API للمزود (مرتبط بـ `--api-key` عبر Commander `.env()`) |
| `DATA_DIR` | تجاوز دليل بيانات OmniRoute |
### Cursor (Desktop App)
جميع المدخلات غير التفاعلية الأخرى تمر كعلامات، وليس كمتغيرات بيئة:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(انظر خيارات `omniroute setup` أعلاه).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## استكشاف الأخطاء
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### التشخيص
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # التحقق من التكوين، قاعدة البيانات، المنافذ، وقت التشغيل، الذاكرة، الحيادية
omniroute doctor --json # JSON قابل للقراءة بواسطة الآلة
omniroute doctor --no-liveness # تخطي اختبار صحة HTTP
omniroute doctor --host 0.0.0.0 # تجاوز مضيف الحيادية
omniroute doctor --liveness-url <url> # تجاوز عنوان URL لنقطة النهاية الصحية بالكامل
```
يقوم الطبيب بتشغيل هذه الفحوصات: `التكوين`، `قاعدة البيانات`، `التخزين/التشفير`،
`توفر المنفذ`، `وقت تشغيل العقدة`، `الملف الثنائي الأصلي` (better-sqlite3)،
`الذاكرة`، و`حيادية الخادم`. يخرج برقم غير صفري إذا فشل أي فحص.
### إدارة المزودين
```bash
omniroute providers available # كتالوج مزود OmniRoute
omniroute providers available --search openai # تصفية الكتالوج حسب id/الاسم/الاسم المستعار/الفئة
omniroute providers available --category api-key # تصفية حسب الفئة (api-key، oauth، مجاني، ...)
omniroute providers available --json # JSON قابل للقراءة بواسطة الآلة
omniroute providers list # اتصالات المزودين المكونة
omniroute providers list --json
omniroute providers test <id|name> # اختبار اتصال واحد مكون
omniroute providers test-all # اختبار كل اتصال نشط
omniroute providers validate # التحقق الهيكلي المحلي فقط
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # تدفق OAuth موجود
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` هي أولاً API وبالتالي تعمل ضد
السياق المحلي أو البعيد النشط. يجب أن تستخدم إدخال الاعتماد
`--credential-stdin` أو `--credential-env`؛ `--dry-run --json` تقارير فقط
عن الوجود/الشكل المحجوب. `providers available` يقرأ كتالوج OmniRoute؛
`providers list/test/test-all/validate` تحتفظ بسلوك SQLite المحلي الخاص بها ولا تتطلب تشغيل الخادم.
### الاسترداد وإعادة التعيين
```bash
omniroute reset-password # إعادة تعيين كلمة مرور المسؤول (أيضًا: omniroute-reset-password)
omniroute reset-encrypted-columns # عرض تحذير + تشغيل جافا لتعيين الاعتماد المشفر
omniroute reset-encrypted-columns --force # فعليًا إلغاء الاعتمادات المشفرة في SQLite
```
### تصدير الاعتماد (⚠ التعامل بحذر)
```bash
omniroute auth export # عرض تحذير + بوابة تأكيد — لا يوجد وصول إلى قاعدة البيانات
omniroute auth export --force # تصدير جميع اعتمادات الاتصالات غير المشفرة إلى stdout كـ JSON
omniroute auth export --force --id <id> # تصدير فقط الاتصال المطابق
omniroute auth export --force --format env # إصدار خطوط OMNIROUTE_<PROVIDER>_<FIELD>=<value>
omniroute auth export --force --out creds.json # الكتابة إلى ملف (تم إنشاؤه بأذونات 0600)
```
`auth export` هو **محلي فقط** (قراءة SQLite مباشرة، لا يوجد مسار HTTP) ويطبع/يكتب عمدًا
قيم `apiKey`/`accessToken`/`refreshToken`/`idToken` **بشكل نصي** — هذه هي الميزة، وليست
خطأ. لا يتم قراءة أي شيء من قاعدة البيانات، ولا يتم فك تشفير أي شيء، بدون `--force`. يتم دائمًا طباعة لافتة تحذير stderr قبل إصدار أي نص عادي. يتطلب تعيين `STORAGE_ENCRYPTION_KEY`.
يتم الإبلاغ عن حقل يفشل في فك التشفير (مفتاح قديم، نص مشفر تالف) كـ
`<field>DecryptFailed: true` بدلاً من إنهاء التصدير بالكامل أو تسريب الخطأ الأساسي.
### أوامر فرعية أخرى
تفترض هذه وجود خادم OmniRoute قيد التشغيل، ما لم يُذكر خلاف ذلك:
```bash
omniroute status # حالة شاملة لوقت التشغيل
omniroute logs # بث سجلات الطلبات (--json، --search، --follow)
omniroute config show # عرض التكوين الحالي
omniroute provider list # قائمة بالمزودين المتاحين (اسم مستعار لقائمة المزودين)
omniroute provider add # تسجيل OmniRoute كمزود على أداة
omniroute keys add | list | remove # إدارة مفاتيح API
omniroute models [provider] # قائمة النماذج (--json، --search)
omniroute combo list | switch | create | delete
omniroute backup # لقطة للتكوين + قاعدة البيانات
omniroute restore # استعادة من لقطة سابقة
omniroute health # صحة مفصلة (قواطع، ذاكرة مؤقتة، ذاكرة)
omniroute quota # استخدام حصة المزود
omniroute cache # حالة الذاكرة المؤقتة
omniroute cache clear # مسح الذاكرة المؤقتة الدلالية + التوقيع
omniroute mcp status | restart # حالة خادم MCP / إعادة التشغيل
omniroute a2a status | card # حالة خادم A2A / بطاقة الوكيل
omniroute tunnel list | create | stop # إدارة الأنفاق (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # فحص / تعيين متغيرات البيئة (مؤقتة)
omniroute test # اختبار اتصال المزود
omniroute update # التحقق من التحديثات
omniroute completion # توليد إكمال الصدفة
```
### العلامات الشائعة
| Flag | الوصف |
| ------------------- | ---------------------------------------------------------------- |
| `--no-open` | لا تفتح المتصفح تلقائيًا عند البدء |
| `--port <n>` | تجاوز منفذ API (الافتراضي 20128) |
| `--mcp` | العمل كخادم MCP عبر stdio (لـ IDEs) |
| `--non-interactive` | وضع CI (لا توجد مطالبات؛ يقرأ من env/flags) |
| `--json` | مخرجات JSON قابلة للقراءة بواسطة الآلة (doctor، providers، إلخ.) |
| `--help`, `-h` | عرض مساعدة محددة بالأمر |
| `--version`, `-v` | طباعة الإصدار المثبت |
---
## نقاط نهاية API المتاحة
| نقطة النهاية | الوصف | الاستخدام |
| -------------------------- | ------------------------------------------- | ------------------------------------- |
| `/v1/chat/completions` | دردشة قياسية (جميع المزودين) | جميع الأدوات الحديثة |
| `/v1/responses` | واجهة برمجة التطبيقات للردود (تنسيق OpenAI) | Codex، سير العمل الوكيلة |
| `/v1/completions` | إكمالات نصية قديمة | الأدوات القديمة التي تستخدم `prompt:` |
| `/v1/embeddings` | تضمينات نصية | RAG، بحث |
| `/v1/images/generations` | توليد الصور | GPT-Image، Flux، إلخ. |
| `/v1/audio/speech` | تحويل النص إلى كلام | ElevenLabs، OpenAI TTS |
| `/v1/audio/transcriptions` | تحويل الكلام إلى نص | Deepgram، AssemblyAI |
أمثلة جاهزة للنسخ مع عنوان URL موحد:
```txt
مثال على الرمز: sk-a3ab3c080beaee3a-69f4a4-070d71af
الأساس القياسي لـ OpenAI: http://localhost:20128/v1
نماذج VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
دردشة VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
ردود VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
علامات Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
دردشة Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## استكشاف الأخطاء وإصلاحها
| الخطأ | السبب | الحل |
| ------------------------------------------- | -------------------------- | ---------------------------------------------------- |
| `Connection refused` | OmniRoute غير قيد التشغيل | `omniroute serve` |
| `401 Unauthorized` | مفتاح API خاطئ | تحقق في `/dashboard/api-manager` |
| `No combo configured` | لا يوجد مجموعة توجيه نشطة | إعداد في `/dashboard/combos` |
| CLI يظهر "not installed" | الثنائي غير موجود في PATH | تحقق من `which <command>` |
| لوحة التحكم تظهر "not detected" بعد التثبيت | ذاكرة التخزين المؤقت قديمة | انقر على "⟳ Refresh detection" في لوحة التحكم |
| رابط قديم `/dashboard/cli-tools` | إشارة مرجعية قبل v3.8.6 | إعادة توجيه تلقائي إلى `/dashboard/cli-code` (308) |
| رابط قديم `/dashboard/agents` | إشارة مرجعية قبل v3.8.6 | إعادة توجيه تلقائي إلى `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,271 @@
# CLI-INTEGRATIONS (Azərbaycan dili)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI İnteqrasiyaları — hər hansı bir kodlama CLI-ni OmniRoute-a yönləndirin"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI İnteqrasiyaları
OmniRoute, bir kodlama CLI-nin (Codex, Claude Code, OpenCode, Cline, …) OmniRoute-u arxa planda istifadə etməsi üçün konfiqurasiya edən `setup-*` əmrləri ailəsini təqdim edir — beləliklə, alət **bir** uç nöqtə ilə danışır və OmniRoute doğru təminatçıya avtomatik geri dönmə ilə yönləndirir. Hər bir əmr, işləyən bir OmniRoute-dan **canlı** model kataloqunu oxuyur və alətin öz konfiqurasiya faylını **sizin** maşınınıza yazır. API açarı, alətin dəstəklədiyi hər yerdə bir mühit dəyişəni ilə istinad edilir. Alətə məxsus mühit faylını saxlayan əmrlər aşağıda qeyd olunmuşdur.
Eyni zamanda, `omniroute run <target>` adlı ümumi bir başlatıcı da var — bu, `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` və ya `gemini`-ni düzgün mühitlə başlatır, heç bir konfiqurasiya yazmadan. Hədəflər və onların təmsilçiləri, kanonik manifest `bin/cli/cli-manifest.mjs`-dən gəlir (`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`, `open-code`, `qwen-code`, `gemini-cli`), və `omniroute completion` eyni manifest-dən əldə edilən hədəf sözlərini təqdim edir. Köhnə alət başlatıcıları`omniroute launch` (Claude Code) və `omniroute launch-codex` (Codex) — hələ də mövcuddur.
Təminatçı onboarding eyni yerli/uzaq kontekstdən mövcuddur. Aşağıdakı API-öncəli əmrlər, idarəetmə autentifikasiyasını təminatçı etimadnamələrindən ayrı saxlayır və heç vaxt strukturlu çıxışda etimadnaməni çap etmir:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
Skriptlər üçün `--credential-stdin` və ya `--credential-env`-i üstün tutun; `--credential` isə nəzarət olunan yerli istifadə üçün saxlanılır. `providers remove` qeyri-interaktiv terminalda `--yes` tələb edir və beş əmrdən hamısı aktiv konteksti və ya qlobal `--base-url`/`--api-key` seçimlərini nəzərə alır.
İki ən zəngin inteqrasiyanın bir dəfəlik, əl ilə yazılmış əsas konfiqurasiyası üçün alətə xas dərin dalışlara baxın:
- [Claude Code konfiqurasiyası](./CLAUDE-CODE-CONFIGURATION.md)
- [Codex CLI konfiqurasiyası](./CODEX-CLI-CONFIGURATION.md)
- [Uzaq Rejim](./REMOTE-MODE.md) — laptopunuzdan uzaq OmniRoute (VPS / Tailnet) idarə edin
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — OmniCopilot genişləndirməsi; bu, eyni zamanda redaktordan içəridən bu `setup-*` əmrlərini sizin üçün icra edə bilər
---
## Master cədvəli
Hər bir əmr **aktiv konteksti** ( `omniroute connect` ilə təyin edilmişdir, bax [Uzaq Rejim](./REMOTE-MODE.md)) və ya açıq `--remote <url> --api-key <key>` flag-larını nəzərə alır. Aşağıdakı "Yerli vs uzaq" deməkdir: heç bir flag olmadan `http://localhost:20128`-i hədəfləyir; `--remote` (və ya aktiv uzaq kontekst) ilə o, kataloqu həmin serverdən alır və konfiqurasiyanı yerli yazır.
| Əmr | Alət | Yazdığı şey | Əsas flag-lar | Yerli vs uzaq |
| -------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — uyğun mətn modeli üçün bir profil (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | Hər ikisi |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — uyğun model üçün bir profil (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | Hər ikisi |
| `omniroute setup-opencode` | OpenCode (openai-uyğun) | `~/.config/opencode/opencode.json` — hər bir kataloq modeli ilə `omniroute` təminatçısı (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | Hər ikisi |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI rejimi) + VS Code genişləndirmə parametrlərini çap edir | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | Hər ikisi |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + varsa `kilocode.*`-ni VS Code `settings.json`-a birləşdirir | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | Hər ikisi |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` modelləri, açar `${{ secrets.OMNIROUTE_API_KEY }}` vasitəsilə | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Hər ikisi |
| `omniroute setup-cursor` | Cursor | Heç nə — tətbiq içindəki addımları çap edir (Cursor konfiqurasiyası qeyri-şəffaf SQLite-dir) | `--remote` `--api-key` `--only` `--port` | Hər ikisi |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (idxal sənədi) + varsa VS Code `settings.json`-da `roo-cline.autoImportSettingsPath`-ı təyin edir | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | Hər ikisi |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-uyğun` təminatçı, açar `$OMNIROUTE_API_KEY` vasitəsilə | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Hər ikisi |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + mühit reseptini çap edir | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Hər ikisi |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + mühit reseptini çap edir | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Hər ikisi |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai` massivi + `OMNIROUTE_API_KEY` `~/.qwen/.env`-də | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | Hər ikisi |
| `omniroute run <target>` | İcra başlatma (ümumi) | Heç nə — `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini`-ni düzgün mühit və arqumentlərlə başlat; Qwen və Gemini müvəqqəti izolyasiya olunmuş ev istifadə edir | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | Hər ikisi |
| `omniroute launch` | Claude Code | Heç nə — `claude`-ni `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` ilə başlatır | `--remote` `--api-key` `--token` `--profile` `--port` | Hər ikisi |
| `omniroute launch-codex` | OpenAI Codex CLI | Heç nə — `codex`-i `omniroute` təminatçısı ilə `-c` flag-ları vasitəsilə başlatır | `--remote` `--api-key` `--profile` (`-p`) `--port` | Hər ikisi |
Flag-lar haqqında qeydlər (əmr mənbəsində təsdiqlənmişdir):
- `--remote <url>` — uzaq OmniRoute-dan kataloqu alır ( `--port` və aktiv konteksti üstələyir). `--api-key <key>` həmin server üçün etimadnaməni təmin edir (varsayılan olaraq `OMNIROUTE_API_KEY` mühit dəyişəni və ya aktiv kontekstin tokeni).
- `--only <patterns>` — vergüllə ayrılmış alt stringlər; yalnız uyğun model ID-lərini saxlayır (məsələn, `--only glm,kimi`). `setup-codex`, `setup-claude`, `setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`-da mövcuddur.
- `--dry-run` — fayl sisteminə toxunmadan yazılacaq şeyləri dəqiq çap edir. Hər bir `setup-*` əmrdə **istisna olmaqla** `setup-cursor` (heç vaxt fayl yazmır).
- `--model <id>` — avtomatik model aşkar etməyən alətlər üçün tələb olunur (və ya interaktiv olaraq seçilir): Cline, Kilo, Roo, Goose, Qwen, Aider. Bu alətlər həmçinin qeyri-interaktiv icra üçün `--yes` qəbul edir (bu zaman `--model` tələb olunur). `setup-opencode` varsayılan üst səviyyə modelini təyin etmək üçün `--model` qəbul edir.
- `--model <id>` `omniroute run`-da manifestin hədəf wiring-ini izləyir (`bin/cli/cli-manifest.mjs`): **aider** `--model openai/<id>` alır və **opencode** `--model omniroute/<id>` (prefix yalnız id artıq onu daşımadığı zaman əlavə olunur); **qwen****gemini** id-ni olduğu kimi alır; **claude** bunu `ANTHROPIC_MODEL` vasitəsilə alır, **goose** `GOOSE_MODEL` vasitəsilə, və **codex** `-c model_providers.omniroute.*` arqumentləri vasitəsilə. **Qwen, yalnız `--model` tələb edən yeganə icra hədəfidir**`omniroute run qwen` olmadan `2` ilə açıq bir xəta ilə çıxır.
- `--port <port>` — yerli OmniRoute portu (varsayılan `20128`, `--remote` təyin edildikdə nəzərə alınmır). Bütün `setup-*` və hər iki başlatıcıda mövcuddur.
- `omniroute run` çıxış kodları: uşaq CLI-nin öz çıxış kodu olduğu kimi ötürülür; `2` = etibarsız arqumentlər (dəstəklənməyən hədəf, tələb olunan `--model`-in olmaması, konteyner qoruyucusu); `127` = hədəf ikili `PATH`-da yoxdur; `130`/`143`/`129` başlatma `SIGINT`/`SIGTERM`/`SIGHUP` ilə bitdikdə; `1` = digər icra başlatma xətası.
- İki başlatıcı (`launch`, `launch-codex`) `setup-claude` / `setup-codex` tərəfindən yazılmış profili seçmək üçün `--profile <name>` qəbul edir, həmçinin əsas `claude` / `codex` ikilisi üçün pass-through arqumentləri.
İnteraktiv seçici, eyni zamanda konfiqurasiya reseptləri ilə də paylaşılır:
```bash
# Aktiv yerli və ya uzaq model kataloqundan seçin və hədəfi konfiqurasiya edin.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` hazırda `codex`, `claude`, `opencode`, `qwen`, `aider`, `goose`, `cline`, `continue``kilo` üçün test edilmiş reseptlərə yönləndirilir. IDE-yə xas, MITM və yalnız bələdçi kataloq girişləri açıq `setup-*`/əl ilə axınlar olaraq qalır və başlatma hədəfləri kimi təqdim edilmir.
> `setup-opencode` **yüngül openai-uyğun** OpenCode inteqrasiyasıdır.
> Həmçinin daha zəngin bir plugin inteqrasiyası var — `omniroute setup opencode` — bu, `@omniroute/opencode-plugin`-i quraşdırır. Onlar fərqli əmrlərdir; yuxarıdakı cədvəl `setup-opencode`-i sənədləşdirir.
---
## Yerli istifadə
`localhost:20128` ünvanında OmniRoute işləyərkən, sadəcə alətiniz üçün qurma əmrini icra edin. Kataloq yerli serverdən alınır.
```bash
# Codex: uyğun model üçün ~/.codex/ içində profil yaz
omniroute setup-codex
codex --profile glm52 # yaradılmış profili istifadə et
# Claude Code: model başına profilləri yaz, sonra birini işə sal
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: bütün kataloq modelləri ilə openai-uyğun provayderi yaz
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # {env:OMNIROUTE_API_KEY} vasitəsilə istinad edilir, heç vaxt diskdə deyil
opencode -m omniroute/glm/glm-5.2 "..."
# Avtomatik aşkar etməyi tələb etməyən alətlər üçün açıq model lazımdır:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Heç nə yazmadan önizləmə:
omniroute setup-continue --dry-run
```
Heç bir konfiqurasiya yazmadan işə salın (yalnız env-injection):
```bash
omniroute launch # Claude Code → yerli OmniRoute
omniroute launch-codex # Codex CLI → yerli OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# Açıq əmr yolu: --dan sonra gələn hər şeyi keçirin
omniroute run claude -- --print-system-prompt "bu fərqi nəzərdən keçirin"
```
---
## Uzaqdan istifadə
Hər hansı bir qurma əmrini `--remote` + `--api-key` ilə uzaq OmniRoute-a yönləndirin. Kataloq uzaqdan alınır; konfiqurasiya yerli maşınınıza yazılır.
```bash
# Uzaq VPS-yə qarşı OpenCode, yalnız glm/kimi modelləri saxla
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # əvvəlcə OMNIROUTE_API_KEY-i ixrac et
# Uzaq kataloqdan Codex profilləri
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Uzaqdan bir CLI işə sal
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
Hər dəfə `--remote`/`--api-key` keçirmək əvəzinə, bir dəfə daxil olun və **aktiv kontekst** onların avtomatik təmin edilməsinə icazə verin:
```bash
omniroute connect 192.168.0.15 # məhdudlaşdırılmış token yaradır, konteksti saxlayır
omniroute setup-codex # ← indi uzaq kataloqdan istifadə edir
omniroute setup-opencode # ← eyni
omniroute launch # ← Claude Code uzaqda
```
Kontekstlər, sahələr və token idarəçiliyi üçün [Uzaq Rejim](./REMOTE-MODE.md) səhifəsinə baxın.
---
## Əsas URL konvensiyaları (hansı alətlər `/v1` istəyir)
OmniRoute OpenAI səthini `/v1`-də, Anthropic səthini kökdə, və yerli Gemini səthini `/v1beta`-da təqdim edir. Hər bir inteqrasiya alətinin gözlədiyi forma bağlıdır (əmr mənbəsində təsdiqlənmişdir):
| İnteqrasiya | Yazılan Əsas URL | `/v1`? |
| -------------------------------------------------------------------------- | ---------------- | ------------------------------------------------ |
| `setup-cline` (`openAiBaseUrl`) | kök | Xeyr — Cline `/v1/chat/completions` əlavə edir |
| `setup-goose` (`OPENAI_HOST`) | kök | Xeyr — Goose yolu əlavə edir |
| `setup-aider` (`OPENAI_API_BASE`) | kök | Xeyr — LiteLLM `/v1/chat/completions` əlavə edir |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | `/v1` ilə | Bəli |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | kök | Xeyr — Claude Code `/v1/messages` əlavə edir |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | `/v1` ilə | Bəli |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | `/v1` ilə | Bəli |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | kök | Xeyr — SDK `/v1beta/models/…` əlavə edir |
---
## Yerli asılılıqları yeniləmək: `--include=optional`
`omniroute update` ilə yenilədikdə (təsdiqlədikdən sonra, ya da `--apply` ilə),
OmniRoute quraşdırmanı `--include=optional` ilə icra edir:
```bash
npm install -g omniroute@latest --include=optional
```
Bu, `omniroute update`-ə ötürdüyünüz bir bayraq **deyil** — bu, həmişə
yeniləyici tərəfindən tətbiq olunur. Bu, `optionalDependencies`-in (`better-sqlite3`, `keytar`,
`tls-client`, LLMLingua SLM yığını) yeniləmədən sağ qalmasını təmin edir, əgər
npm konfiqurasiyanızda `omit=optional` təyin edilibsə, bu, yerli SQLite
sürücüsünü və OS-keyring bağlanmasını səssizcə silərdi. Dəqiq əmri tətbiq etmədən
öncə baxmaq üçün:
```bash
omniroute update --dry-run
# [DRY RUN] İcra ediləcək: npm install -g omniroute@latest --include=optional
```
Digər `omniroute update` bayraqları (mənbədə təsdiqlənmişdir): `--check` (köhnədirsə 1 ilə çıxır), `--apply` (sorğu olmadan quraşdırır), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI `omniroute run gemini` vasitəsilə
`@google/gemini-cli` 0.50.0 ilə müqavilə təsdiqlənmişdir: CLI
`GOOGLE_GEMINI_BASE_URL`-i tanıyır və `POST /v1beta/models/<model>:generateContent`
(və `:streamGenerateContent?alt=sse`) göndərir — tam olaraq OmniRoute-un yerli
Gemini interfeysi (`/v1beta`). `omniroute run gemini` bunu avtomatik olaraq
bağlayır:
- `GOOGLE_GEMINI_BASE_URL` → aktiv OmniRoute əsas URL (kök, `/v1` yoxdur);
- `GEMINI_API_KEY` → həll edilmiş OmniRoute kredensialı (seçim/env/kontekst);
- **müvəqqəti izolyasiya olunmuş `GEMINI_CLI_HOME`** hansı ki, `.gemini/settings.json`
`gemini-api-key` autentifikasiyasını seçir, beləliklə saxlanılan Google OAuth sessiyası
(Kod Dəstəyi) heç vaxt OmniRoute yönləndirilmiş başlatmanı üstələməz — çıxışdan sonra silinir;
- **env gigiyenası**: uşaq mühiti `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI``GOOGLE_GENAI_USE_GCA`-dan təmizlənir (bu, autentifikasiyanı
Vertex/Kod Dəstəyi ilə yönləndirərdi), və `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key`
ehtiyat olaraq təyin edilir — digər `run` hədəfləri öz münaqişəli dəyişənləri üçün eyni
müalicəni alır;
- `--model <id>` `--provider`/`--model`-dan inyeksiya.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Gemini-nin iş sahəsi etimad qoruyucusu hələ də başsız rejimdə tətbiq olunur —
`--skip-trust` (ya da interaktiv olaraq qovluğu etimad edin) özünüz keçirin; başlatıcı
qəsdən bunu atlamır. Bu başlatıcı **ACP qeydiyyatından** (`src/lib/acp/registry.ts`, `gemini --acp`) fərqlidir, bu, `/dashboard/acp-agents` üçün agent-protokol inteqrasiyasıdır.
---
## Real tüstü süzgəci (seçimlə)
Deterministik başlatma-planı geriyə dönmə testləri CI-də (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). REAL ikili faylları REAL
OmniRoute serveri ilə təsdiqləmək üçün seçimlə bir harness mövcuddur
`tests/integration/upstream-cli-smoke.int.test.ts`. Bu, avtomatik olaraq
işləmir (hər bir alt-test `RUN_CLI_SMOKE=1` olmadıqca atlanır), kredensialı env-dəki
AD ilə ötürür (dəyər ilə deyil), qeydə alınmış çıxışdan açar formasında olan
sözləri gizlədir, quraşdırılmamış hədəfləri atlayır və uğursuzluqları
autentifikasiya / upstream / konfiqurasiya kimi təsnif edir, sadəcə boolean
yerinə:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
İstəyə bağlı: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` süzgəci məhdudlaşdırır;
`OMNIROUTE_SMOKE_TIMEOUT_MS` 120s-lik hər hədəf üçün vaxt aşımını üstələyir.
---
## Baxın həmçinin
- [Claude Code konfiqurasiyası](./CLAUDE-CODE-CONFIGURATION.md) — daha dərin Claude Code bələdçisi
- [Codex CLI konfiqurasiyası](./CODEX-CLI-CONFIGURATION.md) — bir dəfəlik `[model_providers.omniroute]` əsas qurulması
- [Uzaq Mod](./REMOTE-MODE.md) — kontekstlər, məhdudlaşdırılmış giriş tokenləri, uzaq serveri idarə etmək
- [CLI Alətləri istinad](../reference/CLI-TOOLS.md) — dəstəklənən alətlərin tam kataloqu + idarəetmə səhifələri
- [Quraşdırma Bələdçisi](./SETUP_GUIDE.md) — quraşdırma metodları və ilk dəfə işə salma təlimatı

View File

@@ -1,86 +1,308 @@
# CLI Tools Setup Guide — OmniRoute (Български)
# CLI-TOOLS (Azərbaycan dili)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI Alətləri — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Alətləri — OmniRoute
Sonuncu yeniləmə: 2026-08-18
OmniRoute, üç xüsusi idarəetmə səhifəsində yayılmış üç kateqoriyalı CLI alətləri ilə inteqrasiya edir:
| Səhifə | Marşrut | Konsept | Say |
| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------ | ---------------- |
| **CLI Kodu** | `/dashboard/cli-code` | OmniRoute-a yönləndirdiyiniz kodlaşdırma alətləri (Müştəri → CLI → OmniRoute → Təchizatçı) | 26 |
| **CLI Agentləri** | `/dashboard/cli-agents` | OmniRoute-a yönləndirdiyiniz müstəqil agentlər (eyni axın, daha geniş əhatə) | 8 |
| **ACP Agentləri** | `/dashboard/acp-agents` | OmniRoute-un stdio/ACP vasitəsilə arxa planda yaratdığı CLİ-lər (tərs axın) | qeydiyyata baxın |
Köhnə marşrutlar 308 ilə yönləndirilir: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## Necə İşləyir
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI Kodu / CLI Agentləri (istehlak axını):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (hamısı OmniRoute-a yönləndirilir)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute düzgün təchizatçıya yönləndirir)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP Agentləri (tərs yaradılma axını):
Müştəri tələbi → OmniRoute → stdio/ACP vasitəsilə CLİ yaradır → cavab
```
**Benefits:**
**Faydaları:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Bütün alətləri idarə etmək üçün bir API açarı
- İdarəetmə panelində bütün CLİ-lər üzrə xərclərin izlənməsi
- Hər aləti yenidən konfiqurasiya etmədən model dəyişdirmək
- Yerli və uzaq serverlərdə (VPS, Docker, Akamai, Cloudflare Tunnel) işləyir
---
## Supported Tools (Dashboard Source of Truth)
## `setup-*` ilə Avtomatik Konfiqurasiya
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
Hər alətin konfiqurasiyasını əl ilə yazmağa ehtiyac yoxdur. OmniRoute, dəstəklənən hər bir CLİ üçün **canlı** model kataloqunu oxuyan və alətin öz konfiqurasiyasını sizin maşınınıza yazan `setup-*` komandasını təqdim edir:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Hər biri `--remote <url> --api-key <key>` (uzaq OmniRoute-a qarşı yerli aləti konfiqurasiya etmək), `--dry-run` (yazmadan önizləmə) və `--port` qəbul edir. Model avtomatik aşkar edilməyən alətlər (Cline, Kilo, Roo, Goose, Aider, Qwen) `--model <id>` (və interaktiv olmayan işlər üçün `--yes`) qəbul edir. Doğru mühitin daxil edildiyi və heç bir konfiqurasiya yazılmadan CLİ başlatmaq üçün, ümumi `omniroute run <target>` başlatıcısını istifadə edin (claude, codex, aider, goose, opencode, qwen, gemini — hədəflər və təyin etmələr `bin/cli/cli-manifest.mjs`-dən gəlir); köhnə alət başlatmaçıları `omniroute launch` (Claude Kodu) və `omniroute launch-codex` (Codex) hələ də mövcuddur. Gemini CLİ yalnız başlatma üçündür: bu `omniroute run` hədəfidir, lakin `setup-*`/`configure` resepti yoxdur.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Tam istinad:** ustad cədvəl — hər bir komandanın yazdığı, hər bir bayraq, yerli vs uzaq və hansı alətlərin `/v1` əlavəsinə ehtiyacı olduğu — **[CLI İnteqrasiyaları](../guides/CLI-INTEGRATIONS.md)**-da yerləşir.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Bir konteyner içində bunları işlətmək
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
OmniRoute konteyneri içində icra olunan `setup-*` komandası konteynerin öz evinə yazır, bu da heç bir ev sahibi CLİ tərəfindən oxunmur və konteynerlə birlikdə yox olur. OmniRoute bunu aşkar edir və yazmadan əvvəl təlimatlarla `2` ilə çıxır. İki dəstəklənən yol — CLİ-ni ev sahibində quraşdırmaq və konteynerə `omniroute connect` etmək, ya da konfiqurasiya qovluqlarını bağlamaq və `CLI_CONFIG_HOME` təyin etməkdir (compose `host` profili). Hər `setup-*` komandası, eləcə də `omniroute configure``omniroute config set`, konteynerin öz CLİ-lərini konfiqurasiya etmək istədiyiniz zaman `--allow-container-write` qəbul edir; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` server üçün eyni şeyi edir. Baxın
[Docker Bələdçisi → Ev sahibi CLİ alətlərini konfiqurasiya etmək](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
İdarəetmə panelinin **tətbiq son nöqtəsi** (`POST /api/cli-tools/apply`) eyni qorumağı tətbiq edir: konteynerdə, ev sahibi tərəfindən bağlanmamış bir yazı **`422`** ilə `containerEphemeralTarget: true` cavabını verir, təhlükəsiz xəta mətni və — ev sahibi resepti olan alətlər üçün (claude, codex, opencode, cline, kilo, continue) — ev sahibində işlətmək üçün `hostSetupCommand` (məsələn, `omniroute setup-opencode`) təqdim edir; heç nə yazılmır. `dryRun: true` konteyner rejimində işləməyə davam edir və diskə toxunmadan yaradılan məzmunu + hədəf yolunu qaytarır, beləliklə, siz idarəetmə panelindən önizləyə və ev sahibində tətbiq edə bilərsiniz. Bu davranış məqsədli və `tests/unit/api/cli-tools/apply-container-guard.test.ts` ilə geriyə qorunmuşdur — heç vaxt qorumanı aradan qaldıraraq 422-ni "düzəltməyin".
---
## Step 1 — Get an OmniRoute API Key
## Həqiqət Mənbəyi
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
Birləşmiş kataloq `src/shared/constants/cliTools.ts` faylında `CLI_TOOLS: Record<string, CliCatalogEntry>` kimi yaşayır.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Hər bir girişin bu sahələri var (müəyyən edilib `src/shared/schemas/cliCatalog.ts` faylında):
| Sahə | Tip | Təsvir |
| ----------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------------- |
| `category` | `"code" \| "agent"` | Alət hansı səhifədə görünür |
| `vendor` | `string` | Alətin mənşəyi ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | ACP Agent kimi də istifadə oluna bilər (badge göstərilir) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Xüsusi endpoint dəstək səviyyəsi. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Konfiqurasiya mexanizmi |
| `id`, `name`, `color`, `description`, `docsUrl` | standart | Əsas görüntü sahələri |
`baseUrlSupport: "none"` olan girişlər **göstərilmir** dashboard səhifələrində — onlar plan 11 üçün MITM backlog-da qeyd olunur (baxın `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Bacarıq pillələri (kataloqda × aşkar edilə bilən × konfiqurasiya edilə bilən × işə salına bilən)
Hər kataloqda olan alət aşkar edilə bilən, konfiqurasiya edilə bilən və ya işə salına bilən deyil. Hər pillənin bir
bəyannamə mənbəyi var və bir drift testi onları uyğun saxlayır:
| Pillə | Mənası | Bəyannamə edilib |
| ----------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| **Kataloqda** | Dashboard kataloqunda görünür (ad, vendor, sənədlər, konfiqurasiya tipi) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Aşkar edilə bilən** | İkili/konfiqurasiya aşkar edilməsi, sağlamlıq yoxlamaları, konfiqurasiya yolları | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime kataloqu) |
| **Konfiqurasiya edilə bilən** | `omniroute configure <cli>` tərəfindən dəstəklənir (quraşdırma resepti mövcuddur) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **İşə salına bilən** | `omniroute run <target>` tərəfindən dəstəklənir (env/args inyeksiya müəyyən edilib) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` CLI əmri üçün kanonik icra manifestidir
sahələri: `run`, `configure` və shell-completion generator-ları hamısı
hədəf siyahılarını, alias həllini (məsələn, `kilocode`/`kilo-code`/`kilo_cli``kilo`)
`--model` flag bağlantısını ondan alır. Drift qoruyucusu
`tests/unit/cli/cli-manifest-drift.test.ts` manifestin, runtime
kataloqunun, UI kataloqunun və hər bir istehlakçı sahəsinin uyğun qaldığını təsdiqləyir — bir sahəyə əlavə olunan hədəf
digər sahələr olmadan əlavə edildikdə, sessiya sükutla drift etmək əvəzinə uğursuz olur.
## 1. CLI Kod Kataloqu (26 alət)
`/dashboard/cli-code`-da görünən bütün alətlər. `baseUrlSupport: none` olanlar xüsusi əsas URL əvəzinə MITM və ya manual bələdçi vasitəsilə qoşulmuşdur:
| id | ad | istehsalçı | baseUrlSupport | konfiqurasiya Növü | acpSpawnable |
| ------------ | ------------------------- | ------------------- | -------------- | ------------------ | ------------ |
| claude | Claude Kod | Anthropic | tam | env | true |
| codex | OpenAI Codex CLI | OpenAI | tam | xüsusi | true |
| zcode | ZCode (GLM Kodlama Planı) | Z.ai | heç biri | xüsusi | false |
| cline | Cline | OSS (ex-Claude Dev) | tam | xüsusi | true |
| kilo | Kilo Kod | Kilo-Org | tam | xüsusi | false |
| roo | Roo Kod | Roo (OSS) | tam | bələdçi | false |
| continue | Continue | continue.dev | tam | bələdçi | false |
| aider | Aider | OSS (P. Gauthier) | tam | bələdçi | true |
| forge | ForgeCode | Antinomy HQ | tam | xüsusi | true |
| jcode | jcode | 1jehuang (OSS) | tam | xüsusi | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | tam | xüsusi | false |
| codewhale | CodeWhale | Hmbown (OSS) | tam | xüsusi | false |
| opencode | OpenCode | Anomaly (ex-SST) | tam | bələdçi | true |
| droid | Factory Droid | Factory AI | qismən | bələdçi | false |
| copilot | GitHub Copilot CLI | GitHub/MS | tam | xüsusi | false |
| cursor-cli | Cursor CLI | Anysphere | qismən | bələdçi | true |
| smelt | Smelt | leonardcser (OSS) | tam | xüsusi | false |
| pi | Pi (pi-coding-agent) | M. Zechner (OSS) | tam | xüsusi | false |
| grok-build | Grok Build | xAI | tam | xüsusi | false |
| crush | Crush | OSS (Charm) | tam | xüsusi | false |
| qwen | Qwen Kod | Alibaba | tam | bələdçi | true |
| cursor | Cursor | Anysphere | heç biri | bələdçi | false |
| antigravity | Antigravity | Google | heç biri | mitm | false |
| hermes | Hermes | Nous Research | heç biri | bələdçi | false |
| kiro | Kiro AI | Amazon | heç biri | mitm | false |
| custom | Xüsusi CLI | — | tam | xüsusi-builder | false |
`baseUrlSupport: "partial"` olan alətlər, idarəetmə kartında "⚠ Base URL qismən" nişanı göstərir.
## 2. CLI Agentləri Kataloqu (8 alət)
`/dashboard/cli-agents`-də görünən müstəqil agentlər:
| id | ad | istehsalçı | baseUrlDəstəyi | acpYaradılan |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | Hermes Agent | Nous Research | tam | false |
| openclaw | OpenClaw | OSS (P. Steinberger) | tam | true |
| goose | Goose | Block / Linux Foundation | tam | true |
| interpreter | Open Interpreter | OSS | tam | true |
| warp | Warp AI | Warp Inc. | qismən | true |
| agent-deck | Agent Deck | asheshgoplani (OSS) | tam | false |
| omp | Oh My Pi | OSS | tam | true |
| letta | Letta CLI | Letta | tam | false |
---
## Step 2 — Install CLI Tools
## 3. ACP Agentləri (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Bu səhifə (`/dashboard/agents`-dən adlandırılmışdır) OmniRoute-un stdio/ACP protokolu vasitəsilə **yarada biləcəyi** arxa plan icra mühərriklərini göstərir. Kataloq ayrıca `src/lib/acp/registry.ts`-də saxlanılır və `CLI_TOOLS` ilə **eyni deyil**.
---
## 4. MITM Gecikməsi (dashboard-da göstərilmir)
Aşağıdakı CLI-lər özəl base URL-ni yerli olaraq dəstəkləmir və CLI Kodunun və ya CLI Agentləri səhifələrinin **siyahısında deyil**. Onlar plan 11-də MITM müdaxiləsi üçün namizəddirlər:
| CLI | Səbəb |
| ------------------- | ------------------------------------------------------------- |
| windsurf | BYOK yalnız seçilmiş Claude modelləri + korporativ URL/token |
| amp | Bağlı ekosistem (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO auth, özəl URL yoxdur |
| cowork | Anthropic Desktop, konfiqurasiya edilə bilən son nöqtə yoxdur |
Tam kross-referans üçün `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`-ə baxın.
---
## 5. Batch Detection API
Bütün alət aşkarlanması tək bir son nöqtə vasitəsilə toplanır:
**`GET /api/cli-tools/all-statuses`**
- Auth: `requireCliToolsAuth(request)` (digər `/api/cli-tools/` marşrutları ilə eynidir)
- Dönüş: `Record<toolId, ToolBatchStatus>` (növ: `src/shared/types/cliBatchStatus.ts`)
- Strategiya: `Promise.all` bütün alətlər üzərində, hər alət üçün 5s vaxt aşımı
- Cache: konfiqurasiya faylı `mtime` ilə indekslənmiş yaddaşda LRU. Cache, mtime dəyişdikdə etibarsızlaşdırılır. Server yenidən başladıqda sıfırlanır.
Hər alət üçün cavab forması:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // sanitizasiya edilmiş, heç bir stack trace yoxdur
}
```
## 6. Yeni Alətlər Üçün Ayar İdarəediciləri
`configType: "custom"` olan yeni alətlərin xüsusi ayar API marşrutları var:
| Marşrut | Alət |
| ------------------------------------------- | ---------------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, köhnə) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, əsas + köhnə `~/.deepseek` sinxronizasiya) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi kodlaşdırma agenti |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + xüsusi `.env` açarı) |
Bütün marşrutlar xəta cavabları üçün `sanitizeErrorMessage()` istifadə edir (Sərt Qayda #12).
---
## 7. İdarə Paneli Səhifələrinin Arxitekturası
### CLI Kodu (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — server komponenti
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — müştəri grid
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — alət detal səhifəsi
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 ixtisaslaşmış alət kartı + `ToolDetailClient.tsx`
### CLI Agentləri (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — server komponenti
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — müştəri grid
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx``ToolDetailClient`-dən istifadə edir
### ACP Agentləri (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — server komponenti (moved from `agents/`)
### Paylaşılan UI Komponentləri (`src/shared/components/cli/`)
| Fayl | Məqsəd |
| ----------------------- | --------------------------------------------------- |
| `CliToolCard.tsx` | Ağıllı status kartı (detection + config + endpoint) |
| `CliConceptCard.tsx` | Hər səhifə üçün konsept izah kartı |
| `CliComparisonCard.tsx` | CLI növləri arasında üç sütunlu müqayisə |
| `BaseUrlSelect.tsx` | Endpoint açılan menyusu (Local/Cloud/Custom) |
| `ApiKeySelect.tsx` | API açar seçici |
| `ManualConfigModal.tsx` | Kopyalanabilən konfiqurasiya snippet modal |
### Paylaşılan Hook (`src/shared/hooks/cli/`)
| Fayl | Məqsəd |
| ------------------------- | ---------------------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | `/api/cli-tools/all-statuses`-i əldə edir, yükləmə/yeniləmə vəziyyətini idarə edir |
## 8. i18n
Plan 14 F9-da yeni adlar əlavə edildi:
| Namespace | Məqsəd |
| ----------- | ---------------------------------------------------------------------------------------- |
| `cliCommon` | Paylaşılan mətnlər (kart etiketləri, konsept/müqayisə mətnləri, detal səhifə etiketləri) |
| `cliCode` | CLI Kod səhifə mətnləri |
| `cliAgents` | CLI Agentləri səhifə mətnləri |
| `acpAgents` | ACP Agentləri səhifə mətnləri |
Tam PT-BR və EN tərcümələri təqdim edilir. 39 digər dil avtomatik olaraq EN-ə geri dönür `src/i18n/request.ts`-də ad səviyyəsində birləşmə vasitəsilə.
---
## 9. Tez Başlama
### Addım 1 — OmniRoute API Açarını Alın
1. `/dashboard/api-manager`-ıın → **API Açarı Yaradın**
2. Bir ad verin (məsələn, `cli-tools`) və bütün icazələri seçin
3. Açarı kopyalayın — aşağıdakı hər CLI üçün buna ehtiyacınız olacaq
> Açarınız belə görünür: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Addım 2 — CLI Alətləri Quraşdırın
Bütün npm əsaslı alətlər Node.js 22.22.2+ və ya 24.x tələb edir:
```bash
# Claude Code (Anthropic)
@@ -98,96 +320,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (launchable via `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Rust əsaslı
# Pi coding agent
# quraşdırma üçün https://github.com/zechnerj/pi-coding-agent-ə baxın
# jcode
# quraşdırma üçün https://github.com/1jehuang/jcode-ə baxın
```
---
## Step 3 — Set Global Environment Variables
### Addım 3 — Dashboard vasitəsilə Konfiqurasiya Edin
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. `http://localhost:20128/dashboard/cli-code`-a gedin
2. Şəbəkədə alətinizi tapın
3. Alət detal səhifəsini açmaq üçün kartı klikləyin
4. API açarınızı və əsas URL-i seçin
5. **Konfiqurasiyanı Tətbiq Et**-i klikləyin və ya manual konfiqurasiya parçasını kopyalayın
---
### Addım 4 — Qlobal Mühit Dəyişənlərini Təyin Edin
```bash
# OmniRoute Universal Endpoint
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI ROOT-da GOOGLE_GEMINI_BASE_URL oxuyur (SDK özü /v1beta/... əlavə edir)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> **Uzaq server** üçün `localhost:20128`-i server IP və ya domen ilə əvəz edin,
> məsələn, `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### Addım 4 — Hər Aləti Konfiqurasiya Edin
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# ~/.claude/settings.json yaradın:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
Claude Code üçün birləşdirilmiş Anthropic qapı kökünü istifadə edin. Burada `/v1` əlavə etməyin.
**Test:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
Müasir Codex (v0.137+) yalnız `~/.codex/config.toml`-ı oxuyur — köhnə
`config.yaml` köhnə npm CLI-yə aiddir və səssizcə göz ardı edilir. API
açarı `OMNIROUTE_API_KEY` mühit dəyişənində (`env_key`) qalır, heç vaxt
faylda deyil:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
Tam istinad (profil, `wire_api`, kontekst pəncərələri): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Test:** `codex "what is 2+2?"`
---
### OpenCode
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `opencode`
> `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> istifadə edərək düşüncə variantlarını göndərin.
---
### Cline (CLI or VS Code)
#### Cline (CLI və ya VS Code)
**CLI mode:**
**CLI rejimi:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +463,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible` → Base URL: `http://localhost:20128/v1`
**VS Code rejimi:**
Cline genişləndirmə parametrləri → API Provider: `OpenAI Compatible` → Base URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
Yaxud OmniRoute dashboardunu istifadə edin**CLI Alətləri → Cline → Konfiqurasiyanı Tətbiq Et**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI və ya VS Code)
**CLI mode:**
**CLI rejimi:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**VS Code parametrləri:**
```json
{
@@ -223,13 +487,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
Yaxud OmniRoute dashboardunu istifadə edin**CLI Alətləri → KiloCode → Konfiqurasiyanı Tətbiq Et**.
---
### Continue (VS Code Extension)
#### Continue (VS Code Genişləndirməsi)
Edit `~/.continue/config.yaml`:
`~/.continue/config.yaml`-ı redaktə edin:
```yaml
models:
@@ -241,158 +505,253 @@ models:
default: true
```
Restart VS Code after editing.
Redaktə etdikdən sonra VS Code-u yenidən başladın.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Bu, VS Code Insiders xüsusi son nöqtə modelləri üçün konfiqurasiya edildikdə və OmniRoute-un xüsusi başlıq sahəsi olmadan işləməsini istədiyiniz zaman istifadə olunur.
**Tövsiyə olunan yer:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Tokenləşdirilmiş OmniRoute təxmini istifadə edərək nümunə:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Qeydlər:**
- `sk-your-omniroute-key`-i OmniRoute-da yaradılmış API açarı ilə əvəz edin.
- `url` sahəsi `/api/v1/vscode/{token}/chat/completions`-a işarə etməlidir.
- `modelsUrl` sahəsi `/api/v1/vscode/{token}/models`-a işarə etməlidir.
- Müştəri xüsusi başlıqları dəstəklədikdə normal `/v1` + Bearer başlıq axınını üstün tutun.
- URL-də yerləşdirilmiş tokenlər uyğunluq üçün geri dönüşdür və redaktor qeydlərində və ya proxy tarixində görünə bilər.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# AWS/Kiro hesabınıza daxil olun:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI öz autentifikasiyasını istifadə edir — Kiro CLI üçün OmniRoute arxa planda lazım deyil.
# Kiro CLI-ni OmniRoute ilə yanaşı digər alətlər üçün istifadə edin.
kiro-cli status
```
---
**Kiro IDE** masaüstü tətbiqi üçün OmniRoute tərəfindən təqdim edilən MITM son nöqtəsini istifadə edin
`/dashboard/cli-tools → Kiro` altında.
### Qwen Code (Alibaba)
## 10. Daxili OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
`omniroute` ikili serverin həyat dövrü, qurulması, diaqnostika və təminatçı idarəetməsi üçün əmrlər təqdim edir. Giriş nöqtəsi: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Serveri başladın (default port 20128)
omniroute setup # İnteraktiv qurma sehrbazı
omniroute doctor # Konfiqurasiya, DB, portlar, iş vaxtını yoxlayın
omniroute providers list # Konfiqurasiya edilmiş təminatçı bağlantıları
omniroute providers test-all # Hər aktiv bağlantını test edin
omniroute reset-password # Admin parolunu sıfırlayın
omniroute logs # İstək loglarını axın edin
omniroute health # Ətraflı sağlamlıq (qırıcılar, keş, yaddaş)
omniroute --version # Versiyanı çap edin
omniroute --help # Bütün əmrləri göstərin
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Qurma və İnkşaf
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # İnteraktiv qurma sehrbazı
omniroute setup --non-interactive # CI/avtomatlaşdırma rejimi (mühit dəyişənlərini + bayraqları oxuyur)
omniroute setup --password '<value>' # Admin parolunu birbaşa təyin edin
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Bir anda təminatçı əlavə edin və test edin
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
İnteraktiv olmayan qurma üçün tanınan mühit dəyişənləri:
**Test:** `qwen "say hello"`
| Var | Məqsəd |
| ------------------- | ---------------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | Təminatçı API açarı (Commander `.env()` vasitəsilə `--api-key` ilə bağlanır) |
| `DATA_DIR` | OmniRoute məlumat qovluğunu üstələyin |
### Cursor (Desktop App)
Bütün digər interaktiv olmayan girişlər bayraqlar kimi ötürülür, mühit dəyişənləri kimi deyil:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(baxın `omniroute setup` seçimlərinə yuxarıda).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## Отстраняване на проблеми
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### Diaqnostika
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # Konfiqurasiya, DB, portlar, iş vaxtı, yaddaş, canlılıq yoxlayın
omniroute doctor --json # Maşın oxunaqlı JSON
omniroute doctor --no-liveness # HTTP sağlamlıq probunu atlayın
omniroute doctor --host 0.0.0.0 # Canlılıq hostunu üstələyin
omniroute doctor --liveness-url <url> # Tam sağlamlıq son nöqtəsi URL üstələyin
```
Doktor bu yoxlamaları aparır: `Konfiqurasiya`, `Veritabanı`, `Saxlama/şifrələmə`,
`Port mövcudluğu`, `Node iş vaxtı`, `Təbiət ikilisi` (better-sqlite3),
`Yaddaş``Server canlılığı`. Hər hansı bir yoxlama `uğursuz` olarsa, sıfırdan fərqli bir çıxış edir.
### Təminatçı İdarəetməsi
```bash
omniroute providers available # OmniRoute təminatçı kataloqu
omniroute providers available --search openai # Kataloqu id/ad/şəxsiyyət/kateqoriya ilə süzgəcdən keçirin
omniroute providers available --category api-key # Kateqoriya ilə süzgəcdən keçirin (api-key, oauth, pulsuz, ...)
omniroute providers available --json # Maşın oxunaqlı JSON
omniroute providers list # Konfiqurasiya edilmiş təminatçı bağlantıları
omniroute providers list --json
omniroute providers test <id|name> # Bir konfiqurasiya edilmiş bağlantını test edin
omniroute providers test-all # Hər aktiv bağlantını test edin
omniroute providers validate # Yalnız yerli struktural yoxlama
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Mövcud OAuth axını
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` API-ilkdir və buna görə də
aktiv yerli və ya uzaq kontekstə qarşı işləyir. Şifrə girişləri
`--credential-stdin` və ya `--credential-env` istifadə etməlidir; `--dry-run --json` yalnız
redaktə edilmiş mövcudluğu/formasını bildirir. `providers available` OmniRoute kataloqunu oxuyur;
`providers list/test/test-all/validate` yerli SQLite davranışını saxlayır və
serverin işləməsini tələb etmir.
### Bərpa və Sıfırlama
```bash
omniroute reset-password # Admin parolunu sıfırlayın (həmçinin: omniroute-reset-password)
omniroute reset-encrypted-columns # Şifrələnmiş şifrə sıfırlaması üçün xəbərdarlıq + dry-run göstərin
omniroute reset-encrypted-columns --force # SQLite-də şifrələnmiş şifrələri faktiki olaraq sıfırlayın
```
### Şifrə İxracı (⚠ diqqətlə idarə edin)
```bash
omniroute auth export # Xəbərdarlıq + təsdiq qapısı göstərin — DB giriş yoxdur
omniroute auth export --force # BÜTÜN bağlantıların ŞİFRƏLƏNMİŞ şifrələrini stdout-a JSON olaraq ixrac edin
omniroute auth export --force --id <id> # Yalnız uyğun bağlantını ixrac edin
omniroute auth export --force --format env # OMNIROUTE_<PROVIDER>_<FIELD>=<value> xətləri çıxarın
omniroute auth export --force --out creds.json # Fayla yazın (0600 icazələri ilə yaradılır)
```
`auth export` **yalnız yerli** (birbaşa SQLite oxuma, HTTP marşrutu yoxdur) və qəsdən çap edir/yazır
**düz mətndə** `apiKey`/`accessToken`/`refreshToken`/`idToken` dəyərləri — bu, xüsusiyyətdir, səhv deyil.
Veritabanından heç nə oxunmur və heç nə şifrəsi açılmır, `--force` olmadan. Hər zaman düz mətndə çıxarılmadan əvvəl bir stderr xəbərdarlıq banneri çap olunur. `STORAGE_ENCRYPTION_KEY` təyin edilməlidir. Şifrələnmədə uğursuz olan bir sahə (köhnə açar, korrupt şifrələnmiş mətn)
`<field>DecryptFailed: true` olaraq bildirilir, bütün ixracı dayandırmadan və ya əsas səhvi sızdırmadan.
### Digər alt əmrlər
Bunlar işləyən OmniRoute serverini tələb edir, əks halda qeyd edilməmişdir:
```bash
omniroute status # Ətraflı iş vaxtı statusu
omniroute logs # İstək loglarını axın edin (--json, --search, --follow)
omniroute config show # Cari konfiqurasiyanı göstərin
omniroute provider list # Mövcud təminatçıları siyahıya alın (providers list-in təkrarı)
omniroute provider add # OmniRoute-u bir alətdə təminatçı kimi qeyd edin
omniroute keys add | list | remove # API açarlarını idarə edin
omniroute models [provider] # Modelləri siyahıya alın (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Konfiqurasiya + DB snapshot
omniroute restore # Əvvəlki snapshot-dan bərpa edin
omniroute health # Ətraflı sağlamlıq (qırıcılar, keş, yaddaş)
omniroute quota # Təminatçı kvota istifadəsi
omniroute cache # Keş statusu
omniroute cache clear # Semantik + imza keşlərini təmizləyin
omniroute mcp status | restart # MCP server statusu / yenidən başladın
omniroute a2a status | card # A2A server statusu / agent kartı
omniroute tunnel list | create | stop # Tunelləri idarə edin (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Mühit dəyişənlərini yoxlayın / təyin edin (müvəqqəti)
omniroute test # Təminatçı bağlantısı test
omniroute update # Yeniləmələri yoxlayın
omniroute completion # Shell tamamlanmasını yaradın
```
### Ümumi bayraqlar
| Bayraq | Təsvir |
| ------------------- | ------------------------------------------------------ |
| `--no-open` | Başlanğıcda brauzeri avtomatik açmayın |
| `--port <n>` | API portunu üstələyin (default 20128) |
| `--mcp` | IDE-lər üçün stdio üzərində MCP serveri kimi işləyin |
| `--non-interactive` | CI rejimi (sorğular yoxdur; mühit/bayraqlardan oxuyur) |
| `--json` | Maşın oxunaqlı JSON çıxışı (doctor, providers və s.) |
| `--help`, `-h` | Əmrə spesifik kömək göstərin |
| `--version`, `-v` | Quraşdırılmış versiyanı çap edin |
---
## Mövcud API Son Nöqtələri
| Son Nöqtə | Təsvir | İstifadə Üçün |
| -------------------------- | ------------------------------------ | ------------------------------------- |
| `/v1/chat/completions` | Standart söhbət (bütün provayderlər) | Bütün müasir alətlər |
| `/v1/responses` | Cavablar API (OpenAI formatı) | Codex, agentik iş axınları |
| `/v1/completions` | Köhnə mətn tamamlamaları | `prompt:` istifadə edən köhnə alətlər |
| `/v1/embeddings` | Mətn yerləşdirmələri | RAG, axtarış |
| `/v1/images/generations` | Şəkil yaradılması | GPT-Image, Flux və s. |
| `/v1/audio/speech` | Mətn-dan-səs | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Səs-dan-mətn | Deepgram, AssemblyAI |
Yerləşdirmək üçün hazır nümunələr tokenləşdirilmiş OmniRoute URL ilə:
```txt
Token nümunəsi: sk-a3ab3c080beaee3a-69f4a4-070d71af
Standart OpenAI bazası: http://localhost:20128/v1
VS Code modelləri: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code söhbəti: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code cavabları: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama etiketləri: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama söhbəti: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Problemlərin Həlli
| Xəta | Səbəb | Həll |
| -------------------------------------------------------- | -------------------------------- | ------------------------------------------------------- |
| `Connection refused` | OmniRoute işləmir | `omniroute serve` |
| `401 Unauthorized` | Yanlış API açarı | `/dashboard/api-manager`-də yoxlayın |
| `No combo configured` | Aktiv yönləndirmə kombosu yoxdur | `/dashboard/combos`-da qurun |
| CLI "quraşdırılmayıb" göstərir | İcra faylı PATH-da deyil | `which <command>`-i yoxlayın |
| Dashboard quraşdırmadan sonra "təsbit edilmədi" göstərir | Keş köhnədir | Dashboard-da "⟳ Təsbiti yenilə" düyməsini basın |
| Köhnə link `/dashboard/cli-tools` | Pre-v3.8.6 işarəsi | `/dashboard/cli-code`-ə avtomatik yönləndirilir (308) |
| Köhnə link `/dashboard/agents` | Pre-v3.8.6 işarəsi | `/dashboard/acp-agents`-ə avtomatik yönləndirilir (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,308 @@
# CLI-INTEGRATIONS (Български)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI Интеграции — насочете всяко CLI за кодиране към OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Интеграции
OmniRoute предлага набор от команди `setup-*`, които конфигурират CLI за кодиране (Codex, Claude Code, OpenCode, Cline и др.) да използва OmniRoute като свой бекенд — така инструментът комуникира с **една** крайна точка и OmniRoute маршрутизира към правилния доставчик с автоматично резервиране. Всяка команда чете **активния** каталог на моделите от работещ OmniRoute (локален или отдалечен) и записва конфигурационния файл на инструмента на **вашата** машина. API ключът се посочва чрез променлива на средата, където инструментът го поддържа. Командите, които запазват локален файл на средата на инструмента, са отбелязани по-долу.
Има и универсален стартер — `omniroute run <target>` — който стартира `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` или `gemini` с правилно инжектирана среда, без да записва никаква конфигурация. Целите и техните псевдоними идват от каноничния манифест `bin/cli/cli-manifest.mjs`
(`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`,
`open-code`, `qwen-code`, `gemini-cli`), а `omniroute completion` предлага
същите целеви думи, произтичащи от манифеста. Легаси стартерите за всеки инструмент —
`omniroute launch` (Claude Code) и `omniroute launch-codex` (Codex) — остават
достъпни.
Включването на доставчици е налично от същия локален/отдалечен контекст. Командите с API-първи подход по-долу поддържат управлението на удостоверяване отделно от удостоверителните данни на доставчика и никога не отпечатват удостоверителни данни в структурирания изход:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
За скриптове, предпочитайте `--credential-stdin` или `--credential-env`; `--credential`
се запазва за контролирана локална употреба. `providers remove` изисква `--yes` на
неинтерактивен терминал, а всички пет команди уважават активния контекст или глобалните опции `--base-url`/`--api-key`.
За еднократната, ръчно написана основна настройка на двата най-богати интеграции, вижте
дълбочинните анализи за всеки инструмент:
- [Конфигурация на Claude Code](./CLAUDE-CODE-CONFIGURATION.md)
- [Конфигурация на Codex CLI](./CODEX-CLI-CONFIGURATION.md)
- [Отдалечен режим](./REMOTE-MODE.md) — управлявайте отдалечен OmniRoute (VPS / Tailnet) от вашия лаптоп
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — разширението OmniCopilot; то може също да изпълнява тези
`setup-*` команди вместо вас от вътре в редактора
---
## Основна таблица
Всяка команда уважава **активния контекст** (настроен с `omniroute connect`, вижте
[Отдалечен режим](./REMOTE-MODE.md)) или явни флагове `--remote <url> --api-key <key>`.
"Локално срещу отдалечено" по-долу означава: без флагове, целта е `http://localhost:20128`;
с `--remote` (или активен отдалечен контекст) извлича каталога от този
сървър и записва конфигурацията локално.
| Команда | Инструмент | Какво записва | Ключови флагове | Локално срещу отдалечено |
| -------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — един профил за всеки съвместим текстов модел (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | И двете |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — един профил за всеки съвпадащ модел (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | И двете |
| `omniroute setup-opencode` | OpenCode (съвместим с openai) | `~/.config/opencode/opencode.json``omniroute` доставчик с всеки модел от каталога (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | И двете |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI режим) + отпечатва настройки за разширението на VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | И двете |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + слива `kilocode.*` в `settings.json` на VS Code, ако е наличен | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | И двете |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` модели, ключ чрез `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | И двете |
| `omniroute setup-cursor` | Cursor | Нищо — отпечатва стъпките в приложението (конфигурацията на Cursor е непрозрачна SQLite) | `--remote` `--api-key` `--only` `--port` | И двете |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (импортен документ) + задава `roo-cline.autoImportSettingsPath`, ако съществува `settings.json` на VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | И двете |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-compat` доставчик, ключ чрез `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | И двете |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + отпечатва рецепта за среда | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | И двете |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + отпечатва рецепта за среда | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | И двете |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai` масив + `OMNIROUTE_API_KEY` в `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | И двете |
| `omniroute run <target>` | Стартиране на време (универсално) | Нищо — стартира `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` с правилната среда и аргументи; Qwen и Gemini използват временно изолирано домашно | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | И двете |
| `omniroute launch` | Claude Code | Нищо — стартира `claude` с инжектирани `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` | `--remote` `--api-key` `--token` `--profile` `--port` | И двете |
| `omniroute launch-codex` | OpenAI Codex CLI | Нищо — стартира `codex` с инжектиран `omniroute` доставчик чрез `-c` флагове | `--remote` `--api-key` `--profile` (`-p`) `--port` | И двете |
Бележки относно флаговете (потвърдени в източника на командата):
- `--remote <url>` — извлича каталога от отдалечен OmniRoute (презаписва `--port`
и активния контекст). `--api-key <key>` предоставя удостоверителните данни за този
сървър (по подразбиране е `OMNIROUTE_API_KEY` променливата на средата или токена на активния контекст).
- `--only <patterns>` — низове, разделени с запетаи; запазва само идентификаторите на моделите, които съвпадат
(например `--only glm,kimi`). Наличен на `setup-codex`, `setup-claude`,
`setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`.
- `--dry-run` — отпечатва точно какво би било записано, без да засяга
файловата система. Наличен на всяка команда `setup-*` **освен** `setup-cursor`
(която никога не записва файл).
- `--model <id>` — задължителен (или избран интерактивно) за инструментите, които нямат
автоматично откриване на модел: Cline, Kilo, Roo, Goose, Qwen, Aider. Тези инструменти
също приемат `--yes` за неинтерактивни изпълнения (което след това изисква `--model`).
`setup-opencode` приема `--model`, за да зададе основния модел на най-високо ниво.
- `--model <id>` на `omniroute run` следва свързването на манифеста за всяка цел
(`bin/cli/cli-manifest.mjs`): **aider** получава `--model openai/<id>` и
**opencode** `--model omniroute/<id>` (префиксът се добавя само когато идентификаторът
не го носи); **qwen** и **gemini** получават идентификатора без промяна;
**claude** го получава чрез `ANTHROPIC_MODEL`, **goose** чрез `GOOSE_MODEL`, а
**codex** чрез `-c model_providers.omniroute.*` аргументи. **Qwen е единствената цел за изпълнение, която изисква `--model`**`omniroute run qwen` без него излиза
`2` с явна грешка.
- `--port <port>` — локален порт на OmniRoute (по подразбиране `20128`, игнорира се, когато е зададен `--remote`).
Наличен на всички `setup-*` и двата стартера.
- Кодове за изход на `omniroute run`: изходният код на детското CLI се предава
без промяна; `2` = невалидни аргументи (неподдържана цел, липсващ задължителен
`--model`, защитник на контейнера); `127` = целевият бинарен файл не е в `PATH`;
`130`/`143`/`129`, когато стартирането е прекратено от `SIGINT`/`SIGTERM`/`SIGHUP`;
`1` = друга грешка при стартиране.
- Двата стартера (`launch`, `launch-codex`) приемат `--profile <name>` за избор
на профил, написан от `setup-claude` / `setup-codex`, плюс аргументи за
предаване за основния бинарен файл `claude` / `codex`.
Интерактивният селектор също се споделя от рецептите за настройка:
```bash
# Изберете от активния локален или отдалечен каталог на модели и конфигурирайте целта.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` в момента делегира на тестваните рецепти за `codex`, `claude`,
`opencode`, `qwen`, `aider`, `goose`, `cline`, `continue` и `kilo`. Записите само за IDE,
MITM и само за ръководства остават явни `setup-*`/ръчни потоци и не се представят като целеви за стартиране.
> `setup-opencode` е **леката интеграция, съвместима с openai** OpenCode.
> Има и по-богата интеграция с плъгин — `omniroute setup opencode` — която
> инсталира `@omniroute/opencode-plugin`. Те са различни команди; таблицата
> по-горе документира `setup-opencode`.
---
## Локално използване
С OmniRoute, работещ на `localhost:20128`, просто стартирайте командата за настройка на вашия инструмент. Каталогът се извлича от локалния сървър.
```bash
# Codex: пише профил за всяка съвпаднала модел в ~/.codex/
omniroute setup-codex
codex --profile glm52 # използвайте генериран профил
# Claude Code: пише профили за всеки модел, след което стартира един
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: пише съвместим с openai доставчик с всички модели от каталога
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # реферирано чрез {env:OMNIROUTE_API_KEY}, никога на диск
opencode -m omniroute/glm/glm-5.2 "..."
# Инструменти без автоматично откриване се нуждаят от явен модел:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Преглед без записване на нищо:
omniroute setup-continue --dry-run
```
Стартирайте без записване на никаква конфигурация (само инжектиране на среда):
```bash
omniroute launch # Claude Code → локален OmniRoute
omniroute launch-codex # Codex CLI → локален OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# Ясен път на командата: предайте всичко, което идва след --
omniroute run claude -- --print-system-prompt "review this diff"
```
---
## Отдалечено използване
Посочете всяка команда за настройка на отдалечен OmniRoute с `--remote` + `--api-key`. Каталогът се извлича от отдалеченото; конфигурацията се записва на вашия локален компютър.
```bash
# OpenCode срещу отдалечен VPS, запазете само glm/kimi модели
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # първо експортирайте OMNIROUTE_API_KEY
# Профили Codex от отдалечен каталог
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Стартирайте CLI директно срещу отдалеченото
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
Вместо да предавате `--remote`/`--api-key` всеки път, влезте веднъж и оставете **активния контекст** да ги предоставя автоматично:
```bash
omniroute connect 192.168.0.15 # генерира ограничен токен, съхранява контекста
omniroute setup-codex # ← сега използва отдалечения каталог
omniroute setup-opencode # ← същото
omniroute launch # ← Claude Code срещу отдалеченото
```
Вижте [Отдалечен режим](./REMOTE-MODE.md) за контексти, обхвати и управление на токени.
---
## Конвенции за основен URL (които инструменти искат `/v1`)
OmniRoute излага OpenAI интерфейса на `/v1`, Anthropic интерфейса на корена, и местен Gemini интерфейс на `/v1beta`. Всяка интеграция е свързана с формата, който инструментът очаква (потвърдено в източника на командата):
| Интеграция | Основен URL написан | `/v1`? |
| -------------------------------------------------------------------------- | ------------------- | ------------------------------------------ |
| `setup-cline` (`openAiBaseUrl`) | корен | Не — Cline добавя `/v1/chat/completions` |
| `setup-goose` (`OPENAI_HOST`) | корен | Не — Goose добавя пътя |
| `setup-aider` (`OPENAI_API_BASE`) | корен | Не — LiteLLM добавя `/v1/chat/completions` |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | с `/v1` | Да |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | корен | Не — Claude Code добавя `/v1/messages` |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | с `/v1` | Да |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | с `/v1` | Да |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | корен | Не — SDK добавя `/v1beta/models/…` |
---
## Поддържане на местни зависимости при актуализация: `--include=optional`
Когато актуализирате с `omniroute update` (след потвърждение или с `--apply`),
OmniRoute изпълнява инсталацията с вградена опция `--include=optional`:
```bash
npm install -g omniroute@latest --include=optional
```
Това **не е** флаг, който предавате на `omniroute update` — той винаги се прилага от
актуализатора. Това гарантира, че `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, LLMLingua SLM стекът) оцеляват при актуализация, дори ако вашата npm конфигурация
има зададено `omit=optional`, което в противен случай тихо би премахнало местния SQLite
драйвер и свързването с OS-keyring. За да прегледате точната команда без прилагане:
```bash
omniroute update --dry-run
# [DRY RUN] Ще изпълни: npm install -g omniroute@latest --include=optional
```
Други флагове на `omniroute update` (потвърдени в източника): `--check` (изход 1, ако
остарял), `--apply` (инсталира без подканване), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI чрез `omniroute run gemini`
Договорът е потвърден спрямо `@google/gemini-cli` 0.50.0: CLI-то уважава
`GOOGLE_GEMINI_BASE_URL` и издава `POST /v1beta/models/<model>:generateContent`
`:streamGenerateContent?alt=sse`) срещу него — точно така, както е местната
Gemini повърхност на OmniRoute (`/v1beta`). `omniroute run gemini` автоматично
свързва това:
- `GOOGLE_GEMINI_BASE_URL` → активният базов URL на OmniRoute (корен, без `/v1`);
- `GEMINI_API_KEY` → разрешените идентификационни данни на OmniRoute (опция/среда/контекст);
- **временен изолиран `GEMINI_CLI_HOME`**, чийто `.gemini/settings.json`
избира `gemini-api-key` удостоверяване, така че съхранената Google OAuth сесия (Code Assist)
никога да не замества стартирането, насочено от OmniRoute — премахва се след изход;
- **чистота на средата**: детската среда е почистена от `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` и `GOOGLE_GENAI_USE_GCA` (които биха пренасочили
удостоверяването към Vertex/Code Assist), и `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` е
зададено като резервен вариант — другите цели на `run` получават същото
третиране за техните конфликтни променливи;
- инжектиране на `--model <id>` от `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Пазачът на доверие на работното пространство на Gemini все още важи в безглав режим — предайте
`--skip-trust` (или доверете директорията интерактивно) сами; стартерът
умишлено не го заобикаля. Този стартер е различен от **регистрацията на ACP**
(`src/lib/acp/registry.ts`, `gemini --acp`), която остава интеграция на агент-протокол за `/dashboard/acp-agents`.
---
## Истинско почистване на дим (по избор)
Детерминираният план за стартиране на регресия се изпълнява в CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). За да валидирате ИСТИНСКИТЕ бинарни файлове спрямо ИСТИНСКИ
сървър на OmniRoute, съществува опционален хъб на
`tests/integration/upstream-cli-smoke.int.test.ts`. Той никога не се изпълнява автоматично
(всяко под-тест пропуска, освен ако `RUN_CLI_SMOKE=1`), предава удостоверението чрез променлива на средата
NAME (никога по стойност), цензурира ключоподобни низове от всякакъв записан изход, пропуска
цели, чийто бинарен файл не е инсталиран, и класифицира неуспехите като
удостоверяване / upstream / конфигурация вместо просто булева стойност:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
Опционално: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` ограничава почистването;
`OMNIROUTE_SMOKE_TIMEOUT_MS` заменя 120-секундния таймаут за всяка цел.
## Вижте също
- [Конфигурация на Claude Code](./CLAUDE-CODE-CONFIGURATION.md) — по-дълбокото ръководство за Claude Code
- [Конфигурация на Codex CLI](./CODEX-CLI-CONFIGURATION.md) — еднократната основна настройка `[model_providers.omniroute]`
- [Отдалечен режим](./REMOTE-MODE.md) — контексти, ограничени токени за достъп, управление на отдалечен сървър
- [Справочник на CLI инструментите](../reference/CLI-TOOLS.md) — пълният каталог на поддържаните инструменти + страници на таблото
- [Ръководство за настройка](./SETUP_GUIDE.md) — методи за инсталиране и първоначално запознаване

View File

@@ -1,86 +1,336 @@
# CLI Tools Setup Guide — OmniRoute (Български)
# CLI-TOOLS (Български)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI инструменти — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI инструменти — OmniRoute
Последно обновление: 2026-08-18
OmniRoute интегрира три категории CLI инструменти, разпределени на три специализирани страници на таблото:
| Страница | Път | Концепция | Брой |
| -------------- | ----------------------- | --------------------------------------------------------------------------------------------- | --------------- |
| **CLI Кодове** | `/dashboard/cli-code` | Инструменти за кодиране, които насочвате към OmniRoute (Клиент → CLI → OmniRoute → Доставчик) | 26 |
| **CLI Агенти** | `/dashboard/cli-agents` | Автономни агенти, които насочвате към OmniRoute (същия поток, по-широк обхват) | 8 |
| **ACP Агенти** | `/dashboard/acp-agents` | CLI, които OmniRoute създава като бекенд чрез stdio/ACP (обратен поток) | вижте регистъра |
Наследствените маршрути пренасочват чрез 308: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## Как работи
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI Кодове / CLI Агенти (поток на потребление):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (всички насочват към OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute маршрутизира към правилния доставчик)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP Агенти (обратен поток на създаване):
Клиентска заявка → OmniRoute → създава CLI чрез stdio/ACP → отговор
```
**Benefits:**
**Ползи:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Един API ключ за управление на всички инструменти
- Проследяване на разходите за всички CLI в таблото
- Смяна на модели без пренастройване на всеки инструмент
- Работи локално и на отдалечени сървъри (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## Автоматична конфигурация с `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
Не е необходимо да пишете конфигурацията на всеки инструмент на ръка. OmniRoute предлага команда `setup-*`
за всеки поддържан CLI, която чете **активния** каталог на модели от работещ
OmniRoute (локален или отдалечен) и записва собствената конфигурация на инструмента на вашата машина:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Всеки приема `--remote <url> --api-key <key>` (конфигуриране на локален инструмент спрямо
отдалечен OmniRoute), `--dry-run` (преглед без запис), и `--port`. Инструменти
без автоматично откриване на модел (Cline, Kilo, Roo, Goose, Aider, Qwen) приемат
`--model <id>``--yes` за неинтерактивни изпълнения). За да стартирате CLI с
правилната среда инжектирана и без записана конфигурация, използвайте общия
`omniroute run <target>` стартер (claude, codex, aider, goose, opencode, qwen,
gemini — целите и алиасите идват от `bin/cli/cli-manifest.mjs`); наследствените
стартери за всеки инструмент `omniroute launch` (Claude Code) и `omniroute launch-codex`
(Codex) остават налични. Gemini CLI е само за стартиране: той е цел за `omniroute run`
но няма `setup-*`/`configure` рецепта.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Пълен справочник:** главната таблица — какво пише всяка команда, всеки флаг,
> локално срещу отдалечено, и кои инструменти искат суфикс `/v1` — се намира в
> **[CLI Интеграции](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Изпълнение на тези команди в контейнер
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
Команда `setup-*`, изпълнена в контейнера на OmniRoute, записва в
собствената домашна директория на контейнера, която никой хост CLI не чете и която изчезва с
контейнера. OmniRoute открива това и излиза с `2` с инструкции, вместо да записва. Два поддържани начина напред — инсталирайте CLI на хоста и
`omniroute connect` към контейнера, или свържете директориите за конфигурация и задайте
`CLI_CONFIG_HOME` (профил на compose `host`). Всяка команда `setup-*`, плюс
`omniroute configure` и `omniroute config set`, приема
`--allow-container-write`, когато конфигурирането на собствените CLI на контейнера е това, което наистина имате предвид; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` прави същото за
сървъра. Вижте
[Docker Ръководство → Конфигуриране на инструменти CLI на хоста](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
**apply endpoint** на таблото (`POST /api/cli-tools/apply`) налага
същата защита: в контейнер, запис, чиято цел не е свързана от хоста, отговаря с **`422`** с `containerEphemeralTarget: true`, безопасен текст за грешка и — за инструментите с рецепта за хост (claude, codex, opencode, cline,
kilo, continue) — `hostSetupCommand` (например `omniroute setup-opencode`), който да се изпълни
на хоста вместо това; нищо не се записва. `dryRun: true` продължава да работи в режим на контейнер
и връща генерираното съдържание + целевия път без да докосва диска, така че
можете да прегледате от таблото и да приложите на хоста. Това поведение е
намерено и защитено от регресия с
`tests/unit/api/cli-tools/apply-container-guard.test.ts` — никога не "поправяйте" 422
чрез премахване на защитата.
---
## Step 1 — Get an OmniRoute API Key
## Източник на истината
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
Обединеният каталог се намира в `src/shared/constants/cliTools.ts` като `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Всеки запис има тези полета (определени в `src/shared/schemas/cliCatalog.ts`):
| Поле | Тип | Описание |
| ----------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------- |
| `category` | `"code" \| "agent"` | На коя страница се появява инструментът |
| `vendor` | `string` | Произход на инструмента ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | Също така използваем като ACP агент (показан значка) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Ниво на поддръжка на персонализирани крайни точки. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Механизъм за конфигурация |
| `id`, `name`, `color`, `description`, `docsUrl` | стандарт | Основни полета за показване |
Записите с `baseUrlSupport: "none"` **не се показват** на страниците на таблото — те са регистрирани в MITM backlog за план 11 (виж `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Нива на способности (каталогизирани × откриваеми × конфигурируеми × стартиваеми)
Не всеки каталогизиран инструмент е откриваем, конфигурируем или стартиваем. Всяко ниво има един
деклариращ източник, а тест за отклонение ги поддържа синхронизирани:
| Ниво | Значение | Декларирано в |
| ------------------ | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Каталогизирано** | Появява се в каталога на таблото (име, производител, документация, тип конфигурация) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Откриваемо** | Откритие на бинарни/конфигурационни файлове, проверки на здравето, пътища за конфигурация | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime catalog) |
| **Конфигурируемо** | Поддържа се от `omniroute configure <cli>` (съществува рецепта за настройка) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **Стартиваемо** | Поддържа се от `omniroute run <target>` (определено инжектиране на env/args) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` е каноничният изпълним манифест за командата CLI
повърхности: `run`, `configure` и генераторите за завършване на командния ред произвеждат своите
списъци с цели, разрешаване на псевдоними (например `kilocode`/`kilo-code`/`kilo_cli``kilo`)
и свързване на флага `--model` от него. Тестът за отклонение
`tests/unit/cli/cli-manifest-drift.test.ts` удостоверява, че манифестът, времевият
каталог, UI каталогът и всяка повърхност на потребителя остават синхронизирани — цел, добавена към
една повърхност без другите, проваля тестовия пакет вместо да се отклонява безшумно.
## 1. Каталог на CLI кода (26 инструмента)
Всички инструменти, които се появяват в `/dashboard/cli-code`. Тези с `baseUrlSupport: none` са свързани чрез MITM или ръководство вместо персонализиран базов URL:
| id | име | доставчик | baseUrlSupport | тип конфигурация | acpSpawnable |
| ------------ | ----------------------- | --------------------- | -------------- | ---------------- | ------------ |
| claude | Claude Code | Anthropic | full | env | true |
| codex | OpenAI Codex CLI | OpenAI | full | custom | true |
| zcode | ZCode (GLM Coding Plan) | Z.ai | none | custom | false |
| cline | Cline | OSS (бивш Claude Dev) | full | custom | true |
| kilo | Kilo Code | Kilo-Org | full | custom | false |
| roo | Roo Code | Roo (OSS) | full | guide | false |
| continue | Continue | continue.dev | full | guide | false |
| aider | Aider | OSS (П. Готие) | full | guide | true |
| forge | ForgeCode | Antinomy HQ | full | custom | true |
| jcode | jcode | 1jehuang (OSS) | full | custom | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | full | custom | false |
| codewhale | CodeWhale | Hmbown (OSS) | full | custom | false |
| opencode | OpenCode | Anomaly (бивш SST) | full | guide | true |
| droid | Factory Droid | Factory AI | partial | guide | false |
| copilot | GitHub Copilot CLI | GitHub/MS | full | custom | false |
| cursor-cli | Cursor CLI | Anysphere | partial | guide | true |
| smelt | Smelt | leonardcser (OSS) | full | custom | false |
| pi | Pi (pi-coding-agent) | M. Zechner (OSS) | full | custom | false |
| grok-build | Grok Build | xAI | full | custom | false |
| crush | Crush | OSS (Charm) | full | custom | false |
| qwen | Qwen Code | Alibaba | full | guide | true |
| cursor | Cursor | Anysphere | none | guide | false |
| antigravity | Antigravity | Google | none | mitm | false |
| hermes | Hermes | Nous Research | none | guide | false |
| kiro | Kiro AI | Amazon | none | mitm | false |
| custom | Custom CLI | — | full | custom-builder | false |
Инструментите с `baseUrlSupport: "partial"` показват значка "⚠ Частичен базов URL" в картата на таблото.
## 2. Каталог на CLI агенти (8 инструмента)
Автономни агенти, които се появяват в `/dashboard/cli-agents`:
| id | име | доставчик | поддръжка на baseUrl | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------------- | ------------ |
| hermes-agent | Hermes Agent | Nous Research | пълна | false |
| openclaw | OpenClaw | OSS (P. Steinberger) | пълна | true |
| goose | Goose | Block / Linux Foundation | пълна | true |
| interpreter | Open Interpreter | OSS | пълна | true |
| warp | Warp AI | Warp Inc. | частична | true |
| agent-deck | Agent Deck | asheshgoplani (OSS) | пълна | false |
| omp | Oh My Pi | OSS | пълна | true |
| letta | Letta CLI | Letta | пълна | false |
---
## Step 2 — Install CLI Tools
## 3. ACP агенти (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Тази страница (преименувана от `/dashboard/agents`) показва CLI, които OmniRoute може да **създаде** като бекенд изпълнителни двигатели чрез протокола stdio/ACP. Каталогът се поддържа отделно в `src/lib/acp/registry.ts` и **не** е същият като `CLI_TOOLS`.
---
## 4. MITM задължения (не показани в таблото)
Следните CLI не поддържат персонализиран base URL по подразбиране и **не са изброени** в страниците на CLI Code или CLI Agents. Те са кандидати за MITM прихващане в план 11:
| CLI | Причина |
| ------------------- | ------------------------------------------------------------------- |
| windsurf | BYOK ограничен до избрани модели на Claude + корпоративен URL/токен |
| amp | Затворена екосистема (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO удостоверяване, без персонализиран URL |
| cowork | Anthropic Desktop, без конфигурируем крайна точка |
Вижте `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` за пълния крос-референс.
---
## 5. API за откриване на партиди
Всички открития на инструменти се агрегат чрез единен крайна точка:
**`GET /api/cli-tools/all-statuses`**
- Удостоверяване: `requireCliToolsAuth(request)` (същото като другите маршрути `/api/cli-tools/`)
- Връща: `Record<toolId, ToolBatchStatus>` (тип: `src/shared/types/cliBatchStatus.ts`)
- Стратегия: `Promise.all` за всички инструменти, 5s таймаут на инструмент
- Кеш: в паметта LRU, индексиран по конфигурационен файл `mtime`. Кешът се невалидира, когато mtime се променя. Нулира се при рестарт на сървъра.
Форма на отговора за всеки инструмент:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // санитаризирано, без стек трасове
}
```
## 6. Настройки на обработчиците за нови инструменти
Новите инструменти с `configType: "custom"` имат специализирани API маршрути за настройки:
| Маршрут | Инструмент |
| ------------------------------------------- | ------------------------------------------------------------------------------ |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url флаг) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, наследствен) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, основен + наследствен `~/.deepseek` синхронизация) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi кодов агент |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + специален `.env` ключ) |
Всички маршрути използват `sanitizeErrorMessage()` за отговори при грешки (Твърдо правило #12).
---
## 7. Архитектура на страниците на таблото
### CLI Код (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — сървърен компонент
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — клиентска решетка
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — страница с детайли за инструмента
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 специализирани карти за инструменти + `ToolDetailClient.tsx`
### CLI Агенти (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — сървърен компонент
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — клиентска решетка
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — повторно използва `ToolDetailClient`
### ACP Агенти (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — сървърен компонент (преместен от `agents/`)
### Споделени UI Компоненти (`src/shared/components/cli/`)
| Файл | Цел |
| ----------------------- | ------------------------------------------------------------- |
| `CliToolCard.tsx` | Умен статусен картон (детекция + конфигурация + крайна точка) |
| `CliConceptCard.tsx` | Карта с обяснение на концепцията на страницата |
| `CliComparisonCard.tsx` | Сравнение в три колони между CLI типове |
| `BaseUrlSelect.tsx` | Падащо меню за крайна точка (Локално/Облачно/Персонализирано) |
| `ApiKeySelect.tsx` | Избор на API ключ |
| `ManualConfigModal.tsx` | Модал за копируем фрагмент от конфигурация |
### Споделен Хук (`src/shared/hooks/cli/`)
| Файл | Цел |
| ------------------------- | ------------------------------------------------------------------------------------ |
| `useToolBatchStatuses.ts` | Извлича `/api/cli-tools/all-statuses`, управлява състоянието на зареждане/освежаване |
## 8. i18n
Нови пространства от имена добавени в план 14 F9:
| Пространство от имена | Цел |
| --------------------- | -------------------------------------------------------------------------------------------------- |
| `cliCommon` | Споделени низове (етикети на карти, текстове за концепции/сравнения, етикети на детайлни страници) |
| `cliCode` | Низове на страницата на CLI Code |
| `cliAgents` | Низове на страницата на CLI Agents |
| `acpAgents` | Низове на страницата на ACP Agents |
Пълни преводи на PT-BR и EN са предоставени. 39 други локализации автоматично се връщат към EN чрез сливане на ниво пространство от имена в `src/i18n/request.ts`.
---
## 9. Бързо начало
### Стъпка 1 — Получете API ключ за OmniRoute
1. Отворете `/dashboard/api-manager`**Създайте API ключ**
2. Дайте му име (например `cli-tools`) и изберете всички разрешения
3. Копирайте ключа — ще ви е необходим за всеки CLI по-долу
> Вашият ключ изглежда така: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Стъпка 2 — Инсталирайте CLI инструменти
Всички инструменти, базирани на npm, изискват Node.js 22.22.2+ или 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +348,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (може да се стартира чрез `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Базиран на Rust
# Pi coding agent
# вижте https://github.com/zechnerj/pi-coding-agent за инсталация
# jcode
# вижте https://github.com/1jehuang/jcode за инсталация
```
---
## Step 3 — Set Global Environment Variables
### Стъпка 3 — Конфигурирайте чрез таблото
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. Отидете на `http://localhost:20128/dashboard/cli-code`
2. Намерете инструмента си в мрежата
3. Щракнете върху картата, за да отворите страницата с детайли на инструмента
4. Изберете вашия API ключ и основен URL
5. Щракнете **Приложи конфигурация** или копирайте ръчно фрагмента за конфигурация
---
### Стъпка 4 — Задайте глобални променливи на средата
```bash
# OmniRoute Universal Endpoint
# OmniRoute универсален крайна точка
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI чете GOOGLE_GEMINI_BASE_URL на ROOT (неговият SDK сам добавя /v1beta/... )
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> За **отдалечен сървър** заменете `localhost:20128` с IP адреса или домейна на сървъра,
> например `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### Стъпка 4 — Конфигурирайте всеки инструмент
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Създайте ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
Използвайте обединената коренова точка на Anthropic за Claude Code. Не добавяйте `/v1` тук.
**Тест:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
Съвременният Codex (v0.137+) чете `~/.codex/config.toml` само — старият
`config.yaml` принадлежи на наследения npm CLI и се игнорира безшумно. API
ключът остава в променливата на средата `OMNIROUTE_API_KEY` (`env_key`), никога
във файла:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
Пълна справка (профили, `wire_api`, контекстни прозорци): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Тест:** `codex "what is 2+2?"`
---
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `codex "what is 2+2?"`
**Тест:** `opencode`
> Използвайте `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> за да изпратите мисловни варианти.
---
### OpenCode
#### Cline (CLI или VS Code)
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
EOF
```
**Test:** `opencode`
---
### Cline (CLI or VS Code)
**CLI mode:**
**CLI режим:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +491,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**VS Code режим:**
Настройки на разширението Cline → API доставчик: `OpenAI Compatible`Основен URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
Или използвайте таблото на OmniRoute → **CLI инструменти → Cline → Приложи конфигурация**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI или VS Code)
**CLI mode:**
**CLI режим:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**Настройки на VS Code:**
```json
{
@@ -223,13 +515,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
Или използвайте таблото на OmniRoute → **CLI инструменти → KiloCode → Приложи конфигурация**.
---
### Continue (VS Code Extension)
#### Continue (разширение за VS Code)
Edit `~/.continue/config.yaml`:
Редактирайте `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +533,257 @@ models:
default: true
```
Restart VS Code after editing.
Рестартирайте VS Code след редактиране.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Използвайте това, когато VS Code Insiders е конфигуриран за модели на персонализирани крайни точки и искате OmniRoute да работи без персонализирано поле на заглавката.
**Препоръчано местоположение:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Пример с токенизирания псевдоним на OmniRoute:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Бележки:**
- Заменете `sk-your-omniroute-key` с API ключ, създаден в OmniRoute.
- Полето `url` трябва да сочи към `/api/v1/vscode/{token}/chat/completions`.
- Полето `modelsUrl` трябва да сочи към `/api/v1/vscode/{token}/models`.
- Предпочитайте нормалния поток `/v1` + заглавка Bearer, когато клиентът поддържа персонализирани заглавки.
- Вградени токени в URL са съвместимостна резервна опция и могат да се появят в логовете на редактора или историята на проксито.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# Влезте в акаунта си в AWS/Kiro:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI използва собствена автентикация — OmniRoute не е необходима като бекенд за Kiro CLI самата.
# Използвайте kiro-cli заедно с OmniRoute за други инструменти.
kiro-cli status
```
За настолната апликация **Kiro IDE** използвайте MITM крайна точка, предоставена от OmniRoute
под `/dashboard/cli-tools → Kiro`.
---
### Qwen Code (Alibaba)
## 10. Вътрешен OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
Бинарният файл `omniroute` предоставя команди за жизнения цикъл на сървъра, настройка, диагностика и управление на доставчици. Точка на вход: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Стартиране на сървъра (по подразбиране порт 20128)
omniroute setup # Интерактивен помощник за настройка
omniroute doctor # Проверка на конфигурация, БД, портове, време на работа
omniroute providers list # Конфигурирани връзки с доставчици
omniroute providers test-all # Тест на всяка активна връзка
omniroute reset-password # Нулиране на паролата на администратора
omniroute logs # Поток на логовете на заявките
omniroute health # Подробно здравословно състояние (разпределители, кеш, памет)
omniroute --version # Печат на версията
omniroute --help # Показване на всички команди
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Настройка и инициализация
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # Интерактивен помощник за настройка
omniroute setup --non-interactive # CI/автоматизираен режим (чете променливи на средата + флагове)
omniroute setup --password '<value>' # Задаване на парола на администратора директно
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Добавяне и тестване на доставчик в едно
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
Разпознати променливи на средата за неинтерактивна настройка:
**Test:** `qwen "say hello"`
| Var | Purpose |
| ------------------- | ---------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | API ключ на доставчика (свързан с `--api-key` чрез Commander `.env()`) |
| `DATA_DIR` | Презаписване на директорията за данни на OmniRoute |
### Cursor (Desktop App)
Всички останали неинтерактивни входове се предават като флагове, а не променливи на средата:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(вижте опциите за `omniroute setup` по-горе).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
### Диагностика
Via GUI: **Settings → Models → OpenAI API Key**
```bash
omniroute doctor # Проверка на конфигурация, БД, портове, време на работа, памет, жизненост
omniroute doctor --json # Машинно четим JSON
omniroute doctor --no-liveness # Пропускане на HTTP проверката за здравословно състояние
omniroute doctor --host 0.0.0.0 # Презаписване на хоста за жизненост
omniroute doctor --liveness-url <url> # Презаписване на пълния URL на крайна точка за здравословно състояние
```
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
Докторът извършва тези проверки: `Конфигурация`, `База данни`, `Съхранение/шифроване`,
`Наличност на порт`, `Време на работа на Node`, `Нативен бинарен файл` (better-sqlite3),
`Памет` и `Жизненост на сървъра`. Излиза с ненулев код, ако някоя проверка е `неуспешна`.
### Управление на доставчици
```bash
omniroute providers available # Каталог на доставчиците на OmniRoute
omniroute providers available --search openai # Филтриране на каталога по id/име/псевдоним/категория
omniroute providers available --category api-key # Филтриране по категория (api-key, oauth, free, ...)
omniroute providers available --json # Машинно четим JSON
omniroute providers list # Конфигурирани връзки с доставчици
omniroute providers list --json
omniroute providers test <id|name> # Тест на една конфигурирана връзка
omniroute providers test-all # Тест на всяка активна връзка
omniroute providers validate # Локална структурна валидация
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Съществуващ OAuth поток
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` са API-първи и следователно работят срещу
активния локален или отдалечен контекст. Входът на удостоверение трябва да използва
`--credential-stdin` или `--credential-env`; `--dry-run --json` отчита само
редактирана наличност/форма. `providers available` чете каталога на OmniRoute;
`providers list/test/test-all/validate` запазват локалното си SQLite поведение и
не изискват сървърът да работи.
### Възстановяване и нулиране
```bash
omniroute reset-password # Нулиране на паролата на администратора (също: omniroute-reset-password)
omniroute reset-encrypted-columns # Показване на предупреждение + пробен режим за нулиране на шифровани удостоверения
omniroute reset-encrypted-columns --force # Всъщност нулира шифрованите удостоверения в SQLite
```
### Експорт на удостоверения (⚠ обработвайте с внимание)
```bash
omniroute auth export # Показване на предупреждение + врата за потвърждение — без достъп до БД
omniroute auth export --force # Експорт на ВСИЧКИ DECRYPTED удостоверения на връзките в stdout като JSON
omniroute auth export --force --id <id> # Експорт само на съответстващата връзка
omniroute auth export --force --format env # Изход OMNIROUTE_<PROVIDER>_<FIELD>=<value> редове
omniroute auth export --force --out creds.json # Запис в файл (създаден с 0600 права)
```
`auth export` е **локален** (директно четене от SQLite, без HTTP маршрут) и умишлено печата/записва
**плоски** `apiKey`/`accessToken`/`refreshToken`/`idToken` стойности — това е функция, а не
грешка. Нищо не се чете от базата данни и нищо не се декриптира, без `--force`. Предупредителен банер
винаги се печата преди всяко излъчване на плоски данни. Изисква `STORAGE_ENCRYPTION_KEY` да
бъде зададен. Поле, което не успее да се декриптира (остарял ключ, повреден шифрован текст) се отчита като
`<field>DecryptFailed: true` вместо да прекратява целия експорт или да изтича основната грешка.
### Други подкоманди
Тези предполагат работещ сървър OmniRoute, освен ако не е посочено друго:
```bash
omniroute status # Обширен статус на времето на работа
omniroute logs # Поток на логовете на заявките (--json, --search, --follow)
omniroute config show # Показване на текущата конфигурация
omniroute provider list # Списък на наличните доставчици (псевдоним на providers list)
omniroute provider add # Регистриране на OmniRoute като доставчик на инструмент
omniroute keys add | list | remove # Управление на API ключове
omniroute models [provider] # Списък на модели (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Снимка на конфигурацията + БД
omniroute restore # Възстановяване от предишна снимка
omniroute health # Подробно здравословно състояние (разпределители, кеш, памет)
omniroute quota # Използване на квота на доставчика
omniroute cache # Статус на кеша
omniroute cache clear # Изчистване на семантични + подписващи кешове
omniroute mcp status | restart # Статус на MCP сървъра / рестарт
omniroute a2a status | card # Статус на A2A сървъра / карта на агента
omniroute tunnel list | create | stop # Управление на тунели (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Инспекция / задаване на променливи на средата (временни)
omniroute test # Тест за свързаност на доставчика
omniroute update # Проверка за актуализации
omniroute completion # Генериране на завършване на командния ред
```
### Общи флагове
| Flag | Description |
| ------------------- | ------------------------------------------------------ |
| `--no-open` | Не отваряйте автоматично браузъра при стартиране |
| `--port <n>` | Презаписване на API порта (по подразбиране 20128) |
| `--mcp` | Работете като MCP сървър през stdio (за IDE) |
| `--non-interactive` | CI режим (без подканвания; чете от променливи/флагове) |
| `--json` | Машинно четим JSON изход (doctor, providers и др.) |
| `--help`, `-h` | Показване на помощ, специфична за командата |
| `--version`, `-v` | Печат на инсталираната версия |
---
## Dashboard Auto-Configuration
## Налични API крайни точки
The OmniRoute dashboard automates configuration for most tools:
| Крайна точка | Описание | Използва се за |
| -------------------------- | ---------------------------------- | ------------------------------------------ |
| `/v1/chat/completions` | Стандартен чат (всички доставчици) | Всички съвременни инструменти |
| `/v1/responses` | API за отговори (формат OpenAI) | Codex, агентни работни потоци |
| `/v1/completions` | Остарели текстови завършвания | По-стари инструменти, използващи `prompt:` |
| `/v1/embeddings` | Текстови вграждания | RAG, търсене |
| `/v1/images/generations` | Генерация на изображения | GPT-Image, Flux и др. |
| `/v1/audio/speech` | Текст към реч | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Реч към текст | Deepgram, AssemblyAI |
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
Примери, готови за поставяне с токенизиран OmniRoute URL:
---
```txt
Token пример: sk-a3ab3c080beaee3a-69f4a4-070d71af
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
Стандартен OpenAI базов: http://localhost:20128/v1
VS Code модели: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code чат: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code отговори: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama тагове: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama чат: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Отстраняване на проблеми
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
```
| Грешка | Причина | Решение |
| ---------------------------------------------- | ------------------------------ | ---------------------------------------------------------- |
| `Connection refused` | OmniRoute не работи | `omniroute serve` |
| `401 Unauthorized` | Грешен API ключ | Проверете в `/dashboard/api-manager` |
| `No combo configured` | Няма активна рутинг комбинация | Настройте в `/dashboard/combos` |
| CLI показва "not installed" | Бинарният файл не е в PATH | Проверете `which <command>` |
| Таблото показва "not detected" след инсталация | Кешът е остарял | Кликнете "⟳ Refresh detection" в таблото |
| Стара връзка `/dashboard/cli-tools` | Закладка преди v3.8.6 | Автоматично пренасочване към `/dashboard/cli-code` (308) |
| Стара връзка `/dashboard/agents` | Закладка преди v3.8.6 | Автоматично пренасочване към `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,262 @@
# CLI-INTEGRATIONS (বাংলা)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI ইন্টিগ্রেশন — OmniRoute-এ যেকোন কোডিং CLI নির্দেশ করুন"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI ইন্টিগ্রেশন
OmniRoute একটি `setup-*` কমান্ডের পরিবার সরবরাহ করে যা একটি কোডিং CLI (Codex, Claude Code, OpenCode, Cline, …) কে OmniRoute-কে তার ব্যাকএন্ড হিসেবে ব্যবহার করতে কনফিগার করে — তাই টুলটি **একটি** এন্ডপয়েন্টের সাথে কথা বলে এবং OmniRoute সঠিক প্রদানকারীর কাছে রাউট করে স্বয়ংক্রিয়ভাবে ফallback করে। প্রতিটি কমান্ড একটি চলমান OmniRoute (স্থানীয় বা দূরবর্তী) থেকে **লাইভ** মডেল ক্যাটালগ পড়ে এবং টুলের নিজস্ব কনফিগারেশন ফাইল **আপনার** মেশিনে লেখে। API কী একটি পরিবেশ ভেরিয়েবলের মাধ্যমে উল্লেখ করা হয় যেখানে টুলটি এটি সমর্থন করে। টুল-স্থানীয় পরিবেশ ফাইল সংরক্ষণকারী কমান্ডগুলি নিচে উল্লেখ করা হয়েছে।
একটি সাধারণ লঞ্চারও রয়েছে — `omniroute run <target>` — যা সঠিক পরিবেশ ইনজেক্ট করে `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` বা `gemini` চালু করে, কোন কনফিগারেশন লেখার প্রয়োজন ছাড়াই। টার্গেট এবং তাদের উপনামগুলি ক্যানোনিক্যাল ম্যানিফেস্ট `bin/cli/cli-manifest.mjs` থেকে আসে (`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`, `open-code`, `qwen-code`, `gemini-cli`), এবং `omniroute completion` একই ম্যানিফেস্ট-উৎপন্ন টার্গেট শব্দগুলি অফার করে। পুরানো প্রতি-টুল লঞ্চারগুলি — `omniroute launch` (Claude Code) এবং `omniroute launch-codex` (Codex) — উপলব্ধ রয়েছে।
প্রদানকারী অনবোর্ডিং একই স্থানীয়/দূরবর্তী প্রসঙ্গে উপলব্ধ। নিচের API-প্রথম কমান্ডগুলি ব্যবস্থাপনা প্রমাণীকরণকে প্রদানকারী শংসাপত্র থেকে আলাদা রাখে এবং কখনও একটি শংসাপত্র কাঠামোগত আউটপুটে মুদ্রণ করে না:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
স্ক্রিপ্টের জন্য, `--credential-stdin` বা `--credential-env` পছন্দ করুন; `--credential` নিয়ন্ত্রিত স্থানীয় ব্যবহারের জন্য রাখা হয়েছে। `providers remove` একটি অ-ইন্টারঅ্যাকটিভ টার্মিনালে `--yes` প্রয়োজন, এবং সমস্ত পাঁচটি কমান্ড সক্রিয় প্রসঙ্গ বা গ্লোবাল `--base-url`/`--api-key` বিকল্পগুলিকে সম্মান করে।
দুইটি সবচেয়ে সমৃদ্ধ ইন্টিগ্রেশনের একবারের জন্য, হাতে লেখা বেস সেটআপের জন্য, প্রতি-টুল গভীর ডাইভগুলি দেখুন:
- [Claude Code কনফিগারেশন](./CLAUDE-CODE-CONFIGURATION.md)
- [Codex CLI কনফিগারেশন](./CODEX-CLI-CONFIGURATION.md)
- [দূরবর্তী মোড](./REMOTE-MODE.md) — আপনার ল্যাপটপ থেকে একটি দূরবর্তী OmniRoute (VPS / Tailnet) চালান
- [VS Code Copilot চ্যাট](./VSCODE-COPILOT.md) — OmniCopilot এক্সটেনশন; এটি সম্পাদক থেকে আপনার জন্য এই `setup-*` কমান্ডগুলি চালাতে পারে
---
## মাস্টার টেবিল
প্রতিটি কমান্ড **সক্রিয় প্রসঙ্গ** (যা `omniroute connect` দিয়ে সেট করা হয়, দেখুন [দূরবর্তী মোড](./REMOTE-MODE.md)) বা স্পষ্ট `--remote <url> --api-key <key>` ফ্ল্যাগগুলি সম্মান করে। "স্থানীয় বনাম দূরবর্তী" নিচে মানে: কোন ফ্ল্যাগ ছাড়া এটি `http://localhost:20128` লক্ষ্য করে; `--remote` (অথবা একটি সক্রিয় দূরবর্তী প্রসঙ্গ) সহ এটি সেই সার্ভার থেকে ক্যাটালগ নিয়ে আসে এবং স্থানীয়ভাবে কনফিগারেশন লেখে।
| কমান্ড | টুল | এটি কি লেখে | মূল ফ্ল্যাগগুলি | স্থানীয় বনাম দূরবর্তী |
| -------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — একটি সামঞ্জস্যপূর্ণ টেক্সট মডেলের জন্য একটি প্রোফাইল (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | উভয় |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — মিলে যাওয়া মডেলের জন্য একটি প্রোফাইল (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | উভয় |
| `omniroute setup-opencode` | OpenCode (openai-compatible) | `~/.config/opencode/opencode.json` — প্রতিটি ক্যাটালগ মডেলের জন্য `omniroute` প্রদানকারী (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | উভয় |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI মোড) + VS Code এক্সটেনশনের সেটিংস মুদ্রণ করে | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | উভয় |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + যদি উপস্থিত থাকে তবে `kilocode.*` কে VS Code `settings.json` এ মিশ্রিত করে | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | উভয় |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` মডেল, কী `${{ secrets.OMNIROUTE_API_KEY }}` এর মাধ্যমে | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | উভয় |
| `omniroute setup-cursor` | Cursor | কিছুই নয় — ইন-অ্যাপ পদক্ষেপ মুদ্রণ করে (Cursor কনফিগারেশন অস্বচ্ছ SQLite) | `--remote` `--api-key` `--only` `--port` | উভয় |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (আমদানি নথি) + যদি একটি VS Code `settings.json` বিদ্যমান থাকে তবে `roo-cline.autoImportSettingsPath` সেট করে | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | উভয় |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-compat` প্রদানকারী, কী `$OMNIROUTE_API_KEY` এর মাধ্যমে | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | উভয় |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + পরিবেশ রেসিপি মুদ্রণ করে | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | উভয় |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + পরিবেশ রেসিপি মুদ্রণ করে | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | উভয় |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai` অ্যারে + `OMNIROUTE_API_KEY` `~/.qwen/.env` এ | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | উভয় |
| `omniroute run <target>` | রানটাইম লঞ্চ (সাধারণ) | কিছুই নয় — সঠিক পরিবেশ এবং আর্গুমেন্ট সহ `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` চালু করে; Qwen এবং Gemini একটি অস্থায়ী বিচ্ছিন্ন বাড়ি ব্যবহার করে | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | উভয় |
| `omniroute launch` | Claude Code | কিছুই নয় — `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` ইনজেক্ট করে `claude` চালু করে | `--remote` `--api-key` `--token` `--profile` `--port` | উভয় |
| `omniroute launch-codex` | OpenAI Codex CLI | কিছুই নয় — `-c` ফ্ল্যাগের মাধ্যমে `omniroute` প্রদানকারী ইনজেক্ট করে `codex` চালু করে | `--remote` `--api-key` `--profile` (`-p`) `--port` | উভয় |
ফ্ল্যাগগুলির উপর নোট (কমান্ড সোর্সে যাচাই করা হয়েছে):
- `--remote <url>` — একটি দূরবর্তী OmniRoute থেকে ক্যাটালগ নিয়ে আসে (এটি `--port` এবং সক্রিয় প্রসঙ্গকে অতিক্রম করে)। `--api-key <key>` সেই সার্ভারের জন্য শংসাপত্র সরবরাহ করে (ডিফল্টভাবে `OMNIROUTE_API_KEY` পরিবেশ ভেরিয়েবল, অথবা সক্রিয় প্রসঙ্গের টোকেন)।
- `--only <patterns>` — কমা দ্বারা পৃথক সাবস্ট্রিং; শুধুমাত্র মডেল আইডি রাখুন যা মেলে (যেমন `--only glm,kimi`)। উপলব্ধ `setup-codex`, `setup-claude`, `setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush` এ।
- `--dry-run` — ফাইল সিস্টেমে স্পর্শ না করে ঠিক কি লেখা হবে তা মুদ্রণ করে। প্রতিটি `setup-*` কমান্ডে উপলব্ধ **ছাড়া** `setup-cursor` (যা কখনও একটি ফাইল লেখে না)।
- `--model <id>` — প্রয়োজনীয় (অথবা ইন্টারঅ্যাকটিভভাবে নির্বাচিত) টুলগুলির জন্য যাদের মডেল স্বয়ংক্রিয় আবিষ্কার নেই: Cline, Kilo, Roo, Goose, Qwen, Aider। সেই টুলগুলি `--yes` গ্রহণ করে অ-ইন্টারঅ্যাকটিভ রানগুলির জন্য (যা তখন `--model` প্রয়োজন)। `setup-opencode` ডিফল্ট শীর্ষ স্তরের মডেল সেট করতে `--model` গ্রহণ করে।
- `--model <id>` `omniroute run` এ ম্যানিফেস্টের প্রতি-টার্গেট ওয়্যারিং অনুসরণ করে (`bin/cli/cli-manifest.mjs`): **aider** `--model openai/<id>` এবং **opencode** `--model omniroute/<id>` গ্রহণ করে (প্রিফিক্সটি কেবল তখনই যোগ করা হয় যখন আইডিটি ইতিমধ্যে এটি বহন করে না); **qwen** এবং **gemini** আইডিটি যথাযথভাবে গ্রহণ করে; **claude** এটি `ANTHROPIC_MODEL` এর মাধ্যমে পায়, **goose** `GOOSE_MODEL` এর মাধ্যমে, এবং **codex** `-c model_providers.omniroute.*` আর্গুমেন্টের মাধ্যমে। **Qwen হল একমাত্র রান টার্গেট যা কঠোরভাবে `--model` প্রয়োজন**`omniroute run qwen` ছাড়া এটি `2` এর সাথে একটি স্পষ্ট ত্রুটি সহ বেরিয়ে আসে।
- `--port <port>` — স্থানীয় OmniRoute পোর্ট (ডিফল্ট `20128`, যখন `--remote` সেট করা হয় তখন উপেক্ষা করা হয়)। সমস্ত `setup-*` এবং উভয় লঞ্চারে উপস্থিত।
- `omniroute run` প্রস্থান কোড: শিশু CLI-এর নিজস্ব প্রস্থান কোড সঠিকভাবে প্রচারিত হয়; `2` = অবৈধ আর্গুমেন্ট (সমর্থিত টার্গেট, প্রয়োজনীয় `--model` অনুপস্থিত, কন্টেইনার গার্ড); `127` = টার্গেট বাইনারি `PATH` এ নেই; `130`/`143`/`129` যখন লঞ্চটি `SIGINT`/`SIGTERM`/`SIGHUP` দ্বারা শেষ হয়; `1` = অন্যান্য রানটাইম লঞ্চ ব্যর্থতা।
- দুটি লঞ্চার (`launch`, `launch-codex`) `setup-claude` / `setup-codex` দ্বারা লেখা একটি প্রোফাইল নির্বাচন করতে `--profile <name>` গ্রহণ করে, পাশাপাশি মৌলিক `claude` / `codex` বাইনারির জন্য পাস-থ্রু আর্গুমেন্ট।
ইন্টারঅ্যাকটিভ পিকারটি সেটআপ রেসিপিগুলির দ্বারা শেয়ার করা হয়:
```bash
# সক্রিয় স্থানীয় বা দূরবর্তী মডেল ক্যাটালগ থেকে নির্বাচন করুন এবং টার্গেট কনফিগার করুন।
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` বর্তমানে `codex`, `claude`, `opencode`, `qwen`, `aider`, `goose`, `cline`, `continue`, এবং `kilo` এর জন্য পরীক্ষিত রেসিপিগুলিতে অর্পিত। IDE-শুধুমাত্র, MITM, এবং গাইড-শুধুমাত্র ক্যাটালগ এন্ট্রি স্পষ্ট `setup-*`/ম্যানুয়াল প্রবাহ হিসাবে রয়ে যায় এবং লঞ্চযোগ্য টার্গেট হিসাবে উপস্থাপন করা হয় না।
> `setup-opencode` হল **হালকা ওজনের openai-সামঞ্জস্যপূর্ণ** OpenCode ইন্টিগ্রেশন।
> একটি সমৃদ্ধ প্লাগইন ইন্টিগ্রেশনও রয়েছে — `omniroute setup opencode` — যা `@omniroute/opencode-plugin` ইনস্টল করে। এগুলি ভিন্ন কমান্ড; উপরের টেবিলটি `setup-opencode` ডকুমেন্ট করে।
---
## স্থানীয় ব্যবহার
`localhost:20128` এ OmniRoute চলমান থাকলে, আপনার টুলের জন্য কনফিগারেশন কমান্ড চালান। ক্যাটালগ স্থানীয় সার্ভার থেকে নেওয়া হয়।
```bash
# Codex: মেলানো মডেলের জন্য ~/.codex/ এ একটি প্রোফাইল লিখুন
omniroute setup-codex
codex --profile glm52 # একটি তৈরি করা প্রোফাইল ব্যবহার করুন
# Claude Code: মডেল অনুযায়ী প্রোফাইল লিখুন, তারপর একটি চালু করুন
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: সমস্ত ক্যাটালগ মডেল সহ openai-সঙ্গত প্রদানকারী লিখুন
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # {env:OMNIROUTE_API_KEY} এর মাধ্যমে উল্লেখ করা হয়েছে, কখনও ডিস্কে নয়
opencode -m omniroute/glm/glm-5.2 "..."
# স্বয়ংক্রিয় আবিষ্কার ছাড়া টুলগুলির জন্য একটি স্পষ্ট মডেল প্রয়োজন:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# কিছু লিখা ছাড়াই প্রিভিউ:
omniroute setup-continue --dry-run
```
কোনও কনফিগারেশন লিখা ছাড়াই চালু করুন (শুধু env-injection):
```bash
omniroute launch # Claude Code → স্থানীয় OmniRoute
omniroute launch-codex # Codex CLI → স্থানীয় OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# স্পষ্ট কমান্ড পাথ: -- এর পরে যা আসে তা পাস করুন
omniroute run claude -- --print-system-prompt "review this diff"
```
---
## দূরবর্তী ব্যবহার
কোনও কনফিগারেশন কমান্ডকে একটি দূরবর্তী OmniRoute এ `--remote` + `--api-key` দিয়ে নির্দেশ করুন। ক্যাটালগ দূরবর্তী থেকে নেওয়া হয়; কনফিগারেশন আপনার স্থানীয় মেশিনে লেখা হয়।
```bash
# একটি দূরবর্তী VPS এর বিরুদ্ধে OpenCode, শুধুমাত্র glm/kimi মডেল রাখুন
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # প্রথমে OMNIROUTE_API_KEY রপ্তানী করুন
# একটি দূরবর্তী ক্যাটালগ থেকে Codex প্রোফাইল
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# সরাসরি দূরবর্তী বিরুদ্ধে একটি CLI চালু করুন
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
প্রতিবার `--remote`/`--api-key` পাস করার পরিবর্তে, একবার লগ ইন করুন এবং **সক্রিয় প্রসঙ্গ** তাদের স্বয়ংক্রিয়ভাবে সরবরাহ করতে দিন:
```bash
omniroute connect 192.168.0.15 # একটি স্কোপড টোকেন তৈরি করে, প্রসঙ্গ সংরক্ষণ করে
omniroute setup-codex # ← এখন দূরবর্তী ক্যাটালগ ব্যবহার করে
omniroute setup-opencode # ← একই
omniroute launch # ← Claude Code দূরবর্তী বিরুদ্ধে
```
প্রসঙ্গ, স্কোপ এবং টোকেন ব্যবস্থাপনার জন্য [দূরবর্তী মোড](./REMOTE-MODE.md) দেখুন।
---
## বেস URL কনভেনশন (যা টুলগুলি `/v1` চায়)
OmniRoute `/v1` এ OpenAI পৃষ্ঠাটি প্রকাশ করে, মূল পৃষ্ঠায় Anthropic পৃষ্ঠাটি এবং `/v1beta` এ একটি স্থানীয় Gemini পৃষ্ঠাটি। প্রতিটি ইন্টিগ্রেশন তার টুলের প্রত্যাশিত ফর্মে সংযুক্ত (কমান্ড সোর্সে যাচাই করা হয়েছে):
| ইন্টিগ্রেশন | বেস URL লেখা | `/v1`? |
| -------------------------------------------------------------------------- | ------------ | ------------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | মূল | না — Cline `/v1/chat/completions` যোগ করে |
| `setup-goose` (`OPENAI_HOST`) | মূল | না — Goose পাথ যোগ করে |
| `setup-aider` (`OPENAI_API_BASE`) | মূল | না — LiteLLM `/v1/chat/completions` যোগ করে |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | `/v1` সহ | হ্যাঁ |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | মূল | না — Claude Code `/v1/messages` যোগ করে |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | `/v1` সহ | হ্যাঁ |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | `/v1` সহ | হ্যাঁ |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | মূল | না — SDK `/v1beta/models/…` যোগ করে |
---
## নেটিভ ডিপেন্ডেন্সি আপডেট রাখা: `--include=optional`
যখন আপনি `omniroute update` দিয়ে আপডেট করেন (নিশ্চিত করার পরে, অথবা `--apply` দিয়ে),
OmniRoute `--include=optional` সহ ইনস্টল চালায়:
```bash
npm install -g omniroute@latest --include=optional
```
এটি `omniroute update` এ আপনি যে ফ্ল্যাগটি পাস করেন তা **নয়** — এটি সর্বদা আপডেটারের দ্বারা প্রয়োগ করা হয়। এটি নিশ্চিত করে যে `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, LLMLingua SLM স্ট্যাক) আপডেটের সময় টিকে থাকে, এমনকি যদি আপনার npm কনফিগারেশনে
`omit=optional` সেট করা থাকে, যা অন্যথায় নীরবে নেটিভ SQLite ড্রাইভার এবং OS-keyring বাইন্ডিং মুছে ফেলবে। সঠিক কমান্ডটি প্রিভিউ করতে, প্রয়োগ না করে:
```bash
omniroute update --dry-run
# [DRY RUN] চালানো হবে: npm install -g omniroute@latest --include=optional
```
অন্যান্য `omniroute update` ফ্ল্যাগ (সোর্সে যাচাই করা হয়েছে): `--check` (পুরনো হলে 1 এ বেরিয়ে যাবে), `--apply` (প্রম্পট ছাড়াই ইনস্টল), `--changelog`, `--no-backup`,
`--yes`
---
## Google Gemini CLI `omniroute run gemini` এর মাধ্যমে
`@google/gemini-cli` 0.50.0 এর বিরুদ্ধে চুক্তি যাচাই করা হয়েছে: CLI `GOOGLE_GEMINI_BASE_URL` কে সম্মান করে
এবং `POST /v1beta/models/<model>:generateContent`
(এবং `:streamGenerateContent?alt=sse`) এর বিরুদ্ধে জারি করে — ঠিক OmniRoute এর নেটিভ
Gemini সারফেস (`/v1beta`)। `omniroute run gemini` এটি স্বয়ংক্রিয়ভাবে সংযুক্ত করে:
- `GOOGLE_GEMINI_BASE_URL` → সক্রিয় OmniRoute বেস URL (মূল, `/v1` নেই);
- `GEMINI_API_KEY` → সমাধানকৃত OmniRoute শংসাপত্র (অপশন/env/প্রেক্ষাপট);
- একটি **অস্থায়ী বিচ্ছিন্ন `GEMINI_CLI_HOME`** যার `.gemini/settings.json`
`gemini-api-key` প্রমাণীকরণ নির্বাচন করে, যাতে একটি সংরক্ষিত Google OAuth সেশন (Code Assist)
কখনও OmniRoute-নির্দেশিত লঞ্চকে অতিক্রম না করে — প্রস্থান করার পরে মুছে ফেলা হয়;
- **env স্বাস্থ্যবিধি**: শিশু পরিবেশ `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` এবং `GOOGLE_GENAI_USE_GCA` থেকে পরিষ্কার করা হয় (যা প্রমাণীকরণকে
Vertex/Code Assist এ পুনঃনির্দেশ করবে), এবং `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` একটি
বেল্ট-এবং-সাসপেন্ডার ব্যাকআপ হিসাবে সেট করা হয় — অন্যান্য `run` লক্ষ্য তাদের নিজস্ব
বিরোধী ভেরিয়েবলের জন্য একই চিকিত্সা পায়;
- `--model <id>` ইনজেকশন `--provider`/`--model` থেকে।
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Gemini এর কর্মস্থান-ভরসা গার্ড এখনও হেডলেস মোডে প্রযোজ্য — `--skip-trust` পাস করুন
(অথবা ইন্টারেক্টিভভাবে ডিরেক্টরিটি বিশ্বাস করুন); লঞ্চার এটি বাইপাস করতে ইচ্ছাকৃতভাবে করে না। এই লঞ্চার **ACP নিবন্ধন** (`src/lib/acp/registry.ts`, `gemini --acp`) থেকে আলাদা,
যা `/dashboard/acp-agents` এর জন্য এজেন্ট-প্রোটোকল ইন্টিগ্রেশন হিসেবে রয়ে যায়।
---
## বাস্তব ধোঁয়াSweep (অপ্ট-ইন)
CI তে নির্ধারক লঞ্চ-প্ল্যান রিগ্রেশন চালায় (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`)। একটি বাস্তব OmniRoute সার্ভারের বিরুদ্ধে REAL বাইনারিগুলি যাচাই করতে,
একটি অপ্ট-ইন হার্নেস রয়েছে `tests/integration/upstream-cli-smoke.int.test.ts` এ। এটি স্বয়ংক্রিয়ভাবে কখনও চলে না
(প্রতিটি সাব-টেস্ট `RUN_CLI_SMOKE=1` ছাড়া স্কিপ করে), পরিবেশ-ভেরিয়েবল
নাম দ্বারা শংসাপত্রটি পাস করে (মূল্য দ্বারা কখনও নয়), রেকর্ড করা আউটপুট থেকে কী-আকৃতির স্ট্রিংগুলি মুছে ফেলে, ইনস্টল করা নেই এমন বাইনারির লক্ষ্যগুলি স্কিপ করে, এবং ব্যর্থতাগুলিকে
প্রমাণীকরণ / আপস্ট্রিম / কনফিগারেশন হিসাবে শ্রেণীবদ্ধ করে, একটি খালি বুলিয়ান নয়:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
ঐচ্ছিক: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` Sweep সীমাবদ্ধ করে;
`OMNIROUTE_SMOKE_TIMEOUT_MS` প্রতি লক্ষ্য 120 সেকেন্ডের টাইমআউটকে ওভাররাইড করে।
## আরও দেখুন
- [Claude Code কনফিগারেশন](./CLAUDE-CODE-CONFIGURATION.md) — গভীর Claude Code গাইড
- [Codex CLI কনফিগারেশন](./CODEX-CLI-CONFIGURATION.md) — একবারের জন্য `[model_providers.omniroute]` বেস সেটআপ
- [রিমোট মোড](./REMOTE-MODE.md) — প্রসঙ্গ, স্কোপড অ্যাক্সেস টোকেন, একটি রিমোট সার্ভার চালানো
- [CLI টুলস রেফারেন্স](../reference/CLI-TOOLS.md) — সমর্থিত টুলগুলোর পূর্ণ ক্যাটালগ + ড্যাশবোর্ড পৃষ্ঠা
- [সেটআপ গাইড](./SETUP_GUIDE.md) — ইনস্টল পদ্ধতি এবং প্রথমবারের অনবোর্ডিং

View File

@@ -1,86 +1,326 @@
# CLI Tools Setup Guide — OmniRoute (বাংলা)
# CLI-TOOLS (বাংলা)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI Tools — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Tools — OmniRoute
শেষ আপডেট: 2026-08-18
OmniRoute তিনটি ক্যাটাগরির CLI টুলের সাথে সংযুক্ত যা তিনটি নির্দিষ্ট ড্যাশবোর্ড পৃষ্ঠায় ছড়িয়ে রয়েছে:
| পৃষ্ঠা | রুট | ধারণা | সংখ্যা |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------- | ------------------ |
| **CLI কোডের** | `/dashboard/cli-code` | কোডিং টুল যা আপনি OmniRoute এ নির্দেশ করেন (ক্লায়েন্ট → CLI → OmniRoute → প্রদানকারী) | 26 |
| **CLI এজেন্টস** | `/dashboard/cli-agents` | স্বায়ত্তশাসিত এজেন্ট যা আপনি OmniRoute এ নির্দেশ করেন (একই প্রবাহ, বিস্তৃত পরিধি) | 8 |
| **ACP এজেন্টস** | `/dashboard/acp-agents` | CLIs যা OmniRoute ব্যাকএন্ড হিসেবে stdio/ACP এর মাধ্যমে তৈরি করে (বিপরীত প্রবাহ) | রেজিস্ট্রিতে দেখুন |
লিগ্যাসি রুটগুলি 308 এর মাধ্যমে পুনঃনির্দেশ করে: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`
---
## How It Works
## এটি কিভাবে কাজ করে
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI কোডের / CLI এজেন্টস (ব্যবহার প্রবাহ):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (সব OmniRoute এ নির্দেশ করে)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute সঠিক প্রদানকারীর কাছে রুট করে)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP এজেন্টস (বিপরীত স্পন প্রবাহ):
ক্লায়েন্টের অনুরোধ → OmniRoute → stdio/ACP এর মাধ্যমে CLI তৈরি করে → প্রতিক্রিয়া
```
**Benefits:**
**সুবিধাসমূহ:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- সমস্ত টুল পরিচালনার জন্য একটি API কী
- ড্যাশবোর্ডে সমস্ত CLI এর মধ্যে খরচ ট্র্যাকিং
- প্রতিটি টুল পুনঃকনফিগার না করেই মডেল পরিবর্তন
- স্থানীয় এবং দূরবর্তী সার্ভারে কাজ করে (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## `setup-*` এর সাথে স্বয়ংক্রিয় কনফিগার করুন
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
আপনাকে প্রতিটি টুলের কনফিগারেশন হাতে লিখতে হবে না। OmniRoute একটি `setup-*`
কমান্ড সরবরাহ করে প্রতি সমর্থিত CLI এর জন্য যা একটি চলমান
OmniRoute (স্থানীয় বা দূরবর্তী) থেকে **লাইভ** মডেল ক্যাটালগ পড়ে এবং আপনার মেশিনে টুলের নিজস্ব কনফিগারেশন লেখে:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
প্রতিটি `--remote <url> --api-key <key>` গ্রহণ করে (একটি স্থানীয় টুলকে একটি
দূরবর্তী OmniRoute এর বিরুদ্ধে কনফিগার করতে), `--dry-run` (লেখার আগে প্রিভিউ), এবং `--port`। মডেল স্বয়ংক্রিয় আবিষ্কার ছাড়া টুলগুলি (Cline, Kilo, Roo, Goose, Aider, Qwen) `--model <id>` গ্রহণ করে (এবং `--yes` অ-ইন্টারঅ্যাকটিভ রানগুলির জন্য)। সঠিক পরিবেশ ইনজেক্ট করে এবং কোনও কনফিগারেশন লেখা ছাড়াই একটি CLI চালু করতে, সাধারণ
`omniroute run <target>` লঞ্চার ব্যবহার করুন (claude, codex, aider, goose, opencode, qwen,
gemini — লক্ষ্য এবং উপনামগুলি `bin/cli/cli-manifest.mjs` থেকে আসে); লিগ্যাসি
প্রতি-টুল লঞ্চারগুলি `omniroute launch` (Claude Code) এবং `omniroute launch-codex`
(Codex) উপলব্ধ রয়েছে। Gemini CLI শুধুমাত্র লঞ্চ-অনলি: এটি একটি `omniroute run`
লক্ষ্য কিন্তু এর কোনও `setup-*`/`configure` রেসিপি নেই।
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **সম্পূর্ণ রেফারেন্স:** মাস্টার টেবিল — প্রতিটি কমান্ড কী লেখে, প্রতিটি পতাকা,
> স্থানীয় বনাম দূরবর্তী, এবং কোন টুলগুলি `/v1` সাফিক্স চায় — এটি
> **[CLI Integrations](../guides/CLI-INTEGRATIONS.md)** এ রয়েছে।
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### একটি কনটেইনারের ভিতরে এগুলি চালানো
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
OmniRoute কনটেইনারের ভিতরে কার্যকর করা একটি `setup-*` কমান্ড কনটেইনারের নিজস্ব হোমে লেখে, যা কোনও হোস্ট CLI পড়ে না এবং যা কনটেইনারের সাথে অদৃশ্য হয়ে যায়। OmniRoute এটি সনাক্ত করে এবং লেখার পরিবর্তে নির্দেশনা সহ `2` এ বেরিয়ে আসে। এগিয়ে যাওয়ার দুটি সমর্থিত উপায় — হোস্টে CLI ইনস্টল করুন এবং
`omniroute connect` কনটেইনারে, অথবা কনফিগারেশন ডিরেক্টরিগুলি বাইন্ড-মাউন্ট করুন এবং `CLI_CONFIG_HOME` সেট করুন (কম্পোজ `host` প্রোফাইল)। প্রতিটি `setup-*` কমান্ড, পাশাপাশি
`omniroute configure` এবং `omniroute config set`, গ্রহণ করে
`--allow-container-write` যখন কনটেইনারের নিজস্ব CLIs কনফিগার করা আপনার আসল উদ্দেশ্য ছিল; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` সার্ভারের জন্য একই কাজ করে। দেখুন
[Docker Guide → Configuring host CLI tools](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker)।
ড্যাশবোর্ডের **প্রয়োগ এন্ডপয়েন্ট** (`POST /api/cli-tools/apply`) একই সুরক্ষা প্রয়োগ করে: একটি কনটেইনারে, একটি লেখার লক্ষ্য যা হোস্ট থেকে বাইন্ড-মাউন্ট করা হয়নি **`422`** এর সাথে উত্তর দেয় `containerEphemeralTarget: true`, নিরাপদ ত্রুটি
টেক্সট এবং — যেসব টুলের একটি হোস্ট রেসিপি রয়েছে (claude, codex, opencode, cline,
kilo, continue) — একটি `hostSetupCommand` (যেমন `omniroute setup-opencode`) যা পরিবর্তে হোস্টে চালাতে হবে; কিছুই লেখা হয় না। `dryRun: true` কনটেইনার মোডে কাজ করে এবং ডিস্কে স্পর্শ না করে উত্পন্ন সামগ্রী + লক্ষ্য পাথ ফেরত দেয়, তাই আপনি ড্যাশবোর্ড থেকে প্রিভিউ করতে পারেন এবং হোস্টে প্রয়োগ করতে পারেন। এই আচরণটি ইচ্ছাকৃত এবং
`tests/unit/api/cli-tools/apply-container-guard.test.ts` দ্বারা রিগ্রেশন-গার্ডেড — কখনও "ফিক্স" করবেন না একটি 422 কে সুরক্ষা অপসারণ করে।
---
## Step 1 — Get an OmniRoute API Key
## সত্যের উৎস
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
একক ক্যাটালগটি `src/shared/constants/cliTools.ts``CLI_TOOLS: Record<string, CliCatalogEntry>` হিসেবে বিদ্যমান।
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
প্রতিটি এন্ট্রির এই ক্ষেত্রগুলি রয়েছে (যা `src/shared/schemas/cliCatalog.ts` এ সংজ্ঞায়িত):
| ক্ষেত্র | প্রকার | বর্ণনা |
| ----------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------- |
| `category` | `"code" \| "agent"` | টুলটি কোন পৃষ্ঠায় প্রদর্শিত হয় |
| `vendor` | `string` | টুলের উৎস ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | ACP এজেন্ট হিসেবেও ব্যবহারযোগ্য (ব্যাজ প্রদর্শিত) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | কাস্টম এন্ডপয়েন্ট সমর্থন স্তর। `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | কনফিগারেশন প্রক্রিয়া |
| `id`, `name`, `color`, `description`, `docsUrl` | স্ট্যান্ডার্ড | মূল প্রদর্শন ক্ষেত্র |
যেসব এন্ট্রির `baseUrlSupport: "none"` রয়েছে সেগুলি **ড্যাশবোর্ড পৃষ্ঠায় প্রদর্শিত হয় না** — সেগুলি পরিকল্পনা 11 এর জন্য MITM backlog এ নিবন্ধিত হয় (দেখুন `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`)।
### সক্ষমতা স্তর (ক্যাটালগ করা × সনাক্তযোগ্য × কনফিগারযোগ্য × চালু করা যায়)
প্রতিটি ক্যাটালগ করা টুল সনাক্তযোগ্য, কনফিগারযোগ্য বা চালু করা যায় না। প্রতিটি স্তরের একটি
ঘোষণাকারী উৎস রয়েছে, এবং একটি ড্রিফট পরীক্ষা সেগুলিকে সঙ্গতিপূর্ণ রাখে:
| স্তর | অর্থ | ঘোষিত হয়েছে |
| ----------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------ |
| **ক্যাটালগ করা** | ড্যাশবোর্ড ক্যাটালগে প্রদর্শিত হয় (নাম, বিক্রেতা, ডকস, কনফিগ টাইপ) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **সনাক্তযোগ্য** | বাইনারি/কনফিগ সনাক্তকরণ, স্বাস্থ্য পরীক্ষা, কনফিগ পাথ | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` রানটাইম ক্যাটালগ) |
| **কনফিগারযোগ্য** | `omniroute configure <cli>` দ্বারা সমর্থিত (সেটআপ রেসিপি বিদ্যমান) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **চালু করা যায়** | `omniroute run <target>` দ্বারা সমর্থিত (env/args ইনজেকশন সংজ্ঞায়িত) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` হল CLI কমান্ডের জন্য ক্যানোনিকাল এক্সিকিউটেবল ম্যানিফেস্ট
পৃষ্ঠাগুলি: `run`, `configure` এবং শেল-সম্পূর্ণতা জেনারেটরগুলি সমস্ত তাদের
লক্ষ্য তালিকা, উপনাম সমাধান (যেমন `kilocode`/`kilo-code`/`kilo_cli``kilo`)
এবং `--model` ফ্ল্যাগ সংযোগ থেকে এটি থেকে উদ্ভূত হয়। ড্রিফট গার্ড
`tests/unit/cli/cli-manifest-drift.test.ts` নিশ্চিত করে যে ম্যানিফেস্ট, রানটাইম
ক্যাটালগ, UI ক্যাটালগ এবং প্রতিটি ভোক্তা পৃষ্ঠাগুলি সিঙ্কে থাকে — একটি লক্ষ্য একটিতে যোগ করা
পৃষ্ঠায় অন্যদের ছাড়া পরীক্ষাটি ব্যর্থ হয়, নিঃশব্দে ড্রিফট করার পরিবর্তে।
## 1. CLI কোডের ক্যাটালগ (২৬টি টুল)
সব টুল যা `/dashboard/cli-code` এ উপস্থিত। যেগুলোর `baseUrlSupport: none` সেগুলো MITM বা একটি ম্যানুয়াল গাইডের মাধ্যমে সংযুক্ত করা হয়েছে কাস্টম বেস URL এর পরিবর্তে:
| id | নাম | বিক্রেতা | baseUrlSupport | configType | acpSpawnable |
| ------------ | --------------------------- | ------------------- | -------------- | -------------- | ------------ |
| claude | ক্লড কোড | অ্যানথ্রোপিক | পূর্ণ | env | সত্য |
| codex | OpenAI Codex CLI | OpenAI | পূর্ণ | কাস্টম | সত্য |
| zcode | ZCode (GLM কোডিং পরিকল্পনা) | Z.ai | নেই | কাস্টম | মিথ্যা |
| cline | ক্লাইন | OSS (ex-Claude Dev) | পূর্ণ | কাস্টম | সত্য |
| kilo | কিলো কোড | কিলো-অর্গ | পূর্ণ | কাস্টম | মিথ্যা |
| roo | রু কোড | রু (OSS) | পূর্ণ | গাইড | মিথ্যা |
| continue | কন্টিনিউ | continue.dev | পূর্ণ | গাইড | মিথ্যা |
| aider | এইডার | OSS (P. Gauthier) | পূর্ণ | গাইড | সত্য |
| forge | ফোর্জকোড | অ্যান্টিনমি HQ | পূর্ণ | কাস্টম | সত্য |
| jcode | জেকোড | 1jehuang (OSS) | পূর্ণ | কাস্টম | মিথ্যা |
| deepseek-tui | ডীপসিক TUI | হান্টার বাউন (OSS) | পূর্ণ | কাস্টম | মিথ্যা |
| codewhale | কোডওয়েল | এইচএমবাউন (OSS) | পূর্ণ | কাস্টম | মিথ্যা |
| opencode | ওপেনকোড | অ্যানোমালি (ex-SST) | পূর্ণ | গাইড | সত্য |
| droid | ফ্যাক্টরি ড্রয়েড | ফ্যাক্টরি AI | আংশিক | গাইড | মিথ্যা |
| copilot | গিটহাব কোপাইলট CLI | গিটহাব/MS | পূর্ণ | কাস্টম | মিথ্যা |
| cursor-cli | কার্সর CLI | অ্যানিস্ফিয়ার | আংশিক | গাইড | সত্য |
| smelt | স্মেল্ট | লিওনার্ডসার (OSS) | পূর্ণ | কাস্টম | মিথ্যা |
| pi | পাই (পাই-কোডিং-এজেন্ট) | এম. জেচনার (OSS) | পূর্ণ | কাস্টম | মিথ্যা |
| grok-build | গ্রোক বিল্ড | xAI | পূর্ণ | কাস্টম | মিথ্যা |
| crush | ক্রাশ | OSS (চার্ম) | পূর্ণ | কাস্টম | মিথ্যা |
| qwen | কিউয়েন কোড | আলিবাবা | পূর্ণ | গাইড | সত্য |
| cursor | কার্সর | অ্যানিস্ফিয়ার | নেই | গাইড | মিথ্যা |
| antigravity | অ্যান্টিগ্রাভিটি | গুগল | নেই | mitm | মিথ্যা |
| hermes | হার্মিস | নাউস রিসার্চ | নেই | গাইড | মিথ্যা |
| kiro | কিরো AI | অ্যামাজন | নেই | mitm | মিথ্যা |
| custom | কাস্টম CLI | — | পূর্ণ | কাস্টম-বিল্ডার | মিথ্যা |
`baseUrlSupport: "partial"` সহ টুলগুলি ড্যাশবোর্ড কার্ডে "⚠ বেস URL আংশিক" একটি ব্যাজ প্রদর্শন করে।
## 2. CLI এজেন্টের ক্যাটালগ (৮টি টুল)
স্বায়ত্তশাসিত এজেন্টগুলি `/dashboard/cli-agents` এ উপস্থিত:
| id | নাম | বিক্রেতা | baseUrlSupport | acpSpawnable |
| ------------ | ------------------ | ------------------------ | -------------- | ------------ |
| hermes-agent | হার্মেস এজেন্ট | Nous Research | পূর্ণ | মিথ্যা |
| openclaw | ওপেনক্ল আইন | OSS (P. স্টেইনবার্গ) | পূর্ণ | সত্য |
| goose | গুজ | ব্লক / লিনাক্স ফাউন্ডেশন | পূর্ণ | সত্য |
| interpreter | ওপেন ইন্টারপ্রেটার | OSS | পূর্ণ | সত্য |
| warp | ওয়ার্প এআই | ওয়ার্প ইনক. | আংশিক | সত্য |
| agent-deck | এজেন্ট ডেক | asheshgoplani (OSS) | পূর্ণ | মিথ্যা |
| omp | ওহ মাই পাই | OSS | পূর্ণ | সত্য |
| letta | লেটা CLI | লেটা | পূর্ণ | মিথ্যা |
---
## Step 2 — Install CLI Tools
## 3. ACP এজেন্ট (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
এই পৃষ্ঠা (যা `/dashboard/agents` থেকে নাম পরিবর্তন করা হয়েছে) CLIs দেখায় যা OmniRoute **স্পন** করতে পারে ব্যাকএন্ড এক্সিকিউশন ইঞ্জিন হিসাবে stdio/ACP প্রোটোকল মাধ্যমে। ক্যাটালগটি আলাদাভাবে `src/lib/acp/registry.ts` এ রক্ষণাবেক্ষণ করা হয় এবং এটি `CLI_TOOLS` এর সমান **নয়**
---
## 4. MITM ব্যাকলগ (ড্যাশবোর্ডে প্রদর্শিত হয় না)
নিচের CLIs গুলি কাস্টম বেস URL স্বাভাবিকভাবে সমর্থন করে না এবং CLI কোডের বা CLI এজেন্টের পৃষ্ঠায় **তালিকাভুক্ত নয়**। এগুলি পরিকল্পনা ১১ এ MITM হস্তক্ষেপের জন্য প্রার্থী:
| CLI | কারণ |
| ------------------- | ------------------------------------------------------ |
| windsurf | BYOK নির্বাচিত ক্লড মডেল + কর্পোরেট URL/token সীমাবদ্ধ |
| amp | বন্ধ ইকোসিস্টেম (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO প্রমাণীকরণ, কাস্টম URL নেই |
| cowork | অ্যানথ্রোপিক ডেস্কটপ, কনফিগারযোগ্য এন্ডপয়েন্ট নেই |
সম্পূর্ণ ক্রস-রেফারেন্সের জন্য `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` দেখুন।
---
## 5. ব্যাচ ডিটেকশন API
সমস্ত টুল ডিটেকশন একটি একক এন্ডপয়েন্টের মাধ্যমে একত্রিত হয়:
**`GET /api/cli-tools/all-statuses`**
- অথরাইজেশন: `requireCliToolsAuth(request)` (অন্যান্য `/api/cli-tools/` রুটের মতো)
- রিটার্ন: `Record<toolId, ToolBatchStatus>` (টাইপ: `src/shared/types/cliBatchStatus.ts`)
- কৌশল: `Promise.all` সমস্ত টুলের উপর, প্রতি টুলে ৫ সেকেন্ডের টাইমআউট
- ক্যাশে: ইন-মেমরি LRU কনফিগারেশন ফাইল `mtime` দ্বারা সূচীকৃত। mtime পরিবর্তিত হলে ক্যাশে অবৈধ হয়। সার্ভার পুনরায় চালু হলে রিসেট হয়।
প্রতি টুলের জন্য প্রতিক্রিয়া আকার:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // স্যানিটাইজড, কোন স্ট্যাক ট্রেস নেই
}
```
## 6. নতুন টুলের জন্য সেটিংস হ্যান্ডলার
`configType: "custom"` সহ নতুন টুলগুলির জন্য নির্দিষ্ট সেটিংস API রুট রয়েছে:
| রুট | টুল |
| ------------------------------------------- | ----------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url ফ্ল্যাগ) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, পুরনো) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, প্রাথমিক + পুরনো `~/.deepseek` সিঙ্ক) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi কোডিং এজেন্ট |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + নির্দিষ্ট `.env` কী) |
সমস্ত রুট `sanitizeErrorMessage()` ব্যবহার করে ত্রুটি প্রতিক্রিয়ার জন্য (Hard Rule #12)।
---
## 7. ড্যাশবোর্ড পৃষ্ঠার স্থাপত্য
### CLI কোডের (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — সার্ভার কম্পোনেন্ট
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — ক্লায়েন্ট গ্রিড
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — টুলের বিস্তারিত পৃষ্ঠা
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12টি বিশেষায়িত টুল কার্ড + `ToolDetailClient.tsx`
### CLI এজেন্টস (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — সার্ভার কম্পোনেন্ট
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — ক্লায়েন্ট গ্রিড
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx``ToolDetailClient` পুনরায় ব্যবহার করে
### ACP এজেন্টস (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — সার্ভার কম্পোনেন্ট (এজেন্টস/ থেকে স্থানান্তরিত)
### শেয়ার্ড UI কম্পোনেন্টস (`src/shared/components/cli/`)
| ফাইল | উদ্দেশ্য |
| ----------------------- | ------------------------------------------------------- |
| `CliToolCard.tsx` | স্মার্ট স্ট্যাটাস কার্ড (ডিটেকশন + কনফিগ + এন্ডপয়েন্ট) |
| `CliConceptCard.tsx` | প্রতি পৃষ্ঠার ধারণা ব্যাখ্যা কার্ড |
| `CliComparisonCard.tsx` | CLI প্রকারগুলির মধ্যে তিন কলামের তুলনা |
| `BaseUrlSelect.tsx` | এন্ডপয়েন্ট ড্রপডাউন (লোকাল/ক্লাউড/কাস্টম) |
| `ApiKeySelect.tsx` | API কী সিলেক্টর |
| `ManualConfigModal.tsx` | কপি করার জন্য কনফিগ স্নিপেট মডাল |
### শেয়ার্ড হুক (`src/shared/hooks/cli/`)
| ফাইল | উদ্দেশ্য |
| ------------------------- | ----------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | `/api/cli-tools/all-statuses` ফেচ করে, লোডিং/রিফ্রেশ স্টেট পরিচালনা করে |
---
## 8. i18n
নতুন নামস্থানগুলি পরিকল্পনা 14 F9-এ যোগ করা হয়েছে:
| Namespace | Purpose |
| ----------- | ---------------------------------------------------------------------------- |
| `cliCommon` | শেয়ার করা স্ট্রিং (কার্ড লেবেল, ধারণা/তুলনা টেক্সট, বিস্তারিত পৃষ্ঠা লেবেল) |
| `cliCode` | CLI কোডের পৃষ্ঠা স্ট্রিং |
| `cliAgents` | CLI এজেন্টস পৃষ্ঠা স্ট্রিং |
| `acpAgents` | ACP এজেন্টস পৃষ্ঠা স্ট্রিং |
পূর্ণ PT-BR এবং EN অনুবাদ প্রদান করা হয়েছে। 39 অন্যান্য লোকাল স্বয়ংক্রিয়ভাবে EN-এ ফিরে যায় `src/i18n/request.ts`-এ নামস্থান-স্তরের মার্জের মাধ্যমে।
---
## 9. দ্রুত শুরু
### পদক্ষেপ 1 — একটি OmniRoute API কী পান
1. `/dashboard/api-manager` খুলুন → **API কী তৈরি করুন**
2. একটি নাম দিন (যেমন `cli-tools`) এবং সমস্ত অনুমতি নির্বাচন করুন
3. কীটি কপি করুন — আপনাকে নিচের প্রতিটি CLI-এর জন্য এটি প্রয়োজন হবে
> আপনার কী এরূপ দেখায়: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### পদক্ষেপ 2 — CLI টুলগুলি ইনস্টল করুন
সমস্ত npm-ভিত্তিক টুলের জন্য Node.js 22.22.2+ বা 24.x প্রয়োজন:
```bash
# Claude Code (Anthropic)
@@ -98,96 +338,137 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (launchable via `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Rust-based
# Pi coding agent
# see https://github.com/zechnerj/pi-coding-agent for install
# jcode
# see https://github.com/1jehuang/jcode for install
```
---
## Step 3 — Set Global Environment Variables
### পদক্ষেপ 3 — ড্যাশবোর্ডের মাধ্যমে কনফিগার করুন
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. `http://localhost:20128/dashboard/cli-code` এ যান
2. গ্রিডে আপনার টুলটি খুঁজুন
3. টুলের বিস্তারিত পৃষ্ঠা খুলতে কার্ডে ক্লিক করুন
4. আপনার API কী এবং বেস URL নির্বাচন করুন
5. **কনফিগ প্রয়োগ করুন** বা ম্যানুয়াল কনফিগ স্নিপেট কপি করুন
---
### পদক্ষেপ 4 — গ্লোবাল এনভায়রনমেন্ট ভেরিয়েবল সেট করুন
```bash
# OmniRoute Universal Endpoint
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI reads GOOGLE_GEMINI_BASE_URL at the ROOT (its SDK appends /v1beta/... itself)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> একটি **রিমোট সার্ভার** এর জন্য `localhost:20128` কে সার্ভারের IP বা ডোমেইন দিয়ে প্রতিস্থাপন করুন,
> যেমন `http://<your-server-ip>:20128`
---
## Step 4 — Configure Each Tool
### পদক্ষেপ 4 — প্রতিটি টুল কনফিগার করুন
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Create ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
Claude Code-এর জন্য একক Anthropic গেটওয়ে রুট ব্যবহার করুন। এখানে `/v1` যোগ করবেন না।
**পরীক্ষা:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
মডার্ন Codex (v0.137+) শুধুমাত্র `~/.codex/config.toml` পড়ে — পুরানো
`config.yaml` লিগ্যাসি npm CLI-এর জন্য এবং নীরবে উপেক্ষা করা হয়। API
কী `OMNIROUTE_API_KEY` এনভায়রনমেন্ট ভেরিয়েবলে (`env_key`) থাকে, কখনও
ফাইলে নয়:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
পূর্ণ রেফারেন্স (প্রোফাইল, `wire_api`, প্রসঙ্গ উইন্ডো): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md)।
**পরীক্ষা:** `codex "what is 2+2?"`
---
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `codex "what is 2+2?"`
**পরীক্ষা:** `opencode`
> চিন্তার ভেরিয়েন্ট পাঠানোর জন্য `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high` ব্যবহার করুন।
---
### OpenCode
#### Cline (CLI বা VS Code)
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
EOF
```
**Test:** `opencode`
---
### Cline (CLI or VS Code)
**CLI mode:**
**CLI মোড:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +480,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**VS Code মোড:**
Cline এক্সটেনশন সেটিংস → API প্রদানকারী: `OpenAI Compatible`বেস URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard**CLI Tools → Cline → Apply Config**.
অথবা OmniRoute ড্যাশবোর্ড ব্যবহার করুন**CLI Tools → Cline → Apply Config**
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI বা VS Code)
**CLI mode:**
**CLI মোড:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**VS Code সেটিংস:**
```json
{
@@ -223,13 +504,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard**CLI Tools → KiloCode → Apply Config**.
অথবা OmniRoute ড্যাশবোর্ড ব্যবহার করুন**CLI Tools → KiloCode → Apply Config**
---
### Continue (VS Code Extension)
#### Continue (VS Code Extension)
Edit `~/.continue/config.yaml`:
`~/.continue/config.yaml` সম্পাদনা করুন:
```yaml
models:
@@ -241,158 +522,252 @@ models:
default: true
```
Restart VS Code after editing.
সম্পাদনার পর VS Code পুনরায় চালু করুন।
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
যখন VS Code Insiders কাস্টম এন্ডপয়েন্ট মডেলের জন্য কনফিগার করা হয় এবং আপনি OmniRoute-কে কাস্টম হেডার ফিল্ড ছাড়াই কাজ করতে চান তখন এটি ব্যবহার করুন।
**প্রস্তাবিত অবস্থান:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**টোকেনাইজড OmniRoute অ্যালিয়াস ব্যবহার করে উদাহরণ:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**নোট:**
- `sk-your-omniroute-key` কে OmniRoute-এ তৈরি করা একটি API কী দিয়ে প্রতিস্থাপন করুন।
- `url` ক্ষেত্রটি `/api/v1/vscode/{token}/chat/completions` নির্দেশ করা উচিত।
- `modelsUrl` ক্ষেত্রটি `/api/v1/vscode/{token}/models` নির্দেশ করা উচিত।
- ক্লায়েন্ট কাস্টম হেডার সমর্থন করলে সাধারণ `/v1` + Bearer হেডার প্রবাহকে অগ্রাধিকার দিন।
- URL-এ এম্বেড করা টোকেনগুলি একটি সামঞ্জস্যপূর্ণ ব্যাকআপ এবং সম্পাদক লগ বা প্রক্সি ইতিহাসে প্রদর্শিত হতে পারে।
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# আপনার AWS/Kiro অ্যাকাউন্টে লগইন করুন:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI তার নিজস্ব অথেন্টিকেশন ব্যবহার করে — Kiro CLI-এর জন্য OmniRoute প্রয়োজন নেই।
# অন্যান্য টুলের জন্য OmniRoute-এর সাথে kiro-cli ব্যবহার করুন।
kiro-cli status
```
---
**Kiro IDE** ডেস্কটপ অ্যাপের জন্য, OmniRoute দ্বারা প্রকাশিত MITM এন্ডপয়েন্ট ব্যবহার করুন
`/dashboard/cli-tools → Kiro` এর অধীনে।
### Qwen Code (Alibaba)
## 10. অভ্যন্তরীণ OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
`omniroute` বাইনারিটি সার্ভার জীবনচক্র, সেটআপ, ডায়াগনস্টিকস এবং প্রদানকারী ব্যবস্থাপনার জন্য কমান্ড প্রদান করে। প্রবেশ পয়েন্ট: `bin/omniroute.mjs`
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # সার্ভার শুরু করুন (ডিফল্ট পোর্ট 20128)
omniroute setup # ইন্টারেক্টিভ সেটআপ উইজার্ড
omniroute doctor # কনফিগ, DB, পোর্ট, রানটাইম পরীক্ষা করুন
omniroute providers list # কনফিগার করা প্রদানকারী সংযোগ
omniroute providers test-all # প্রতিটি সক্রিয় সংযোগ পরীক্ষা করুন
omniroute reset-password # প্রশাসক পাসওয়ার্ড পুনরায় সেট করুন
omniroute logs # অনুরোধ লগ স্ট্রিম করুন
omniroute health # বিস্তারিত স্বাস্থ্য (ব্রেকার, ক্যাশে, মেমরি)
omniroute --version # সংস্করণ মুদ্রণ করুন
omniroute --help # সমস্ত কমান্ড দেখান
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### সেটআপ এবং প্রাথমিককরণ
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # ইন্টারেক্টিভ সেটআপ উইজার্ড
omniroute setup --non-interactive # CI/অটোমেশন মোড (এনভ ভ্যার + ফ্ল্যাগ পড়ে)
omniroute setup --password '<value>' # প্রশাসক পাসওয়ার্ড সরাসরি সেট করুন
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # একবারে একটি প্রদানকারী যোগ করুন এবং পরীক্ষা করুন
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
নন-ইন্টারেক্টিভ সেটআপের জন্য স্বীকৃত পরিবেশ ভেরিয়েবল:
**Test:** `qwen "say hello"`
| Var | উদ্দেশ্য |
| ------------------- | -------------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | প্রদানকারী API কী (কমান্ডার `.env()` এর মাধ্যমে `--api-key` এর সাথে বাঁধা) |
| `DATA_DIR` | OmniRoute ডেটা ডিরেক্টরি ওভাররাইড করুন |
### Cursor (Desktop App)
অন্যান্য সমস্ত নন-ইন্টারেক্টিভ ইনপুট ফ্ল্যাগ হিসাবে পাস করা হয়, পরিবেশ ভেরিয়েবল নয়:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(উপরের `omniroute setup` অপশনগুলি দেখুন)।
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## Solución de Problemas
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### ডায়াগনস্টিকস
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # কনফিগ, DB, পোর্ট, রানটাইম, মেমরি, জীবন্ততা পরীক্ষা করুন
omniroute doctor --json # মেশিন-পঠনযোগ্য JSON
omniroute doctor --no-liveness # HTTP স্বাস্থ্য প্রোব বাদ দিন
omniroute doctor --host 0.0.0.0 # জীবন্ততা হোস্ট ওভাররাইড করুন
omniroute doctor --liveness-url <url> # সম্পূর্ণ স্বাস্থ্য এন্ডপয়েন্ট URL ওভাররাইড
```
ডাক্তার এই পরীক্ষা চালায়: `কনফিগ`, `ডেটাবেস`, `স্টোরেজ/এনক্রিপশন`,
`পোর্টের প্রাপ্যতা`, `নোড রানটাইম`, `স্থানীয় বাইনারি` (better-sqlite3),
`মেমরি`, এবং `সার্ভার জীবন্ততা`। যদি কোন পরীক্ষা `ব্যর্থ` হয় তবে এটি নন-জিরো এন্ট্রি করে।
### প্রদানকারী ব্যবস্থাপনা
```bash
omniroute providers available # OmniRoute প্রদানকারী ক্যাটালগ
omniroute providers available --search openai # আইড/নাম/অ্যালিয়াস/শ্রেণী দ্বারা ক্যাটালগ ফিল্টার করুন
omniroute providers available --category api-key # শ্রেণী দ্বারা ফিল্টার করুন (api-key, oauth, free, ...)
omniroute providers available --json # মেশিন-পঠনযোগ্য JSON
omniroute providers list # কনফিগার করা প্রদানকারী সংযোগ
omniroute providers list --json
omniroute providers test <id|name> # একটি কনফিগার করা সংযোগ পরীক্ষা করুন
omniroute providers test-all # প্রতিটি সক্রিয় সংযোগ পরীক্ষা করুন
omniroute providers validate # স্থানীয়-শুধুমাত্র কাঠামোগত যাচাইকরণ
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # বিদ্যমান OAuth প্রবাহ
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` API-প্রথম এবং তাই সক্রিয় স্থানীয় বা দূরবর্তী প্রসঙ্গে কাজ করে। শংসাপত্র ইনপুট ব্যবহার করা উচিত
`--credential-stdin` বা `--credential-env`; `--dry-run --json` শুধুমাত্র
রিড্যাক্টেড উপস্থিতি/আকৃতি রিপোর্ট করে। `providers available` OmniRoute ক্যাটালগ পড়ে;
`providers list/test/test-all/validate` তাদের স্থানীয় SQLite আচরণ বজায় রাখে এবং
সার্ভার চালু থাকতে হবে না।
### পুনরুদ্ধার এবং পুনরায় সেট
```bash
omniroute reset-password # প্রশাসক পাসওয়ার্ড পুনরায় সেট করুন (এছাড়াও: omniroute-reset-password)
omniroute reset-encrypted-columns # এনক্রিপ্ট করা শংসাপত্র পুনরায় সেট করার জন্য সতর্কতা + ড্রাই-রান দেখান
omniroute reset-encrypted-columns --force # সত্যিই SQLite-এ এনক্রিপ্ট করা শংসাপত্রগুলি শূন্য করুন
```
### শংসাপত্র রপ্তানি (⚠ সাবধানতার সাথে পরিচালনা করুন)
```bash
omniroute auth export # সতর্কতা + নিশ্চিতকরণ গেট দেখান — DB অ্যাক্সেস নেই
omniroute auth export --force # সমস্ত সংযোগের ডিক্রিপ্টেড শংসাপত্র stdout এ JSON হিসাবে রপ্তানি করুন
omniroute auth export --force --id <id> # শুধুমাত্র মেলানো সংযোগ রপ্তানি করুন
omniroute auth export --force --format env # OMNIROUTE_<PROVIDER>_<FIELD>=<value> লাইন তৈরি করুন
omniroute auth export --force --out creds.json # একটি ফাইলে লিখুন (0600 অনুমতিসহ তৈরি করা হয়েছে)
```
`auth export` হল **স্থানীয়-শুধুমাত্র** (সরাসরি SQLite পড়া, কোন HTTP রুট নেই) এবং ইচ্ছাকৃতভাবে মুদ্রণ/লিখে
**প্লেইনটেক্সট** `apiKey`/`accessToken`/`refreshToken`/`idToken` মান — এটি বৈশিষ্ট্য, ত্রুটি নয়। কিছুই ডেটাবেস থেকে পড়া হয় না, এবং কিছুই ডিক্রিপ্ট করা হয় না, `--force` ছাড়া। একটি stderr
সতর্কতা ব্যানার সর্বদা প্লেইনটেক্সট মুদ্রণের আগে মুদ্রণ করে। `STORAGE_ENCRYPTION_KEY` সেট করা আবশ্যক। একটি ক্ষেত্র যা ডিক্রিপ্ট করতে ব্যর্থ হয় (পুরানো কী, ক্ষতিগ্রস্ত সাইফারটেক্সট) রিপোর্ট করা হয়
`<field>DecryptFailed: true` হিসাবে সম্পূর্ণ রপ্তানি বন্ধ করার পরিবর্তে বা অন্তর্নিহিত ত্রুটি ফাঁস করার পরিবর্তে।
### অন্যান্য সাবকমান্ড
এইগুলি একটি চলমান OmniRoute সার্ভার অনুমান করে, অন্যথায় উল্লেখ না করা হলে:
```bash
omniroute status # ব্যাপক রানটাইম স্ট্যাটাস
omniroute logs # অনুরোধ লগ স্ট্রিম (--json, --search, --follow)
omniroute config show # বর্তমান কনফিগারেশন প্রদর্শন করুন
omniroute provider list # উপলব্ধ প্রদানকারীর তালিকা (প্রদানকারীর তালিকার অ্যালিয়াস)
omniroute provider add # একটি সরঞ্জামে প্রদানকারী হিসাবে OmniRoute নিবন্ধন করুন
omniroute keys add | list | remove # API কী পরিচালনা করুন
omniroute models [provider] # মডেল তালিকা (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # কনফিগ + DB এর স্ন্যাপশট
omniroute restore # পূর্ববর্তী স্ন্যাপশট থেকে পুনরুদ্ধার করুন
omniroute health # বিস্তারিত স্বাস্থ্য (ব্রেকার, ক্যাশে, মেমরি)
omniroute quota # প্রদানকারী কোটা ব্যবহার
omniroute cache # ক্যাশে স্ট্যাটাস
omniroute cache clear # সেমান্টিক + স্বাক্ষর ক্যাশে পরিষ্কার করুন
omniroute mcp status | restart # MCP সার্ভারের স্ট্যাটাস / পুনরায় শুরু করুন
omniroute a2a status | card # A2A সার্ভারের স্ট্যাটাস / এজেন্ট কার্ড
omniroute tunnel list | create | stop # টানেল পরিচালনা করুন (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # এনভ ভ্যারস পরিদর্শন / সেট করুন (অস্থায়ী)
omniroute test # প্রদানকারী সংযোগের ধোঁয়া পরীক্ষা
omniroute update # আপডেটের জন্য পরীক্ষা করুন
omniroute completion # শেল সম্পূর্ণতা তৈরি করুন
```
### সাধারণ ফ্ল্যাগ
| ফ্ল্যাগ | বর্ণনা |
| ------------------- | --------------------------------------------------------- |
| `--no-open` | শুরুতে ব্রাউজার স্বয়ংক্রিয়ভাবে খুলবেন না |
| `--port <n>` | API পোর্ট ওভাররাইড করুন (ডিফল্ট 20128) |
| `--mcp` | stdio এর মাধ্যমে MCP সার্ভার হিসাবে চালান (IDE এর জন্য) |
| `--non-interactive` | CI মোড (কোনো প্রম্পট নেই; এনভ/ফ্ল্যাগ থেকে পড়ে) |
| `--json` | মেশিন-পঠনযোগ্য JSON আউটপুট (ডাক্তার, প্রদানকারী, ইত্যাদি) |
| `--help`, `-h` | কমান্ড-নির্দিষ্ট সহায়তা দেখান |
| `--version`, `-v` | ইনস্টল করা সংস্করণ মুদ্রণ করুন |
---
## উপলব্ধ API এন্ডপয়েন্ট
| এন্ডপয়েন্ট | বর্ণনা | ব্যবহারের জন্য |
| -------------------------- | -------------------------------------- | ------------------------------------ |
| `/v1/chat/completions` | স্ট্যান্ডার্ড চ্যাট (সমস্ত প্রদানকারী) | সমস্ত আধুনিক টুল |
| `/v1/responses` | প্রতিক্রিয়া API (OpenAI ফরম্যাট) | কোডেক্স, এজেন্টিক ওয়ার্কফ্লো |
| `/v1/completions` | পুরানো টেক্সট সম্পূর্ণকরণ | পুরানো টুলগুলি `prompt:` ব্যবহার করে |
| `/v1/embeddings` | টেক্সট এম্বেডিং | RAG, অনুসন্ধান |
| `/v1/images/generations` | ইমেজ উৎপাদন | GPT-Image, Flux, ইত্যাদি |
| `/v1/audio/speech` | টেক্সট-টু-স্পিচ | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | স্পিচ-টু-টেক্সট | Deepgram, AssemblyAI |
পেস্ট করার জন্য প্রস্তুত উদাহরণ একটি টোকেনাইজড OmniRoute URL সহ:
```txt
Token example: sk-a3ab3c080beaee3a-69f4a4-070d71af
Standard OpenAI base: http://localhost:20128/v1
VS Code models: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code responses: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama tags: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## সমস্যা সমাধান
| ত্রুটি | কারণ | সমাধান |
| ------------------------------------------------ | ------------------------ | -------------------------------------------------------------- |
| `Connection refused` | OmniRoute চলছে না | `omniroute serve` |
| `401 Unauthorized` | ভুল API কী | `/dashboard/api-manager` এ চেক করুন |
| `No combo configured` | সক্রিয় রাউটিং কম্বো নেই | `/dashboard/combos` এ সেট আপ করুন |
| CLI "not installed" দেখায় | বাইনারি PATH এ নেই | `which <command>` চেক করুন |
| ইনস্টল করার পরে ড্যাশবোর্ড "not detected" দেখায় | ক্যাশে পুরনো | ড্যাশবোর্ডে "⟳ Refresh detection" ক্লিক করুন |
| পুরানো লিঙ্ক `/dashboard/cli-tools` | Pre-v3.8.6 বুকমার্ক | `/dashboard/cli-code` এ স্বয়ংক্রিয়ভাবে পুনঃনির্দেশিত (308) |
| পুরানো লিঙ্ক `/dashboard/agents` | Pre-v3.8.6 বুকমার্ক | `/dashboard/acp-agents` এ স্বয়ংক্রিয়ভাবে পুনঃনির্দেশিত (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,326 @@
# CLI-INTEGRATIONS (Čeština)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI Integrace — nasměrujte jakýkoli kódovací CLI na OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Integrace
OmniRoute dodává rodinu příkazů `setup-*`, které konfiguruje kódovací
CLI (Codex, Claude Code, OpenCode, Cline, …) pro použití OmniRoute jako svého backendu — takže
nástroj komunikuje s **jedním** koncovým bodem a OmniRoute směruje k správnému poskytovateli s
automatickým zálohováním. Každý příkaz čte **živý** katalog modelů z běžícího
OmniRoute (místního nebo vzdáleného) a zapisuje vlastní konfigurační soubor nástroje na **vašem**
počítači. API klíč je odkazován proměnnou prostředí, kdekoliv to nástroj podporuje. Příkazy, které uchovávají místní soubor prostředí nástroje, jsou uvedeny níže.
K dispozici je také generický spouštěč — `omniroute run <target>` — který spouští
`claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` nebo `gemini` s
odpovídajícím prostředím, aniž by zapisoval jakoukoli konfiguraci. Cíle a jejich
aliasy pocházejí z kanonického manifestu `bin/cli/cli-manifest.mjs`
(`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`,
`open-code`, `qwen-code`, `gemini-cli`), a `omniroute completion` nabízí
stejné cílové výrazy odvozené z manifestu. Dědictví per-tool spouštěče —
`omniroute launch` (Claude Code) a `omniroute launch-codex` (Codex) — zůstávají
k dispozici.
Onboarding poskytovatele je k dispozici ze stejného místního/vzdáleného kontextu. Příkazy
API-first níže udržují autentizaci správy oddělenou od pověření poskytovatele a nikdy
nevytištějí pověření ve strukturovaném výstupu:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
Pro skripty preferujte `--credential-stdin` nebo `--credential-env`; `--credential`
je zachováno pro kontrolované místní použití. `providers remove` vyžaduje `--yes` na
neinteraktivním terminálu a všech pět příkazů ctí aktivní kontext nebo globální
možnosti `--base-url`/`--api-key`.
Pro jednorázové, ručně psané základní nastavení dvou nejbohatších integrací viz
hloubkové analýzy per-tool:
- [Konfigurace Claude Code](./CLAUDE-CODE-CONFIGURATION.md)
- [Konfigurace Codex CLI](./CODEX-CLI-CONFIGURATION.md)
- [Vzdálený režim](./REMOTE-MODE.md) — ovládejte vzdálený OmniRoute (VPS / Tailnet) ze svého laptopu
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — rozšíření OmniCopilot; může také spouštět tyto
`setup-*` příkazy za vás zevnitř editoru
---
## Hlavní tabulka
Každý příkaz ctí **aktivní kontext** (nastavený pomocí `omniroute connect`, viz
[Remote Mode](./REMOTE-MODE.md)) nebo explicitní příznaky `--remote <url> --api-key <key>`.
"Lokální vs vzdálený" níže znamená: bez příznaků cílí na `http://localhost:20128`;
s `--remote` (nebo aktivním vzdáleným kontextem) získává katalog z tohoto
serveru a zapisuje konfiguraci lokálně.
| Příkaz | Nástroj | Co zapisuje | Klíčové příznaky | Lokální vs vzdálený |
| -------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — jeden profil pro každý kompatibilní textový model (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | Oba |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — jeden profil pro každý odpovídající model (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | Oba |
| `omniroute setup-opencode` | OpenCode (openai-kompatibilní) | `~/.config/opencode/opencode.json``omniroute` poskytovatel se všemi modely katalogu (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | Oba |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI režim) + tiskne nastavení rozšíření VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | Oba |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + slučuje `kilocode.*` do `settings.json` VS Code, pokud je přítomno | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | Oba |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` modely, klíč přes `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Oba |
| `omniroute setup-cursor` | Cursor | Nic — tiskne kroky v aplikaci (konfigurace Cursor je neprůhledná SQLite) | `--remote` `--api-key` `--only` `--port` | Oba |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (import doc) + nastaví `roo-cline.autoImportSettingsPath`, pokud existuje `settings.json` VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | Oba |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-compat` poskytovatel, klíč přes `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Oba |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + tiskne recept pro prostředí | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Oba |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + tiskne recept pro prostředí | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Oba |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai` pole + `OMNIROUTE_API_KEY` v `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | Oba |
| `omniroute run <target>` | Runtime launch (generic) | Nic — spouští `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` s odpovídajícím prostředím a argumenty; Qwen a Gemini používají dočasný izolovaný domov | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | Oba |
| `omniroute launch` | Claude Code | Nic — spouští `claude` s `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` injektovaným | `--remote` `--api-key` `--token` `--profile` `--port` | Oba |
| `omniroute launch-codex` | OpenAI Codex CLI | Nic — spouští `codex` s poskytovatelem `omniroute` injektovaným pomocí `-c` příznaků | `--remote` `--api-key` `--profile` (`-p`) `--port` | Oba |
Poznámky k příznakům (ověřeno ve zdroji příkazů):
- `--remote <url>` — získává katalog z vzdáleného OmniRoute (přepisuje `--port`
a aktivní kontext). `--api-key <key>` dodává pověření pro tento
server (výchozí hodnota je proměnná prostředí `OMNIROUTE_API_KEY`, nebo token aktivního kontextu).
- `--only <patterns>` — čárkami oddělené podřetězce; uchová pouze ID modelů, které odpovídají
(např. `--only glm,kimi`). K dispozici na `setup-codex`, `setup-claude`,
`setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`.
- `--dry-run` — tiskne přesně to, co by bylo zapsáno, aniž by se dotýkalo
souborového systému. K dispozici na každém příkazu `setup-*` **kromě** `setup-cursor`
(který nikdy nezapisuje soubor).
- `--model <id>` — vyžaduje se (nebo se vybírá interaktivně) pro nástroje, které nemají
automatické objevování modelů: Cline, Kilo, Roo, Goose, Qwen, Aider. Tyto nástroje
také přijímají `--yes` pro neinteraktivní běhy (což pak vyžaduje `--model`).
`setup-opencode` bere `--model` pro nastavení výchozího nejvyššího modelu.
- `--model <id>` na `omniroute run` následuje propojení per-target manifestu
(`bin/cli/cli-manifest.mjs`): **aider** přijímá `--model openai/<id>` a
**opencode** `--model omniroute/<id>` (prefix je přidán pouze tehdy, když id
jej již nenese); **qwen** a **gemini** přijímají id doslovně;
**claude** jej získává přes `ANTHROPIC_MODEL`, **goose** přes `GOOSE_MODEL`, a
**codex** přes `-c model_providers.omniroute.*` argumenty. **Qwen je jediným cílem běhu,
který tvrdě vyžaduje `--model`** — `omniroute run qwen` bez něj končí
`2` s explicitní chybou.
- `--port <port>` — místní port OmniRoute (výchozí `20128`, ignorováno, když je nastaveno `--remote`).
Přítomno na všech `setup-*` a obou spouštěčích.
- Kódy ukončení `omniroute run`: vlastní kód ukončení podřízeného CLI je propagován
doslovně; `2` = neplatné argumenty (nepodporovaný cíl, chybějící požadovaný
`--model`, ochrana kontejneru); `127` = cílový binární soubor není v `PATH`;
`130`/`143`/`129`, když je spuštění ukončeno `SIGINT`/`SIGTERM`/`SIGHUP`;
`1` = jiná chyba při spuštění.
- Dva spouštěče (`launch`, `launch-codex`) přijímají `--profile <name>` pro výběr
profilu napsaného pomocí `setup-claude` / `setup-codex`, plus předávací argumenty pro
podkladový `claude` / `codex` binární soubor.
Interaktivní výběr je také sdílen recepty nastavení:
```bash
# Vyberte z aktivního místního nebo vzdáleného katalogu modelů a nakonfigurujte cíl.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` v současnosti deleguje na testované recepty pro `codex`, `claude`,
`opencode`, `qwen`, `aider`, `goose`, `cline`, `continue` a `kilo`. Pouze pro IDE,
MITM a pouze pro průvodce záznamy zůstávají explicitní `setup-*`/manuální toky a
nejsou prezentovány jako spouštěcí cíle.
> `setup-opencode` je **lehká openai-kompatibilní** integrace OpenCode.
> K dispozici je také bohatší pluginová integrace — `omniroute setup opencode` — která
> instaluje `@omniroute/opencode-plugin`. Jsou to různé příkazy; tabulka
> výše dokumentuje `setup-opencode`.
---
## Místní použití
S OmniRoute běžícím na `localhost:20128`, stačí spustit příkaz pro nastavení vašeho
nástroje. Katalog je načten z místního serveru.
```bash
# Codex: zapisuje profil pro každý shodný model do ~/.codex/
omniroute setup-codex
codex --profile glm52 # použijte vygenerovaný profil
# Claude Code: zapisuje profily pro každý model, poté spustí jeden
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: zapisuje poskytovatele kompatibilního s openai se všemi modely katalogu
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # odkazováno přes {env:OMNIROUTE_API_KEY}, nikdy na disku
opencode -m omniroute/glm/glm-5.2 "..."
# Nástroje bez automatického objevování potřebují explicitní model:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Náhled bez zápisu čehokoliv:
omniroute setup-continue --dry-run
```
Spusťte bez zápisu jakékoli konfigurace (pouze injekce prostředí):
```bash
omniroute launch # Claude Code → místní OmniRoute
omniroute launch-codex # Codex CLI → místní OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "odpověď OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "odpověď OK"
omniroute run qwen --model glm/glm-5.2 -- -p "odpověď OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "odpověď OK"
# Explicitní cesta příkazu: předat cokoliv, co přijde po --
omniroute run claude -- --print-system-prompt "zkontrolujte tento rozdíl"
```
---
## Vzdálené použití
Nasměrujte jakýkoli příkaz pro nastavení na vzdálený OmniRoute s `--remote` + `--api-key`. Katalog je načten ze vzdáleného serveru; konfigurace je zapsána na vašem místním počítači.
```bash
# OpenCode proti vzdálenému VPS, ponechte pouze glm/kimi modely
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # nejprve exportujte OMNIROUTE_API_KEY
# Profily Codex z vzdáleného katalogu
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Spusťte CLI přímo proti vzdálenému
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
Místo předávání `--remote`/`--api-key` pokaždé, přihlaste se jednou a nechte
**aktivní kontext** je dodávat automaticky:
```bash
omniroute connect 192.168.0.15 # vytvoří token s omezeným rozsahem, uloží kontext
omniroute setup-codex # ← nyní používá vzdálený katalog
omniroute setup-opencode # ← stejné
omniroute launch # ← Claude Code proti vzdálenému
```
Viz [Vzdálený režim](./REMOTE-MODE.md) pro kontexty, rozsahy a správu tokenů.
---
## Konvence základní URL (které nástroje chtějí `/v1`)
OmniRoute vystavuje OpenAI rozhraní na `/v1`, Anthropic rozhraní na kořenové úrovni,
a nativní Gemini rozhraní na `/v1beta`. Každá integrace je připojena k formátu, který
je pro její nástroj očekáván (ověřeno ve zdroji příkazu):
| Integrace | Základní URL zapsáno | `/v1`? |
| -------------------------------------------------------------------------- | -------------------- | ------------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | kořen | Ne — Cline přidává `/v1/chat/completions` |
| `setup-goose` (`OPENAI_HOST`) | kořen | Ne — Goose přidává cestu |
| `setup-aider` (`OPENAI_API_BASE`) | kořen | Ne — LiteLLM přidává `/v1/chat/completions` |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | s `/v1` | Ano |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | kořen | Ne — Claude Code přidává `/v1/messages` |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | s `/v1` | Ano |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | s `/v1` | Ano |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | kořen | Ne — SDK přidává `/v1beta/models/…` |
---
## Udržování nativních závislostí při aktualizaci: `--include=optional`
Když aktualizujete pomocí `omniroute update` (po potvrzení nebo s `--apply`),
OmniRoute spouští instalaci s `--include=optional` zabudovaným:
```bash
npm install -g omniroute@latest --include=optional
```
To **není** příznak, který předáváte `omniroute update` — je vždy aplikován
aktualizátorem. Zaručuje, že `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, LLMLingua SLM stack) přežijí aktualizaci, i když je vaše npm konfigurace
nastavena na `omit=optional`, což by jinak tiše odstranilo nativní SQLite
ovladač a vazbu na OS-keyring. Chcete-li si prohlédnout přesný příkaz bez aplikace:
```bash
omniroute update --dry-run
# [DRY RUN] By běžel: npm install -g omniroute@latest --include=optional
```
Další příznaky `omniroute update` (ověřeno ve zdrojovém kódu): `--check` (ukončí s 1, pokud
je zastaralý), `--apply` (nainstaluje bez výzvy), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI přes `omniroute run gemini`
Smlouva ověřena proti `@google/gemini-cli` 0.50.0: CLI respektuje
`GOOGLE_GEMINI_BASE_URL` a vydává `POST /v1beta/models/<model>:generateContent`
(a `:streamGenerateContent?alt=sse`) proti němu — přesně jako nativní
Gemini rozhraní OmniRoute (`/v1beta`). `omniroute run gemini` to automaticky
propojuje:
- `GOOGLE_GEMINI_BASE_URL` → aktivní základní URL OmniRoute (kořen, žádné `/v1`);
- `GEMINI_API_KEY` → vyřešené pověření OmniRoute (volba/env/context);
- **dočasný izolovaný `GEMINI_CLI_HOME`**, jehož `.gemini/settings.json`
vybírá autentizaci `gemini-api-key`, takže uložená relace Google OAuth (Code Assist)
nikdy nepřepíše spuštění řízené OmniRoute — odstraněno po ukončení;
- **hygiena prostředí**: dětské prostředí je očištěno od `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` a `GOOGLE_GENAI_USE_GCA` (což by přesměrovalo
autentizaci na Vertex/Code Assist), a `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` je
nastaven jako záložní — ostatní cíle `run` dostávají stejnou
péči pro své vlastní konfliktní proměnné;
- injekce `--model <id>` z `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Ochrana důvěry pracovního prostoru Gemini stále platí v bezhlavém režimu — předejte
`--skip-trust` (nebo důvěřujte adresáři interaktivně) sami; spouštěč
úmyslně neobchází tuto ochranu. Tento spouštěč je odlišný od **registrace ACP**
(`src/lib/acp/registry.ts`, `gemini --acp`), která zůstává integrací agent-protokolu pro
`/dashboard/acp-agents`.
---
## Skutečné kouřové testy (opt-in)
Deterministické regresní testy plánu spuštění v CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). Pro ověření SKUTEČNÝCH binárních souborů proti SKUTEČNÉMU
serveru OmniRoute existuje opt-in rámec na
`tests/integration/upstream-cli-smoke.int.test.ts`. Nikdy se nespouští automaticky
(všechny podtesty přeskočí, pokud není `RUN_CLI_SMOKE=1`), předává pověření pomocí env-var
NAME (nikdy podle hodnoty), rediguje klíčové řetězce z jakéhokoli zaznamenaného výstupu, přeskočí
cíle, jejichž binární soubor není nainstalován, a klasifikuje selhání jako
auth / upstream / config místo holého booleanu:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
Volitelně: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` omezuje testování;
`OMNIROUTE_SMOKE_TIMEOUT_MS` přepisuje časový limit 120s na cíl.
## Viz také
- [Konfigurace Claude Code](./CLAUDE-CODE-CONFIGURATION.md) — hlubší průvodce Claude Code
- [Konfigurace Codex CLI](./CODEX-CLI-CONFIGURATION.md) — jednorázové základní nastavení `[model_providers.omniroute]`
- [Vzdálený režim](./REMOTE-MODE.md) — kontexty, přístupové tokeny s omezeným rozsahem, ovládání vzdáleného serveru
- [Reference nástrojů CLI](../reference/CLI-TOOLS.md) — kompletní katalog podporovaných nástrojů + stránky řídicího panelu
- [Průvodce nastavením](./SETUP_GUIDE.md) — metody instalace a onboarding při prvním spuštění

View File

@@ -1,86 +1,340 @@
# CLI Tools Setup Guide — OmniRoute (Čeština)
# CLI-TOOLS (Čeština)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI Nástroje — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Nástroje — OmniRoute
Poslední aktualizace: 2026-08-18
OmniRoute integruje tři kategorie CLI nástrojů rozložené na třech specializovaných stránkách dashboardu:
| Stránka | Trasa | Koncept | Počet |
| -------------- | ----------------------- | --------------------------------------------------------------------------------------------- | ----------- |
| **CLI Kód** | `/dashboard/cli-code` | Nástroje pro kódování, které směřujete na OmniRoute (Klient → CLI → OmniRoute → Poskytovatel) | 26 |
| **CLI Agenti** | `/dashboard/cli-agents` | Autonomní agenti, které směřujete na OmniRoute (stejný tok, širší rozsah) | 8 |
| **ACP Agenti** | `/dashboard/acp-agents` | CLIs, které OmniRoute spouští jako backend přes stdio/ACP (obrácený tok) | viz registr |
Zastaralé trasy přesměrovávají přes 308: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## Jak to funguje
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI Kód / CLI Agenti (tok spotřeby):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (vše směřuje na OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute směruje k správnému poskytovateli)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP Agenti (obrácený tok spuštění):
Klientský požadavek → OmniRoute → spouští CLI přes stdio/ACP → odpověď
```
**Benefits:**
**Výhody:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Jeden API klíč pro správu všech nástrojů
- Sledování nákladů napříč všemi CLIs v dashboardu
- Přepínání modelů bez přeconfigurování každého nástroje
- Funguje lokálně i na vzdálených serverech (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## Automatická konfigurace s `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
Nemusíte psát konfiguraci každého nástroje ručně. OmniRoute dodává příkaz `setup-*`
pro každý podporovaný CLI, který čte **živý** katalog modelů z běžícího
OmniRoute (lokálního nebo vzdáleného) a zapisuje vlastní konfiguraci nástroje na vašem stroji:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Každý přijímá `--remote <url> --api-key <key>` (konfigurovat lokální nástroj proti
vzdálenému OmniRoute), `--dry-run` (náhled bez zápisu) a `--port`. Nástroje
bez automatického objevování modelu (Cline, Kilo, Roo, Goose, Aider, Qwen) berou
`--model <id>` (a `--yes` pro neinteraktivní běhy). Pro spuštění CLI s
odpovídajícím prostředím a bez jakéhokoli zápisu konfigurace použijte generický
`omniroute run <target>` launcher (claude, codex, aider, goose, opencode, qwen,
gemini — cíle a aliasy pocházejí z `bin/cli/cli-manifest.mjs`); zastaralé
per-tool launchery `omniroute launch` (Claude Code) a `omniroute launch-codex`
(Codex) zůstávají k dispozici. Gemini CLI je pouze pro spuštění: je to cíl
`omniroute run`, ale nemá žádný `setup-*`/`configure` recept.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Úplná reference:** hlavní tabulka — co každý příkaz zapisuje, každý příznak,
> lokální vs vzdálený, a které nástroje chtějí příponu `/v1` — se nachází v
> **[CLI Integrace](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Spuštění těchto příkazů uvnitř kontejneru
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
Příkaz `setup-*` provedený uvnitř kontejneru OmniRoute zapisuje do
vlastního domova kontejneru, který žádný hostitelský CLI nečte a který zmizí s
kontejnerem. OmniRoute to detekuje a ukončuje s kódem `2` s instrukcemi místo
zápisu. Dva podporované způsoby vpřed — nainstalovat CLI na hostiteli a
`omniroute connect` do kontejneru, nebo bind-mount adresáře konfigurace a nastavit
`CLI_CONFIG_HOME` (profil compose `host`). Každý příkaz `setup-*`, plus
`omniroute configure` a `omniroute config set`, přijímá
`--allow-container-write`, když je skutečně zamýšleno konfigurovat vlastní CLIs
kontejneru; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` dělá to samé pro
server. Viz
[Docker Průvodce → Konfigurace hostitelských CLI nástrojů](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
**apply endpoint** dashboardu (`POST /api/cli-tools/apply`) vynucuje
stejnou ochranu: v kontejneru, zápis, jehož cíl není bind-mounted z hostitele,
odpovídá **`422`** s `containerEphemeralTarget: true`, bezpečným chybovým
textem a — pro nástroje s hostitelským receptem (claude, codex, opencode, cline,
kilo, continue) — `hostSetupCommand` (např. `omniroute setup-opencode`), který
se má spustit na hostiteli místo; nic není zapsáno. `dryRun: true` stále funguje
v režimu kontejneru a vrací vygenerovaný obsah + cílovou cestu bez dotyku disku,
takže si můžete prohlédnout z dashboardu a aplikovat na hostiteli. Toto chování je
úmyslné a chráněné regresí pomocí
`tests/unit/api/cli-tools/apply-container-guard.test.ts` — nikdy "neopravujte" 422
odstraněním ochrany.
---
## Step 1 — Get an OmniRoute API Key
## Zdroj pravdy
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
Jednotný katalog se nachází v `src/shared/constants/cliTools.ts` jako `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Každý záznam má tyto pole (definováno v `src/shared/schemas/cliCatalog.ts`):
| Pole | Typ | Popis |
| ----------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------- |
| `category` | `"code" \| "agent"` | Na které stránce se nástroj zobrazuje |
| `vendor` | `string` | Původ nástroje ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | Také použitelný jako ACP Agent (zobrazená ikona) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Úroveň podpory vlastního koncového bodu. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Mechanismus konfigurace |
| `id`, `name`, `color`, `description`, `docsUrl` | standard | Základní zobrazení polí |
Záznamy s `baseUrlSupport: "none"` **nejsou zobrazeny** na stránkách dashboardu — jsou registrovány v MITM backlogu pro plán 11 (viz `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Úrovně schopností (katalogizované × detekovatelné × konfigurovatelné × spustitelné)
Ne každý katalogizovaný nástroj je detekovatelný, konfigurovatelný nebo spustitelný. Každá úroveň má jeden
deklarující zdroj a test odchylek je udržuje v souladu:
| Úroveň | Význam | Deklarováno |
| -------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Katalogizované** | Zobrazuje se v katalogu dashboardu (název, dodavatel, dokumentace, typ konfigurace) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Detekovatelné** | Detekce binárních/config, kontroly zdraví, cesty k konfiguraci | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime catalog) |
| **Konfigurovatelné** | Podporováno `omniroute configure <cli>` (existuje recept na nastavení) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **Spustitelné** | Podporováno `omniroute run <target>` (definována injekce env/args) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` je kanonický spustitelný manifest pro příkazy CLI
povrchů: `run`, `configure` a generátory shell-completion odvozují své
seznamy cílů, rozlišení aliasů (například `kilocode`/`kilo-code`/`kilo_cli``kilo`)
a zapojení příznaku `--model` z něj. Ochrana proti odchylkám
`tests/unit/cli/cli-manifest-drift.test.ts` zajišťuje, že manifest, runtime
katalog, UI katalog a každý spotřebitelský povrch zůstávají synchronizovány — cíl přidaný do
jednoho povrchu bez ostatních způsobí selhání testu místo tichého odchýlení.
## 1. Katalog kódu CLI (26 nástrojů)
Všechny nástroje, které se objevují v `/dashboard/cli-code`. Ty, které mají `baseUrlSupport: none`, jsou propojeny prostřednictvím MITM nebo manuálního průvodce místo vlastního základního URL:
| id | název | dodavatel | baseUrlSupport | typKonfigurace | acpSpawnable |
| ------------ | ----------------------- | ------------------- | -------------- | -------------- | ------------ |
| claude | Claude Code | Anthropic | full | env | true |
| codex | OpenAI Codex CLI | OpenAI | full | custom | true |
| zcode | ZCode (GLM Coding Plan) | Z.ai | none | custom | false |
| cline | Cline | OSS (ex-Claude Dev) | full | custom | true |
| kilo | Kilo Code | Kilo-Org | full | custom | false |
| roo | Roo Code | Roo (OSS) | full | guide | false |
| continue | Continue | continue.dev | full | guide | false |
| aider | Aider | OSS (P. Gauthier) | full | guide | true |
| forge | ForgeCode | Antinomy HQ | full | custom | true |
| jcode | jcode | 1jehuang (OSS) | full | custom | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | full | custom | false |
| codewhale | CodeWhale | Hmbown (OSS) | full | custom | false |
| opencode | OpenCode | Anomaly (ex-SST) | full | guide | true |
| droid | Factory Droid | Factory AI | partial | guide | false |
| copilot | GitHub Copilot CLI | GitHub/MS | full | custom | false |
| cursor-cli | Cursor CLI | Anysphere | partial | guide | true |
| smelt | Smelt | leonardcser (OSS) | full | custom | false |
| pi | Pi (pi-coding-agent) | M. Zechner (OSS) | full | custom | false |
| grok-build | Grok Build | xAI | full | custom | false |
| crush | Crush | OSS (Charm) | full | custom | false |
| qwen | Qwen Code | Alibaba | full | guide | true |
| cursor | Cursor | Anysphere | none | guide | false |
| antigravity | Antigravity | Google | none | mitm | false |
| hermes | Hermes | Nous Research | none | guide | false |
| kiro | Kiro AI | Amazon | none | mitm | false |
| custom | Custom CLI | — | full | custom-builder | false |
Nástroje s `baseUrlSupport: "partial"` zobrazují odznak "⚠ Částečná základní URL" na kartě řídicího panelu.
## 2. Katalog CLI agentů (8 nástrojů)
Autonomní agenti, kteří se objevují v `/dashboard/cli-agents`:
| id | název | dodavatel | podporaBaseUrl | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | Hermes Agent | Nous Research | plná | false |
| openclaw | OpenClaw | OSS (P. Steinberger) | plná | true |
| goose | Goose | Block / Linux Foundation | plná | true |
| interpreter | Open Interpreter | OSS | plná | true |
| warp | Warp AI | Warp Inc. | částečná | true |
| agent-deck | Agent Deck | asheshgoplani (OSS) | plná | false |
| omp | Oh My Pi | OSS | plná | true |
| letta | Letta CLI | Letta | plná | false |
---
## Step 2 — Install CLI Tools
## 3. ACP agenti (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Tato stránka (přejmenována z `/dashboard/agents`) zobrazuje CLI, které může OmniRoute **vytvářet** jako backendové výkonné enginy prostřednictvím protokolu stdio/ACP. Katalog je udržován odděleně v `src/lib/acp/registry.ts` a **není** stejný jako `CLI_TOOLS`.
---
## 4. MITM backlog (není zobrazen v dashboardu)
Následující CLI nativně nepodporují vlastní základní URL a **nejsou uvedeny** na stránkách CLI kódu nebo CLI agentů. Jsou kandidáty na MITM interceptaci v plánu 11:
| CLI | Důvod |
| ------------------- | --------------------------------------------------------- |
| windsurf | BYOK omezeno na vybrané modely Claude + firemní URL/token |
| amp | Uzavřený ekosystém (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO autentizace, žádná vlastní URL |
| cowork | Anthropic Desktop, žádný konfigurovatelný koncový bod |
Viz `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` pro úplný křížový odkaz.
---
## 5. API pro detekci dávkových nástrojů
Všechny detekce nástrojů jsou agregovány prostřednictvím jednoho koncového bodu:
**`GET /api/cli-tools/all-statuses`**
- Auth: `requireCliToolsAuth(request)` (stejné jako ostatní `/api/cli-tools/` trasy)
- Vrací: `Record<toolId, ToolBatchStatus>` (typ: `src/shared/types/cliBatchStatus.ts`)
- Strategie: `Promise.all` pro všechny nástroje, 5s timeout na nástroj
- Cache: v paměti LRU indexováno podle konfiguračního souboru `mtime`. Cache je neplatná, když se mtime změní. Resetováno při restartu serveru.
Tvar odpovědi na nástroj:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // sanitizováno, žádné zásobníkové stopy
}
```
## 6. Zpracovatelé nastavení pro nové nástroje
Nové nástroje s `configType: "custom"` mají vyhrazené API trasy pro nastavení:
| Trasa | Nástroj |
| ------------------------------------------- | -------------------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legacy) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, primární + legacy `~/.deepseek` synchronizace) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi kódovací agent |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + vyhrazený `.env` klíč) |
Všechny trasy používají `sanitizeErrorMessage()` pro chybové odpovědi (Pevné pravidlo #12).
---
## 7. Architektura stránek dashboardu
### CLI Kód (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — serverová komponenta
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — klientská mřížka
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — stránka detailu nástroje
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 specializovaných karet nástrojů + `ToolDetailClient.tsx`
### CLI Agenti (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — serverová komponenta
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — klientská mřížka
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — znovu používá `ToolDetailClient`
### ACP Agenti (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — serverová komponenta (přesunuta z `agents/`)
### Sdílené UI komponenty (`src/shared/components/cli/`)
| Soubor | Účel |
| ----------------------- | ---------------------------------------------------------- |
| `CliToolCard.tsx` | Chytrá stavová karta (detekce + konfigurace + koncový bod) |
| `CliConceptCard.tsx` | Karta vysvětlení konceptu na stránce |
| `CliComparisonCard.tsx` | Srovnání ve třech sloupcích napříč typy CLI |
| `BaseUrlSelect.tsx` | Rozbalovací nabídka koncového bodu (Místní/Cloud/Vlastní) |
| `ApiKeySelect.tsx` | Výběr API klíče |
| `ManualConfigModal.tsx` | Modální okno pro kopírovatelný konfigurační úryvek |
### Sdílený hook (`src/shared/hooks/cli/`)
| Soubor | Účel |
| ------------------------- | ------------------------------------------------------------------------ |
| `useToolBatchStatuses.ts` | Načítá `/api/cli-tools/all-statuses`, spravuje stav načítání/aktualizace |
## 8. i18n
Nové namespace přidány v plánu 14 F9:
| Namespace | Účel |
| ----------- | ------------------------------------------------------------------------------------- |
| `cliCommon` | Sdílené řetězce (popisky karet, texty konceptů/porovnání, popisky detailních stránek) |
| `cliCode` | Řetězce stránek CLI kódu |
| `cliAgents` | Řetězce stránek CLI agentů |
| `acpAgents` | Řetězce stránek ACP agentů |
Úplné překlady do PT-BR a EN jsou k dispozici. 39 dalších lokalizací automaticky přechází na EN prostřednictvím sloučení na úrovni namespace v `src/i18n/request.ts`.
---
## 9. Rychlý start
### Krok 1 — Získejte API klíč OmniRoute
1. Otevřete `/dashboard/api-manager`**Vytvořit API klíč**
2. Dejte mu název (např. `cli-tools`) a vyberte všechna oprávnění
3. Zkopírujte klíč — budete ho potřebovat pro každý CLI níže
> Váš klíč vypadá takto: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Krok 2 — Nainstalujte CLI nástroje
Všechny nástroje založené na npm vyžadují Node.js 22.22.2+ nebo 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +352,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (spustitelné přes `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Založené na Rustu
# Pi coding agent
# viz https://github.com/zechnerj/pi-coding-agent pro instalaci
# jcode
# viz https://github.com/1jehuang/jcode pro instalaci
```
---
## Step 3 — Set Global Environment Variables
### Krok 3 — Nakonfigurujte přes Dashboard
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. Přejděte na `http://localhost:20128/dashboard/cli-code`
2. Najděte svůj nástroj v mřížce
3. Klikněte na kartu pro otevření detailní stránky nástroje
4. Vyberte svůj API klíč a základní URL
5. Klikněte na **Použít konfiguraci** nebo zkopírujte ručně konfigurační úryvek
---
### Krok 4 — Nastavte globální proměnné prostředí
```bash
# OmniRoute Universal Endpoint
# OmniRoute Univerzální koncový bod
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI čte GOOGLE_GEMINI_BASE_URL na ROOT (jeho SDK přidává /v1beta/... samo)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> Pro **vzdálený server** nahraďte `localhost:20128` IP adresou nebo doménou serveru,
> např. `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### Krok 4 — Nakonfigurujte každý nástroj
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Vytvořte ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
Použijte sjednocený kořen brány Anthropic pro Claude Code. Nepřidávejte zde `/v1`.
**Test:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
Moderní Codex (v0.137+) čte pouze `~/.codex/config.toml` — starý
`config.yaml` patří k legacy npm CLI a je tiše ignorován. API
klíč zůstává v proměnné prostředí `OMNIROUTE_API_KEY` (`env_key`), nikdy
uvnitř souboru:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
Úplná reference (profily, `wire_api`, kontextová okna): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Test:** `codex "what is 2+2?"`
---
### OpenCode
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `opencode`
> Použijte `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> pro odeslání variant myšlení.
---
### Cline (CLI or VS Code)
#### Cline (CLI nebo VS Code)
**CLI mode:**
**Režim CLI:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +495,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**Režim VS Code:**
Nastavení rozšíření Cline → Poskytovatel API: `OpenAI Compatible`Základní URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
Nebo použijte dashboard OmniRoute **CLI Tools → Cline → Použít konfiguraci**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI nebo VS Code)
**CLI mode:**
**Režim CLI:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**Nastavení VS Code:**
```json
{
@@ -223,13 +519,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
Nebo použijte dashboard OmniRoute **CLI Tools → KiloCode → Použít konfiguraci**.
---
### Continue (VS Code Extension)
#### Continue (rozšíření VS Code)
Edit `~/.continue/config.yaml`:
Upravte `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +537,257 @@ models:
default: true
```
Restart VS Code after editing.
Po úpravě restartujte VS Code.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Použijte toto, když je VS Code Insiders nakonfigurován pro vlastní modely koncových bodů a chcete, aby OmniRoute fungoval bez vlastního pole hlavičky.
**Doporučené umístění:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Příklad použití tokenizovaného aliasu OmniRoute:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Poznámky:**
- Nahraďte `sk-your-omniroute-key` API klíčem vytvořeným v OmniRoute.
- Pole `url` by mělo směřovat na `/api/v1/vscode/{token}/chat/completions`.
- Pole `modelsUrl` by mělo směřovat na `/api/v1/vscode/{token}/models`.
- Preferujte normální `/v1` + Bearer hlavičkový tok, když klient podporuje vlastní hlavičky.
- Tokeny vložené do URL jsou záložním řešením kompatibility a mohou se objevit v protokolech editoru nebo historii proxy.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# Přihlaste se ke svému účtu AWS/Kiro:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI používá vlastní autentizaci — OmniRoute není potřebný jako backend pro Kiro CLI samotné.
# Používejte kiro-cli spolu s OmniRoute pro další nástroje.
kiro-cli status
```
Pro desktopovou aplikaci **Kiro IDE** použijte MITM koncový bod vystavený OmniRoute
pod `/dashboard/cli-tools → Kiro`.
---
### Qwen Code (Alibaba)
## 10. Interní OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
Binární soubor `omniroute` poskytuje příkazy pro životní cyklus serveru, nastavení, diagnostiku a správu poskytovatelů. Vstupní bod: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Spustit server (výchozí port 20128)
omniroute setup # Interaktivní nastavení
omniroute doctor # Zkontrolovat konfiguraci, DB, porty, runtime
omniroute providers list # Seznam nakonfigurovaných připojení poskytovatelů
omniroute providers test-all # Otestovat každé aktivní připojení
omniroute reset-password # Resetovat heslo administrátora
omniroute logs # Streamovat logy požadavků
omniroute health # Podrobný stav (přerušovače, cache, paměť)
omniroute --version # Vytisknout verzi
omniroute --help # Zobrazit všechny příkazy
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Nastavení a inicializace
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # Interaktivní nastavení
omniroute setup --non-interactive # CI/automatizační režim (čte proměnné prostředí + příznaky)
omniroute setup --password '<value>' # Nastavit heslo administrátora přímo
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Přidat a otestovat poskytovatele v jednom kroku
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
Rozpoznané proměnné prostředí pro neinteraktivní nastavení:
**Test:** `qwen "say hello"`
| Var | Účel |
| ------------------- | ---------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | API klíč poskytovatele (svázaný s `--api-key` přes Commander `.env()`) |
| `DATA_DIR` | Přepsat adresář dat OmniRoute |
### Cursor (Desktop App)
Všechny ostatní neinteraktivní vstupy jsou předávány jako příznaky, nikoli jako proměnné prostředí:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(podívejte se na možnosti `omniroute setup` výše).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
### Diagnostika
Via GUI: **Settings → Models → OpenAI API Key**
```bash
omniroute doctor # Zkontrolovat konfiguraci, DB, porty, runtime, paměť, životnost
omniroute doctor --json # Strojově čitelný JSON
omniroute doctor --no-liveness # Přeskočit HTTP health probe
omniroute doctor --host 0.0.0.0 # Přepsat hostitele životnosti
omniroute doctor --liveness-url <url> # Úplné přepsání URL koncového bodu zdraví
```
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
Doktor provádí tyto kontroly: `Konfigurace`, `Databáze`, `Úložiště/šifrování`,
`Dostupnost portu`, `Node runtime`, `Nativní binární` (better-sqlite3),
`Paměť` a `Životnost serveru`. Ukončí se s nenulovým kódem, pokud jakákoli kontrola selže.
### Správa poskytovatelů
```bash
omniroute providers available # Katalog poskytovatelů OmniRoute
omniroute providers available --search openai # Filtrovat katalog podle id/název/alias/kategorie
omniroute providers available --category api-key # Filtrovat podle kategorie (api-key, oauth, free, ...)
omniroute providers available --json # Strojově čitelný JSON
omniroute providers list # Seznam nakonfigurovaných připojení poskytovatelů
omniroute providers list --json
omniroute providers test <id|name> # Otestovat jedno nakonfigurované připojení
omniroute providers test-all # Otestovat každé aktivní připojení
omniroute providers validate # Lokální strukturovaná validace
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Existující OAuth tok
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` jsou API-first a proto fungují proti
aktivnímu místnímu nebo vzdálenému kontextu. Vstup pro pověření by měl používat
`--credential-stdin` nebo `--credential-env`; `--dry-run --json` hlásí pouze
redigovanou přítomnost/tvar. `providers available` čte katalog OmniRoute;
`providers list/test/test-all/validate` si zachovávají své místní SQLite chování a
nevyžadují, aby server běžel.
### Obnova a reset
```bash
omniroute reset-password # Resetovat heslo administrátora (také: omniroute-reset-password)
omniroute reset-encrypted-columns # Zobrazit varování + dry-run pro reset šifrovaných pověření
omniroute reset-encrypted-columns --force # Opravuji šifrovaná pověření v SQLite
```
### Export pověření (⚠ zacházejte opatrně)
```bash
omniroute auth export # Zobrazit varování + potvrzovací bránu — žádný přístup k DB
omniroute auth export --force # ExportOVAT VŠECHNA DEŠIFROVANÁ pověření připojení do stdout jako JSON
omniroute auth export --force --id <id> # Exportovat pouze odpovídající připojení
omniroute auth export --force --format env # Vydat řádky OMNIROUTE_<PROVIDER>_<FIELD>=<value>
omniroute auth export --force --out creds.json # Zapsat do souboru (vytvořeno s 0600 oprávněními)
```
`auth export` je **pouze lokální** (přímé čtení SQLite, žádná HTTP trasa) a záměrně tiskne/zapisuje
**čistý text** `apiKey`/`accessToken`/`refreshToken`/`idToken` hodnoty — to je funkce, nikoli
chyba. Nic není čteno z databáze a nic není dešifrováno, bez `--force`. Varovný banner na stderr
se vždy tiskne před jakýmkoli čistým textem. Vyžaduje nastavení `STORAGE_ENCRYPTION_KEY`.
Pole, které se nepodaří dešifrovat (stará klíč, poškozený ciphertext), je hlášeno jako
`<field>DecryptFailed: true` místo přerušení celého exportu nebo úniku základní chyby.
### Další podpříkazy
Tyto předpokládají běžící server OmniRoute, pokud není uvedeno jinak:
```bash
omniroute status # Komplexní stav runtime
omniroute logs # Streamovat logy požadavků (--json, --search, --follow)
omniroute config show # Zobrazit aktuální konfiguraci
omniroute provider list # Seznam dostupných poskytovatelů (alias poskytovatelů seznam)
omniroute provider add # Registrovat OmniRoute jako poskytovatele na nástroji
omniroute keys add | list | remove # Spravovat API klíče
omniroute models [provider] # Seznam modelů (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Snapshot konfigurace + DB
omniroute restore # Obnovit z předchozího snapshotu
omniroute health # Podrobný stav (přerušovače, cache, paměť)
omniroute quota # Využití kvóty poskytovatele
omniroute cache # Stav cache
omniroute cache clear # Vymazat sémantické + podpisové cache
omniroute mcp status | restart # Stav serveru MCP / restart
omniroute a2a status | card # Stav serveru A2A / agent karta
omniroute tunnel list | create | stop # Spravovat tunely (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Zkontrolovat / nastavit proměnné prostředí (dočasné)
omniroute test # Test připojení poskytovatele
omniroute update # Zkontrolovat aktualizace
omniroute completion # Generovat shell completion
```
### Běžné příznaky
| Příznak | Popis |
| ------------------- | ----------------------------------------------------------- |
| `--no-open` | Neotevírat automaticky prohlížeč při spuštění |
| `--port <n>` | Přepsat API port (výchozí 20128) |
| `--mcp` | Spustit jako MCP server přes stdio (pro IDE) |
| `--non-interactive` | CI režim (žádné výzvy; čte z proměnných prostředí/příznaků) |
| `--json` | Strojově čitelný JSON výstup (doktor, poskytovatelé, atd.) |
| `--help`, `-h` | Zobrazit konkrétní pomoc pro příkaz |
| `--version`, `-v` | Vytisknout nainstalovanou verzi |
---
## Dashboard Auto-Configuration
## Dostupné API koncové body
The OmniRoute dashboard automates configuration for most tools:
| Koncový bod | Popis | Použití |
| -------------------------- | --------------------------------------- | ------------------------------------- |
| `/v1/chat/completions` | Standardní chat (všichni poskytovatelé) | Všechny moderní nástroje |
| `/v1/responses` | API odpovědí (formát OpenAI) | Codex, agentické pracovní toky |
| `/v1/completions` | Zastaralé textové doplnění | Starší nástroje používající `prompt:` |
| `/v1/embeddings` | Textová embeddings | RAG, vyhledávání |
| `/v1/images/generations` | Generování obrázků | GPT-Image, Flux, atd. |
| `/v1/audio/speech` | Text na řeč | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Řeč na text | Deepgram, AssemblyAI |
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
Příklady připravené k vložení s tokenizovanou OmniRoute URL:
---
```txt
Token příklad: sk-a3ab3c080beaee3a-69f4a4-070d71af
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
Standardní OpenAI základna: http://localhost:20128/v1
VS Code modely: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code odpovědi: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama tagy: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Řešení problémů
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
```
| Chyba | Příčina | Oprava |
| ----------------------------------------------- | --------------------------------- | --------------------------------------------------------- |
| `Connection refused` | OmniRoute neběží | `omniroute serve` |
| `401 Unauthorized` | Špatný API klíč | Zkontrolujte v `/dashboard/api-manager` |
| `No combo configured` | Žádná aktiv routovací kombinace | Nastavte v `/dashboard/combos` |
| CLI zobrazuje "not installed" | Binární soubor není v PATH | Zkontrolujte `which <command>` |
| Dashboard zobrazuje "not detected" po instalaci | Cache je zastaralá | Klikněte na "⟳ Obnovit detekci" v dashboardu |
| Starý odkaz `/dashboard/cli-tools` | Záložka před v3.8.6 | Automaticky přesměrováno na `/dashboard/cli-code` (308) |
| Starý odkaz `/dashboard/agents` | Záložka před v3.8.6 | Automaticky přesměrováno na `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,309 @@
# CLI-INTEGRATIONS (Dansk)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI Integrationer — peg enhver kodnings-CLI mod OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Integrationer
OmniRoute leverer en familie af `setup-*` kommandoer, der konfigurerer en kodnings-CLI (Codex, Claude Code, OpenCode, Cline, …) til at bruge OmniRoute som sin backend — så værktøjet kommunikerer med **én** endpoint, og OmniRoute ruter til den rette udbyder med automatisk tilbagefald. Hver kommando læser den **live** modelkatalog fra en kørende OmniRoute (lokal eller fjern) og skriver værktøjets egen konfigurationsfil på **din** maskine. API-nøglen refereres af en miljøvariabel, hvor værktøjet understøtter det. Kommandoer, der bevarer en værktøjslokal miljøfil, er noteret nedenfor.
Der er også en generisk launcher — `omniroute run <target>` — der starter `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` eller `gemini` med den rette miljøvariabel injiceret, uden at skrive nogen konfiguration overhovedet. Mål og deres aliaser kommer fra det kanoniske manifest `bin/cli/cli-manifest.mjs`
(`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`,
`open-code`, `qwen-code`, `gemini-cli`), og `omniroute completion` tilbyder de samme manifest-afledte målord. De ældre per-værktøj launchers —
`omniroute launch` (Claude Code) og `omniroute launch-codex` (Codex) — forbliver tilgængelige.
Udbyder onboarding er tilgængelig fra den samme lokale/fjern kontekst. De API-første kommandoer nedenfor holder administrationsautentifikation adskilt fra udbyderlegitimationer og printer aldrig en legitimationsoplysning i struktureret output:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
For scripts, foretræk `--credential-stdin` eller `--credential-env`; `--credential`
bevares til kontrolleret lokal brug. `providers remove` kræver `--yes` på en
ikke-interaktiv terminal, og alle fem kommandoer respekterer den aktive kontekst eller de globale `--base-url`/`--api-key` muligheder.
For den engangs, håndskrevne basisopsætning af de to rigeste integrationer, se de
per-værktøj dybdegående analyser:
- [Claude Code konfiguration](./CLAUDE-CODE-CONFIGURATION.md)
- [Codex CLI konfiguration](./CODEX-CLI-CONFIGURATION.md)
- [Fjernmode](./REMOTE-MODE.md) — styre en fjern OmniRoute (VPS / Tailnet) fra din bærbare computer
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — OmniCopilot-udvidelsen; den kan også køre disse
`setup-*` kommandoer for dig fra indeni editoren
---
## Mastertabel
Hver kommando respekterer den **aktive kontekst** (sat med `omniroute connect`, se
[Remote Mode](./REMOTE-MODE.md)) eller eksplicitte `--remote <url> --api-key <key>` flag. "Lokal vs fjern" nedenfor betyder: uden flag retter den sig mod `http://localhost:20128`;
med `--remote` (eller en aktiv fjern kontekst) henter den kataloget fra den
server og skriver konfigurationen lokalt.
| Kommando | Værktøj | Hvad den skriver | Nøgleflag | Lokal vs fjern |
| -------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — én profil pr. kompatibel tekstmodel (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | Begge |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — én profil pr. matchet model (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | Begge |
| `omniroute setup-opencode` | OpenCode (openai-kompatibel) | `~/.config/opencode/opencode.json``omniroute` udbyder med hver katalogmodel (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | Begge |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI mode) + printer VS Code udvidelsesindstillinger | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | Begge |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + fusionerer `kilocode.*` ind i VS Code `settings.json`, hvis til stede | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | Begge |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` modeller, nøgle via `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Begge |
| `omniroute setup-cursor` | Cursor | Intet — printer de trin i appen (Cursor konfiguration er uklar SQLite) | `--remote` `--api-key` `--only` `--port` | Begge |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (importdokument) + sætter `roo-cline.autoImportSettingsPath`, hvis en VS Code `settings.json` eksisterer | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | Begge |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-kompat` udbyder, nøgle via `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Begge |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + printer miljøopskrift | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Begge |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + printer miljøopskrift | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Begge |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai` array + `OMNIROUTE_API_KEY` i `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | Begge |
| `omniroute run <target>` | Runtime launch (generisk) | Intet — starter `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` med det rette miljø og argumenter; Qwen og Gemini bruger et midlertidigt isoleret hjem | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | Begge |
| `omniroute launch` | Claude Code | Intet — starter `claude` med `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` injiceret | `--remote` `--api-key` `--token` `--profile` `--port` | Begge |
| `omniroute launch-codex` | OpenAI Codex CLI | Intet — starter `codex` med `omniroute` udbyderen injiceret via `-c` flag | `--remote` `--api-key` `--profile` (`-p`) `--port` | Begge |
Bemærkninger om flag (verificeret i kommandoens kilde):
- `--remote <url>` — hent kataloget fra en fjern OmniRoute (overskriver `--port`
og den aktive kontekst). `--api-key <key>` leverer legitimationsoplysningen for den
server (standard til `OMNIROUTE_API_KEY` miljøvariabel, eller den aktive kontexts token).
- `--only <patterns>` — komma-separerede understrenge; behold kun model-ID'er, der matcher
(f.eks. `--only glm,kimi`). Tilgængelig på `setup-codex`, `setup-claude`,
`setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`.
- `--dry-run` — print præcist hvad der ville blive skrevet uden at røre ved
filsystemet. Tilgængelig på hver `setup-*` kommando **undtagen** `setup-cursor`
(som aldrig skriver en fil).
- `--model <id>` — påkrævet (eller valgt interaktivt) for de værktøjer, der ikke har
model auto-opdagelse: Cline, Kilo, Roo, Goose, Qwen, Aider. Disse værktøjer
accepterer også `--yes` til ikke-interaktive kørsel (som så kræver `--model`).
`setup-opencode` tager `--model` for at sætte den standard top-niveau model.
- `--model <id>``omniroute run` følger manifestets per-mål wiring
(`bin/cli/cli-manifest.mjs`): **aider** modtager `--model openai/<id>` og
**opencode** `--model omniroute/<id>` (præfikset tilføjes kun, når id'et
ikke allerede bærer det); **qwen** og **gemini** modtager id'et verbatim;
**claude** får det via `ANTHROPIC_MODEL`, **goose** via `GOOSE_MODEL`, og
**codex** via `-c model_providers.omniroute.*` args. **Qwen er det eneste kørsel
mål, der hårdt kræver `--model`** — `omniroute run qwen` uden det afslutter
`2` med en eksplicit fejl.
- `--port <port>` — lokal OmniRoute port (standard `20128`, ignoreres når `--remote`
er sat). Tilstede på alle `setup-*` og begge launchers.
- `omniroute run` exit-koder: barnets CLI's egen exit-kode videreføres
verbatim; `2` = ugyldige argumenter (unsupported target, manglende påkrævet
`--model`, container guard); `127` = mål-binæren er ikke i `PATH`;
`130`/`143`/`129` når lanceringen afsluttes af `SIGINT`/`SIGTERM`/`SIGHUP`;
`1` = anden runtime lancering fejl.
- De to launchers (`launch`, `launch-codex`) accepterer `--profile <name>` for at vælge
en profil skrevet af `setup-claude` / `setup-codex`, plus pass-through args for
den underliggende `claude` / `codex` binære.
Den interaktive vælger deles også af opsætningsopskrifterne:
```bash
# Vælg fra den aktive lokale eller fjern modelkatalog og konfigurer målet.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` delegerer i øjeblikket til de testede opskrifter for `codex`, `claude`,
`opencode`, `qwen`, `aider`, `goose`, `cline`, `continue`, og `kilo`. IDE-only,
MITM, og guide-only katalogindgange forbliver eksplicitte `setup-*`/manuelle flows og
præsenteres ikke som lancerbare mål.
> `setup-opencode` er den **lette openai-kompatible** OpenCode integration.
> Der er også en rigere plugin-integration — `omniroute setup opencode` — som
> installerer `@omniroute/opencode-plugin`. De er forskellige kommandoer; tabellen
> ovenfor dokumenterer `setup-opencode`.
---
## Lokal brug
Med OmniRoute kørende på `localhost:20128`, skal du blot køre opsætningskommandoen for dit værktøj. Kataloget hentes fra den lokale server.
```bash
# Codex: skriv en profil pr. matchet model ind i ~/.codex/
omniroute setup-codex
codex --profile glm52 # brug en genereret profil
# Claude Code: skriv profiler pr. model, og start så en
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: skriv den openai-kompatible udbyder med alle katalogmodeller
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # refereret via {env:OMNIROUTE_API_KEY}, aldrig på disk
opencode -m omniroute/glm/glm-5.2 "..."
# Værktøjer uden automatisk opdagelse kræver en eksplicit model:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Forhåndsvisning uden at skrive noget:
omniroute setup-continue --dry-run
```
Start uden at skrive nogen konfiguration overhovedet (kun miljøinjektion):
```bash
omniroute launch # Claude Code → lokal OmniRoute
omniroute launch-codex # Codex CLI → lokal OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# Eksplicit kommando sti: send alt hvad der kommer efter --
omniroute run claude -- --print-system-prompt "review this diff"
```
---
## Fjernbrug
Peg enhver opsætningskommando mod en fjern OmniRoute med `--remote` + `--api-key`. Kataloget hentes fra den fjerne; konfigurationen skrives på din lokale maskine.
```bash
# OpenCode mod en fjern VPS, behold kun glm/kimi modeller
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # eksportér OMNIROUTE_API_KEY først
# Codex profiler fra et fjernt katalog
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Start en CLI direkte mod den fjerne
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
I stedet for at sende `--remote`/`--api-key` hver gang, log ind én gang og lad den **aktive kontekst** levere dem automatisk:
```bash
omniroute connect 192.168.0.15 # opretter en scoped token, gemmer konteksten
omniroute setup-codex # ← bruger nu det fjerne katalog
omniroute setup-opencode # ← samme
omniroute launch # ← Claude Code mod den fjerne
```
Se [Fjerntilstand](./REMOTE-MODE.md) for kontekster, scopes og tokenhåndtering.
---
## Basis-URL konventioner (hvilke værktøjer ønsker `/v1`)
OmniRoute eksponerer OpenAI-overfladen ved `/v1`, den Anthropic-overflade ved roden, og en native Gemini-overflade ved `/v1beta`. Hver integration er tilsluttet den form, som dens værktøj forventer (verificeret i kommandoens kilde):
| Integration | Basis-URL skrevet | `/v1`? |
| -------------------------------------------------------------------------- | ----------------- | --------------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | rod | Nej — Cline tilføjer `/v1/chat/completions` |
| `setup-goose` (`OPENAI_HOST`) | rod | Nej — Goose tilføjer stien |
| `setup-aider` (`OPENAI_API_BASE`) | rod | Nej — LiteLLM tilføjer `/v1/chat/completions` |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | med `/v1` | Ja |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | rod | Nej — Claude Code tilføjer `/v1/messages` |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | med `/v1` | Ja |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | med `/v1` | Ja |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | rod | Nej — SDK'en tilføjer `/v1beta/models/…` |
---
## Bevare native afhængigheder ved opdatering: `--include=optional`
Når du opdaterer med `omniroute update` (efter bekræftelse eller med `--apply`),
kører OmniRoute installationen med `--include=optional` indbygget:
```bash
npm install -g omniroute@latest --include=optional
```
Dette er **ikke** en flag, du sender til `omniroute update` — det anvendes altid af
opdateringsprogrammet. Det garanterer, at `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, LLMLingua SLM-stakken) overlever opdateringen, selvom din npm-konfiguration
har `omit=optional` indstillet, hvilket ellers stille ville fjerne den native SQLite
driver og OS-keyring binding. For at forhåndsvise den nøjagtige kommando uden at anvende:
```bash
omniroute update --dry-run
# [DRY RUN] Ville køre: npm install -g omniroute@latest --include=optional
```
Andre `omniroute update` flag (verificeret i kildekoden): `--check` (afslut 1 hvis
forældet), `--apply` (installer uden at spørge), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI via `omniroute run gemini`
Kontrakten er verificeret mod `@google/gemini-cli` 0.50.0: CLI'en respekterer
`GOOGLE_GEMINI_BASE_URL` og udsender `POST /v1beta/models/<model>:generateContent`
(og `:streamGenerateContent?alt=sse`) imod det — præcist OmniRoutes native
Gemini-overflade (`/v1beta`). `omniroute run gemini` forbinder det automatisk:
- `GOOGLE_GEMINI_BASE_URL` → den aktive OmniRoute base URL (rod, ingen `/v1`);
- `GEMINI_API_KEY` → den løste OmniRoute legitimationsoplysning (mulighed/miljø/kontekst);
- en **midlertidig isoleret `GEMINI_CLI_HOME`** hvis `.gemini/settings.json`
vælger `gemini-api-key` autentifikation, så en gemt Google OAuth-session (Code Assist)
aldrig overskriver den OmniRoute-styrede lancering — fjernet efter exit;
- **miljøhygiejne**: børne-miljøet er renset for `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` og `GOOGLE_GENAI_USE_GCA` (som ville omdirigere
autentifikation til Vertex/Code Assist), og `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` er
indstillet som en sikkerhedsforanstaltning — de andre `run` mål får samme
behandling for deres egne konfliktende variabler;
- `--model <id>` injektion fra `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Geminis arbejdsplads-tillidsbeskyttelse gælder stadig i headless-tilstand — send
`--skip-trust` (eller stol på mappen interaktivt) selv; lanceren
omgår bevidst ikke dette. Denne lancer er forskellig fra **ACP
registreringen** (`src/lib/acp/registry.ts`, `gemini --acp`), som forbliver
agent-protokol integrationen for `/dashboard/acp-agents`.
---
## Real smoke sweep (opt-in)
Deterministiske lanceringsplan regressionskørsler i CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). For at validere de REAL binære mod en REAL
OmniRoute server, findes der en opt-in ramme ved
`tests/integration/upstream-cli-smoke.int.test.ts`. Den kører aldrig automatisk
(alle under-tests springes over medmindre `RUN_CLI_SMOKE=1`), sender legitimationsoplysningerne via miljøvariabel
NAVN (aldrig ved værdi), redigerer nøgleformede strenge fra enhver registreret output, springer
mål over hvis binæren ikke er installeret, og klassificerer fejl som
auth / upstream / config i stedet for en ren boolean:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
Valgfrit: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` begrænser sweepet;
`OMNIROUTE_SMOKE_TIMEOUT_MS` overskriver timeout på 120s pr. mål.
---
## Se også
- [Claude Code konfiguration](./CLAUDE-CODE-CONFIGURATION.md) — den dybere Claude Code guide
- [Codex CLI konfiguration](./CODEX-CLI-CONFIGURATION.md) — den engangs `[model_providers.omniroute]` grundopsætning
- [Fjernbetjeningstilstand](./REMOTE-MODE.md) — kontekster, scoped adgangstokens, kørsel af en fjernserver
- [CLI Værktøjer reference](../reference/CLI-TOOLS.md) — det fulde katalog over understøttede værktøjer + dashboard sider
- [Opsætningsguide](./SETUP_GUIDE.md) — installationsmetoder og onboarding ved første kørsel

View File

@@ -1,86 +1,340 @@
# CLI Tools Setup Guide — OmniRoute (Dansk)
# CLI-TOOLS (Dansk)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI Værktøjer — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI Værktøjer — OmniRoute
Sidst opdateret: 2026-08-18
OmniRoute integrerer med tre kategorier af CLI værktøjer fordelt på tre dedikerede dashboard sider:
| Side | Rute | Koncept | Antal |
| --------------- | ----------------------- | ----------------------------------------------------------------------------- | ----------- |
| **CLI Kode's** | `/dashboard/cli-code` | Kodningsværktøjer, du peger på OmniRoute (Klient → CLI → OmniRoute → Udbyder) | 26 |
| **CLI Agenter** | `/dashboard/cli-agents` | Autonome agenter, du peger på OmniRoute (samme flow, bredere omfang) | 8 |
| **ACP Agenter** | `/dashboard/acp-agents` | CLIs, som OmniRoute genererer som backend via stdio/ACP (omvendt flow) | se register |
Legacy ruter omdirigerer via 308: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## Hvordan det fungerer
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI Kode's / CLI Agenter (forbrugsflow):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (alle peger på OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute ruter til den rigtige udbyder)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP Agenter (omvendt genereringsflow):
Klientanmodning → OmniRoute → genererer CLI via stdio/ACP → svar
```
**Benefits:**
**Fordele:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Én API-nøgle til at administrere alle værktøjer
- Omkostningssporing på tværs af alle CLIs i dashboardet
- Modelskift uden at omkonfigurere hvert værktøj
- Fungerer lokalt og på fjernservere (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## Auto-konfigurer med `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
Du behøver ikke at skrive hver værktøjs konfiguration i hånden. OmniRoute leverer en `setup-*`
kommando pr. understøttet CLI, der læser den **live** modelkatalog fra en kørende
OmniRoute (lokal eller fjern) og skriver værktøjets egen konfiguration på din maskine:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Hver accepterer `--remote <url> --api-key <key>` (konfigurer et lokalt værktøj mod en
fjern OmniRoute), `--dry-run` (forhåndsvisning uden at skrive), og `--port`. Værktøjer
uden model auto-opdagelse (Cline, Kilo, Roo, Goose, Aider, Qwen) tager
`--model <id>` (og `--yes` for ikke-interaktive kørsel). For at starte en CLI med den
rette miljøvariabel injiceret og ingen konfiguration skrevet overhovedet, brug den generiske
`omniroute run <target>` launcher (claude, codex, aider, goose, opencode, qwen,
gemini — mål og aliaser kommer fra `bin/cli/cli-manifest.mjs`); de legacy
per-værktøj launchers `omniroute launch` (Claude Code) og `omniroute launch-codex`
(Codex) forbliver tilgængelige. Gemini CLI er kun til lancering: det er et `omniroute run`
mål, men har ingen `setup-*`/`configure` opskrift.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Fuld reference:** mastertabellen — hvad hver kommando skriver, hver flag,
> lokal vs fjern, og hvilke værktøjer der ønsker et `/v1` suffix — findes i
> **[CLI Integrationer](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Kørsel af disse inde i en container
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
En `setup-*` kommando udført inde i OmniRoute containeren skriver ind i
containerens egen hjemmemappe, som ingen værts-CLI læser og som forsvinder med
containeren. OmniRoute opdager det og afslutter med `2` med instruktioner i stedet for
at skrive. To understøttede måder fremad — installer CLI på værten og
`omniroute connect` til containeren, eller bind-mount konfigurationsmapperne og sæt
`CLI_CONFIG_HOME` (den compose `host` profil). Hver `setup-*` kommando, plus
`omniroute configure` og `omniroute config set`, accepterer
`--allow-container-write`, når konfiguration af containerens egne CLIs er det, du
faktisk mente; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` gør det samme for
serveren. Se
[Docker Guide → Konfigurering af værts-CLI værktøjer](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
Dashboardets **apply endpoint** (`POST /api/cli-tools/apply`) håndhæver den
samme beskyttelse: i en container, en skrivning hvis mål ikke er bind-mountet fra
værten svarer **`422`** med `containerEphemeralTarget: true`, den sikre fejltekst og — for
de værktøjer med en værtsopskrift (claude, codex, opencode, cline,
kilo, continue) — en `hostSetupCommand` (f.eks. `omniroute setup-opencode`) der skal køres
på værten i stedet; intet skrives. `dryRun: true` fortsætter med at fungere i container
tilstand og returnerer det genererede indhold + målsti uden at røre disken, så
du kan forhåndsvise fra dashboardet og anvende på værten. Denne adfærd er
intentionel og regressionsbeskyttet af
`tests/unit/api/cli-tools/apply-container-guard.test.ts` — fjern aldrig "fix" en 422
ved at fjerne beskyttelsen.
---
## Step 1 — Get an OmniRoute API Key
## Sandkasse
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
Den samlede katalog findes i `src/shared/constants/cliTools.ts` som `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Hver post har disse felter (defineret i `src/shared/schemas/cliCatalog.ts`):
| Felt | Type | Beskrivelse |
| ----------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
| `category` | `"code" \| "agent"` | Hvilken side værktøjet vises på |
| `vendor` | `string` | Værktøjets oprindelse ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | Også brugbar som en ACP Agent (badge vist) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Niveau for tilpasset endpoint support. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Konfigurationsmekanisme |
| `id`, `name`, `color`, `description`, `docsUrl` | standard | Kernevisningsfelter |
Poster med `baseUrlSupport: "none"` vises **ikke** på dashboard-siderne — de er registreret i MITM-backloggen for plan 11 (se `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Kapabilitet niveauer (katalogiseret × detekterbar × konfigurerbar × lancerbar)
Ikke hvert katalogiseret værktøj er detekterbart, konfigurerbart eller lancerbart. Hvert niveau har en
erklærende kilde, og en driftstest holder dem synkroniseret:
| Niveau | Betydning | Erklæret i |
| ----------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Katalogiseret** | Visas i dashboard-kataloget (navn, leverandør, dokumentation, konfigurationstype) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Detekterbar** | Binær/konfigurationsdetektion, sundhedstjek, konfigurationsstier | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime katalog) |
| **Konfigurerbar** | Understøttet af `omniroute configure <cli>` (opsætningsopskrift eksisterer) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **Lancerbar** | Understøttet af `omniroute run <target>` (env/args injektion defineret) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` er det kanoniske eksekverbare manifest for CLI-kommandoerne
overflader: `run`, `configure` og shell-completion generatorer afleder alle deres
mål lister, alias opløsning (for eksempel `kilocode`/`kilo-code`/`kilo_cli``kilo`)
og `--model` flag wiring fra det. Driftbeskyttelsen
`tests/unit/cli/cli-manifest-drift.test.ts` bekræfter, at manifestet, runtime
kataloget, UI kataloget og hver forbruger overflade forbliver synkroniseret — et mål tilføjet til
én overflade uden de andre fejler suite i stedet for at drive stille.
## 1. CLI Kodekatalog (26 værktøjer)
Alle værktøjer, der vises i `/dashboard/cli-code`. De med `baseUrlSupport: none` er tilsluttet gennem MITM eller en manuel vejledning i stedet for en tilpasset base URL:
| id | navn | leverandør | baseUrlSupport | configType | acpSpawnable |
| ------------ | ----------------------- | ------------------- | -------------- | -------------- | ------------ |
| claude | Claude Kode | Anthropic | fuld | env | true |
| codex | OpenAI Codex CLI | OpenAI | fuld | custom | true |
| zcode | ZCode (GLM Coding Plan) | Z.ai | ingen | custom | false |
| cline | Cline | OSS (ex-Claude Dev) | fuld | custom | true |
| kilo | Kilo Kode | Kilo-Org | fuld | custom | false |
| roo | Roo Kode | Roo (OSS) | fuld | guide | false |
| continue | Continue | continue.dev | fuld | guide | false |
| aider | Aider | OSS (P. Gauthier) | fuld | guide | true |
| forge | ForgeCode | Antinomy HQ | fuld | custom | true |
| jcode | jcode | 1jehuang (OSS) | fuld | custom | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | fuld | custom | false |
| codewhale | CodeWhale | Hmbown (OSS) | fuld | custom | false |
| opencode | OpenCode | Anomaly (ex-SST) | fuld | guide | true |
| droid | Factory Droid | Factory AI | delvis | guide | false |
| copilot | GitHub Copilot CLI | GitHub/MS | fuld | custom | false |
| cursor-cli | Cursor CLI | Anysphere | delvis | guide | true |
| smelt | Smelt | leonardcser (OSS) | fuld | custom | false |
| pi | Pi (pi-coding-agent) | M. Zechner (OSS) | fuld | custom | false |
| grok-build | Grok Build | xAI | fuld | custom | false |
| crush | Crush | OSS (Charm) | fuld | custom | false |
| qwen | Qwen Kode | Alibaba | fuld | guide | true |
| cursor | Cursor | Anysphere | ingen | guide | false |
| antigravity | Antigravity | Google | ingen | mitm | false |
| hermes | Hermes | Nous Research | ingen | guide | false |
| kiro | Kiro AI | Amazon | ingen | mitm | false |
| custom | Custom CLI | — | fuld | custom-builder | false |
Værktøjer med `baseUrlSupport: "partial"` viser et badge "⚠ Base URL parcial" i dashboardkortet.
## 2. CLI Agenter Katalog (8 værktøjer)
Autonome agenter, der vises i `/dashboard/cli-agents`:
| id | navn | leverandør | baseUrlSupport | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | Hermes Agent | Nous Research | fuld | falsk |
| openclaw | OpenClaw | OSS (P. Steinberger) | fuld | sand |
| goose | Goose | Block / Linux Foundation | fuld | sand |
| interpreter | Open Interpreter | OSS | fuld | sand |
| warp | Warp AI | Warp Inc. | delvis | sand |
| agent-deck | Agent Deck | asheshgoplani (OSS) | fuld | falsk |
| omp | Oh My Pi | OSS | fuld | sand |
| letta | Letta CLI | Letta | fuld | falsk |
---
## Step 2 — Install CLI Tools
## 3. ACP Agenter (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Denne side (omdøbt fra `/dashboard/agents`) viser CLIs, som OmniRoute kan **spawne** som backend eksekveringsmotorer via stdio/ACP protokol. Katalogen vedligeholdes separat i `src/lib/acp/registry.ts` og er **ikke** den samme som `CLI_TOOLS`.
---
## 4. MITM Backlog (ikke vist i dashboard)
Følgende CLIs understøtter ikke brugerdefineret base URL nativt og er **ikke listet** i CLI Code's eller CLI Agents sider. De er kandidater til MITM interception i plan 11:
| CLI | Årsag |
| ------------------- | --------------------------------------------------------------------- |
| windsurf | BYOK begrænset til udvalgte Claude modeller + virksomhedens URL/token |
| amp | Lukket økosystem (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO autentificering, ingen brugerdefineret URL |
| cowork | Anthropic Desktop, ingen konfigurerbar endpoint |
Se `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` for den fulde krydsreference.
---
## 5. Batch Detection API
Alle værktøjsdetektioner er aggregeret via et enkelt endpoint:
**`GET /api/cli-tools/all-statuses`**
- Auth: `requireCliToolsAuth(request)` (samme som andre `/api/cli-tools/` ruter)
- Returnerer: `Record<toolId, ToolBatchStatus>` (type: `src/shared/types/cliBatchStatus.ts`)
- Strategi: `Promise.all` over alle værktøjer, 5s timeout pr. værktøj
- Cache: i-hukommelse LRU indekseret efter konfigurationsfil `mtime`. Cache ugyldiggjort når mtime ændres. Nulstil ved server genstart.
Responsform pr. værktøj:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // sanitiseret, ingen stack traces
}
```
## 6. Indstillinger Håndterere for Nye Værktøjer
Nye værktøjer med `configType: "custom"` har dedikerede indstillings-API-ruter:
| Rute | Værktøj |
| ------------------------------------------- | --------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legacy) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, primær + legacy `~/.deepseek` synk) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi coding agent |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + dedikeret `.env` nøgle) |
Alle ruter bruger `sanitizeErrorMessage()` til fejlrespons (Hard Rule #12).
---
## 7. Dashboard Sider Arkitektur
### CLI Kode (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — serverkomponent
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — klientgitter
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — værktøjsdetaljeside
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 specialiserede værktøjskort + `ToolDetailClient.tsx`
### CLI Agenter (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — serverkomponent
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — klientgitter
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — genbruger `ToolDetailClient`
### ACP Agenter (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — serverkomponent (flyttet fra `agents/`)
### Delte UI Komponenter (`src/shared/components/cli/`)
| Fil | Formål |
| ----------------------- | ------------------------------------------------------- |
| `CliToolCard.tsx` | Smart statuskort (detektion + konfiguration + endpoint) |
| `CliConceptCard.tsx` | Per-side konceptforklaringskort |
| `CliComparisonCard.tsx` | Tre-kolonne sammenligning på tværs af CLI-typer |
| `BaseUrlSelect.tsx` | Endpoint dropdown (Lokal/Cloud/Custom) |
| `ApiKeySelect.tsx` | API-nøglevælger |
| `ManualConfigModal.tsx` | Kopierbar konfigurationssnippet modal |
### Delte Hook (`src/shared/hooks/cli/`)
| Fil | Formål |
| ------------------------- | ---------------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | Henter `/api/cli-tools/all-statuses`, håndterer indlæsning/opdateringsstatus |
## 8. i18n
Nye navnerum tilføjet i plan 14 F9:
| Navnerum | Formål |
| ----------- | ------------------------------------------------------------------------------------- |
| `cliCommon` | Delte strenge (kortetiketter, koncept/komparative tekster, detaljerede sideetiketter) |
| `cliCode` | CLI Code's side-strenge |
| `cliAgents` | CLI Agents side-strenge |
| `acpAgents` | ACP Agents side-strenge |
Fuld PT-BR og EN oversættelser er tilgængelige. 39 andre lokaliteter falder automatisk tilbage til EN via navnerumsniveau-sammenlægning i `src/i18n/request.ts`.
---
## 9. Hurtig Start
### Trin 1 — Få en OmniRoute API-nøgle
1. Åbn `/dashboard/api-manager`**Opret API-nøgle**
2. Giv den et navn (f.eks. `cli-tools`) og vælg alle tilladelser
3. Kopier nøgle — du får brug for den til hver CLI nedenfor
> Din nøgle ser sådan ud: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Trin 2 — Installer CLI-værktøjer
Alle npm-baserede værktøjer kræver Node.js 22.22.2+ eller 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +352,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (kan startes via `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Rust-baseret
# Pi coding agent
# se https://github.com/zechnerj/pi-coding-agent for installation
# jcode
# se https://github.com/1jehuang/jcode for installation
```
---
## Step 3 — Set Global Environment Variables
### Trin 3 — Konfigurer via Dashboard
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. Gå til `http://localhost:20128/dashboard/cli-code`
2. Find dit værktøj i gitteret
3. Klik på kortet for at åbne værktøjets detaljeside
4. Vælg din API-nøgle og base-URL
5. Klik på **Anvend konfiguration** eller kopier den manuelle konfigurationssnippet
---
### Trin 4 — Indstil globale miljøvariabler
```bash
# OmniRoute Universal Endpoint
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI læser GOOGLE_GEMINI_BASE_URL ved ROOT (dens SDK tilføjer /v1beta/... selv)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> For en **fjernserver** erstat `localhost:20128` med serverens IP eller domæne,
> f.eks. `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### Trin 4 — Konfigurer hvert værktøj
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Opret ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
Brug den samlede Anthropic gateway root til Claude Code. Tilføj ikke `/v1` her.
**Test:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
Moderne Codex (v0.137+) læser kun `~/.codex/config.toml` — den gamle
`config.yaml` tilhører den forældede npm CLI og ignoreres stille. API-nøglen
forbliver i miljøvariablen `OMNIROUTE_API_KEY` (`env_key`), aldrig
inde i filen:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
Fuld reference (profiler, `wire_api`, kontekstvinduer): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Test:** `codex "what is 2+2?"`
---
### OpenCode
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `opencode`
> Brug `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> for at sende tænkevarianter.
---
### Cline (CLI or VS Code)
#### Cline (CLI eller VS Code)
**CLI mode:**
**CLI-tilstand:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +495,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible` → Base URL: `http://localhost:20128/v1`
**VS Code-tilstand:**
Cline-udvidelsesindstillinger → API-udbyder: `OpenAI Compatible` → Base URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
Eller brug OmniRoute-dashboardet**CLI Tools → Cline → Anvend konfiguration**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI eller VS Code)
**CLI mode:**
**CLI-tilstand:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**VS Code-indstillinger:**
```json
{
@@ -223,13 +519,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
Eller brug OmniRoute-dashboardet**CLI Tools → KiloCode → Anvend konfiguration**.
---
### Continue (VS Code Extension)
#### Continue (VS Code-udvidelse)
Edit `~/.continue/config.yaml`:
Rediger `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +537,255 @@ models:
default: true
```
Restart VS Code after editing.
Genstart VS Code efter redigering.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Brug dette, når VS Code Insiders er konfigureret til brugerdefinerede endpoint-modeller, og du ønsker, at OmniRoute skal fungere uden et brugerdefineret headerfelt.
**Anbefalet placering:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Eksempel ved brug af den tokeniserede OmniRoute-alias:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Bemærkninger:**
- Erstat `sk-your-omniroute-key` med en API-nøgle oprettet i OmniRoute.
- Feltet `url` skal pege på `/api/v1/vscode/{token}/chat/completions`.
- Feltet `modelsUrl` skal pege på `/api/v1/vscode/{token}/models`.
- Foretræk den normale `/v1` + Bearer header-flow, når klienten understøtter brugerdefinerede headers.
- URL-embedded tokens er en kompatibilitetsfald tilbage og kan vises i editorlogs eller proxyhistorik.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# Log ind på din AWS/Kiro-konto:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI'en bruger sin egen autentificering — OmniRoute er ikke nødvendig som backend for Kiro CLI selv.
# Brug kiro-cli sammen med OmniRoute til andre værktøjer.
kiro-cli status
```
For **Kiro IDE** desktopapp, brug MITM-endpointet, der er eksponeret af OmniRoute
under `/dashboard/cli-tools → Kiro`.
---
### Qwen Code (Alibaba)
## 10. Intern OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
Den `omniroute` binære fil giver kommandoer til serverlivscyklus, opsætning, diagnostik og leverandørstyring. Indgangspunkt: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Start server (standard port 20128)
omniroute setup # Interaktiv opsætningsguide
omniroute doctor # Tjek konfiguration, DB, porte, runtime
omniroute providers list # Konfigurerede leverandørforbindelser
omniroute providers test-all # Test hver aktiv forbindelse
omniroute reset-password # Nulstil adminadgangskode
omniroute logs # Stream anmodningslogs
omniroute health # Detaljeret sundhed (afbrydere, cache, hukommelse)
omniroute --version # Udskriv version
omniroute --help # Vis alle kommandoer
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Opsætning & Initialisering
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # Interaktiv opsætningsguide
omniroute setup --non-interactive # CI/automatiseringsmode (læser miljøvariabler + flags)
omniroute setup --password '<value>' # Indstil adminadgangskode direkte
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Tilføj og test en leverandør i ét hug
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
Anerkendte miljøvariabler til ikke-interaktiv opsætning:
**Test:** `qwen "say hello"`
| Var | Formål |
| ------------------- | -------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | Leverandør API-nøgle (bundet til `--api-key` via Commander `.env()`) |
| `DATA_DIR` | Overskriv OmniRoute data katalog |
### Cursor (Desktop App)
Alle andre ikke-interaktive input gives som flags, ikke miljøvariabler:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(se `omniroute setup` mulighederne ovenfor).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
### Diagnostik
Via GUI: **Settings → Models → OpenAI API Key**
```bash
omniroute doctor # Tjek konfiguration, DB, porte, runtime, hukommelse, livlighed
omniroute doctor --json # Maskinlæsbart JSON
omniroute doctor --no-liveness # Spring HTTP sundhedsprobe over
omniroute doctor --host 0.0.0.0 # Overskriv livlighedsvært
omniroute doctor --liveness-url <url> # Fuldt sundhedsendepunkt URL-overskrivning
```
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
Doktoren kører disse tjek: `Konfiguration`, `Database`, `Lagring/kryptering`,
`Porttilgængelighed`, `Node runtime`, `Native binær` (better-sqlite3),
`Hukommelse`, og `Serverlivlighed`. Den afslutter ikke-nul, hvis nogen tjek er `fejl`.
---
### Leverandørstyring
## Dashboard Auto-Configuration
```bash
omniroute providers available # OmniRoute leverandørkatalog
omniroute providers available --search openai # Filtrer katalog efter id/navn/alias/kategori
omniroute providers available --category api-key # Filtrer efter kategori (api-key, oauth, gratis, ...)
omniroute providers available --json # Maskinlæsbart JSON
The OmniRoute dashboard automates configuration for most tools:
omniroute providers list # Konfigurerede leverandørforbindelser
omniroute providers list --json
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
omniroute providers test <id|name> # Test én konfigureret forbindelse
omniroute providers test-all # Test hver aktiv forbindelse
omniroute providers validate # Lokalt strukturel validering
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Eksisterende OAuth-flow
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
---
`providers add/import/auth/edit/remove` er API-først og fungerer derfor mod
den aktive lokale eller fjerntliggende kontekst. Credential input bør bruge
`--credential-stdin` eller `--credential-env`; `--dry-run --json` rapporterer kun
redigeret tilstedeværelse/form. `providers available` læser OmniRoute kataloget;
`providers list/test/test-all/validate` bevarer deres lokale SQLite adfærd og
kræver ikke, at serveren kører.
## Built-in Agents: Droid & OpenClaw
### Gendannelse & Nulstilling
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
```bash
omniroute reset-password # Nulstil adminadgangskode (også: omniroute-reset-password)
omniroute reset-encrypted-columns # Vis advarsel + tørkørsel for nulstilling af krypterede legitimationsoplysninger
omniroute reset-encrypted-columns --force # Faktisk nulstil krypterede legitimationsoplysninger i SQLite
```
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
### Eksport af legitimationsoplysninger (⚠ håndter med omhu)
---
```bash
omniroute auth export # Vis advarsel + bekræftelsesport — ingen DB-adgang
omniroute auth export --force # Eksporter ALLE forbindelsers DEKRYPPERET legitimationsoplysninger til stdout som JSON
omniroute auth export --force --id <id> # Eksporter kun den matchende forbindelse
omniroute auth export --force --format env # Udsend OMNIROUTE_<PROVIDER>_<FIELD>=<value> linjer
omniroute auth export --force --out creds.json # Skriv til en fil (oprettet med 0600 tilladelser)
```
## Available API Endpoints
`auth export` er **lokal-only** (direkte SQLite læsning, ingen HTTP rute) og udskriver/skriver
**ukrypteret** `apiKey`/`accessToken`/`refreshToken`/`idToken` værdier — det er funktionen, ikke en
fejl. Intet læses fra databasen, og intet dekrypteres, uden `--force`. En stderr
advarselsbanner udskrives altid før nogen ukrypteret data udsendes. Kræver `STORAGE_ENCRYPTION_KEY` at
være indstillet. Et felt, der ikke kan dekrypteres (gammel nøgle, beskadiget ciphertext) rapporteres som
`<field>DecryptFailed: true` i stedet for at abortere hele eksporten eller lække den underliggende fejl.
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
### Andre underkommandoer
Disse antager en kørende OmniRoute server, medmindre andet er angivet:
```bash
omniroute status # Omfattende runtime status
omniroute logs # Stream anmodningslogs (--json, --search, --follow)
omniroute config show # Vis nuværende konfiguration
omniroute provider list # Liste over tilgængelige leverandører (alias af providers list)
omniroute provider add # Registrer OmniRoute som en leverandør på et værktøj
omniroute keys add | list | remove # Administrer API-nøgler
omniroute models [provider] # Liste over modeller (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Snapshot konfiguration + DB
omniroute restore # Gendan fra et tidligere snapshot
omniroute health # Detaljeret sundhed (afbrydere, cache, hukommelse)
omniroute quota # Leverandør kvote brug
omniroute cache # Cache status
omniroute cache clear # Ryd semantiske + signatur caches
omniroute mcp status | restart # MCP server status / genstart
omniroute a2a status | card # A2A server status / agentkort
omniroute tunnel list | create | stop # Administrer tunneler (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Inspicer / indstil miljøvariabler (midlertidige)
omniroute test # Leverandør tilslutning røgtest
omniroute update # Tjek for opdateringer
omniroute completion # Generer shell completion
```
### Almindelige flags
| Flag | Beskrivelse |
| ------------------- | --------------------------------------------------- |
| `--no-open` | Åbn ikke automatisk browseren ved start |
| `--port <n>` | Overskriv API-porten (standard 20128) |
| `--mcp` | Kør som MCP-server over stdio (til IDE'er) |
| `--non-interactive` | CI-mode (ingen prompts; læser fra env/flags) |
| `--json` | Maskinlæsbart JSON-output (doctor, providers, osv.) |
| `--help`, `-h` | Vis kommando-specifik hjælp |
| `--version`, `-v` | Udskriv den installerede version |
## Tilgængelige API Endpoints
| Endpoint | Beskrivelse | Brug til |
| -------------------------- | ----------------------------- | ------------------------------------ |
| `/v1/chat/completions` | Standard chat (alle udbydere) | Alle moderne værktøjer |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentiske arbejdsgange |
| `/v1/completions` | Legacy tekstkompletteringer | Ældre værktøjer der bruger `prompt:` |
| `/v1/embeddings` | Tekst embeddings | RAG, søgning |
| `/v1/images/generations` | Billedgenerering | GPT-Image, Flux, osv. |
| `/v1/audio/speech` | Tekst-til-tale | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Tale-til-tekst | Deepgram, AssemblyAI |
Klar-til-at-indsætte eksempler med en tokeniseret OmniRoute URL:
```txt
Token eksempel: sk-a3ab3c080beaee3a-69f4a4-070d71af
Standard OpenAI base: http://localhost:20128/v1
VS Code modeller: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code responses: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama tags: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Fejlfinding
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
```
| Fejl | Årsag | Løsning |
| ------------------------------------------------- | ------------------------- | -------------------------------------------------- |
| `Connection refused` | OmniRoute kører ikke | `omniroute serve` |
| `401 Unauthorized` | Forkert API-nøgle | Tjek i `/dashboard/api-manager` |
| `No combo configured` | Ingen aktiv routing combo | Opsæt i `/dashboard/combos` |
| CLI viser "not installed" | Binær ikke i PATH | Tjek `which <command>` |
| Dashboard viser "not detected" efter installation | Cache forældet | Klik "⟳ Opdater registrering" i dashboard |
| Gamle link `/dashboard/cli-tools` | Pre-v3.8.6 bogmærke | Auto-omdirigeret til `/dashboard/cli-code` (308) |
| Gamle link `/dashboard/agents` | Pre-v3.8.6 bogmærke | Auto-omdirigeret til `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,271 @@
# CLI-INTEGRATIONS (Deutsch)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "CLI-Integrationen — jede Coding-CLI auf OmniRoute ausrichten"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI-Integrationen
OmniRoute liefert eine Familie von `setup-*`-Befehlen, die eine Coding-CLI (Codex, Claude Code, OpenCode, Cline, …) so konfigurieren, dass sie OmniRoute als Backend verwendet — sodass das Tool mit **einem** Endpunkt kommuniziert und OmniRoute an den richtigen Anbieter weiterleitet mit automatischem Fallback. Jeder Befehl liest den **aktuellen** Modellkatalog von einem laufenden OmniRoute (lokal oder remote) und schreibt die eigene Konfigurationsdatei des Tools auf **deinem** Rechner. Der API-Schlüssel wird durch eine Umgebungsvariable referenziert, wo immer das Tool dies unterstützt. Befehle, die eine lokal umgebungsbezogene Datei des Tools speichern, sind unten aufgeführt.
Es gibt auch einen generischen Launcher — `omniroute run <target>` — der `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` oder `gemini` mit der richtigen Umgebung injiziert, ohne überhaupt eine Konfiguration zu schreiben. Ziele und deren Aliase stammen aus dem kanonischen Manifest `bin/cli/cli-manifest.mjs` (`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`, `open-code`, `qwen-code`, `gemini-cli`), und `omniroute completion` bietet die gleichen manifest-abgeleiteten Zielwörter an. Die Legacy-Launcher pro Tool — `omniroute launch` (Claude Code) und `omniroute launch-codex` (Codex) — bleiben verfügbar.
Die Anbieter-Onboarding ist aus demselben lokalen/remote Kontext verfügbar. Die API-first-Befehle unten halten die Verwaltungsauthentifizierung von den Anbieteranmeldeinformationen getrennt und drucken niemals eine Anmeldeinformation in strukturiertem Output:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
Für Skripte bevorzuge `--credential-stdin` oder `--credential-env`; `--credential` bleibt für kontrollierte lokale Nutzung erhalten. `providers remove` erfordert `--yes` in einem nicht-interaktiven Terminal, und alle fünf Befehle respektieren den aktiven Kontext oder die globalen `--base-url`/`--api-key`-Optionen.
Für die einmalige, handgeschriebene Basiseinrichtung der beiden umfangreichsten Integrationen siehe die tiefgehenden Analysen pro Tool:
- [Claude Code-Konfiguration](./CLAUDE-CODE-CONFIGURATION.md)
- [Codex CLI-Konfiguration](./CODEX-CLI-CONFIGURATION.md)
- [Remote-Modus](./REMOTE-MODE.md) — steuere ein entferntes OmniRoute (VPS / Tailnet) von deinem Laptop aus
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — die OmniCopilot-Erweiterung; sie kann auch diese `setup-*`-Befehle für dich innerhalb des Editors ausführen
---
## Mastertabelle
Jeder Befehl respektiert den **aktiven Kontext** (gesetzt mit `omniroute connect`, siehe [Remote-Modus](./REMOTE-MODE.md)) oder explizite `--remote <url> --api-key <key>`-Flags. "Lokal vs. remote" bedeutet unten: ohne Flags zielt es auf `http://localhost:20128`; mit `--remote` (oder einem aktiven Remote-Kontext) wird der Katalog von diesem Server abgerufen und die Konfiguration lokal geschrieben.
| Befehl | Tool | Was es schreibt | Schlüssel-Flags | Lokal vs. remote |
| -------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — ein Profil pro kompatiblem Textmodell (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | Beide |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — ein Profil pro übereinstimmendem Modell (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | Beide |
| `omniroute setup-opencode` | OpenCode (openai-kompatibel) | `~/.config/opencode/opencode.json``omniroute`-Anbieter mit jedem Katalogmodell (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | Beide |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (CLI-Modus) + druckt VS Code-Erweiterungseinstellungen | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | Beide |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + fügt `kilocode.*` in die VS Code `settings.json` ein, falls vorhanden | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | Beide |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml``provider: openai` Modelle, Schlüssel über `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Beide |
| `omniroute setup-cursor` | Cursor | Nichts — druckt die Schritte in der App (Cursor-Konfiguration ist undurchsichtiges SQLite) | `--remote` `--api-key` `--only` `--port` | Beide |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (Importdokument) + setzt `roo-cline.autoImportSettingsPath`, falls eine VS Code `settings.json` existiert | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | Beide |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json``openai-kompatibler` Anbieter, Schlüssel über `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Beide |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + druckt Umgebungsrezept | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Beide |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + druckt Umgebungsrezept | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Beide |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — V4 `modelProviders.openai`-Array + `OMNIROUTE_API_KEY` in `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | Beide |
| `omniroute run <target>` | Laufzeit-Launcher (generisch) | Nichts — startet `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` mit der richtigen Umgebung und Argumenten; Qwen und Gemini verwenden ein temporäres isoliertes Home | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | Beide |
| `omniroute launch` | Claude Code | Nichts — startet `claude` mit `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` injiziert | `--remote` `--api-key` `--token` `--profile` `--port` | Beide |
| `omniroute launch-codex` | OpenAI Codex CLI | Nichts — startet `codex` mit dem `omniroute`-Anbieter, der über `-c`-Flags injiziert wird | `--remote` `--api-key` `--profile` (`-p`) `--port` | Beide |
Hinweise zu den Flags (verifiziert im Befehlsquellcode):
- `--remote <url>` — ruft den Katalog von einem entfernten OmniRoute ab (überschreibt `--port` und den aktiven Kontext). `--api-key <key>` liefert die Anmeldeinformation für diesen Server (standardmäßig auf die Umgebungsvariable `OMNIROUTE_API_KEY` oder das Token des aktiven Kontexts gesetzt).
- `--only <patterns>` — durch Kommas getrennte Teilstrings; behält nur Modell-IDs, die übereinstimmen (z. B. `--only glm,kimi`). Verfügbar bei `setup-codex`, `setup-claude`, `setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`.
- `--dry-run` — druckt genau das, was geschrieben werden würde, ohne das Dateisystem zu berühren. Verfügbar bei jedem `setup-*`-Befehl **außer** `setup-cursor` (das niemals eine Datei schreibt).
- `--model <id>` — erforderlich (oder interaktiv ausgewählt) für die Tools, die keine Modell-Autoentdeckung haben: Cline, Kilo, Roo, Goose, Qwen, Aider. Diese Tools akzeptieren auch `--yes` für nicht-interaktive Ausführungen (was dann `--model` erfordert). `setup-opencode` benötigt `--model`, um das standardmäßige oberste Modell festzulegen.
- `--model <id>` bei `omniroute run` folgt der pro-Ziel-Verkabelung des Manifests (`bin/cli/cli-manifest.mjs`): **aider** erhält `--model openai/<id>` und **opencode** `--model omniroute/<id>` (das Präfix wird nur hinzugefügt, wenn die ID es nicht bereits trägt); **qwen** und **gemini** erhalten die ID unverändert; **claude** erhält sie über `ANTHROPIC_MODEL`, **goose** über `GOOSE_MODEL`, und **codex** über `-c model_providers.omniroute.*`-Argumente. **Qwen ist das einzige Laufziel, das zwingend `--model` erfordert**`omniroute run qwen` ohne es beendet mit `2` und einem expliziten Fehler.
- `--port <port>` — lokaler OmniRoute-Port (Standard `20128`, ignoriert, wenn `--remote` gesetzt ist). Vorhanden bei allen `setup-*` und beiden Launchern.
- `omniroute run` Rückgabecodes: Der eigene Rückgabecode der untergeordneten CLI wird unverändert weitergegeben; `2` = ungültige Argumente (nicht unterstütztes Ziel, fehlendes erforderliches `--model`, Container-Schutz); `127` = die Zielbinary ist nicht im `PATH`; `130`/`143`/`129`, wenn der Start durch `SIGINT`/`SIGTERM`/`SIGHUP` beendet wird; `1` = andere Laufzeitstartfehler.
- Die beiden Launcher (`launch`, `launch-codex`) akzeptieren `--profile <name>`, um ein von `setup-claude` / `setup-codex` geschriebenes Profil auszuwählen, plus Durchlauf-Argumente für die zugrunde liegende `claude` / `codex`-Binary.
Der interaktive Picker wird auch von den Setup-Rezepten geteilt:
```bash
# Wähle aus dem aktiven lokalen oder entfernten Modellkatalog und konfiguriere das Ziel.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` delegiert derzeit an die getesteten Rezepte für `codex`, `claude`, `opencode`, `qwen`, `aider`, `goose`, `cline`, `continue` und `kilo`. IDE-only, MITM und guide-only Katalogeinträge bleiben explizite `setup-*`/manuelle Abläufe und werden nicht als startbare Ziele präsentiert.
> `setup-opencode` ist die **leichte openai-kompatible** OpenCode-Integration.
> Es gibt auch eine umfangreichere Plugin-Integration — `omniroute setup opencode` — die `@omniroute/opencode-plugin` installiert. Es sind verschiedene Befehle; die obige Tabelle dokumentiert `setup-opencode`.
---
## Lokale Nutzung
Mit OmniRoute, das auf `localhost:20128` läuft, führen Sie einfach den Setup-Befehl für Ihr Tool aus. Der Katalog wird vom lokalen Server abgerufen.
```bash
# Codex: schreibe ein Profil pro übereinstimmendem Modell in ~/.codex/
omniroute setup-codex
codex --profile glm52 # verwende ein generiertes Profil
# Claude Code: schreibe pro Modell Profile und starte dann eines
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: schreibe den openai-kompatiblen Anbieter mit allen Katalogmodellen
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # verwiesen über {env:OMNIROUTE_API_KEY}, niemals auf der Festplatte
opencode -m omniroute/glm/glm-5.2 "..."
# Tools ohne automatische Erkennung benötigen ein explizites Modell:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Vorschau ohne irgendetwas zu schreiben:
omniroute setup-continue --dry-run
```
Starten Sie ohne jegliche Konfiguration zu schreiben (nur Umgebungsinjektion):
```bash
omniroute launch # Claude Code → lokales OmniRoute
omniroute launch-codex # Codex CLI → lokales OmniRoute
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "antwort OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "antwort OK"
omniroute run qwen --model glm/glm-5.2 -- -p "antwort OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "antwort OK"
# Expliziter Befehls-Pfad: alles, was nach -- kommt, wird durchgereicht
omniroute run claude -- --print-system-prompt "überprüfe diesen Unterschied"
```
---
## Remote-Nutzung
Richten Sie jeden Setup-Befehl auf ein entferntes OmniRoute mit `--remote` + `--api-key` aus. Der Katalog wird von der Ferne abgerufen; die Konfiguration wird auf Ihrem lokalen Computer geschrieben.
```bash
# OpenCode gegen einen entfernten VPS, nur glm/kimi Modelle behalten
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # exportiere OMNIROUTE_API_KEY zuerst
# Codex-Profile aus einem entfernten Katalog
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Starte eine CLI direkt gegen die Ferne
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
Anstatt `--remote`/`--api-key` jedes Mal zu übergeben, melden Sie sich einmal an und lassen Sie den **aktiven Kontext** sie automatisch bereitstellen:
```bash
omniroute connect 192.168.0.15 # erstellt ein eingeschränktes Token, speichert den Kontext
omniroute setup-codex # ← verwendet jetzt den entfernten Katalog
omniroute setup-opencode # ← dasselbe
omniroute launch # ← Claude Code gegen die Ferne
```
Siehe [Remote-Modus](./REMOTE-MODE.md) für Kontexte, Bereiche und Token-Management.
---
## Basis-URL-Konventionen (welche Tools `/v1` wollen)
OmniRoute stellt die OpenAI-Oberfläche unter `/v1` zur Verfügung, die Anthropic-Oberfläche an der Wurzel und eine native Gemini-Oberfläche unter `/v1beta`. Jede Integration ist an die Form angeschlossen, die ihr Tool erwartet (verifiziert in der Befehlsquelle):
| Integration | Basis-URL geschrieben | `/v1`? |
| -------------------------------------------------------------------------- | --------------------- | ------------------------------------------------ |
| `setup-cline` (`openAiBaseUrl`) | Wurzel | Nein — Cline fügt `/v1/chat/completions` hinzu |
| `setup-goose` (`OPENAI_HOST`) | Wurzel | Nein — Goose fügt den Pfad hinzu |
| `setup-aider` (`OPENAI_API_BASE`) | Wurzel | Nein — LiteLLM fügt `/v1/chat/completions` hinzu |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | mit `/v1` | Ja |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | Wurzel | Nein — Claude Code fügt `/v1/messages` hinzu |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | mit `/v1` | Ja |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | mit `/v1` | Ja |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | Wurzel | Nein — das SDK fügt `/v1beta/models/…` hinzu |
---
## Native Abhängigkeiten bei Updates beibehalten: `--include=optional`
Wenn Sie mit `omniroute update` aktualisieren (nach Bestätigung oder mit `--apply`),
führt OmniRoute die Installation mit `--include=optional` aus:
```bash
npm install -g omniroute@latest --include=optional
```
Dies ist **kein** Flag, das Sie an `omniroute update` übergeben — es wird immer vom
Updater angewendet. Es garantiert, dass die `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, der LLMLingua SLM-Stack) das Update überstehen, selbst wenn Ihre npm-Konfiguration
`omit=optional` gesetzt hat, was andernfalls den nativen SQLite-Treiber und die OS-Keyring-Bindung
stillschweigend entfernen würde. Um den genauen Befehl ohne Anwendung anzuzeigen:
```bash
omniroute update --dry-run
# [DRY RUN] Würde ausgeführt: npm install -g omniroute@latest --include=optional
```
Andere `omniroute update`-Flags (verifiziert im Quellcode): `--check` (beendet mit 1, wenn
veraltet), `--apply` (installiert ohne Aufforderung), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI über `omniroute run gemini`
Vertrag verifiziert gegen `@google/gemini-cli` 0.50.0: die CLI respektiert
`GOOGLE_GEMINI_BASE_URL` und gibt `POST /v1beta/models/<model>:generateContent`
(und `:streamGenerateContent?alt=sse`) dagegen aus — genau wie die native
Gemini-Oberfläche von OmniRoute (`/v1beta`). `omniroute run gemini` verbindet das automatisch:
- `GOOGLE_GEMINI_BASE_URL` → die aktive OmniRoute-Basis-URL (Wurzel, kein `/v1`);
- `GEMINI_API_KEY` → die aufgelöste OmniRoute-Anmeldeinformation (Option/Umgebung/Kontext);
- ein **temporäres isoliertes `GEMINI_CLI_HOME`**, dessen `.gemini/settings.json`
die Authentifizierung `gemini-api-key` auswählt, sodass eine gespeicherte Google OAuth-Sitzung (Code Assist)
niemals den OmniRoute-gesteuerten Start überschreibt — nach dem Verlassen entfernt;
- **Umgebungs-Hygiene**: die Kind-Umgebung wird von `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` und `GOOGLE_GENAI_USE_GCA` bereinigt (die die
Authentifizierung an Vertex/Code Assist umleiten würden), und `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` wird
als Sicherheitsnetz gesetzt — die anderen `run`-Ziele erhalten die gleiche
Behandlung für ihre eigenen widersprüchlichen Variablen;
- `--model <id>`-Einspritzung von `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
Der Workspace-Vertrauensschutz von Gemini gilt weiterhin im Headless-Modus — übergeben Sie
`--skip-trust` (oder vertrauen Sie dem Verzeichnis interaktiv) selbst; der Launcher
umgeht dies absichtlich nicht. Dieser Launcher ist von der **ACP-Registrierung**
(`src/lib/acp/registry.ts`, `gemini --acp`) zu unterscheiden, die die
Agenten-Protokoll-Integration für `/dashboard/acp-agents` bleibt.
---
## Echter Smoke-Test (Opt-in)
Deterministische Launch-Plan-Regressionsläufe in CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). Um die REALEN Binärdateien gegen einen REALEN
OmniRoute-Server zu validieren, gibt es ein Opt-in-Harness unter
`tests/integration/upstream-cli-smoke.int.test.ts`. Es wird niemals automatisch ausgeführt
(jeder Untertest wird übersprungen, es sei denn, `RUN_CLI_SMOKE=1`), übergibt die Anmeldeinformationen
über die Umgebungsvariable NAME (niemals durch Wert), redigiert schlüsselähnliche Zeichenfolgen
aus allen aufgezeichneten Ausgaben, überspringt Ziele, deren Binärdatei nicht installiert ist,
und klassifiziert Fehler als auth / upstream / config anstelle eines einfachen Booleans:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
Optional: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` beschränkt den Test;
`OMNIROUTE_SMOKE_TIMEOUT_MS` überschreibt das Timeout von 120s pro Ziel.
---
## Siehe auch
- [Claude Code-Konfiguration](./CLAUDE-CODE-CONFIGURATION.md) — der tiefere Claude Code-Leitfaden
- [Codex CLI-Konfiguration](./CODEX-CLI-CONFIGURATION.md) — die einmalige `[model_providers.omniroute]` Basiseinrichtung
- [Remote-Modus](./REMOTE-MODE.md) — Kontexte, eingeschränkte Zugriffstoken, einen Remote-Server steuern
- [CLI-Tools-Referenz](../reference/CLI-TOOLS.md) — der vollständige Katalog unterstützter Tools + Dashboard-Seiten
- [Einrichtungsanleitung](./SETUP_GUIDE.md) — Installationsmethoden und Onboarding beim ersten Start

View File

@@ -1,86 +1,326 @@
# CLI Tools Setup Guide — OmniRoute (Deutsch)
# CLI-TOOLS (Deutsch)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "CLI-Tools — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# CLI-Tools — OmniRoute
Zuletzt aktualisiert: 2026-08-18
OmniRoute integriert sich mit drei Kategorien von CLI-Tools, die auf drei speziellen Dashboard-Seiten verteilt sind:
| Seite | Route | Konzept | Anzahl |
| -------------- | ----------------------- | ------------------------------------------------------------------------------------------ | ------------------- |
| **CLI Code's** | `/dashboard/cli-code` | Codierungswerkzeuge, die Sie auf OmniRoute verweisen (Client → CLI → OmniRoute → Provider) | 26 |
| **CLI Agents** | `/dashboard/cli-agents` | Autonome Agenten, die Sie auf OmniRoute verweisen (derselbe Fluss, breiterer Umfang) | 8 |
| **ACP Agents** | `/dashboard/acp-agents` | CLIs, die OmniRoute als Backend über stdio/ACP erzeugt (umgekehrter Fluss) | siehe Registrierung |
Legacy-Routen leiten über 308 um: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## So funktioniert es
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
CLI Code's / CLI Agents (Konsumfluss):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (alle verweisen auf OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute leitet an den richtigen Anbieter weiter)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
ACP Agents (umgekehrter Erzeugungsfluss):
Client-Anfrage → OmniRoute → erzeugt CLI über stdio/ACP → Antwort
```
**Benefits:**
**Vorteile:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Ein API-Schlüssel zur Verwaltung aller Werkzeuge
- Kostenverfolgung über alle CLIs im Dashboard
- Modellwechsel ohne Neukonfiguration jedes Werkzeugs
- Funktioniert lokal und auf Remote-Servern (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## Automatische Konfiguration mit `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
Sie müssen die Konfiguration jedes Werkzeugs nicht von Hand schreiben. OmniRoute liefert einen `setup-*`
Befehl pro unterstütztem CLI, der das **live** Modellkatalog von einem laufenden
OmniRoute (lokal oder remote) liest und die eigene Konfiguration des Werkzeugs auf Ihrem Rechner schreibt:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Jeder akzeptiert `--remote <url> --api-key <key>` (konfiguriert ein lokales Werkzeug gegen ein
remote OmniRoute), `--dry-run` (Vorschau ohne Schreiben) und `--port`. Werkzeuge
ohne automatische Modellerkennung (Cline, Kilo, Roo, Goose, Aider, Qwen) benötigen
`--model <id>` (und `--yes` für nicht-interaktive Ausführungen). Um ein CLI mit der
richtigen Umgebung zu starten und keine Konfiguration überhaupt zu schreiben, verwenden Sie den generischen
`omniroute run <target>` Launcher (claude, codex, aider, goose, opencode, qwen,
gemini — Ziele und Aliase stammen aus `bin/cli/cli-manifest.mjs`); die Legacy
pro-Werkzeug-Launcher `omniroute launch` (Claude Code) und `omniroute launch-codex`
(Codex) bleiben verfügbar. Gemini CLI ist nur zum Starten: es ist ein `omniroute run`
Ziel, hat aber kein `setup-*`/`configure` Rezept.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Vollständige Referenz:** die Mastertabelle — was jeder Befehl schreibt, jede Flagge,
> lokal vs. remote und welche Werkzeuge ein `/v1` Suffix benötigen — befindet sich in
> **[CLI-Integrationen](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Ausführen dieser innerhalb eines Containers
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
Ein `setup-*` Befehl, der innerhalb des OmniRoute-Containers ausgeführt wird, schreibt in das
eigene Home des Containers, das von keinem Host-CLI gelesen wird und mit dem
Container verschwindet. OmniRoute erkennt das und beendet mit `2` und Anweisungen, anstatt zu schreiben. Zwei unterstützte Wege nach vorne — installieren Sie das CLI auf dem Host und
`omniroute connect` zum Container, oder binden Sie die Konfigurationsverzeichnisse und setzen Sie
`CLI_CONFIG_HOME` (das Compose `host` Profil). Jeder `setup-*` Befehl, plus
`omniroute configure` und `omniroute config set`, akzeptiert
`--allow-container-write`, wenn die Konfiguration der eigenen CLIs des Containers tatsächlich gemeint war; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` tut dasselbe für
den Server. Siehe
[Docker Guide → Konfigurieren von Host-CLI-Tools](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
Der **apply endpoint** des Dashboards (`POST /api/cli-tools/apply`) erzwingt den
gleichen Schutz: in einem Container beantwortet ein Schreiben, dessen Ziel nicht vom
Host gebunden ist, mit **`422`** und `containerEphemeralTarget: true`, dem sicheren Fehlertext und — für die Werkzeuge mit einem Host-Rezept (claude, codex, opencode, cline,
kilo, continue) — einem `hostSetupCommand` (z.B. `omniroute setup-opencode`), das stattdessen auf dem Host ausgeführt werden soll; es wird nichts geschrieben. `dryRun: true` funktioniert weiterhin im Container-Modus und gibt den generierten Inhalt + Zielpfad zurück, ohne die Festplatte zu berühren, sodass Sie eine Vorschau vom Dashboard anzeigen und auf dem Host anwenden können. Dieses Verhalten ist
absichtlich und durch `tests/unit/api/cli-tools/apply-container-guard.test.ts` geschützt — niemals "reparieren" Sie ein 422, indem Sie den Schutz entfernen.
---
## Step 1 — Get an OmniRoute API Key
## Quelle der Wahrheit
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
Der einheitliche Katalog befindet sich in `src/shared/constants/cliTools.ts` als `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Jeder Eintrag hat diese Felder (definiert in `src/shared/schemas/cliCatalog.ts`):
| Feld | Typ | Beschreibung |
| ----------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `category` | `"code" \| "agent"` | Auf welcher Seite das Tool erscheint |
| `vendor` | `string` | Herkunft des Tools ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | Auch als ACP-Agent nutzbar (Abzeichen angezeigt) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Unterstützungsgrad für benutzerdefinierte Endpunkte. `"none"` = MITM-Rückstand |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Konfigurationsmechanismus |
| `id`, `name`, `color`, `description`, `docsUrl` | standard | Kernanzeigefelder |
Einträge mit `baseUrlSupport: "none"` werden **nicht angezeigt** auf den Dashboard-Seiten — sie sind im MITM-Rückstand für Plan 11 registriert (siehe `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Fähigkeitsstufen (katalogisiert × erkennbar × konfigurierbar × startbar)
Nicht jedes katalogisierte Tool ist erkennbar, konfigurierbar oder startbar. Jede Stufe hat eine deklarierende Quelle, und ein Drift-Test hält sie synchron:
| Stufe | Bedeutung | Deklariert in |
| ------------------ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Katalogisiert** | Erscheint im Dashboard-Katalog (Name, Anbieter, Dokumentation, Konfigurationstyp) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Erkennbar** | Binär-/Konfigurationsdetektion, Gesundheitsprüfungen, Konfigurationspfade | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` Laufzeitkatalog) |
| **Konfigurierbar** | Unterstützt durch `omniroute configure <cli>` (Setup-Rezept vorhanden) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **Startbar** | Unterstützt durch `omniroute run <target>` (Umgebungs-/Argumenteinfügung definiert) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` ist das kanonische ausführbare Manifest für die CLI-Befehle: `run`, `configure` und die Shell-Vervollständigungs-Generatoren leiten ihre Ziel-Listen, Alias-Auflösung (zum Beispiel `kilocode`/`kilo-code`/`kilo_cli``kilo`) und die Verkabelung des `--model`-Flags davon ab. Der Drift-Wächter `tests/unit/cli/cli-manifest-drift.test.ts` stellt sicher, dass das Manifest, der Laufzeitkatalog, der UI-Katalog und jede Verbraucherschnittstelle synchron bleiben — ein Ziel, das einer Oberfläche hinzugefügt wird, ohne dass die anderen aktualisiert werden, führt zum Fehlschlagen der Suite, anstatt stillschweigend abzuweichen.
## 1. Katalog der CLI-Tools (26 Werkzeuge)
Alle Werkzeuge, die in `/dashboard/cli-code` erscheinen. Die mit `baseUrlSupport: none` sind über MITM oder einen manuellen Leitfaden verbunden, anstatt über eine benutzerdefinierte Basis-URL:
| id | name | vendor | baseUrlSupport | configType | acpSpawnable |
| ------------ | ----------------------- | ------------------- | -------------- | -------------- | ------------ |
| claude | Claude Code | Anthropic | full | env | true |
| codex | OpenAI Codex CLI | OpenAI | full | custom | true |
| zcode | ZCode (GLM Coding Plan) | Z.ai | none | custom | false |
| cline | Cline | OSS (ex-Claude Dev) | full | custom | true |
| kilo | Kilo Code | Kilo-Org | full | custom | false |
| roo | Roo Code | Roo (OSS) | full | guide | false |
| continue | Continue | continue.dev | full | guide | false |
| aider | Aider | OSS (P. Gauthier) | full | guide | true |
| forge | ForgeCode | Antinomy HQ | full | custom | true |
| jcode | jcode | 1jehuang (OSS) | full | custom | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | full | custom | false |
| codewhale | CodeWhale | Hmbown (OSS) | full | custom | false |
| opencode | OpenCode | Anomaly (ex-SST) | full | guide | true |
| droid | Factory Droid | Factory AI | partial | guide | false |
| copilot | GitHub Copilot CLI | GitHub/MS | full | custom | false |
| cursor-cli | Cursor CLI | Anysphere | partial | guide | true |
| smelt | Smelt | leonardcser (OSS) | full | custom | false |
| pi | Pi (pi-coding-agent) | M. Zechner (OSS) | full | custom | false |
| grok-build | Grok Build | xAI | full | custom | false |
| crush | Crush | OSS (Charm) | full | custom | false |
| qwen | Qwen Code | Alibaba | full | guide | true |
| cursor | Cursor | Anysphere | none | guide | false |
| antigravity | Antigravity | Google | none | mitm | false |
| hermes | Hermes | Nous Research | none | guide | false |
| kiro | Kiro AI | Amazon | none | mitm | false |
| custom | Custom CLI | — | full | custom-builder | false |
Werkzeuge mit `baseUrlSupport: "partial"` zeigen ein Badge "⚠ Teilweise Basis-URL" in der Dashboard-Karte an.
---
## 2. CLI-Agenten-Katalog (8 Werkzeuge)
Autonome Agenten, die in `/dashboard/cli-agents` erscheinen:
| id | name | vendor | baseUrlSupport | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | Hermes-Agent | Nous Research | voll | falsch |
| openclaw | OpenClaw | OSS (P. Steinberger) | voll | wahr |
| goose | Goose | Block / Linux Foundation | voll | wahr |
| interpreter | Open Interpreter | OSS | voll | wahr |
| warp | Warp AI | Warp Inc. | teilweise | wahr |
| agent-deck | Agent Deck | asheshgoplani (OSS) | voll | falsch |
| omp | Oh My Pi | OSS | voll | wahr |
| letta | Letta CLI | Letta | voll | falsch |
---
## Step 2 — Install CLI Tools
## 3. ACP-Agenten (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Diese Seite (umbenannt von `/dashboard/agents`) zeigt CLIs, die OmniRoute als **Backend-Ausführungs-Engines** über das stdio/ACP-Protokoll **erzeugen** kann. Der Katalog wird separat in `src/lib/acp/registry.ts` gepflegt und ist **nicht** dasselbe wie `CLI_TOOLS`.
---
## 4. MITM-Rückstand (nicht im Dashboard angezeigt)
Die folgenden CLIs unterstützen nativ keine benutzerdefinierte Basis-URL und sind **nicht aufgeführt** auf den Seiten CLI Code oder CLI Agents. Sie sind Kandidaten für die MITM-Abfangung im Plan 11:
| CLI | Grund |
| ------------------- | ----------------------------------------------------------------------- |
| windsurf | BYOK beschränkt auf ausgewählte Claude-Modelle + Unternehmens-URL/Token |
| amp | Geschlossenes Ökosystem (Sourcegraph) |
| amazon-q / kiro-cli | AWS SSO-Auth, keine benutzerdefinierte URL |
| cowork | Anthropic Desktop, kein konfigurierbarer Endpunkt |
Siehe `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` für das vollständige Querverzeichnis.
---
## 5. Batch Detection API
Alle Werkzeugerkennungen werden über einen einzigen Endpunkt aggregiert:
**`GET /api/cli-tools/all-statuses`**
- Auth: `requireCliToolsAuth(request)` (gleich wie bei anderen `/api/cli-tools/` Routen)
- Gibt zurück: `Record<toolId, ToolBatchStatus>` (Typ: `src/shared/types/cliBatchStatus.ts`)
- Strategie: `Promise.all` über alle Werkzeuge, 5s Timeout pro Werkzeug
- Cache: In-Memory LRU, indiziert nach Konfigurationsdatei `mtime`. Cache wird ungültig, wenn sich mtime ändert. Wird beim Neustart des Servers zurückgesetzt.
Antwortstruktur pro Werkzeug:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // bereinigt, keine Stack-Traces
}
```
## 6. Einstellungen für neue Werkzeuge
Neue Werkzeuge mit `configType: "custom"` haben dedizierte API-Routen für Einstellungen:
| Route | Werkzeug |
| ------------------------------------------- | --------------------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url Flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legacy) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, primär + legacy `~/.deepseek` Synchronisierung) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi Coding-Agent |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + dedizierter `.env` Schlüssel) |
Alle Routen verwenden `sanitizeErrorMessage()` für Fehlermeldungen (Hard Rule #12).
---
## 7. Architektur der Dashboard-Seiten
### CLI-Code (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — Serverkomponente
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — Client-Grid
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — Werkzeug-Detailseite
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 spezialisierte Werkzeugkarten + `ToolDetailClient.tsx`
### CLI-Agenten (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — Serverkomponente
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — Client-Grid
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — wiederverwendet `ToolDetailClient`
### ACP-Agenten (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — Serverkomponente (verschoben von `agents/`)
### Gemeinsame UI-Komponenten (`src/shared/components/cli/`)
| Datei | Zweck |
| ----------------------- | --------------------------------------------------------------- |
| `CliToolCard.tsx` | Intelligente Statuskarte (Erkennung + Konfiguration + Endpunkt) |
| `CliConceptCard.tsx` | Konzept-Erklärungskarte pro Seite |
| `CliComparisonCard.tsx` | Dreispaltiger Vergleich zwischen CLI-Typen |
| `BaseUrlSelect.tsx` | Endpunkt-Dropdown (Lokal/Cloud/Benutzerdefiniert) |
| `ApiKeySelect.tsx` | API-Schlüssel-Auswahl |
| `ManualConfigModal.tsx` | Kopierbarer Konfigurationsausschnitt-Modus |
### Gemeinsamer Hook (`src/shared/hooks/cli/`)
| Datei | Zweck |
| ------------------------- | ----------------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | Ruft `/api/cli-tools/all-statuses` ab, verwaltet Lade-/Aktualisierungszustand |
## 8. i18n
Neue Namensräume, die in Plan 14 F9 hinzugefügt wurden:
| Namensraum | Zweck |
| ----------- | ----------------------------------------------------------------------------------------------- |
| `cliCommon` | Gemeinsame Strings (Kartenbeschriftungen, Konzept-/Vergleichstexte, Detailseitenbeschriftungen) |
| `cliCode` | Strings der CLI-Code-Seite |
| `cliAgents` | Strings der CLI-Agenten-Seite |
| `acpAgents` | Strings der ACP-Agenten-Seite |
Vollständige PT-BR- und EN-Übersetzungen sind vorhanden. 39 andere Lokalisierungen fallen automatisch auf EN über die Namensraum-Ebene in `src/i18n/request.ts` zurück.
---
## 9. Schnellstart
### Schritt 1 — Holen Sie sich einen OmniRoute API-Schlüssel
1. Öffnen Sie `/dashboard/api-manager`**API-Schlüssel erstellen**
2. Geben Sie ihm einen Namen (z.B. `cli-tools`) und wählen Sie alle Berechtigungen aus
3. Kopieren Sie den Schlüssel — Sie benötigen ihn für jede CLI unten
> Ihr Schlüssel sieht so aus: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Schritt 2 — Installieren Sie die CLI-Tools
Alle npm-basierten Tools erfordern Node.js 22.22.2+ oder 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +338,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (startbar über `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Rust-basiert
# Pi-Coding-Agent
# siehe https://github.com/zechnerj/pi-coding-agent für die Installation
# jcode
# siehe https://github.com/1jehuang/jcode für die Installation
```
---
## Step 3 — Set Global Environment Variables
### Schritt 3 — Konfigurieren Sie über das Dashboard
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. Gehen Sie zu `http://localhost:20128/dashboard/cli-code`
2. Finden Sie Ihr Tool im Raster
3. Klicken Sie auf die Karte, um die Detailseite des Tools zu öffnen
4. Wählen Sie Ihren API-Schlüssel und die Basis-URL aus
5. Klicken Sie auf **Konfiguration anwenden** oder kopieren Sie den manuellen Konfigurationsausschnitt
---
### Schritt 4 — Setzen Sie globale Umgebungsvariablen
```bash
# OmniRoute Universal Endpoint
# OmniRoute Universeller Endpunkt
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI liest GOOGLE_GEMINI_BASE_URL an der WURZEL (sein SDK fügt /v1beta/... selbst hinzu)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> Für einen **Remote-Server** ersetzen Sie `localhost:20128` durch die Server-IP oder Domain,
> z.B. `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### Schritt 4 — Konfigurieren Sie jedes Tool
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Erstellen Sie ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
Verwenden Sie das einheitliche Anthropic-Gateway-Wurzel für Claude Code. Fügen Sie hier nicht `/v1` hinzu.
**Test:** `claude "sag hallo"`
---
### OpenAI Codex
#### OpenAI Codex
Der moderne Codex (v0.137+) liest nur `~/.codex/config.toml` — die alte
`config.yaml` gehört zur Legacy-npm-CLI und wird stillschweigend ignoriert. Der API
Schlüssel bleibt in der Umgebungsvariablen `OMNIROUTE_API_KEY` (`env_key`), niemals
innerhalb der Datei:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
**Test:** `codex "what is 2+2?"`
Vollständige Referenz (Profile, `wire_api`, Kontextfenster): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Test:** `codex "was ist 2+2?"`
---
### OpenCode
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `opencode`
> Verwenden Sie `opencode run "Ihr Prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> um Denkvarianten zu senden.
---
### Cline (CLI or VS Code)
#### Cline (CLI oder VS Code)
**CLI mode:**
**CLI-Modus:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +481,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible` → Base URL: `http://localhost:20128/v1`
**VS Code-Modus:**
Cline-Erweiterungseinstellungen → API-Anbieter: `OpenAI Compatible` → Basis-URL: `http://localhost:20128/v1`
Or use the OmniRoute dashboard → **CLI Tools → Cline → Apply Config**.
Oder verwenden Sie das OmniRoute-Dashboard → **CLI-Tools → Cline → Konfiguration anwenden**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI oder VS Code)
**CLI mode:**
**CLI-Modus:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**VS Code-Einstellungen:**
```json
{
@@ -223,13 +505,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard → **CLI Tools → KiloCode → Apply Config**.
Oder verwenden Sie das OmniRoute-Dashboard → **CLI-Tools → KiloCode → Konfiguration anwenden**.
---
### Continue (VS Code Extension)
#### Continue (VS Code-Erweiterung)
Edit `~/.continue/config.yaml`:
Bearbeiten Sie `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +523,253 @@ models:
default: true
```
Restart VS Code after editing.
Starten Sie VS Code nach der Bearbeitung neu.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Verwenden Sie dies, wenn VS Code Insiders für benutzerdefinierte Endpunktmodelle konfiguriert ist und Sie möchten, dass OmniRoute ohne ein benutzerdefiniertes Headerfeld funktioniert.
**Empfohlener Speicherort:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Beispiel unter Verwendung des tokenisierten OmniRoute-Alias:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Hinweise:**
- Ersetzen Sie `sk-your-omniroute-key` durch einen in OmniRoute erstellten API-Schlüssel.
- Das `url`-Feld sollte auf `/api/v1/vscode/{token}/chat/completions` zeigen.
- Das `modelsUrl`-Feld sollte auf `/api/v1/vscode/{token}/models` zeigen.
- Bevorzugen Sie den normalen `/v1` + Bearer-Header-Flow, wenn der Client benutzerdefinierte Header unterstützt.
- URL-eingebettete Tokens sind ein Kompatibilitätsfallback und können in Editorprotokollen oder Proxyverläufen erscheinen.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# Melden Sie sich bei Ihrem AWS/Kiro-Konto an:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# Die CLI verwendet ihre eigene Authentifizierung — OmniRoute wird nicht als Backend für die Kiro CLI selbst benötigt.
# Verwenden Sie kiro-cli zusammen mit OmniRoute für andere Tools.
kiro-cli status
```
---
Für die **Kiro IDE** Desktop-App verwenden Sie den MITM-Endpunkt, der von OmniRoute unter `/dashboard/cli-tools → Kiro` bereitgestellt wird.
### Qwen Code (Alibaba)
## 10. Interne OmniRoute CLI
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
Die `omniroute`-Binärdatei bietet Befehle für den Serverlebenszyklus, die Einrichtung, Diagnosen und das Management von Anbietern. Einstiegspunkt: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Server starten (Standardport 20128)
omniroute setup # Interaktiver Einrichtungsassistent
omniroute doctor # Konfiguration, DB, Ports, Laufzeit überprüfen
omniroute providers list # Konfigurierte Anbieterverbindungen
omniroute providers test-all # Jede aktive Verbindung testen
omniroute reset-password # Admin-Passwort zurücksetzen
omniroute logs # Anforderungsprotokolle streamen
omniroute health # Detaillierte Gesundheit (Schalter, Cache, Speicher)
omniroute --version # Version drucken
omniroute --help # Alle Befehle anzeigen
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Einrichtung & Initialisierung
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # Interaktiver Einrichtungsassistent
omniroute setup --non-interactive # CI/Automatisierungsmodus (liest Umgebungsvariablen + Flags)
omniroute setup --password '<value>' # Admin-Passwort direkt festlegen
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Anbieter hinzufügen und in einem Schritt testen
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
Erkannte Umgebungsvariablen für die nicht-interaktive Einrichtung:
**Test:** `qwen "say hello"`
| Var | Zweck |
| ------------------- | ------------------------------------------------------------------------ |
| `OMNIROUTE_API_KEY` | Anbieter-API-Schlüssel (gebunden an `--api-key` über Commander `.env()`) |
| `DATA_DIR` | Überschreibt das OmniRoute-Datenverzeichnis |
### Cursor (Desktop App)
Alle anderen nicht-interaktiven Eingaben werden als Flags übergeben, nicht als Umgebungsvariablen:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(siehe die Optionen `omniroute setup` oben).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## Fehlerbehebung
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### Diagnosen
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # Konfiguration, DB, Ports, Laufzeit, Speicher, Lebensfähigkeit überprüfen
omniroute doctor --json # Maschinenlesbares JSON
omniroute doctor --no-liveness # HTTP-Gesundheitsprüfung überspringen
omniroute doctor --host 0.0.0.0 # Lebensfähigkeits-Host überschreiben
omniroute doctor --liveness-url <url> # Vollständige URL-Überschreibung des Gesundheitsendpunkts
```
Der Arzt führt diese Überprüfungen durch: `Konfiguration`, `Datenbank`, `Speicher/Verschlüsselung`,
`Portverfügbarkeit`, `Node-Laufzeit`, `Native Binärdatei` (better-sqlite3),
`Speicher` und `Serverlebensfähigkeit`. Er beendet mit einem Nicht-Null-Wert, wenn eine Überprüfung `fehlt`.
### Anbieterverwaltung
```bash
omniroute providers available # OmniRoute-Anbieterkatalog
omniroute providers available --search openai # Katalog nach ID/Name/Alias/Kategorie filtern
omniroute providers available --category api-key # Nach Kategorie filtern (api-key, oauth, free, ...)
omniroute providers available --json # Maschinenlesbares JSON
omniroute providers list # Konfigurierte Anbieterverbindungen
omniroute providers list --json
omniroute providers test <id|name> # Eine konfigurierte Verbindung testen
omniroute providers test-all # Jede aktive Verbindung testen
omniroute providers validate # Nur lokal strukturelle Validierung
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Vorhandener OAuth-Fluss
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` sind API-first und funktionieren daher gegen
den aktiven lokalen oder entfernten Kontext. Die Eingabe von Anmeldeinformationen sollte
`--credential-stdin` oder `--credential-env` verwenden; `--dry-run --json` berichtet nur
über die redigierte Präsenz/Form. `providers available` liest den OmniRoute-Katalog;
`providers list/test/test-all/validate` behalten ihr lokales SQLite-Verhalten bei und
erfordern nicht, dass der Server läuft.
### Wiederherstellung & Zurücksetzen
```bash
omniroute reset-password # Admin-Passwort zurücksetzen (auch: omniroute-reset-password)
omniroute reset-encrypted-columns # Warnung anzeigen + Trockenlauf für das Zurücksetzen verschlüsselter Anmeldeinformationen
omniroute reset-encrypted-columns --force # Tatsächlich verschlüsselte Anmeldeinformationen in SQLite nullen
```
### Anmeldeinformationen exportieren (⚠ vorsichtig behandeln)
```bash
omniroute auth export # Warnung anzeigen + Bestätigungstür — kein DB-Zugriff
omniroute auth export --force # ALLE Verbindungen DEKRYPTIERTE Anmeldeinformationen als JSON in stdout exportieren
omniroute auth export --force --id <id> # Nur die übereinstimmende Verbindung exportieren
omniroute auth export --force --format env # OMNIROUTE_<PROVIDER>_<FIELD>=<value> Zeilen ausgeben
omniroute auth export --force --out creds.json # In eine Datei schreiben (mit 0600 Berechtigungen erstellt)
```
`auth export` ist **nur lokal** (direkter SQLite-Lesezugriff, kein HTTP-Routen) und druckt/schreibt absichtlich
**Klartext** `apiKey`/`accessToken`/`refreshToken`/`idToken`-Werte — das ist das Feature, kein
Fehler. Nichts wird aus der Datenbank gelesen und nichts wird entschlüsselt, ohne `--force`. Ein stderr
Warnbanner wird immer vor der Ausgabe von Klartext gedruckt. Erfordert, dass `STORAGE_ENCRYPTION_KEY` gesetzt ist. Ein Feld, das nicht entschlüsselt werden kann (veralteter Schlüssel, beschädigter Chiffretext), wird als
`<field>DecryptFailed: true` gemeldet, anstatt den gesamten Export abzubrechen oder den zugrunde liegenden Fehler zu leaken.
### Andere Unterbefehle
Diese setzen einen laufenden OmniRoute-Server voraus, es sei denn, es wird anders angegeben:
```bash
omniroute status # Umfassender Laufzeitstatus
omniroute logs # Anforderungsprotokolle streamen (--json, --search, --follow)
omniroute config show # Aktuelle Konfiguration anzeigen
omniroute provider list # Verfügbare Anbieter auflisten (Alias von providers list)
omniroute provider add # OmniRoute als Anbieter in einem Tool registrieren
omniroute keys add | list | remove # API-Schlüssel verwalten
omniroute models [provider] # Modelle auflisten (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Snapshot von Konfiguration + DB
omniroute restore # Aus einem vorherigen Snapshot wiederherstellen
omniroute health # Detaillierte Gesundheit (Schalter, Cache, Speicher)
omniroute quota # Anbieterquotenverbrauch
omniroute cache # Cache-Status
omniroute cache clear # Semantische + Signatur-Caches leeren
omniroute mcp status | restart # MCP-Serverstatus / Neustart
omniroute a2a status | card # A2A-Serverstatus / Agentenkarte
omniroute tunnel list | create | stop # Tunnel verwalten (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Umgebungsvariablen inspizieren / setzen (vorübergehend)
omniroute test # Anbieter-Konnektivitätstest
omniroute update # Auf Updates überprüfen
omniroute completion # Shell-Vervollständigung generieren
```
### Häufige Flags
| Flag | Beschreibung |
| ------------------- | ----------------------------------------------------------- |
| `--no-open` | Browser beim Start nicht automatisch öffnen |
| `--port <n>` | API-Port überschreiben (Standard 20128) |
| `--mcp` | Als MCP-Server über stdio (für IDEs) ausführen |
| `--non-interactive` | CI-Modus (keine Eingabeaufforderungen; liest von env/flags) |
| `--json` | Maschinenlesbare JSON-Ausgabe (doctor, providers usw.) |
| `--help`, `-h` | Befehlsspezifische Hilfe anzeigen |
| `--version`, `-v` | Installierte Version drucken |
---
## Verfügbare API-Endpunkte
| Endpunkt | Beschreibung | Verwendung |
| -------------------------- | ------------------------------ | ----------------------------------------- |
| `/v1/chat/completions` | Standard-Chat (alle Anbieter) | Alle modernen Werkzeuge |
| `/v1/responses` | Responses API (OpenAI-Format) | Codex, agentische Workflows |
| `/v1/completions` | Legacy-Textvervollständigungen | Ältere Werkzeuge, die `prompt:` verwenden |
| `/v1/embeddings` | Text-Embeddings | RAG, Suche |
| `/v1/images/generations` | Bildgenerierung | GPT-Image, Flux usw. |
| `/v1/audio/speech` | Text-zu-Sprache | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Sprache-zu-Text | Deepgram, AssemblyAI |
Bereit zum Einfügen Beispiele mit einer tokenisierten OmniRoute-URL:
```txt
Token-Beispiel: sk-a3ab3c080beaee3a-69f4a4-070d71af
Standard OpenAI-Basis: http://localhost:20128/v1
VS Code-Modelle: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
VS Code-Chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
VS Code-Antworten: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Ollama-Tags: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Ollama-Chat: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Fehlersuche
| Fehler | Ursache | Lösung |
| ------------------------------------------------- | -------------------------------- | ----------------------------------------------------------- |
| `Connection refused` | OmniRoute läuft nicht | `omniroute serve` |
| `401 Unauthorized` | Falscher API-Schlüssel | Überprüfen in `/dashboard/api-manager` |
| `No combo configured` | Keine aktive Routing-Kombination | Einrichten in `/dashboard/combos` |
| CLI zeigt "nicht installiert" | Binary nicht im PATH | Überprüfen mit `which <command>` |
| Dashboard zeigt "nicht erkannt" nach Installation | Cache veraltet | Klicken Sie auf "⟳ Erkennung aktualisieren" im Dashboard |
| Alter Link `/dashboard/cli-tools` | Lesezeichen vor v3.8.6 | Automatische Weiterleitung zu `/dashboard/cli-code` (308) |
| Alter Link `/dashboard/agents` | Lesezeichen vor v3.8.6 | Automatische Weiterleitung zu `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

View File

@@ -0,0 +1,299 @@
# CLI-INTEGRATIONS (Español)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇷 [fa](../../../fa/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "Integraciones CLI — dirija cualquier CLI de codificación a OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# Integraciones CLI
OmniRoute incluye una familia de comandos `setup-*` que configuran un CLI de codificación (Codex, Claude Code, OpenCode, Cline, …) para usar OmniRoute como su backend — así que la herramienta se comunica con **un** endpoint y OmniRoute dirige a el proveedor correcto con retroceso automático. Cada comando lee el catálogo de modelos **en vivo** de un OmniRoute en ejecución (local o remoto) y escribe el archivo de configuración de la herramienta en **tu** máquina. La clave API se referencia mediante una variable de entorno donde la herramienta lo soporte. Los comandos que persisten un archivo de entorno local de la herramienta se anotan a continuación.
También hay un lanzador genérico — `omniroute run <target>` — que inicia `claude`, `codex`, `aider`, `goose`, `opencode`, `qwen` o `gemini` con el entorno correcto inyectado, sin escribir ninguna configuración en absoluto. Los objetivos y sus alias provienen del manifiesto canónico `bin/cli/cli-manifest.mjs` (`claude-code|cc|anthropic`, `codex-cli|openai-codex|openai`, `goose-cli`, `open-code`, `qwen-code`, `gemini-cli`), y `omniroute completion` ofrece las mismas palabras de objetivo derivadas del manifiesto. Los lanzadores por herramienta heredados — `omniroute launch` (Claude Code) y `omniroute launch-codex` (Codex) — siguen disponibles.
La incorporación de proveedores está disponible desde el mismo contexto local/remoto. Los comandos API-first a continuación mantienen la autenticación de gestión separada de las credenciales del proveedor y nunca imprimen una credencial en la salida estructurada:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
Para scripts, se prefiere `--credential-stdin` o `--credential-env`; `--credential` se conserva para uso local controlado. `providers remove` requiere `--yes` en un terminal no interactivo, y los cinco comandos honran el contexto activo o las opciones globales `--base-url`/`--api-key`.
Para la configuración base escrita a mano de una sola vez de las dos integraciones más ricas, consulte las profundizaciones por herramienta:
- [Configuración de Claude Code](./CLAUDE-CODE-CONFIGURATION.md)
- [Configuración de Codex CLI](./CODEX-CLI-CONFIGURATION.md)
- [Modo Remoto](./REMOTE-MODE.md) — controla un OmniRoute remoto (VPS / Tailnet) desde tu laptop
- [VS Code Copilot Chat](./VSCODE-COPILOT.md) — la extensión OmniCopilot; también puede ejecutar estos
comandos `setup-*` por ti desde dentro del editor
---
## Tabla maestra
Cada comando honra el **contexto activo** (establecido con `omniroute connect`, vea
[Modo Remoto](./REMOTE-MODE.md)) o las banderas explícitas `--remote <url> --api-key <key>`. "Local vs remoto" a continuación significa: sin banderas se dirige a `http://localhost:20128`; con `--remote` (o un contexto remoto activo) se obtiene el catálogo de ese servidor y se escribe la configuración localmente.
| Comando | Herramienta | Lo que escribe | Banderas clave | Local vs remoto |
| -------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — un perfil por modelo de texto compatible (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | Ambos |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — un perfil por modelo coincidente (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | Ambos |
| `omniroute setup-opencode` | OpenCode (compatible con openai) | `~/.config/opencode/opencode.json` — proveedor `omniroute` con cada modelo del catálogo (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | Ambos |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (modo CLI) + imprime la configuración de la extensión de VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | Ambos |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + fusiona `kilocode.*` en `settings.json` de VS Code si está presente | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | Ambos |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml` — modelos `provider: openai`, clave a través de `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Ambos |
| `omniroute setup-cursor` | Cursor | Nada — imprime los pasos en la aplicación (la configuración de Cursor es opaca SQLite) | `--remote` `--api-key` `--only` `--port` | Ambos |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (documento de importación) + establece `roo-cline.autoImportSettingsPath` si existe un `settings.json` de VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | Ambos |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json` — proveedor `compatible con openai`, clave a través de `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | Ambos |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + imprime receta de entorno | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Ambos |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + imprime receta de entorno | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | Ambos |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — matriz `modelProviders.openai` V4 + `OMNIROUTE_API_KEY` en `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | Ambos |
| `omniroute run <target>` | Lanzamiento en tiempo de ejecución (genérico) | Nada — inicia `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` con el entorno y argumentos correctos; Qwen y Gemini utilizan un hogar aislado temporal | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | Ambos |
| `omniroute launch` | Claude Code | Nada — inicia `claude` con `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` inyectados | `--remote` `--api-key` `--token` `--profile` `--port` | Ambos |
| `omniroute launch-codex` | OpenAI Codex CLI | Nada — inicia `codex` con el proveedor `omniroute` inyectado a través de banderas `-c` | `--remote` `--api-key` `--profile` (`-p`) `--port` | Ambos |
Notas sobre las banderas (verificadas en la fuente del comando):
- `--remote <url>` — obtiene el catálogo de un OmniRoute remoto (anula `--port`
y el contexto activo). `--api-key <key>` proporciona la credencial para ese
servidor (por defecto a la variable de entorno `OMNIROUTE_API_KEY`, o el token del contexto activo).
- `--only <patterns>` — subcadenas separadas por comas; mantiene solo los IDs de modelo que coinciden
(por ejemplo, `--only glm,kimi`). Disponible en `setup-codex`, `setup-claude`,
`setup-opencode`, `setup-continue`, `setup-cursor`, `setup-crush`.
- `--dry-run` — imprime exactamente lo que se escribiría sin tocar el
sistema de archivos. Disponible en cada comando `setup-*` **excepto** `setup-cursor`
(que nunca escribe un archivo).
- `--model <id>` — requerido (o seleccionado interactivamente) para las herramientas que no tienen
auto-descubrimiento de modelos: Cline, Kilo, Roo, Goose, Qwen, Aider. Esas herramientas
también aceptan `--yes` para ejecuciones no interactivas (que luego requieren `--model`).
`setup-opencode` toma `--model` para establecer el modelo predeterminado de nivel superior.
- `--model <id>` en `omniroute run` sigue el cableado por objetivo del manifiesto
(`bin/cli/cli-manifest.mjs`): **aider** recibe `--model openai/<id>` y
**opencode** `--model omniroute/<id>` (el prefijo se agrega solo cuando el id
no lo lleva ya); **qwen** y **gemini** reciben el id tal cual;
**claude** lo obtiene a través de `ANTHROPIC_MODEL`, **goose** a través de `GOOSE_MODEL`, y
**codex** a través de argumentos `-c model_providers.omniroute.*`. **Qwen es el único objetivo de ejecución
que requiere obligatoriamente `--model`** — `omniroute run qwen` sin él sale
`2` con un error explícito.
- `--port <port>` — puerto local de OmniRoute (por defecto `20128`, ignorado cuando se establece `--remote`).
Presente en todos los `setup-*` y ambos lanzadores.
- Códigos de salida de `omniroute run`: el propio código de salida del CLI hijo se propaga
tal cual; `2` = argumentos inválidos (objetivo no soportado, falta `--model` requerido, guardia de contenedor); `127` = el binario objetivo no está en `PATH`;
`130`/`143`/`129` cuando el lanzamiento se termina por `SIGINT`/`SIGTERM`/`SIGHUP`;
`1` = otro fallo de lanzamiento en tiempo de ejecución.
- Los dos lanzadores (`launch`, `launch-codex`) aceptan `--profile <name>` para seleccionar
un perfil escrito por `setup-claude` / `setup-codex`, además de argumentos de paso para
el binario subyacente `claude` / `codex`.
El selector interactivo también se comparte por las recetas de configuración:
```bash
# Selecciona del catálogo de modelos local o remoto activo y configura el objetivo.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` actualmente delega en las recetas probadas para `codex`, `claude`,
`opencode`, `qwen`, `aider`, `goose`, `cline`, `continue`, y `kilo`. Las entradas de catálogo solo para IDE,
MITM, y solo guía permanecen como flujos explícitos `setup-*`/manuales y no se presentan como objetivos lanzables.
> `setup-opencode` es la integración de OpenCode **compatible con openai** y ligera.
> También hay una integración de plugin más rica — `omniroute setup opencode` — que
> instala `@omniroute/opencode-plugin`. Son comandos diferentes; la tabla
> anterior documenta `setup-opencode`.
---
## Uso local
Con OmniRoute ejecutándose en `localhost:20128`, solo ejecuta el comando de configuración para tu herramienta. El catálogo se obtiene del servidor local.
```bash
# Codex: escribe un perfil por modelo coincidente en ~/.codex/
omniroute setup-codex
codex --profile glm52 # usa un perfil generado
# Claude Code: escribe perfiles por modelo, luego lanza uno
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: escribe el proveedor compatible con openai con todos los modelos del catálogo
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # referenciado a través de {env:OMNIROUTE_API_KEY}, nunca en disco
opencode -m omniroute/glm/glm-5.2 "..."
# Herramientas sin auto-descubrimiento necesitan un modelo explícito:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# Vista previa sin escribir nada:
omniroute setup-continue --dry-run
```
Lanza sin escribir ninguna configuración en absoluto (solo inyección de env):
```bash
omniroute launch # Claude Code → OmniRoute local
omniroute launch-codex # Codex CLI → OmniRoute local
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# Ruta de comando explícita: pasa todo lo que venga después de --
omniroute run claude -- --print-system-prompt "revisa esta diferencia"
```
---
## Uso remoto
Apunta cualquier comando de configuración a un OmniRoute remoto con `--remote` + `--api-key`. El catálogo se obtiene del remoto; la configuración se escribe en tu máquina local.
```bash
# OpenCode contra un VPS remoto, mantener solo modelos glm/kimi
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # exporta OMNIROUTE_API_KEY primero
# Perfiles de Codex desde un catálogo remoto
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# Lanza un CLI directamente contra el remoto
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
En lugar de pasar `--remote`/`--api-key` cada vez, inicia sesión una vez y deja que el **contexto activo** los proporcione automáticamente:
```bash
omniroute connect 192.168.0.15 # genera un token con alcance, almacena el contexto
omniroute setup-codex # ← ahora usa el catálogo remoto
omniroute setup-opencode # ← lo mismo
omniroute launch # ← Claude Code contra el remoto
```
Consulta [Modo Remoto](./REMOTE-MODE.md) para contextos, alcances y gestión de tokens.
---
## Convenciones de URL base (que las herramientas quieren `/v1`)
OmniRoute expone la superficie de OpenAI en `/v1`, la superficie de Anthropic en la raíz, y una superficie nativa de Gemini en `/v1beta`. Cada integración está conectada a la forma que su herramienta espera (verificado en la fuente del comando):
| Integración | URL base escrita | `/v1`? |
| -------------------------------------------------------------------------- | ---------------- | ----------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | raíz | No — Cline añade `/v1/chat/completions` |
| `setup-goose` (`OPENAI_HOST`) | raíz | No — Goose añade la ruta |
| `setup-aider` (`OPENAI_API_BASE`) | raíz | No — LiteLLM añade `/v1/chat/completions` |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | con `/v1` | Sí |
| `setup-claude` (`ANTHROPIC_BASE_URL`), `launch` | raíz | No — Claude Code añade `/v1/messages` |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | con `/v1` | Sí |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | con `/v1` | Sí |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | raíz | No — el SDK añade `/v1beta/models/…` |
---
## Manteniendo las dependencias nativas en la actualización: `--include=optional`
Cuando actualizas con `omniroute update` (después de confirmar, o con `--apply`),
OmniRoute ejecuta la instalación con `--include=optional` incorporado:
```bash
npm install -g omniroute@latest --include=optional
```
Este **no** es un flag que pasas a `omniroute update` — siempre se aplica por el
actualizador. Garantiza que las `optionalDependencies` (`better-sqlite3`, `keytar`,
`tls-client`, la pila LLMLingua SLM) sobrevivan a la actualización incluso si tu configuración de npm
tiene `omit=optional` establecido, lo que de otro modo eliminaría silenciosamente el controlador nativo de SQLite
y el enlace del keyring del sistema operativo. Para previsualizar el comando exacto sin aplicar:
```bash
omniroute update --dry-run
# [DRY RUN] Ejecutaría: npm install -g omniroute@latest --include=optional
```
Otros flags de `omniroute update` (verificados en el código fuente): `--check` (salir 1 si
desactualizado), `--apply` (instalar sin preguntar), `--changelog`, `--no-backup`,
`--yes`.
---
## Google Gemini CLI a través de `omniroute run gemini`
Contrato verificado contra `@google/gemini-cli` 0.50.0: la CLI respeta
`GOOGLE_GEMINI_BASE_URL` y emite `POST /v1beta/models/<model>:generateContent`
(y `:streamGenerateContent?alt=sse`) contra él — exactamente la superficie nativa de
Gemini de OmniRoute (`/v1beta`). `omniroute run gemini` lo conecta automáticamente:
- `GOOGLE_GEMINI_BASE_URL` → la URL base activa de OmniRoute (raíz, sin `/v1`);
- `GEMINI_API_KEY` → la credencial resuelta de OmniRoute (opción/env/contexto);
- un **`GEMINI_CLI_HOME` temporal aislado** cuyo `.gemini/settings.json`
selecciona la autenticación `gemini-api-key`, por lo que una sesión de Google OAuth almacenada (Code Assist)
nunca anula el lanzamiento dirigido por OmniRoute — eliminado después de salir;
- **higiene del entorno**: el entorno hijo se limpia de `GOOGLE_API_KEY`,
`GOOGLE_GENAI_USE_VERTEXAI` y `GOOGLE_GENAI_USE_GCA` (que redirigirían
la autenticación a Vertex/Code Assist), y se establece `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key` como
un respaldo adicional — los otros objetivos de `run` reciben el mismo
tratamiento para sus propias variables en conflicto;
- inyección de `--model <id>` desde `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
La guardia de confianza del espacio de trabajo de Gemini aún se aplica en modo sin cabeza — pasa
`--skip-trust` (o confía en el directorio de forma interactiva) tú mismo; el lanzador
deliberadamente no lo omite. Este lanzador es distinto de la **registración ACP**
(`src/lib/acp/registry.ts`, `gemini --acp`), que sigue siendo la
integración del protocolo de agente para `/dashboard/acp-agents`.
---
## Barrido de humo real (opcional)
Las ejecuciones de regresión del plan de lanzamiento determinista se realizan en CI (`tests/unit/cli/run-command.test.ts`,
`tests/unit/cli/run-execution.test.ts`). Para validar los binarios REALES contra un servidor REAL
de OmniRoute, existe un arnés opcional en
`tests/integration/upstream-cli-smoke.int.test.ts`. Nunca se ejecuta automáticamente
(cada sub-prueba se salta a menos que `RUN_CLI_SMOKE=1`), pasa la credencial por la variable de entorno
NOMBRE (nunca por valor), redacta cadenas con forma de clave de cualquier salida registrada, salta
objetivos cuyo binario no está instalado, y clasifica fallos como
autenticación / upstream / configuración en lugar de un booleano simple:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
Opcional: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` restringe el barrido;
`OMNIROUTE_SMOKE_TIMEOUT_MS` anula el tiempo de espera de 120s por objetivo.
---
## Ver también
- [Configuración de Claude Code](./CLAUDE-CODE-CONFIGURATION.md) — la guía más profunda de Claude Code
- [Configuración de Codex CLI](./CODEX-CLI-CONFIGURATION.md) — la configuración base de una sola vez `[model_providers.omniroute]`
- [Modo Remoto](./REMOTE-MODE.md) — contextos, tokens de acceso con alcance, controlando un servidor remoto
- [Referencia de Herramientas CLI](../reference/CLI-TOOLS.md) — el catálogo completo de herramientas soportadas + páginas del panel de control
- [Guía de Configuración](./SETUP_GUIDE.md) — métodos de instalación y orientación en el primer uso

View File

@@ -1,86 +1,333 @@
# CLI Tools Setup Guide — OmniRoute (Español)
# CLI-TOOLS (Español)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇮🇷 [fa](../../../fa/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "Herramientas CLI — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# Herramientas CLI — OmniRoute
Última actualización: 2026-08-18
OmniRoute se integra con tres categorías de herramientas CLI distribuidas en tres páginas de panel dedicadas:
| Página | Ruta | Concepto | Conteo |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------------- | ------------ |
| **Código CLI** | `/dashboard/cli-code` | Herramientas de codificación que apuntas a OmniRoute (Cliente → CLI → OmniRoute → Proveedor) | 26 |
| **Agentes CLI** | `/dashboard/cli-agents` | Agentes autónomos que apuntas a OmniRoute (mismo flujo, mayor alcance) | 8 |
| **Agentes ACP** | `/dashboard/acp-agents` | CLIs que OmniRoute genera como backend a través de stdio/ACP (flujo inverso) | ver registro |
Las rutas heredadas redirigen a través de 308: `/dashboard/cli-tools``/dashboard/cli-code`, `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## Cómo Funciona
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
Código CLI / Agentes CLI (flujo de consumo):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (todos apuntan a OmniRoute)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute enruta al proveedor correcto)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
Agentes ACP (flujo de generación inverso):
Solicitud del cliente → OmniRoute → genera CLI a través de stdio/ACP → respuesta
```
**Benefits:**
**Beneficios:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- Una clave API para gestionar todas las herramientas
- Seguimiento de costos a través de todas las CLIs en el panel
- Cambio de modelo sin reconfigurar cada herramienta
- Funciona localmente y en servidores remotos (VPS, Docker, Akamai, Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## Configuración automática con `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
No tienes que escribir la configuración de cada herramienta a mano. OmniRoute envía un `setup-*`
comando por cada CLI soportada que lee el catálogo de modelos **en vivo** de un OmniRoute en ejecución
(local o remoto) y escribe la configuración propia de la herramienta en tu máquina:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
Cada uno acepta `--remote <url> --api-key <key>` (configura una herramienta local contra un
OmniRoute remoto), `--dry-run` (vista previa sin escribir), y `--port`. Las herramientas
sin descubrimiento automático de modelos (Cline, Kilo, Roo, Goose, Aider, Qwen) toman
`--model <id>` (y `--yes` para ejecuciones no interactivas). Para lanzar un CLI con el
entorno correcto inyectado y sin configuración escrita en absoluto, usa el lanzador genérico
`omniroute run <target>` (claude, codex, aider, goose, opencode, qwen,
gemini — los objetivos y alias provienen de `bin/cli/cli-manifest.mjs`); los lanzadores
heredados por herramienta `omniroute launch` (Claude Code) y `omniroute launch-codex`
(Codex) siguen disponibles. El CLI de Gemini es solo de lanzamiento: es un objetivo de
`omniroute run` pero no tiene receta `setup-*`/`configure`.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **Referencia completa:** la tabla maestra — lo que cada comando escribe, cada bandera,
> local vs remoto, y qué herramientas quieren un sufijo `/v1` — vive en
> **[Integraciones CLI](../guides/CLI-INTEGRATIONS.md)**.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### Ejecutando esto dentro de un contenedor
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
Un comando `setup-*` ejecutado dentro del contenedor de OmniRoute escribe en
el propio hogar del contenedor, que ninguna CLI del host lee y que desaparece con el
contenedor. OmniRoute detecta eso y sale con `2` con instrucciones en lugar de
escribir. Dos formas soportadas para avanzar: instalar la CLI en el host y
`omniroute connect` al contenedor, o montar los directorios de configuración y establecer
`CLI_CONFIG_HOME` (el perfil `host` de compose). Cada comando `setup-*`, además de
`omniroute configure` y `omniroute config set`, acepta
`--allow-container-write` cuando configurar las propias CLIs del contenedor es lo que
realmente querías decir; `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` hace lo mismo para
el servidor. Ver
[Guía de Docker → Configurando herramientas CLI del host](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker).
El **endpoint de aplicación** del panel (`POST /api/cli-tools/apply`) aplica la
misma protección: en un contenedor, una escritura cuyo objetivo no está montado desde el
host responde **`422`** con `containerEphemeralTarget: true`, el texto de error seguro
y — para las herramientas con una receta de host (claude, codex, opencode, cline,
kilo, continue) — un `hostSetupCommand` (por ejemplo, `omniroute setup-opencode`) para ejecutar
en el host en su lugar; nada se escribe. `dryRun: true` sigue funcionando en modo contenedor
y devuelve el contenido generado + la ruta objetivo sin tocar el disco, por lo que puedes
previsualizar desde el panel y aplicar en el host. Este comportamiento es
intencional y está protegido contra regresiones por
`tests/unit/api/cli-tools/apply-container-guard.test.ts` — nunca "arregles" un 422
eliminando la protección.
---
## Step 1 — Get an OmniRoute API Key
## Fuente de Verdad
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
El catálogo unificado se encuentra en `src/shared/constants/cliTools.ts` como `CLI_TOOLS: Record<string, CliCatalogEntry>`.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
Cada entrada tiene estos campos (definidos en `src/shared/schemas/cliCatalog.ts`):
| Campo | Tipo | Descripción |
| ----------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------- |
| `category` | `"code" \| "agent"` | En qué página aparece la herramienta |
| `vendor` | `string` | Origen de la herramienta ("Anthropic", "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | También utilizable como un Agente ACP (insignia mostrada) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | Nivel de soporte de endpoint personalizado. `"none"` = backlog MITM |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | Mecanismo de configuración |
| `id`, `name`, `color`, `description`, `docsUrl` | estándar | Campos de visualización principales |
Las entradas con `baseUrlSupport: "none"` **no se muestran** en las páginas del panel — están registradas en el backlog MITM para el plan 11 (ver `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md`).
### Niveles de capacidad (catalogado × detectable × configurable × lanzable)
No todas las herramientas catalogadas son detectables, configurables o lanzables. Cada nivel tiene una fuente declarativa, y una prueba de deriva las mantiene alineadas:
| Nivel | Significado | Declarado en |
| ---------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| **Catalogado** | Aparece en el catálogo del panel (nombre, proveedor, docs, tipo de configuración) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **Detectable** | Detección de binarios/configuración, comprobaciones de salud, rutas de configuración | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` catálogo en tiempo de ejecución) |
| **Configurable** | Soportado por `omniroute configure <cli>` (existe receta de configuración) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **Lanzable** | Soportado por `omniroute run <target>` (inyección de env/args definida) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` es el manifiesto ejecutable canónico para los comandos de CLI: `run`, `configure` y los generadores de autocompletado de shell derivan sus listas de objetivos, resolución de alias (por ejemplo `kilocode`/`kilo-code`/`kilo_cli``kilo`) y cableado de la bandera `--model` de él. El guardia de deriva `tests/unit/cli/cli-manifest-drift.test.ts` afirma que el manifiesto, el catálogo en tiempo de ejecución, el catálogo de UI y cada superficie consumidora se mantengan sincronizados — un objetivo agregado a una superficie sin los otros falla la suite en lugar de derivar silenciosamente.
## 1. Catálogo de Código CLI (26 herramientas)
Todas las herramientas que aparecen en `/dashboard/cli-code`. Aquellas con `baseUrlSupport: none` están conectadas a través de MITM o una guía manual en lugar de una URL base personalizada:
| id | nombre | proveedor | soporteBaseUrl | tipoConfiguración | acpSpawnable |
| ------------ | -------------------------------- | ------------------- | -------------- | ------------------------- | ------------ |
| claude | Claude Code | Anthropic | completo | env | true |
| codex | OpenAI Codex CLI | OpenAI | completo | personalizado | true |
| zcode | ZCode (Plan de Codificación GLM) | Z.ai | ninguno | personalizado | false |
| cline | Cline | OSS (ex-Claude Dev) | completo | personalizado | true |
| kilo | Kilo Code | Kilo-Org | completo | personalizado | false |
| roo | Roo Code | Roo (OSS) | completo | guía | false |
| continue | Continue | continue.dev | completo | guía | false |
| aider | Aider | OSS (P. Gauthier) | completo | guía | true |
| forge | ForgeCode | Antinomy HQ | completo | personalizado | true |
| jcode | jcode | 1jehuang (OSS) | completo | personalizado | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | completo | personalizado | false |
| codewhale | CodeWhale | Hmbown (OSS) | completo | personalizado | false |
| opencode | OpenCode | Anomaly (ex-SST) | completo | guía | true |
| droid | Factory Droid | Factory AI | parcial | guía | false |
| copilot | GitHub Copilot CLI | GitHub/MS | completo | personalizado | false |
| cursor-cli | Cursor CLI | Anysphere | parcial | guía | true |
| smelt | Smelt | leonardcser (OSS) | completo | personalizado | false |
| pi | Pi (agente de codificación pi) | M. Zechner (OSS) | completo | personalizado | false |
| grok-build | Grok Build | xAI | completo | personalizado | false |
| crush | Crush | OSS (Charm) | completo | personalizado | false |
| qwen | Qwen Code | Alibaba | completo | guía | true |
| cursor | Cursor | Anysphere | ninguno | guía | false |
| antigravity | Antigravity | Google | ninguno | mitm | false |
| hermes | Hermes | Nous Research | ninguno | guía | false |
| kiro | Kiro AI | Amazon | ninguno | mitm | false |
| custom | CLI Personalizado | — | completo | constructor-personalizado | false |
Las herramientas con `baseUrlSupport: "parcial"` muestran una insignia "⚠ Base URL parcial" en la tarjeta del panel.
## 2. Catálogo de Agentes CLI (8 herramientas)
Agentes autónomos que aparecen en `/dashboard/cli-agents`:
| id | nombre | proveedor | soporteBaseUrl | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | Agente Hermes | Nous Research | completo | falso |
| openclaw | OpenClaw | OSS (P. Steinberger) | completo | verdadero |
| goose | Goose | Block / Linux Foundation | completo | verdadero |
| interpreter | Open Interpreter | OSS | completo | verdadero |
| warp | Warp AI | Warp Inc. | parcial | verdadero |
| agent-deck | Agent Deck | asheshgoplani (OSS) | completo | falso |
| omp | Oh My Pi | OSS | completo | verdadero |
| letta | Letta CLI | Letta | completo | falso |
---
## Step 2 — Install CLI Tools
## 3. Agentes ACP (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
Esta página (renombrada de `/dashboard/agents`) muestra CLIs que OmniRoute puede **generar** como motores de ejecución backend a través del protocolo stdio/ACP. El catálogo se mantiene por separado en `src/lib/acp/registry.ts` y **no** es el mismo que `CLI_TOOLS`.
---
## 4. Pendiente de MITM (no mostrado en el dashboard)
Los siguientes CLIs no soportan URL base personalizadas de forma nativa y **no están listados** en las páginas de Código CLI o Agentes CLI. Son candidatos para la interceptación MITM en el plan 11:
| CLI | Razón |
| ------------------- | --------------------------------------------------------------------- |
| windsurf | BYOK limitado a seleccionar modelos de Claude + URL/token corporativo |
| amp | Ecosistema cerrado (Sourcegraph) |
| amazon-q / kiro-cli | Autenticación AWS SSO, sin URL personalizada |
| cowork | Anthropic Desktop, sin punto final configurable |
Consulta `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` para la referencia cruzada completa.
---
## 5. API de Detección por Lotes
Toda la detección de herramientas se agrega a través de un único punto final:
**`GET /api/cli-tools/all-statuses`**
- Autenticación: `requireCliToolsAuth(request)` (igual que otras rutas de `/api/cli-tools/`)
- Retorna: `Record<toolId, ToolBatchStatus>` (tipo: `src/shared/types/cliBatchStatus.ts`)
- Estrategia: `Promise.all` sobre todas las herramientas, tiempo de espera de 5s por herramienta
- Caché: en memoria LRU indexada por el archivo de configuración `mtime`. Caché invalidada cuando cambia el mtime. Reiniciada al reiniciar el servidor.
Forma de respuesta por herramienta:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // sanitizado, sin trazas de pila
}
```
## 6. Controladores de Configuración para Nuevas Herramientas
Las nuevas herramientas con `configType: "custom"` tienen rutas API de configuración dedicadas:
| Ruta | Herramienta |
| ------------------------------------------- | --------------------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legado) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, sincronización primaria + legado `~/.deepseek`) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Agente de codificación Pi |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + clave dedicada `.env`) |
Todas las rutas utilizan `sanitizeErrorMessage()` para respuestas de error (Regla Dura #12).
---
## 7. Arquitectura de Páginas del Dashboard
### Código CLI (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — componente del servidor
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — cuadrícula del cliente
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — página de detalles de la herramienta
- `src/app/(dashboard)/dashboard/cli-code/components/` — 12 tarjetas de herramientas especializadas + `ToolDetailClient.tsx`
### Agentes CLI (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — componente del servidor
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — cuadrícula del cliente
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — reutiliza `ToolDetailClient`
### Agentes ACP (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — componente del servidor (movido de `agents/`)
### Componentes de UI Compartidos (`src/shared/components/cli/`)
| Archivo | Propósito |
| ----------------------- | ----------------------------------------------------------------------- |
| `CliToolCard.tsx` | Tarjeta de estado inteligente (detección + configuración + punto final) |
| `CliConceptCard.tsx` | Tarjeta de explicación de concepto por página |
| `CliComparisonCard.tsx` | Comparación en tres columnas entre tipos de CLI |
| `BaseUrlSelect.tsx` | Desplegable de punto final (Local/Nube/Personalizado) |
| `ApiKeySelect.tsx` | Selector de clave API |
| `ManualConfigModal.tsx` | Modal de fragmento de configuración copiable |
### Hook Compartido (`src/shared/hooks/cli/`)
| Archivo | Propósito |
| ------------------------- | -------------------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | Obtiene `/api/cli-tools/all-statuses`, gestiona el estado de carga/actualización |
## 8. i18n
Nuevos espacios de nombres añadidos en el plan 14 F9:
| Namespace | Propósito |
| ----------- | ------------------------------------------------------------------------------------------------------------ |
| `cliCommon` | Cadenas compartidas (etiquetas de tarjetas, textos de concepto/comparación, etiquetas de página de detalles) |
| `cliCode` | Cadenas de la página del código CLI |
| `cliAgents` | Cadenas de la página de agentes CLI |
| `acpAgents` | Cadenas de la página de agentes ACP |
Se proporcionan traducciones completas en PT-BR y EN. 39 otros locales recurren automáticamente a EN a través de la fusión a nivel de espacio de nombres en `src/i18n/request.ts`.
---
## 9. Inicio Rápido
### Paso 1 — Obtén una clave de API de OmniRoute
1. Abre `/dashboard/api-manager`**Crear clave de API**
2. Dale un nombre (por ejemplo, `cli-tools`) y selecciona todos los permisos
3. Copia la clave — la necesitarás para cada CLI a continuación
> Tu clave se ve así: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### Paso 2 — Instala las herramientas CLI
Todas las herramientas basadas en npm requieren Node.js 22.22.2+ o 24.x:
```bash
# Claude Code (Anthropic)
@@ -98,96 +345,138 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (lanzable a través de `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # Basado en Rust
# Agente de codificación Pi
# ver https://github.com/zechnerj/pi-coding-agent para la instalación
# jcode
# ver https://github.com/1jehuang/jcode para la instalación
```
---
## Step 3 — Set Global Environment Variables
### Paso 3 — Configura a través del Dashboard
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. Ve a `http://localhost:20128/dashboard/cli-code`
2. Encuentra tu herramienta en la cuadrícula
3. Haz clic en la tarjeta para abrir la página de detalles de la herramienta
4. Selecciona tu clave de API y URL base
5. Haz clic en **Aplicar Configuración** o copia el fragmento de configuración manual
---
### Paso 4 — Establecer Variables de Entorno Globales
```bash
# OmniRoute Universal Endpoint
# Punto de acceso universal de OmniRoute
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI lee GOOGLE_GEMINI_BASE_URL en la RAÍZ (su SDK agrega /v1beta/... por sí mismo)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> Para un **servidor remoto**, reemplaza `localhost:20128` con la IP o dominio del servidor,
> por ejemplo, `http://<tu-ip-del-servidor>:20128`.
---
## Step 4 — Configure Each Tool
### Paso 4 — Configura Cada Herramienta
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# Crea ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
Usa la raíz de la puerta de enlace unificada de Anthropic para Claude Code. No agregues `/v1` aquí.
**Prueba:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
El Codex moderno (v0.137+) lee `~/.codex/config.toml` solamente — el antiguo
`config.yaml` pertenece al CLI npm legado y se ignora silenciosamente. La clave de API
se mantiene en la variable de entorno `OMNIROUTE_API_KEY` (`env_key`), nunca
dentro del archivo:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
Referencia completa (perfiles, `wire_api`, ventanas de contexto): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**Prueba:** `codex "what is 2+2?"`
---
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `codex "what is 2+2?"`
**Prueba:** `opencode`
> Usa `opencode run "tu prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> para enviar variantes de pensamiento.
---
### OpenCode
#### Cline (CLI o VS Code)
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
EOF
```
**Test:** `opencode`
---
### Cline (CLI or VS Code)
**CLI mode:**
**Modo CLI:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +488,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**Modo VS Code:**
Configuraciones de la extensión Cline → Proveedor de API: `OpenAI Compatible`URL base: `http://localhost:20128/v1`
Or use the OmniRoute dashboard **CLI Tools → Cline → Apply Config**.
O usa el dashboard de OmniRoute → **CLI Tools → Cline → Aplicar Configuración**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI o VS Code)
**CLI mode:**
**Modo CLI:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**Configuraciones de VS Code:**
```json
{
@@ -223,13 +512,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard **CLI Tools → KiloCode → Apply Config**.
O usa el dashboard de OmniRoute → **CLI Tools → KiloCode → Aplicar Configuración**.
---
### Continue (VS Code Extension)
#### Continue (Extensión de VS Code)
Edit `~/.continue/config.yaml`:
Edita `~/.continue/config.yaml`:
```yaml
models:
@@ -241,158 +530,255 @@ models:
default: true
```
Restart VS Code after editing.
Reinicia VS Code después de editar.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
Usa esto cuando VS Code Insiders esté configurado para modelos de punto final personalizados y quieras que OmniRoute funcione sin un campo de encabezado personalizado.
**Ubicación recomendada:**
- Linux: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- Windows: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**Ejemplo usando el alias tokenizado de OmniRoute:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**Notas:**
- Reemplaza `sk-your-omniroute-key` con una clave de API creada en OmniRoute.
- El campo `url` debe apuntar a `/api/v1/vscode/{token}/chat/completions`.
- El campo `modelsUrl` debe apuntar a `/api/v1/vscode/{token}/models`.
- Prefiere el flujo normal `/v1` + encabezado Bearer cuando el cliente soporte encabezados personalizados.
- Los tokens incrustados en la URL son una solución de compatibilidad y pueden aparecer en los registros del editor o en el historial del proxy.
---
#### Kiro CLI (Amazon)
```bash
# Login to your AWS/Kiro account:
# Inicia sesión en tu cuenta de AWS/Kiro:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# El CLI utiliza su propia autenticación — OmniRoute no es necesario como backend para Kiro CLI en sí.
# Usa kiro-cli junto con OmniRoute para otras herramientas.
kiro-cli status
```
Para la aplicación de escritorio **Kiro IDE**, usa el punto final MITM expuesto por OmniRoute
bajo `/dashboard/cli-tools → Kiro`.
---
### Qwen Code (Alibaba)
## 10. CLI Interno de OmniRoute
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
El binario `omniroute` proporciona comandos para el ciclo de vida del servidor, configuración, diagnóstico y gestión de proveedores. Punto de entrada: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # Iniciar servidor (puerto por defecto 20128)
omniroute setup # Asistente de configuración interactivo
omniroute doctor # Verificar configuración, DB, puertos, tiempo de ejecución
omniroute providers list # Conexiones de proveedor configuradas
omniroute providers test-all # Probar cada conexión activa
omniroute reset-password # Restablecer la contraseña del administrador
omniroute logs # Transmitir registros de solicitudes
omniroute health # Salud detallada (interruptores, caché, memoria)
omniroute --version # Imprimir versión
omniroute --help # Mostrar todos los comandos
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### Configuración e Inicialización
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # Asistente de configuración interactivo
omniroute setup --non-interactive # Modo CI/automatización (lee vars de entorno + flags)
omniroute setup --password '<value>' # Establecer la contraseña del administrador directamente
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # Agregar y probar un proveedor en un solo paso
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
Variables de entorno reconocidas para configuración no interactiva:
**Test:** `qwen "say hello"`
| Var | Propósito |
| ------------------- | -------------------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | Clave API del proveedor (vinculada a `--api-key` a través de Commander `.env()`) |
| `DATA_DIR` | Sobrescribir el directorio de datos de OmniRoute |
### Cursor (Desktop App)
Todas las demás entradas no interactivas se pasan como flags, no como variables de entorno:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(ver las opciones de `omniroute setup` arriba).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## Solución de Problemas
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### Diagnósticos
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # Verificar configuración, DB, puertos, tiempo de ejecución, memoria, disponibilidad
omniroute doctor --json # JSON legible por máquina
omniroute doctor --no-liveness # Omitir la prueba de salud HTTP
omniroute doctor --host 0.0.0.0 # Sobrescribir el host de disponibilidad
omniroute doctor --liveness-url <url> # Sobrescribir la URL del endpoint de salud completo
```
El doctor realiza estas verificaciones: `Configuración`, `Base de datos`, `Almacenamiento/encriptación`,
`Disponibilidad de puertos`, `Tiempo de ejecución de Node`, `Binario nativo` (better-sqlite3),
`Memoria`, y `Disponibilidad del servidor`. Sale con un código distinto de cero si alguna verificación falla.
### Gestión de Proveedores
```bash
omniroute providers available # Catálogo de proveedores de OmniRoute
omniroute providers available --search openai # Filtrar catálogo por id/nombre/alias/categoría
omniroute providers available --category api-key # Filtrar por categoría (api-key, oauth, free, ...)
omniroute providers available --json # JSON legible por máquina
omniroute providers list # Conexiones de proveedor configuradas
omniroute providers list --json
omniroute providers test <id|name> # Probar una conexión configurada
omniroute providers test-all # Probar cada conexión activa
omniroute providers validate # Validación estructural solo local
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # Flujo OAuth existente
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` son API-first y, por lo tanto, funcionan contra
el contexto local o remoto activo. La entrada de credenciales debe usar
`--credential-stdin` o `--credential-env`; `--dry-run --json` informa solo
la presencia/forma redactada. `providers available` lee el catálogo de OmniRoute;
`providers list/test/test-all/validate` mantienen su comportamiento local de SQLite y
no requieren que el servidor esté en funcionamiento.
### Recuperación y Restablecimiento
```bash
omniroute reset-password # Restablecer la contraseña del administrador (también: omniroute-reset-password)
omniroute reset-encrypted-columns # Mostrar advertencia + prueba en seco para restablecimiento de credenciales encriptadas
omniroute reset-encrypted-columns --force # Realmente anular las credenciales encriptadas en SQLite
```
### Exportación de Credenciales (⚠ manejar con cuidado)
```bash
omniroute auth export # Mostrar advertencia + puerta de confirmación — sin acceso a DB
omniroute auth export --force # Exportar todas las credenciales DESENCRIPTADAS de las conexiones a stdout como JSON
omniroute auth export --force --id <id> # Exportar solo la conexión coincidente
omniroute auth export --force --format env # Emitir líneas OMNIROUTE_<PROVIDER>_<FIELD>=<value>
omniroute auth export --force --out creds.json # Escribir en un archivo (creado con permisos 0600)
```
`auth export` es **solo local** (lectura directa de SQLite, sin ruta HTTP) y deliberadamente imprime/escribe
valores **en texto plano** `apiKey`/`accessToken`/`refreshToken`/`idToken` — esa es la característica, no un
error. No se lee nada de la base de datos, y nada se desencripta, sin `--force`. Un banner de advertencia en stderr
siempre se imprime antes de que se emita cualquier texto plano. Requiere que `STORAGE_ENCRYPTION_KEY` esté
establecido. Un campo que no se puede desencriptar (clave obsoleta, texto cifrado corrupto) se informa como
`<field>DecryptFailed: true` en lugar de abortar toda la exportación o filtrar el error subyacente.
### Otros subcomandos
Estos asumen un servidor OmniRoute en funcionamiento, a menos que se indique lo contrario:
```bash
omniroute status # Estado de tiempo de ejecución integral
omniroute logs # Transmitir registros de solicitudes (--json, --search, --follow)
omniroute config show # Mostrar configuración actual
omniroute provider list # Listar proveedores disponibles (alias de providers list)
omniroute provider add # Registrar OmniRoute como un proveedor en una herramienta
omniroute keys add | list | remove # Gestionar claves API
omniroute models [provider] # Listar modelos (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # Instantánea de configuración + DB
omniroute restore # Restaurar desde una instantánea anterior
omniroute health # Salud detallada (interruptores, caché, memoria)
omniroute quota # Uso de cuota del proveedor
omniroute cache # Estado de la caché
omniroute cache clear # Limpiar cachés semánticas + de firma
omniroute mcp status | restart # Estado del servidor MCP / reiniciar
omniroute a2a status | card # Estado del servidor A2A / tarjeta de agente
omniroute tunnel list | create | stop # Gestionar túneles (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # Inspeccionar / establecer vars de entorno (temporal)
omniroute test # Prueba de conectividad del proveedor
omniroute update # Comprobar actualizaciones
omniroute completion # Generar finalización de shell
```
### Flags Comunes
| Flag | Descripción |
| ------------------- | --------------------------------------------------------- |
| `--no-open` | No abrir automáticamente el navegador al iniciar |
| `--port <n>` | Sobrescribir el puerto API (por defecto 20128) |
| `--mcp` | Ejecutar como servidor MCP a través de stdio (para IDEs) |
| `--non-interactive` | Modo CI (sin mensajes; lee de env/flags) |
| `--json` | Salida JSON legible por máquina (doctor, providers, etc.) |
| `--help`, `-h` | Mostrar ayuda específica del comando |
| `--version`, `-v` | Imprimir la versión instalada |
## Puntos finales de API disponibles
| Endpoint | Descripción | Uso para |
| -------------------------- | ------------------------------------- | -------------------------------------------- |
| `/v1/chat/completions` | Chat estándar (todos los proveedores) | Todas las herramientas modernas |
| `/v1/responses` | API de respuestas (formato OpenAI) | Codex, flujos de trabajo agenticos |
| `/v1/completions` | Completaciones de texto heredadas | Herramientas más antiguas que usan `prompt:` |
| `/v1/embeddings` | Embeddings de texto | RAG, búsqueda |
| `/v1/images/generations` | Generación de imágenes | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Texto a voz | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Voz a texto | Deepgram, AssemblyAI |
Ejemplos listos para pegar con una URL de OmniRoute tokenizada:
```txt
Ejemplo de token: sk-a3ab3c080beaee3a-69f4a4-070d71af
Base estándar de OpenAI: http://localhost:20128/v1
Modelos de VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
Chat de VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
Respuestas de VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
Etiquetas de Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
Chat de Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## Solución de problemas
| Error | Causa | Solución |
| --------------------------------------------------------- | -------------------------------- | ---------------------------------------------------------- |
| `Connection refused` | OmniRoute no está en ejecución | `omniroute serve` |
| `401 Unauthorized` | Clave API incorrecta | Verificar en `/dashboard/api-manager` |
| `No combo configured` | Sin combo de enrutamiento activo | Configurar en `/dashboard/combos` |
| CLI muestra "not installed" | Binario no en PATH | Verificar `which <command>` |
| El panel muestra "not detected" después de la instalación | Caché obsoleta | Hacer clic en "⟳ Refresh detection" en el panel |
| Enlace antiguo `/dashboard/cli-tools` | Marcador anterior a v3.8.6 | Redirigido automáticamente a `/dashboard/cli-code` (308) |
| Enlace antiguo `/dashboard/agents` | Marcador anterior a v3.8.6 | Redirigido automáticamente a `/dashboard/acp-agents` (308) |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,273 @@
# CLI-INTEGRATIONS (فارسی)
🌐 **Languages:** 🇺🇸 [English](../../../../guides/CLI-INTEGRATIONS.md) · 🇸🇦 [ar](../../../ar/docs/guides/CLI-INTEGRATIONS.md) · 🇦🇿 [az](../../../az/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇬 [bg](../../../bg/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇩 [bn](../../../bn/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇿 [cs](../../../cs/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇰 [da](../../../da/docs/guides/CLI-INTEGRATIONS.md) · 🇩🇪 [de](../../../de/docs/guides/CLI-INTEGRATIONS.md) · 🇪🇸 [es](../../../es/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇮 [fi](../../../fi/docs/guides/CLI-INTEGRATIONS.md) · 🇫🇷 [fr](../../../fr/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [gu](../../../gu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇱 [he](../../../he/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [hi](../../../hi/docs/guides/CLI-INTEGRATIONS.md) · 🇭🇺 [hu](../../../hu/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [id](../../../id/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇩 [in](../../../in/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇹 [it](../../../it/docs/guides/CLI-INTEGRATIONS.md) · 🇯🇵 [ja](../../../ja/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇷 [ko](../../../ko/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [mr](../../../mr/docs/guides/CLI-INTEGRATIONS.md) · 🇲🇾 [ms](../../../ms/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇱 [nl](../../../nl/docs/guides/CLI-INTEGRATIONS.md) · 🇳🇴 [no](../../../no/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇭 [phi](../../../phi/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇱 [pl](../../../pl/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇹 [pt](../../../pt/docs/guides/CLI-INTEGRATIONS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇴 [ro](../../../ro/docs/guides/CLI-INTEGRATIONS.md) · 🇷🇺 [ru](../../../ru/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇰 [sk](../../../sk/docs/guides/CLI-INTEGRATIONS.md) · 🇸🇪 [sv](../../../sv/docs/guides/CLI-INTEGRATIONS.md) · 🇰🇪 [sw](../../../sw/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [ta](../../../ta/docs/guides/CLI-INTEGRATIONS.md) · 🇮🇳 [te](../../../te/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇭 [th](../../../th/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇷 [tr](../../../tr/docs/guides/CLI-INTEGRATIONS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/guides/CLI-INTEGRATIONS.md) · 🇵🇰 [ur](../../../ur/docs/guides/CLI-INTEGRATIONS.md) · 🇻🇳 [vi](../../../vi/docs/guides/CLI-INTEGRATIONS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/guides/CLI-INTEGRATIONS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/guides/CLI-INTEGRATIONS.md)
---
---
title: "ادغام‌های CLI — هر CLI کدنویسی را به OmniRoute متصل کنید"
version: 3.8.50
lastUpdated: 2026-08-18
---
# ادغام‌های CLI
OmniRoute یک خانواده از دستورات `setup-*` را ارائه می‌دهد که یک CLI کدنویسی (Codex، Claude Code، OpenCode، Cline و ...) را برای استفاده از OmniRoute به عنوان بک‌اند خود پیکربندی می‌کند — بنابراین ابزار با **یک** نقطه پایانی ارتباط برقرار می‌کند و OmniRoute به ارائه‌دهنده مناسب با بازگشت خودکار هدایت می‌کند. هر دستور فهرست مدل **زنده** را از یک OmniRoute در حال اجرا (محلی یا از راه دور) می‌خواند و فایل پیکربندی خود ابزار را بر روی **ماشین شما** می‌نویسد. کلید API توسط یک متغیر محیطی در هر جایی که ابزار از آن پشتیبانی می‌کند، ارجاع داده می‌شود. دستورات که یک فایل محیط محلی ابزار را حفظ می‌کنند، در زیر ذکر شده‌اند.
همچنین یک راه‌انداز عمومی وجود دارد — `omniroute run <target>` — که `claude`، `codex`، `aider`، `goose`، `opencode`، `qwen` یا `gemini` را با محیط مناسب تزریق شده، بدون نوشتن هیچ پیکربندی، راه‌اندازی می‌کند. اهداف و نام‌های مستعار آن‌ها از فهرست رسمی `bin/cli/cli-manifest.mjs` می‌آیند (`claude-code|cc|anthropic`، `codex-cli|openai-codex|openai`، `goose-cli`، `open-code`، `qwen-code`، `gemini-cli`) و `omniroute completion` همان کلمات هدف مشتق شده از فهرست را ارائه می‌دهد. راه‌اندازهای قدیمی برای هر ابزار — `omniroute launch` (Claude Code) و `omniroute launch-codex` (Codex) — همچنان در دسترس هستند.
پذیرش ارائه‌دهنده از همان زمینه محلی/از راه دور در دسترس است. دستورات API-first زیر مدیریت احراز هویت را از اعتبارنامه‌های ارائه‌دهنده جدا نگه می‌دارند و هرگز اعتبارنامه‌ای را در خروجی ساختاری چاپ نمی‌کنند:
```bash
omniroute providers add glm --credential-env GLM_API_KEY --name work
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth openai
omniroute providers edit <connection-id> --default-model glm/glm-5.2
omniroute providers remove <connection-id> --yes
```
برای اسکریپت‌ها، `--credential-stdin` یا `--credential-env` را ترجیح دهید؛ `--credential` برای استفاده محلی کنترل شده حفظ شده است. `providers remove` نیاز به `--yes` در یک ترمینال غیرتعامل دارد و همه پنج دستور به زمینه فعال یا گزینه‌های جهانی `--base-url`/`--api-key` احترام می‌گذارند.
برای پیکربندی اولیه یک‌باره و دست‌نویس از دو ادغام غنی‌ترین، به بررسی‌های عمیق هر ابزار مراجعه کنید:
- [پیکربندی Claude Code](./CLAUDE-CODE-CONFIGURATION.md)
- [پیکربندی Codex CLI](./CODEX-CLI-CONFIGURATION.md)
- [حالت از راه دور](./REMOTE-MODE.md) — کنترل یک OmniRoute از راه دور (VPS / Tailnet) از لپ‌تاپ شما
- [چت VS Code Copilot](./VSCODE-COPILOT.md) — افزونه OmniCopilot؛ همچنین می‌تواند این دستورات `setup-*` را از داخل ویرایشگر برای شما اجرا کند
---
## جدول اصلی
هر دستور به **زمینه فعال** (تنظیم شده با `omniroute connect`، به [حالت از راه دور](./REMOTE-MODE.md) مراجعه کنید) یا پرچم‌های صریح `--remote <url> --api-key <key>` احترام می‌گذارد. "محلی در مقابل از راه دور" در زیر به این معناست: بدون پرچم‌ها به `http://localhost:20128` هدف‌گذاری می‌کند؛ با `--remote` (یا یک زمینه از راه دور فعال) فهرست را از آن سرور دریافت کرده و پیکربندی را به صورت محلی می‌نویسد.
| دستور | ابزار | آنچه می‌نویسد | پرچم‌های کلیدی | محلی در مقابل از راه دور |
| -------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
| `omniroute setup-codex` | OpenAI Codex CLI | `~/.codex/<name>.config.toml` — یک پروفایل برای هر مدل متنی سازگار (`codex --profile <name>`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--codex-home` | هر دو |
| `omniroute setup-claude` | Claude Code | `~/.claude/profiles/<name>/settings.json` — یک پروفایل برای هر مدل مطابقت یافته (`CLAUDE_CONFIG_DIR`) | `--remote` `--api-key` `--only` `--dry-run` `--port` `--claude-home` | هر دو |
| `omniroute setup-opencode` | OpenCode (سازگار با openai) | `~/.config/opencode/opencode.json` — ارائه‌دهنده `omniroute` با هر مدل فهرست (`opencode -m omniroute/<model>`) | `--remote` `--api-key` `--only` `--model` `--dry-run` `--port` | هر دو |
| `omniroute setup-cline` | Cline | `~/.cline/data/{globalState,secrets}.json` (حالت CLI) + چاپ تنظیمات افزونه VS Code | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--cline-dir` | هر دو |
| `omniroute setup-kilo` | Kilo Code | `~/.local/share/kilo/auth.json` (CLI) + ادغام `kilocode.*` به `settings.json` VS Code در صورت وجود | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--auth-path` `--vscode-settings` | هر دو |
| `omniroute setup-continue` | Continue / `cn` CLI | `~/.continue/config.yaml` — مدل‌های `provider: openai`، کلید از طریق `${{ secrets.OMNIROUTE_API_KEY }}` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | هر دو |
| `omniroute setup-cursor` | Cursor | هیچ چیز — چاپ مراحل درون‌برنامه (پیکربندی Cursor غیرشفاف SQLite) | `--remote` `--api-key` `--only` `--port` | هر دو |
| `omniroute setup-roo` | Roo Code | `~/.omniroute/roo-settings.json` (مدرک وارد شده) + تنظیم `roo-cline.autoImportSettingsPath` اگر یک `settings.json` VS Code وجود داشته باشد | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--import-path` `--vscode-settings` | هر دو |
| `omniroute setup-crush` | Crush | `~/.config/crush/crush.json` — ارائه‌دهنده سازگار با `openai`، کلید از طریق `$OMNIROUTE_API_KEY` | `--remote` `--api-key` `--only` `--dry-run` `--port` `--config-path` | هر دو |
| `omniroute setup-goose` | Goose | `~/.config/goose/config.yaml` (`GOOSE_PROVIDER`/`OPENAI_HOST`/`GOOSE_MODEL`) + چاپ دستورالعمل محیط | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | هر دو |
| `omniroute setup-aider` | Aider | `~/.aider.conf.yml` (`openai-api-base` + `model: openai/<id>`) + چاپ دستورالعمل محیط | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` | هر دو |
| `omniroute setup-qwen` | Qwen Code | `~/.qwen/settings.json` — آرایه `V4 modelProviders.openai` + `OMNIROUTE_API_KEY` در `~/.qwen/.env` | `--remote` `--api-key` `--model` `--yes` `--dry-run` `--port` `--config-path` `--env-path` | هر دو |
| `omniroute run <target>` | راه‌اندازی زمان اجرا (عمومی) | هیچ چیز — راه‌اندازی `claude`/`codex`/`aider`/`goose`/`opencode`/`qwen`/`gemini` با محیط و آرگومان‌های مناسب؛ Qwen و Gemini از یک خانه موقتی ایزوله استفاده می‌کنند | `--remote` `--base-url` `--context` `--provider` `--model` `--api-key` `--api-key-env` `--dry-run` `--json` `--port` `--profile` `--token` | هر دو |
| `omniroute launch` | Claude Code | هیچ چیز — `claude` را با `ANTHROPIC_BASE_URL`/`ANTHROPIC_AUTH_TOKEN` تزریق شده راه‌اندازی می‌کند | `--remote` `--api-key` `--token` `--profile` `--port` | هر دو |
| `omniroute launch-codex` | OpenAI Codex CLI | هیچ چیز — `codex` را با ارائه‌دهنده `omniroute` تزریق شده از طریق پرچم‌های `-c` راه‌اندازی می‌کند | `--remote` `--api-key` `--profile` (`-p`) `--port` | هر دو |
نکات مربوط به پرچم‌ها (تأیید شده در منبع دستور):
- `--remote <url>` — فهرست را از یک OmniRoute از راه دور دریافت کنید (پرچم‌های `--port` و زمینه فعال را نادیده می‌گیرد). `--api-key <key>` اعتبارنامه را برای آن سرور تأمین می‌کند (به طور پیش‌فرض به متغیر محیطی `OMNIROUTE_API_KEY` یا توکن زمینه فعال اشاره می‌کند).
- `--only <patterns>` — زیررشته‌های جداشده با کاما؛ فقط شناسه‌های مدل‌هایی که مطابقت دارند را نگه‌دارید (به عنوان مثال `--only glm,kimi`). در `setup-codex`، `setup-claude`، `setup-opencode`، `setup-continue`، `setup-cursor`، `setup-crush` در دسترس است.
- `--dry-run` — دقیقاً آنچه که نوشته می‌شود را بدون لمس سیستم فایل چاپ کنید. در هر دستور `setup-*` **به جز** `setup-cursor` در دسترس است (که هرگز فایلی نمی‌نویسد).
- `--model <id>` — برای ابزارهایی که کشف خودکار مدل ندارند، الزامی است (یا به صورت تعاملی انتخاب می‌شود): Cline، Kilo، Roo، Goose، Qwen، Aider. این ابزارها همچنین `--yes` را برای اجراهای غیرتعامل می‌پذیرند (که سپس نیاز به `--model` دارد). `setup-opencode` `--model` را برای تنظیم مدل پیش‌فرض سطح بالا می‌پذیرد.
- `--model <id>` در `omniroute run` از اتصالات مشخص شده در فهرست استفاده می‌کند (`bin/cli/cli-manifest.mjs`): **aider** `--model openai/<id>` و **opencode** `--model omniroute/<id>` (پیشوند فقط زمانی اضافه می‌شود که شناسه قبلاً آن را نداشته باشد)؛ **qwen** و **gemini** شناسه را به صورت عینی دریافت می‌کنند؛ **claude** آن را از طریق `ANTHROPIC_MODEL`، **goose** از طریق `GOOSE_MODEL` و **codex** از طریق آرگومان‌های `-c model_providers.omniroute.*` دریافت می‌کند. **Qwen تنها هدف اجرایی است که به شدت نیاز به `--model` دارد**`omniroute run qwen` بدون آن با خطای صریح `2` خارج می‌شود.
- `--port <port>` — پورت محلی OmniRoute (پیش‌فرض `20128`، در صورت تنظیم `--remote` نادیده گرفته می‌شود). در تمام `setup-*` و هر دو راه‌انداز موجود است.
- کدهای خروجی `omniroute run`: کد خروجی خود CLI فرزند به صورت عینی منتقل می‌شود؛ `2` = آرگومان‌های نامعتبر (هدف پشتیبانی نشده، `--model` مورد نیاز گم شده، نگهبان کانتینر)؛ `127` = باینری هدف در `PATH` نیست؛ `130`/`143`/`129` زمانی که راه‌اندازی با `SIGINT`/`SIGTERM`/`SIGHUP` پایان می‌یابد؛ `1` = سایر خطاهای راه‌اندازی زمان اجرا.
- دو راه‌انداز (`launch`، `launch-codex`) `--profile <name>` را برای انتخاب یک پروفایل نوشته شده توسط `setup-claude` / `setup-codex` می‌پذیرند، به علاوه آرگومان‌های عبوری برای باینری‌های زیرین `claude` / `codex`.
انتخابگر تعاملی همچنین توسط دستورالعمل‌های پیکربندی به اشتراک گذاشته می‌شود:
```bash
# از فهرست مدل محلی یا از راه دور فعال انتخاب کنید و هدف را پیکربندی کنید.
omniroute configure claude
omniroute configure opencode --provider glm
omniroute configure qwen --model qwen/qwen3.8-max-preview --yes
```
`configure` در حال حاضر به دستورالعمل‌های آزمایش شده برای `codex`، `claude`، `opencode`، `qwen`، `aider`، `goose`، `cline`، `continue` و `kilo` واگذار می‌شود. ورودی‌های فهرست فقط IDE، MITM و راهنما به صورت صریح `setup-*`/جریان‌های دستی باقی می‌مانند و به عنوان اهداف قابل راه‌اندازی ارائه نمی‌شوند.
> `setup-opencode` ادغام **سبک سازگار با openai** OpenCode است.
> همچنین یک ادغام پلاگین غنی‌تر وجود دارد — `omniroute setup opencode` — که `@omniroute/opencode-plugin` را نصب می‌کند. این‌ها دستورات متفاوتی هستند؛ جدول بالا `setup-opencode` را مستند می‌کند.
---
## استفاده محلی
با اجرای OmniRoute بر روی `localhost:20128`، فقط دستور راه‌اندازی را برای ابزار خود اجرا کنید. کاتالوگ از سرور محلی دریافت می‌شود.
```bash
# Codex: نوشتن یک پروفایل برای هر مدل مطابقت یافته در ~/.codex/
omniroute setup-codex
codex --profile glm52 # استفاده از پروفایل تولید شده
# Claude Code: نوشتن پروفایل‌های هر مدل، سپس راه‌اندازی یکی
omniroute setup-claude
omniroute launch --profile glm52
# OpenCode: نوشتن ارائه‌دهنده سازگار با openai با تمام مدل‌های کاتالوگ
omniroute setup-opencode
export OMNIROUTE_API_KEY=sk-... # ارجاع داده شده از طریق {env:OMNIROUTE_API_KEY}، هرگز بر روی دیسک
opencode -m omniroute/glm/glm-5.2 "..."
# ابزارهایی که به کشف خودکار نیاز ندارند به یک مدل صریح نیاز دارند:
omniroute setup-aider --model glm/glm-5.2
omniroute setup-qwen --model qwen/qwen3.8-max-preview
# پیش‌نمایش بدون نوشتن هیچ چیزی:
omniroute setup-continue --dry-run
```
بدون نوشتن هیچ پیکربندی (فقط تزریق متغیر محیطی) راه‌اندازی کنید:
```bash
omniroute launch # Claude Code → OmniRoute محلی
omniroute launch-codex # Codex CLI → OmniRoute محلی
omniroute launch-codex --profile glm52
omniroute run claude --model openai/gpt-5.4
omniroute run codex --model openai/gpt-5.4 --dry-run --json
omniroute run aider --model glm/glm-5.2 -- --message "reply OK"
omniroute run goose --model glm/glm-5.2
omniroute run opencode --model glm/glm-5.2 -- run "reply OK"
omniroute run qwen --model glm/glm-5.2 -- -p "reply OK"
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "reply OK"
# مسیر دستور صریح: هر چیزی که بعد از -- بیاید را عبور دهید
omniroute run claude -- --print-system-prompt "این تفاوت را بررسی کنید"
```
---
## استفاده از راه دور
هر دستور راه‌اندازی را به یک OmniRoute از راه دور با `--remote` + `--api-key` اشاره کنید. کاتالوگ از راه دور دریافت می‌شود؛ پیکربندی بر روی ماشین محلی شما نوشته می‌شود.
```bash
# OpenCode در برابر یک VPS از راه دور، فقط مدل‌های glm/kimi را نگه دارید
omniroute setup-opencode --remote http://192.168.0.15:20128 --api-key oma_live_xxx \
--only glm,kimi
opencode -m omniroute/glm/glm-5.2 "..." # ابتدا OMNIROUTE_API_KEY را صادر کنید
# پروفایل‌های Codex از یک کاتالوگ از راه دور
omniroute setup-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
# راه‌اندازی یک CLI به طور مستقیم در برابر راه دور
omniroute launch --remote http://192.168.0.15:20128 --api-key oma_live_xxx
omniroute launch-codex --remote http://192.168.0.15:20128 --api-key oma_live_xxx
```
به جای اینکه هر بار `--remote`/`--api-key` را عبور دهید، یک بار وارد شوید و اجازه دهید **زمینه فعال** به طور خودکار آنها را تأمین کند:
```bash
omniroute connect 192.168.0.15 # یک توکن محدوده‌ای ایجاد می‌کند، زمینه را ذخیره می‌کند
omniroute setup-codex # ← حالا از کاتالوگ از راه دور استفاده می‌کند
omniroute setup-opencode # ← مشابه
omniroute launch # ← Claude Code در برابر راه دور
```
برای زمینه‌ها، دامنه‌ها و مدیریت توکن به [حالت راه دور](./REMOTE-MODE.md) مراجعه کنید.
---
## کنوانسیون‌های URL پایه (کدام ابزارها به `/v1` نیاز دارند)
OmniRoute سطح OpenAI را در `/v1`، سطح Anthropic را در ریشه و یک سطح بومی Gemini را در `/v1beta` ارائه می‌دهد. هر یکپارچگی به شکلی که ابزارش انتظار دارد متصل شده است (در منبع دستور تأیید شده):
| یکپارچگی | URL پایه نوشته شده | `/v1`؟ |
| -------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------- |
| `setup-cline` (`openAiBaseUrl`) | ریشه | خیر — Cline `/v1/chat/completions` را اضافه می‌کند |
| `setup-goose` (`OPENAI_HOST`) | ریشه | خیر — Goose مسیر را اضافه می‌کند |
| `setup-aider` (`OPENAI_API_BASE`) | ریشه | خیر — LiteLLM `/v1/chat/completions` را اضافه می‌کند |
| `setup-kilo`, `setup-roo`, `setup-continue`, `setup-crush`, `setup-cursor` | با `/v1` | بله |
| `setup-claude` (`ANTHROPIC_BASE_URL``launch` | ریشه | خیر — Claude Code `/v1/messages` را اضافه می‌کند |
| `setup-codex`, `launch-codex` (`model_providers.omniroute.base_url`) | با `/v1` | بله |
| `setup-qwen` (`modelProviders.openai[].baseUrl`) | با `/v1` | بله |
| `run gemini` (`GOOGLE_GEMINI_BASE_URL`) | ریشه | خیر — SDK `/v1beta/models/…` را اضافه می‌کند |
---
## نگهداری وابستگی‌های بومی در بروزرسانی: `--include=optional`
زمانی که با `omniroute update` بروزرسانی می‌کنید (پس از تأیید یا با `--apply`
OmniRoute نصب را با `--include=optional` انجام می‌دهد:
```bash
npm install -g omniroute@latest --include=optional
```
این **یک** پرچم نیست که به `omniroute update` بدهید — همیشه توسط بروزرسان
اعمال می‌شود. این اطمینان می‌دهد که `optionalDependencies` (`better-sqlite3`، `keytar`،
`tls-client`، پشته LLMLingua SLM) در طول بروزرسانی باقی بمانند حتی اگر پیکربندی npm شما
دارای `omit=optional` باشد، که در غیر این صورت به طور خاموش درایور SQLite بومی و
بایندینگ OS-keyring را حذف می‌کند. برای پیش‌نمایش فرمان دقیق بدون اعمال:
```bash
omniroute update --dry-run
# [DRY RUN] Would run: npm install -g omniroute@latest --include=optional
```
سایر پرچم‌های `omniroute update` (تأیید شده در منبع): `--check` (خروج 1 اگر
قدیمی باشد)، `--apply` (نصب بدون درخواست)، `--changelog`، `--no-backup`،
`--yes`.
---
## Google Gemini CLI از طریق `omniroute run gemini`
قرارداد تأیید شده در برابر `@google/gemini-cli` 0.50.0: CLI به
`GOOGLE_GEMINI_BASE_URL` احترام می‌گذارد و `POST /v1beta/models/<model>:generateContent`
`:streamGenerateContent?alt=sse`) را به آن ارسال می‌کند — دقیقاً سطح بومی
Gemini OmniRoute (`/v1beta`). `omniroute run gemini` این را به طور خودکار متصل می‌کند:
- `GOOGLE_GEMINI_BASE_URL` → URL پایه فعال OmniRoute (ریشه، بدون `/v1`
- `GEMINI_API_KEY` → اعتبارنامه حل شده OmniRoute (گزینه/محیط/زمینه)؛
- یک **`GEMINI_CLI_HOME` موقت و ایزوله** که `.gemini/settings.json` آن
احراز هویت `gemini-api-key` را انتخاب می‌کند، بنابراین یک جلسه OAuth
ذخیره شده Google (Code Assist) هرگز راه‌اندازی هدایت شده OmniRoute را
نادیده نمی‌گیرد — پس از خروج حذف می‌شود؛
- **بهداشت محیط**: محیط فرزند از `GOOGLE_API_KEY`،
`GOOGLE_GENAI_USE_VERTEXAI` و `GOOGLE_GENAI_USE_GCA` پاک می‌شود (که
احراز هویت را به Vertex/Code Assist هدایت می‌کند)، و `GEMINI_DEFAULT_AUTH_TYPE=gemini-api-key`
به عنوان یک پشتیبان اضافی تنظیم می‌شود — سایر اهداف `run` همین
درمان را برای متغیرهای متضاد خود دریافت می‌کنند؛
- تزریق `--model <id>` از `--provider`/`--model`.
```bash
omniroute run gemini --model glm/glm-5.2 -- --skip-trust -p "hello"
```
نگهبان اعتماد workspace Gemini هنوز در حالت بدون سر اعمال می‌شود —
`--skip-trust` را عبور دهید (یا به صورت تعاملی به دایرکتوری اعتماد کنید)؛
راه‌انداز عمداً از آن عبور نمی‌کند. این راه‌انداز از **ثبت ACP**
(`src/lib/acp/registry.ts`، `gemini --acp`) متمایز است، که
ادغام پروتکل عامل برای `/dashboard/acp-agents` باقی می‌ماند.
---
## پاکسازی واقعی دود (اختیاری)
اجرای برنامه راه‌اندازی قطعی در CI (`tests/unit/cli/run-command.test.ts`،
`tests/unit/cli/run-execution.test.ts`). برای اعتبارسنجی باینری‌های واقعی
در برابر یک سرور واقعی OmniRoute، یک ابزار اختیاری در
`tests/integration/upstream-cli-smoke.int.test.ts` وجود دارد. این ابزار هرگز به
طور خودکار اجرا نمی‌شود (هر زیرآزمایش رد می‌شود مگر اینکه `RUN_CLI_SMOKE=1`
اعتبارنامه را از طریق متغیر محیطی NAME (هرگز از طریق مقدار) منتقل می‌کند،
رشته‌های کلید شکل را از هر خروجی ثبت شده حذف می‌کند، اهدافی که باینری آن‌ها
نصب نشده است را رد می‌کند و شکست‌ها را به عنوان auth / upstream / config
به جای یک بولین خالص طبقه‌بندی می‌کند:
```bash
RUN_CLI_SMOKE=1 \
OMNIROUTE_SMOKE_BASE_URL="http://localhost:20128" \
OMNIROUTE_SMOKE_MODEL="<provider/model>" \
OMNIROUTE_SMOKE_API_KEY_ENV="OMNIROUTE_API_KEY" \
node --import tsx/esm --test tests/integration/upstream-cli-smoke.int.test.ts
```
اختیاری: `OMNIROUTE_SMOKE_TARGETS="codex,opencode,qwen"` پاکسازی را محدود می‌کند؛
`OMNIROUTE_SMOKE_TIMEOUT_MS` زمان‌سنج 120 ثانیه‌ای برای هر هدف را نادیده می‌گیرد.
---
## همچنین ببینید
- [پیکربندی کلاود کد](./CLAUDE-CODE-CONFIGURATION.md) — راهنمای عمیق‌تر کلاود کد
- [پیکربندی CLI کدکس](./CODEX-CLI-CONFIGURATION.md) — تنظیمات پایه یک‌باره `[model_providers.omniroute]`
- [حالت از راه دور](./REMOTE-MODE.md) — زمینه‌ها، توکن‌های دسترسی محدود، راه‌اندازی یک سرور از راه دور
- [مرجع ابزارهای CLI](../reference/CLI-TOOLS.md) — کاتالوگ کامل ابزارهای پشتیبانی‌شده + صفحات داشبورد
- [راهنمای راه‌اندازی](./SETUP_GUIDE.md) — روش‌های نصب و آموزش اولیه در اولین اجرا

View File

@@ -1,86 +1,316 @@
# CLI Tools Setup Guide — OmniRoute (فارسی)
# CLI-TOOLS (فارسی)
🌐 **Languages:** 🇺🇸 [English](../../../../docs/CLI-TOOLS.md) · 🇸🇦 [ar](../../ar/docs/CLI-TOOLS.md) · 🇧🇬 [bg](../../bg/docs/CLI-TOOLS.md) · 🇧🇩 [bn](../../bn/docs/CLI-TOOLS.md) · 🇨🇿 [cs](../../cs/docs/CLI-TOOLS.md) · 🇩🇰 [da](../../da/docs/CLI-TOOLS.md) · 🇩🇪 [de](../../de/docs/CLI-TOOLS.md) · 🇪🇸 [es](../../es/docs/CLI-TOOLS.md) · 🇮🇷 [fa](../../fa/docs/CLI-TOOLS.md) · 🇫🇮 [fi](../../fi/docs/CLI-TOOLS.md) · 🇫🇷 [fr](../../fr/docs/CLI-TOOLS.md) · 🇮🇳 [gu](../../gu/docs/CLI-TOOLS.md) · 🇮🇱 [he](../../he/docs/CLI-TOOLS.md) · 🇮🇳 [hi](../../hi/docs/CLI-TOOLS.md) · 🇭🇺 [hu](../../hu/docs/CLI-TOOLS.md) · 🇮🇩 [id](../../id/docs/CLI-TOOLS.md) · 🇮🇹 [it](../../it/docs/CLI-TOOLS.md) · 🇯🇵 [ja](../../ja/docs/CLI-TOOLS.md) · 🇰🇷 [ko](../../ko/docs/CLI-TOOLS.md) · 🇮🇳 [mr](../../mr/docs/CLI-TOOLS.md) · 🇲🇾 [ms](../../ms/docs/CLI-TOOLS.md) · 🇳🇱 [nl](../../nl/docs/CLI-TOOLS.md) · 🇳🇴 [no](../../no/docs/CLI-TOOLS.md) · 🇵🇭 [phi](../../phi/docs/CLI-TOOLS.md) · 🇵🇱 [pl](../../pl/docs/CLI-TOOLS.md) · 🇵🇹 [pt](../../pt/docs/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../pt-BR/docs/CLI-TOOLS.md) · 🇷🇴 [ro](../../ro/docs/CLI-TOOLS.md) · 🇷🇺 [ru](../../ru/docs/CLI-TOOLS.md) · 🇸🇰 [sk](../../sk/docs/CLI-TOOLS.md) · 🇸🇪 [sv](../../sv/docs/CLI-TOOLS.md) · 🇰🇪 [sw](../../sw/docs/CLI-TOOLS.md) · 🇮🇳 [ta](../../ta/docs/CLI-TOOLS.md) · 🇮🇳 [te](../../te/docs/CLI-TOOLS.md) · 🇹🇭 [th](../../th/docs/CLI-TOOLS.md) · 🇹🇷 [tr](../../tr/docs/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../uk-UA/docs/CLI-TOOLS.md) · 🇵🇰 [ur](../../ur/docs/CLI-TOOLS.md) · 🇻🇳 [vi](../../vi/docs/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../zh-CN/docs/CLI-TOOLS.md)
🌐 **Languages:** 🇺🇸 [English](../../../../reference/CLI-TOOLS.md) · 🇸🇦 [ar](../../../ar/docs/reference/CLI-TOOLS.md) · 🇦🇿 [az](../../../az/docs/reference/CLI-TOOLS.md) · 🇧🇬 [bg](../../../bg/docs/reference/CLI-TOOLS.md) · 🇧🇩 [bn](../../../bn/docs/reference/CLI-TOOLS.md) · 🇨🇿 [cs](../../../cs/docs/reference/CLI-TOOLS.md) · 🇩🇰 [da](../../../da/docs/reference/CLI-TOOLS.md) · 🇩🇪 [de](../../../de/docs/reference/CLI-TOOLS.md) · 🇪🇸 [es](../../../es/docs/reference/CLI-TOOLS.md) · 🇫🇮 [fi](../../../fi/docs/reference/CLI-TOOLS.md) · 🇫🇷 [fr](../../../fr/docs/reference/CLI-TOOLS.md) · 🇮🇳 [gu](../../../gu/docs/reference/CLI-TOOLS.md) · 🇮🇱 [he](../../../he/docs/reference/CLI-TOOLS.md) · 🇮🇳 [hi](../../../hi/docs/reference/CLI-TOOLS.md) · 🇭🇺 [hu](../../../hu/docs/reference/CLI-TOOLS.md) · 🇮🇩 [id](../../../id/docs/reference/CLI-TOOLS.md) · 🇮🇩 [in](../../../in/docs/reference/CLI-TOOLS.md) · 🇮🇹 [it](../../../it/docs/reference/CLI-TOOLS.md) · 🇯🇵 [ja](../../../ja/docs/reference/CLI-TOOLS.md) · 🇰🇷 [ko](../../../ko/docs/reference/CLI-TOOLS.md) · 🇮🇳 [mr](../../../mr/docs/reference/CLI-TOOLS.md) · 🇲🇾 [ms](../../../ms/docs/reference/CLI-TOOLS.md) · 🇳🇱 [nl](../../../nl/docs/reference/CLI-TOOLS.md) · 🇳🇴 [no](../../../no/docs/reference/CLI-TOOLS.md) · 🇵🇭 [phi](../../../phi/docs/reference/CLI-TOOLS.md) · 🇵🇱 [pl](../../../pl/docs/reference/CLI-TOOLS.md) · 🇵🇹 [pt](../../../pt/docs/reference/CLI-TOOLS.md) · 🇧🇷 [pt-BR](../../../pt-BR/docs/reference/CLI-TOOLS.md) · 🇷🇴 [ro](../../../ro/docs/reference/CLI-TOOLS.md) · 🇷🇺 [ru](../../../ru/docs/reference/CLI-TOOLS.md) · 🇸🇰 [sk](../../../sk/docs/reference/CLI-TOOLS.md) · 🇸🇪 [sv](../../../sv/docs/reference/CLI-TOOLS.md) · 🇰🇪 [sw](../../../sw/docs/reference/CLI-TOOLS.md) · 🇮🇳 [ta](../../../ta/docs/reference/CLI-TOOLS.md) · 🇮🇳 [te](../../../te/docs/reference/CLI-TOOLS.md) · 🇹🇭 [th](../../../th/docs/reference/CLI-TOOLS.md) · 🇹🇷 [tr](../../../tr/docs/reference/CLI-TOOLS.md) · 🇺🇦 [uk-UA](../../../uk-UA/docs/reference/CLI-TOOLS.md) · 🇵🇰 [ur](../../../ur/docs/reference/CLI-TOOLS.md) · 🇻🇳 [vi](../../../vi/docs/reference/CLI-TOOLS.md) · 🇨🇳 [zh-CN](../../../zh-CN/docs/reference/CLI-TOOLS.md) · 🇹🇼 [zh-TW](../../../zh-TW/docs/reference/CLI-TOOLS.md)
---
This guide explains how to install and configure all supported AI coding CLI tools
to use **OmniRoute** as the unified backend, giving you centralized key management,
cost tracking, model switching, and request logging across every tool.
---
title: "ابزارهای CLI — OmniRoute"
version: 3.8.50
lastUpdated: 2026-08-18
---
# ابزارهای CLI — OmniRoute
آخرین به‌روزرسانی: 2026-08-18
OmniRoute با سه دسته از ابزارهای CLI که در سه صفحه داشبورد اختصاصی پخش شده‌اند، یکپارچه می‌شود:
| صفحه | مسیر | مفهوم | تعداد |
| ----------------- | ----------------------- | -------------------------------------------------------------------------------------- | ---------------------- |
| **کدهای CLI** | `/dashboard/cli-code` | ابزارهای کدنویسی که به OmniRoute اشاره می‌کنند (مشتری → CLI → OmniRoute → ارائه‌دهنده) | 26 |
| **نمایندگان CLI** | `/dashboard/cli-agents` | نمایندگان خودکار که به OmniRoute اشاره می‌کنند (همان جریان، دامنه وسیع‌تر) | 8 |
| **نمایندگان ACP** | `/dashboard/acp-agents` | CLIهایی که OmniRoute به عنوان بک‌اند از طریق stdio/ACP ایجاد می‌کند (جریان معکوس) | به ثبت‌نام مراجعه کنید |
مسیرهای قدیمی از طریق 308 هدایت می‌شوند: `/dashboard/cli-tools``/dashboard/cli-code`، `/dashboard/agents``/dashboard/acp-agents`.
---
## How It Works
## نحوه کار
```
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Kiro / Cursor / Copilot
کدهای CLI / نمایندگان CLI (جریان مصرف):
Claude / Codex / OpenCode / Cline / KiloCode / Continue / Hermes Agent / Goose / ...
▼ (all point to OmniRoute)
▼ (همه به OmniRoute اشاره می‌کنند)
http://YOUR_SERVER:20128/v1
▼ (OmniRoute routes to the right provider)
▼ (OmniRoute به ارائه‌دهنده صحیح هدایت می‌کند)
Anthropic / OpenAI / Gemini / DeepSeek / Groq / Mistral / ...
نمایندگان ACP (جریان ایجاد معکوس):
درخواست مشتری → OmniRoute → CLI را از طریق stdio/ACP ایجاد می‌کند → پاسخ
```
**Benefits:**
**مزایا:**
- One API key to manage all tools
- Cost tracking across all CLIs in the dashboard
- Model switching without reconfiguring every tool
- Works locally and on remote servers (VPS)
- یک کلید API برای مدیریت همه ابزارها
- ردیابی هزینه‌ها در تمام CLIها در داشبورد
- تغییر مدل بدون نیاز به پیکربندی مجدد هر ابزار
- کارکرد محلی و بر روی سرورهای از راه دور (VPS، Docker، Akamai، Cloudflare Tunnel)
---
## Supported Tools (Dashboard Source of Truth)
## پیکربندی خودکار با `setup-*`
The dashboard cards in `/dashboard/cli-tools` are generated from `src/shared/constants/cliTools.ts`.
Current list (v3.0.0-rc.16):
شما نیازی به نوشتن پیکربندی هر ابزار به صورت دستی ندارید. OmniRoute یک دستور `setup-*`
برای هر CLI پشتیبانی شده ارائه می‌دهد که کاتالوگ مدل **زنده** را از یک OmniRoute در حال اجرا (محلی یا از راه دور) می‌خواند و پیکربندی خود ابزار را بر روی ماشین شما می‌نویسد:
| Tool | ID | Command | Setup Mode | Install Method |
| ------------------ | ------------- | ---------- | ---------- | -------------- |
| **Claude Code** | `claude` | `claude` | env | npm |
| **OpenAI Codex** | `codex` | `codex` | custom | npm |
| **Factory Droid** | `droid` | `droid` | custom | bundled/CLI |
| **OpenClaw** | `openclaw` | `openclaw` | custom | bundled/CLI |
| **Cursor** | `cursor` | app | guide | desktop app |
| **Cline** | `cline` | `cline` | custom | npm |
| **Kilo Code** | `kilo` | `kilocode` | custom | npm |
| **Continue** | `continue` | extension | guide | VS Code |
| **Antigravity** | `antigravity` | internal | mitm | OmniRoute |
| **GitHub Copilot** | `copilot` | extension | custom | VS Code |
| **OpenCode** | `opencode` | `opencode` | guide | npm |
| **Kiro AI** | `kiro` | app/cli | mitm | desktop/CLI |
| **Qwen Code** | `qwen` | `qwen` | custom | npm |
```bash
omniroute setup-codex omniroute setup-claude omniroute setup-opencode
omniroute setup-cline omniroute setup-kilo omniroute setup-continue
omniroute setup-cursor omniroute setup-roo omniroute setup-crush
omniroute setup-goose omniroute setup-qwen omniroute setup-aider
```
### CLI fingerprint sync (Agents + Settings)
هر کدام `--remote <url> --api-key <key>` را می‌پذیرند (پیکربندی یک ابزار محلی در برابر یک OmniRoute از راه دور)، `--dry-run` (پیش‌نمایش بدون نوشتن) و `--port`. ابزارهایی که کشف خودکار مدل ندارند (Cline، Kilo، Roo، Goose، Aider، Qwen) `--model <id>` را می‌پذیرند (و `--yes` برای اجراهای غیرتعامل‌پذیر). برای راه‌اندازی یک CLI با محیط صحیح و بدون نوشتن هیچ پیکربندی، از راه‌انداز عمومی
`omniroute run <target>` استفاده کنید (claude، codex، aider، goose، opencode، qwen،
gemini — اهداف و نام‌های مستعار از `bin/cli/cli-manifest.mjs` می‌آیند)؛ راه‌اندازهای قدیمی به ازای هر ابزار `omniroute launch` (Claude Code) و `omniroute launch-codex`
(Codex) همچنان در دسترس هستند. CLI جیمنای فقط برای راه‌اندازی است: این یک هدف `omniroute run`
است اما هیچ دستور `setup-*`/`configure` ندارد.
`/dashboard/agents` and `Settings > CLI Fingerprint` use `src/shared/constants/cliCompatProviders.ts`.
This keeps provider IDs aligned with CLI cards and legacy IDs.
> **مرجع کامل:** جدول اصلی — آنچه هر دستور می‌نویسد، هر پرچم،
> محلی در مقابل از راه دور، و اینکه کدام ابزارها به یک پسوند `/v1` نیاز دارند — در
> **[یکپارچه‌سازی‌های CLI](../guides/CLI-INTEGRATIONS.md)** موجود است.
| CLI ID | Fingerprint Provider ID |
| ---------------------------------------------------------------------------------------------------- | ----------------------- |
| `kilo` | `kilocode` |
| `copilot` | `github` |
| `claude` / `codex` / `antigravity` / `kiro` / `cursor` / `cline` / `opencode` / `droid` / `openclaw` | same ID |
### اجرای این‌ها در داخل یک کانتینر
Legacy IDs still accepted for compatibility: `copilot`, `kimi-coding`, `qwen`.
یک دستور `setup-*` که در داخل کانتینر OmniRoute اجرا می‌شود، در خانه خود کانتینر می‌نویسد، که هیچ CLI میزبان آن را نمی‌خواند و با کانتینر ناپدید می‌شود. OmniRoute این را تشخیص می‌دهد و با دستورالعمل‌ها `2` خارج می‌شود به جای نوشتن. دو راه پشتیبانی شده برای پیشرفت — نصب CLI بر روی میزبان و
`omniroute connect` به کانتینر، یا بایند-مونت کردن دایرکتوری‌های پیکربندی و تنظیم
`CLI_CONFIG_HOME` (پروفایل میزبان کامپوز). هر دستور `setup-*`، به علاوه
`omniroute configure` و `omniroute config set`، `--allow-container-write` را می‌پذیرند زمانی که پیکربندی CLIهای خود کانتینر واقعاً منظور شما بوده است؛ `OMNIROUTE_ALLOW_CONTAINER_CONFIG_WRITE=true` همین کار را برای
سرور انجام می‌دهد. به
[راهنمای Docker → پیکربندی ابزارهای CLI میزبان](../guides/DOCKER_GUIDE.md#configuring-host-cli-tools-when-omniroute-runs-in-docker) مراجعه کنید.
نقطه پایانی **اعمال داشبورد** (`POST /api/cli-tools/apply`) همان محافظ را اعمال می‌کند: در یک کانتینر، نوشتن که هدف آن از میزبان بایند-مونت نشده است، **`422`** را با `containerEphemeralTarget: true`، متن خطای ایمن و — برای ابزارهایی که دستور میزبان دارند (claude، codex، opencode، cline،
kilo، continue) — یک `hostSetupCommand` (به عنوان مثال `omniroute setup-opencode`) برای اجرا بر روی میزبان به جای آن؛ هیچ چیزی نوشته نمی‌شود. `dryRun: true` در حالت کانتینر همچنان کار می‌کند و محتوای تولید شده + مسیر هدف را بدون لمس دیسک برمی‌گرداند، بنابراین می‌توانید از داشبورد پیش‌نمایش کنید و بر روی میزبان اعمال کنید. این رفتار عمدی است و توسط
`tests/unit/api/cli-tools/apply-container-guard.test.ts` محافظت می‌شود — هرگز "اصلاح" نکنید یک 422 را با حذف محافظ.
---
## Step 1 — Get an OmniRoute API Key
## منبع حقیقت
1. Open the OmniRoute dashboard → **API Manager** (`/dashboard/api-manager`)
2. Click **Create API Key**
3. Give it a name (e.g. `cli-tools`) and select all permissions
4. Copy the key — you'll need it for every CLI below
کاتالوگ یکپارچه در `src/shared/constants/cliTools.ts` به عنوان `CLI_TOOLS: Record<string, CliCatalogEntry>` وجود دارد.
> Your key looks like: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
هر ورودی دارای این فیلدها است (تعریف شده در `src/shared/schemas/cliCatalog.ts`):
| فیلد | نوع | توضیحات |
| ----------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `category` | `"code" \| "agent"` | کدام صفحه ابزار را نمایش می‌دهد |
| `vendor` | `string` | منبع ابزار ("Anthropic"، "OSS (P. Gauthier)") |
| `acpSpawnable` | `boolean` | همچنین به عنوان یک عامل ACP قابل استفاده است (نشان داده شده) |
| `baseUrlSupport` | `"full" \| "partial" \| "none"` | سطح پشتیبانی از نقطه پایانی سفارشی. `"none"` = MITM backlog |
| `configType` | `"env" \| "custom" \| "guide" \| "custom-builder" \| "mitm"` | مکانیزم پیکربندی |
| `id`, `name`, `color`, `description`, `docsUrl` | استاندارد | فیلدهای اصلی نمایش |
ورودی‌هایی با `baseUrlSupport: "none"` در صفحات داشبورد **نمایش داده نمی‌شوند** — آنها در MITM backlog برای طرح 11 ثبت شده‌اند (به `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` مراجعه کنید).
### سطوح قابلیت (کاتالوگ شده × قابل شناسایی × قابل پیکربندی × قابل راه‌اندازی)
هر ابزار کاتالوگ شده قابل شناسایی، قابل پیکربندی یا قابل راه‌اندازی نیست. هر سطح یک منبع اعلام کننده دارد و یک تست انحراف آنها را هم‌راستا نگه می‌دارد:
| سطح | معنی | اعلام شده در |
| ------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **کاتالوگ شده** | در کاتالوگ داشبورد ظاهر می‌شود (نام، فروشنده، مستندات، نوع پیکربندی) | `src/shared/constants/cliTools.ts` (`CLI_TOOLS`) |
| **قابل شناسایی** | شناسایی باینری/پیکربندی، بررسی سلامت، مسیرهای پیکربندی | `src/shared/services/cliRuntime.ts` (`CLI_TOOLS` runtime catalog) |
| **قابل پیکربندی** | توسط `omniroute configure <cli>` پشتیبانی می‌شود (دستورالعمل راه‌اندازی وجود دارد) | `bin/cli/cli-manifest.mjs` (`configure: true`) |
| **قابل راه‌اندازی** | توسط `omniroute run <target>` پشتیبانی می‌شود (تزریق env/args تعریف شده) | `bin/cli/cli-manifest.mjs` (`run: true`) |
`bin/cli/cli-manifest.mjs` مانفیست اجرایی رسمی برای دستورات CLI است: `run`، `configure` و تولیدکنندگان تکمیل شل همه لیست‌های هدف، حل نام مستعار (به عنوان مثال `kilocode`/`kilo-code`/`kilo_cli``kilo`) و اتصال پرچم `--model` را از آن استخراج می‌کنند. نگهبان انحراف
`tests/unit/cli/cli-manifest-drift.test.ts` تأیید می‌کند که مانفیست، کاتالوگ زمان اجرا، کاتالوگ UI و هر سطح مصرف‌کننده در همگام بمانند — هدفی که به یک سطح اضافه می‌شود بدون اینکه به دیگران اضافه شود، به جای انحراف بی‌صدا، آزمون را شکست می‌دهد.
## 1. کاتالوگ کد CLI (۲۶ ابزار)
تمام ابزارهایی که در `/dashboard/cli-code` ظاهر می‌شوند. آن‌هایی که `baseUrlSupport: none` دارند از طریق MITM یا یک راهنمای دستی به جای یک URL پایه سفارشی متصل شده‌اند:
| id | name | vendor | baseUrlSupport | configType | acpSpawnable |
| ------------ | ------------------------ | --------------------------- | -------------- | -------------- | ------------ |
| claude | کد کلاود | Anthropic | full | env | true |
| codex | CLI کد OpenAI | OpenAI | full | custom | true |
| zcode | ZCode (برنامه نویسی GLM) | Z.ai | none | custom | false |
| cline | Cline | OSS (توسعه‌دهنده ex-Claude) | full | custom | true |
| kilo | کد کیلو | Kilo-Org | full | custom | false |
| roo | کد رو | Roo (OSS) | full | guide | false |
| continue | ادامه | continue.dev | full | guide | false |
| aider | Aider | OSS (P. Gauthier) | full | guide | true |
| forge | ForgeCode | Antinomy HQ | full | custom | true |
| jcode | jcode | 1jehuang (OSS) | full | custom | false |
| deepseek-tui | DeepSeek TUI | Hunter Bown (OSS) | full | custom | false |
| codewhale | CodeWhale | Hmbown (OSS) | full | custom | false |
| opencode | OpenCode | Anomaly (ex-SST) | full | guide | true |
| droid | Factory Droid | Factory AI | partial | guide | false |
| copilot | CLI کد GitHub Copilot | GitHub/MS | full | custom | false |
| cursor-cli | CLI کد Cursor | Anysphere | partial | guide | true |
| smelt | Smelt | leonardcser (OSS) | full | custom | false |
| pi | Pi (عامل کدگذاری pi) | M. Zechner (OSS) | full | custom | false |
| grok-build | Grok Build | xAI | full | custom | false |
| crush | Crush | OSS (Charm) | full | custom | false |
| qwen | کد Qwen | Alibaba | full | guide | true |
| cursor | Cursor | Anysphere | none | guide | false |
| antigravity | ضد جاذبه | Google | none | mitm | false |
| hermes | هرمس | Nous Research | none | guide | false |
| kiro | Kiro AI | Amazon | none | mitm | false |
| custom | CLI سفارشی | — | full | custom-builder | false |
ابزارهایی که `baseUrlSupport: "partial"` دارند در کارت داشبورد نشان "⚠ Base URL parcial" را نمایش می‌دهند.
---
## 2. کاتالوگ ابزارهای CLI (8 ابزار)
عامل‌های خودمختار که در `/dashboard/cli-agents` ظاهر می‌شوند:
| id | name | vendor | baseUrlSupport | acpSpawnable |
| ------------ | ---------------- | ------------------------ | -------------- | ------------ |
| hermes-agent | عامل هرمس | Nous Research | full | false |
| openclaw | OpenClaw | OSS (P. Steinberger) | full | true |
| goose | Goose | Block / Linux Foundation | full | true |
| interpreter | Open Interpreter | OSS | full | true |
| warp | Warp AI | Warp Inc. | partial | true |
| agent-deck | Agent Deck | asheshgoplani (OSS) | full | false |
| omp | Oh My Pi | OSS | full | true |
| letta | Letta CLI | Letta | full | false |
---
## Step 2 — Install CLI Tools
## 3. عامل‌های ACP (/dashboard/acp-agents)
All npm-based tools require Node.js 18+:
این صفحه (که از `/dashboard/agents` تغییر نام داده است) CLIهایی را نشان می‌دهد که OmniRoute می‌تواند به عنوان موتورهای اجرایی backend از طریق پروتکل stdio/ACP **ایجاد** کند. کاتالوگ به طور جداگانه در `src/lib/acp/registry.ts` نگهداری می‌شود و **همانند** `CLI_TOOLS` نیست.
---
## 4. لیست معوقه MITM (در داشبورد نمایش داده نمی‌شود)
CLIهای زیر به طور طبیعی از URL پایه سفارشی پشتیبانی نمی‌کنند و در صفحات کد CLI یا عامل‌های CLI **فهرست نشده‌اند**. آن‌ها نامزدهای مداخله MITM در طرح 11 هستند:
| CLI | دلیل |
| ------------------- | ------------------------------------------------------ |
| windsurf | BYOK محدود به مدل‌های انتخابی Claude + URL/token شرکتی |
| amp | اکوسیستم بسته (Sourcegraph) |
| amazon-q / kiro-cli | احراز هویت AWS SSO، بدون URL سفارشی |
| cowork | Anthropic Desktop، بدون نقطه پایانی قابل تنظیم |
برای مرجع کامل به `_tasks/features-v3.8.6/refactorpages/_orchestration/_plan11-mitm-backlog.md` مراجعه کنید.
---
## 5. API تشخیص دسته‌ای
تمام تشخیص ابزارها از طریق یک نقطه پایانی واحد تجمیع می‌شود:
**`GET /api/cli-tools/all-statuses`**
- Auth: `requireCliToolsAuth(request)` (همانند سایر مسیرهای `/api/cli-tools/`)
- Returns: `Record<toolId, ToolBatchStatus>` (نوع: `src/shared/types/cliBatchStatus.ts`)
- Strategy: `Promise.all` بر روی تمام ابزارها، 5 ثانیه زمان محدود برای هر ابزار
- Cache: در حافظه LRU با ایندکس فایل پیکربندی `mtime`. کش زمانی که mtime تغییر کند، نامعتبر می‌شود. در زمان راه‌اندازی مجدد سرور بازنشانی می‌شود.
شکل پاسخ برای هر ابزار:
```ts
interface ToolBatchStatus {
detection: {
installed: boolean;
runnable: boolean;
version?: string;
command?: string;
commandPath?: string;
reason?: string;
};
config: {
status: "configured" | "not_configured" | "not_installed" | "unknown" | "other";
endpoint?: string | null;
lastConfiguredAt?: string | null;
};
error?: string; // sanitized, no stack traces
}
```
## ۶. مدیریت تنظیمات برای ابزارهای جدید
ابزارهای جدید با `configType: "custom"` دارای مسیرهای API تنظیمات اختصاصی هستند:
| مسیر | ابزار |
| ------------------------------------------- | ---------------------------------------------------------------- |
| `POST /api/cli-tools/forge-settings` | ForgeCode (.forge.toml) |
| `POST /api/cli-tools/jcode-settings` | jcode (--base-url flag) |
| `POST /api/cli-tools/deepseek-tui-settings` | DeepSeek TUI (OPENAI_BASE_URL, legacy) |
| `POST /api/cli-tools/codewhale-settings` | CodeWhale (OPENAI_BASE_URL, primary + legacy `~/.deepseek` sync) |
| `POST /api/cli-tools/smelt-settings` | Smelt |
| `POST /api/cli-tools/pi-settings` | Pi coding agent |
| `POST /api/cli-tools/grok-build-settings` | Grok Build (~/.grok/config.toml, `[model.omniroute]`) |
| `POST /api/cli-tools/qwen-settings` | Qwen Code (`~/.qwen/settings.json` + dedicated `.env` key) |
تمام مسیرها از `sanitizeErrorMessage()` برای پاسخ‌های خطا استفاده می‌کنند (قانون سخت شماره ۱۲).
---
## ۷. معماری صفحات داشبورد
### کد CLI (`/dashboard/cli-code`)
- `src/app/(dashboard)/dashboard/cli-code/page.tsx` — کامپوننت سرور
- `src/app/(dashboard)/dashboard/cli-code/CliCodePageClient.tsx` — گرید کلاینت
- `src/app/(dashboard)/dashboard/cli-code/[id]/page.tsx` — صفحه جزئیات ابزار
- `src/app/(dashboard)/dashboard/cli-code/components/` — ۱۲ کارت ابزار تخصصی + `ToolDetailClient.tsx`
### عوامل CLI (`/dashboard/cli-agents`)
- `src/app/(dashboard)/dashboard/cli-agents/page.tsx` — کامپوننت سرور
- `src/app/(dashboard)/dashboard/cli-agents/CliAgentsPageClient.tsx` — گرید کلاینت
- `src/app/(dashboard)/dashboard/cli-agents/[id]/page.tsx` — استفاده مجدد از `ToolDetailClient`
### عوامل ACP (`/dashboard/acp-agents`)
- `src/app/(dashboard)/dashboard/acp-agents/page.tsx` — کامپوننت سرور (انتقال یافته از `agents/`)
### کامپوننت‌های UI مشترک (`src/shared/components/cli/`)
| فایل | هدف |
| ----------------------- | ------------------------------------------------- |
| `CliToolCard.tsx` | کارت وضعیت هوشمند (تشخیص + تنظیمات + نقطه پایانی) |
| `CliConceptCard.tsx` | کارت توضیح مفهوم در هر صفحه |
| `CliComparisonCard.tsx` | مقایسه سه ستونی بین انواع CLI |
| `BaseUrlSelect.tsx` | منوی کشویی نقطه پایانی (محلی/ابری/سفارشی) |
| `ApiKeySelect.tsx` | انتخاب‌کننده کلید API |
| `ManualConfigModal.tsx` | مدال قطعه کد تنظیمات قابل کپی |
### هوک مشترک (`src/shared/hooks/cli/`)
| فایل | هدف |
| ------------------------- | ---------------------------------------------------------------------- |
| `useToolBatchStatuses.ts` | دریافت `/api/cli-tools/all-statuses`، مدیریت حالت بارگذاری/به‌روزرسانی |
## 8. i18n
فضاهای نام جدید در طرح 14 F9 اضافه شده‌اند:
| Namespace | Purpose |
| ----------- | ------------------------------------------------------------------------- |
| `cliCommon` | رشته‌های مشترک (برچسب‌های کارت، متون مفهوم/مقایسه، برچسب‌های صفحه جزئیات) |
| `cliCode` | رشته‌های صفحه CLI Code |
| `cliAgents` | رشته‌های صفحه CLI Agents |
| `acpAgents` | رشته‌های صفحه ACP Agents |
ترجمه‌های کامل PT-BR و EN ارائه شده‌اند. 39 زبان دیگر به طور خودکار از طریق ادغام سطح فضای نام در `src/i18n/request.ts` به EN برمی‌گردند.
---
## 9. شروع سریع
### مرحله 1 — دریافت کلید API OmniRoute
1. به `/dashboard/api-manager` بروید → **ایجاد کلید API**
2. یک نام به آن بدهید (مثلاً `cli-tools`) و تمام مجوزها را انتخاب کنید
3. کلید را کپی کنید — شما به آن برای هر CLI زیر نیاز خواهید داشت
> کلید شما به شکل زیر است: `sk-xxxxxxxxxxxxxxxx-xxxxxxxxx`
---
### مرحله 2 — نصب ابزارهای CLI
تمام ابزارهای مبتنی بر npm به Node.js 22.22.2+ یا 24.x نیاز دارند:
```bash
# Claude Code (Anthropic)
@@ -98,96 +328,135 @@ npm install -g cline
# KiloCode
npm install -g kilocode
# Kiro CLI (Amazon — requires curl + unzip)
apt-get install -y unzip # on Debian/Ubuntu
curl -fsSL https://cli.kiro.dev/install | bash
export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc
```
# Qwen Code
npm install -g @qwen-code/qwen-code
**Verify:**
# Google Gemini CLI (قابل راه‌اندازی از طریق `omniroute run gemini` → /v1beta surface)
npm install -g @google/gemini-cli
```bash
claude --version # 2.x.x
codex --version # 0.x.x
opencode --version # x.x.x
cline --version # 2.x.x
kilocode --version # x.x.x (or: kilo --version)
kiro-cli --version # 1.x.x
# Aider
pip install aider-chat
# Smelt
cargo install smelt # مبتنی بر Rust
# Pi coding agent
# برای نصب به https://github.com/zechnerj/pi-coding-agent مراجعه کنید
# jcode
# برای نصب به https://github.com/1jehuang/jcode مراجعه کنید
```
---
## Step 3 — Set Global Environment Variables
### مرحله 3 — پیکربندی از طریق داشبورد
Add to `~/.bashrc` (or `~/.zshrc`), then run `source ~/.bashrc`:
1. به `http://localhost:20128/dashboard/cli-code` بروید
2. ابزار خود را در شبکه پیدا کنید
3. بر روی کارت کلیک کنید تا صفحه جزئیات ابزار باز شود
4. کلید API و URL پایه خود را انتخاب کنید
5. بر روی **اعمال پیکربندی** کلیک کنید یا قطعه کد پیکربندی دستی را کپی کنید
---
### مرحله 4 — تنظیم متغیرهای محیطی جهانی
```bash
# OmniRoute Universal Endpoint
# نقطه پایانی جهانی OmniRoute
export OPENAI_BASE_URL="http://localhost:20128/v1"
export OPENAI_API_KEY="sk-your-omniroute-key"
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_API_KEY="sk-your-omniroute-key"
export GEMINI_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_BASE_URL="http://localhost:20128"
export ANTHROPIC_AUTH_TOKEN="sk-your-omniroute-key"
# Gemini CLI در ROOT متغیر GOOGLE_GEMINI_BASE_URL را می‌خواند (SDK آن به طور خودکار /v1beta/... را اضافه می‌کند)
export GOOGLE_GEMINI_BASE_URL="http://localhost:20128"
export GEMINI_API_KEY="sk-your-omniroute-key"
```
> For a **remote server** replace `localhost:20128` with the server IP or domain,
> e.g. `http://192.168.0.15:20128`.
> برای **سرور از راه دور** `localhost:20128` را با IP یا دامنه سرور جایگزین کنید،
> مثلاً `http://<your-server-ip>:20128`.
---
## Step 4 — Configure Each Tool
### مرحله 4 — پیکربندی هر ابزار
### Claude Code
#### Claude Code
```bash
# Via CLI:
claude config set --global api-base-url http://localhost:20128/v1
# Or create ~/.claude/settings.json:
# ایجاد ~/.claude/settings.json:
mkdir -p ~/.claude && cat > ~/.claude/settings.json << EOF
{
"apiBaseUrl": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:20128",
"ANTHROPIC_AUTH_TOKEN": "sk-your-omniroute-key"
}
}
EOF
```
**Test:** `claude "say hello"`
از ریشه دروازه یکپارچه Anthropic برای Claude Code استفاده کنید. در اینجا `/v1` را اضافه نکنید.
**آزمایش:** `claude "say hello"`
---
### OpenAI Codex
#### OpenAI Codex
Codex مدرن (v0.137+) فقط `~/.codex/config.toml` را می‌خواند — `config.yaml` قدیمی متعلق به CLI قدیمی npm است و به طور خاموش نادیده گرفته می‌شود. کلید API در متغیر محیطی `OMNIROUTE_API_KEY` (`env_key`) باقی می‌ماند و هرگز در داخل فایل نیست:
```bash
mkdir -p ~/.codex && cat > ~/.codex/config.yaml << EOF
model: auto
apiKey: sk-your-omniroute-key
apiBaseUrl: http://localhost:20128/v1
mkdir -p ~/.codex && cat > ~/.codex/config.toml << EOF
model_provider = "omniroute"
[model_providers.omniroute]
name = "OmniRoute"
base_url = "http://localhost:20128/v1"
env_key = "OMNIROUTE_API_KEY"
requires_openai_auth = false
EOF
export OMNIROUTE_API_KEY="sk-your-omniroute-key"
```
مرجع کامل (پروفایل‌ها، `wire_api`، پنجره‌های زمینه): [CODEX-CLI-CONFIGURATION.md](../guides/CODEX-CLI-CONFIGURATION.md).
**آزمایش:** `codex "what is 2+2?"`
---
#### OpenCode
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/opencode.json << EOF
{
"\$schema": "https://opencode.ai/config.json",
"provider": {
"omniroute": {
"npm": "@ai-sdk/openai-compatible",
"name": "OmniRoute",
"options": {
"baseURL": "http://localhost:20128/v1",
"apiKey": "sk-your-omniroute-key"
},
"models": {
"claude-sonnet-4-5": { "name": "claude-sonnet-4-5" },
"claude-sonnet-4-5-thinking": { "name": "claude-sonnet-4-5-thinking" },
"gemini-3-flash": { "name": "gemini-3-flash" }
}
}
}
}
EOF
```
**Test:** `codex "what is 2+2?"`
**آزمایش:** `opencode`
> از `opencode run "your prompt" --model omniroute/claude-sonnet-4-5-thinking --variant high`
> برای ارسال واریانت‌های تفکر استفاده کنید.
---
### OpenCode
#### Cline (CLI یا VS Code)
```bash
mkdir -p ~/.config/opencode && cat > ~/.config/opencode/config.toml << EOF
[provider.openai]
base_url = "http://localhost:20128/v1"
api_key = "sk-your-omniroute-key"
EOF
```
**Test:** `opencode`
---
### Cline (CLI or VS Code)
**CLI mode:**
**حالت CLI:**
```bash
mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
@@ -199,22 +468,22 @@ mkdir -p ~/.cline/data && cat > ~/.cline/data/globalState.json << EOF
EOF
```
**VS Code mode:**
Cline extension settings → API Provider: `OpenAI Compatible`Base URL: `http://localhost:20128/v1`
**حالت VS Code:**
تنظیمات افزونه Cline → ارائه‌دهنده API: `OpenAI Compatible`URL پایه: `http://localhost:20128/v1`
Or use the OmniRoute dashboard**CLI Tools → Cline → Apply Config**.
یا از داشبورد OmniRoute استفاده کنید**CLI Tools → Cline → Apply Config**.
---
### KiloCode (CLI or VS Code)
#### KiloCode (CLI یا VS Code)
**CLI mode:**
**حالت CLI:**
```bash
kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
```
**VS Code settings:**
**تنظیمات VS Code:**
```json
{
@@ -223,13 +492,13 @@ kilocode --api-base http://localhost:20128/v1 --api-key sk-your-omniroute-key
}
```
Or use the OmniRoute dashboard**CLI Tools → KiloCode → Apply Config**.
یا از داشبورد OmniRoute استفاده کنید**CLI Tools → KiloCode → Apply Config**.
---
### Continue (VS Code Extension)
#### Continue (افزونه VS Code)
Edit `~/.continue/config.yaml`:
فایل `~/.continue/config.yaml` را ویرایش کنید:
```yaml
models:
@@ -241,158 +510,254 @@ models:
default: true
```
Restart VS Code after editing.
پس از ویرایش، VS Code را دوباره راه‌اندازی کنید.
---
### Kiro CLI (Amazon)
#### VS Code Insiders (`chatLanguageModels.json`)
از این مورد زمانی استفاده کنید که VS Code Insiders برای مدل‌های نقطه پایانی سفارشی پیکربندی شده و می‌خواهید OmniRoute بدون فیلد هدر سفارشی کار کند.
**محل توصیه شده:**
- لینوکس: `~/.config/Code - Insiders/User/chatLanguageModels.json`
- ویندوز: `%APPDATA%/Code - Insiders/User/chatLanguageModels.json`
**مثال با استفاده از نام مستعار توکن‌شده OmniRoute:**
```json
[
{
"vendor": "customendpoint",
"id": "auto",
"name": "OmniRoute Auto",
"family": "gpt-4",
"version": "1.0.0",
"url": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/chat/completions",
"modelsUrl": "http://localhost:20128/api/v1/vscode/sk-your-omniroute-key/models",
"requestFormat": "openai-chat-completions",
"contextWindow": 256000,
"maxOutputTokens": 32768,
"auth": {
"type": "none"
}
}
]
```
**نکات:**
- `sk-your-omniroute-key` را با کلید API ایجاد شده در OmniRoute جایگزین کنید.
- فیلد `url` باید به `/api/v1/vscode/{token}/chat/completions` اشاره کند.
- فیلد `modelsUrl` باید به `/api/v1/vscode/{token}/models` اشاره کند.
- در صورت پشتیبانی کلاینت از هدرهای سفارشی، از جریان معمول `/v1` + هدر Bearer استفاده کنید.
- توکن‌های جاسازی شده در URL یک بازگشت سازگاری هستند و ممکن است در لاگ‌های ویرایشگر یا تاریخچه پروکسی ظاهر شوند.
---
#### Kiro CLI (آمازون)
```bash
# Login to your AWS/Kiro account:
# به حساب AWS/Kiro خود وارد شوید:
kiro-cli login
# The CLI uses its own auth — OmniRoute is not needed as backend for Kiro CLI itself.
# Use kiro-cli alongside OmniRoute for other tools.
# CLI از احراز هویت خود استفاده می‌کند — OmniRoute به عنوان backend برای Kiro CLI خود لازم نیست.
# از kiro-cli در کنار OmniRoute برای ابزارهای دیگر استفاده کنید.
kiro-cli status
```
برای برنامه دسکتاپ **Kiro IDE**، از نقطه پایانی MITM که توسط OmniRoute در زیر `/dashboard/cli-tools → Kiro` در دسترس است استفاده کنید.
---
### Qwen Code (Alibaba)
## 10. CLI داخلی OmniRoute
Qwen Code supports OpenAI-compatible API endpoints via environment variables or `settings.json`.
**Option 1: Environment variables (`~/.qwen/.env`)**
باینری `omniroute` دستورات مربوط به چرخه عمر سرور، راه‌اندازی، تشخیص و مدیریت ارائه‌دهنده را فراهم می‌کند. نقطه ورودی: `bin/omniroute.mjs`.
```bash
mkdir -p ~/.qwen && cat > ~/.qwen/.env << EOF
OPENAI_API_KEY="sk-your-omniroute-key"
OPENAI_BASE_URL="http://localhost:20128/v1"
OPENAI_MODEL="auto"
EOF
omniroute # شروع سرور (پورت پیش‌فرض 20128)
omniroute setup # ویزارد راه‌اندازی تعاملی
omniroute doctor # بررسی پیکربندی، پایگاه داده، پورت‌ها، زمان اجرا
omniroute providers list # اتصالات ارائه‌دهنده پیکربندی شده
omniroute providers test-all # تست هر اتصال فعال
omniroute reset-password # بازنشانی رمز عبور مدیر
omniroute logs # استریم لاگ‌های درخواست
omniroute health # سلامت دقیق (شکست‌ها، کش، حافظه)
omniroute --version # چاپ نسخه
omniroute --help # نمایش تمام دستورات
```
**Option 2: `settings.json` with model providers**
```json
// ~/.qwen/settings.json
{
"env": {
"OPENAI_API_KEY": "sk-your-omniroute-key",
"OPENAI_BASE_URL": "http://localhost:20128/v1"
},
"modelProviders": {
"openai": [
{
"id": "omniroute-default",
"name": "OmniRoute (Auto)",
"envKey": "OPENAI_API_KEY",
"baseUrl": "http://localhost:20128/v1"
}
]
}
}
```
**Option 3: Inline CLI flags**
### راه‌اندازی و اولیه‌سازی
```bash
OPENAI_BASE_URL="http://localhost:20128/v1" \
OPENAI_API_KEY="sk-your-omniroute-key" \
OPENAI_MODEL="auto" \
qwen
omniroute setup # ویزارد راه‌اندازی تعاملی
omniroute setup --non-interactive # حالت CI/خودکار (خواندن متغیرهای محیطی + پرچم‌ها)
omniroute setup --password '<value>' # تنظیم رمز عبور مدیر به طور مستقیم
omniroute setup --add-provider \
--provider openai \
--api-key '<value>' \
--test-provider # افزودن و تست یک ارائه‌دهنده در یک مرحله
```
> For a **remote server** replace `localhost:20128` with the server IP or domain.
متغیرهای محیطی شناخته شده برای راه‌اندازی غیر تعاملی:
**Test:** `qwen "say hello"`
| Var | Purpose |
| ------------------- | --------------------------------------------------------------------- |
| `OMNIROUTE_API_KEY` | کلید API ارائه‌دهنده (متصل به `--api-key` از طریق Commander `.env()`) |
| `DATA_DIR` | بازنویسی دایرکتوری داده‌های OmniRoute |
### Cursor (Desktop App)
تمام ورودی‌های غیر تعاملی دیگر به عنوان پرچم‌ها ارسال می‌شوند، نه متغیرهای محیطی:
`--password`, `--provider`, `--provider-name`, `--provider-base-url`, `--default-model`
(به گزینه‌های `omniroute setup` در بالا مراجعه کنید).
> **Note:** Cursor routes requests through its cloud. For OmniRoute integration,
> enable **Cloud Endpoint** in OmniRoute Settings and use your public domain URL.
Via GUI: **Settings → Models → OpenAI API Key**
- Base URL: `https://your-domain.com/v1`
- API Key: your OmniRoute key
---
## Dashboard Auto-Configuration
The OmniRoute dashboard automates configuration for most tools:
1. Go to `http://localhost:20128/dashboard/cli-tools`
2. Expand any tool card
3. Select your API key from the dropdown
4. Click **Apply Config** (if tool is detected as installed)
5. Or copy the generated config snippet manually
---
## Built-in Agents: Droid & OpenClaw
**Droid** and **OpenClaw** are AI agents built directly into OmniRoute — no installation needed.
They run as internal routes and use OmniRoute's model routing automatically.
- Access: `http://localhost:20128/dashboard/agents`
- Configure: same combos and providers as all other tools
- No API key or CLI install required
---
## Available API Endpoints
| Endpoint | Description | Use For |
| -------------------------- | ----------------------------- | --------------------------- |
| `/v1/chat/completions` | Standard chat (all providers) | All modern tools |
| `/v1/responses` | Responses API (OpenAI format) | Codex, agentic workflows |
| `/v1/completions` | Legacy text completions | Older tools using `prompt:` |
| `/v1/embeddings` | Text embeddings | RAG, search |
| `/v1/images/generations` | Image generation | GPT-Image, Flux, etc. |
| `/v1/audio/speech` | Text-to-speech | ElevenLabs, OpenAI TTS |
| `/v1/audio/transcriptions` | Speech-to-text | Deepgram, AssemblyAI |
---
## Solución de Problemas
| Error | Cause | Fix |
| ------------------------- | ----------------------- | ------------------------------------------ |
| `Connection refused` | OmniRoute not running | `pm2 start omniroute` |
| `401 Unauthorized` | Wrong API key | Check in `/dashboard/api-manager` |
| `No combo configured` | No active routing combo | Set up in `/dashboard/combos` |
| `invalid model` | Model not in catalog | Use `auto` or check `/dashboard/providers` |
| CLI shows "not installed" | Binary not in PATH | Check `which <command>` |
| `kiro-cli: not found` | Not in PATH | `export PATH="$HOME/.local/bin:$PATH"` |
---
## Quick Setup Script (One Command)
### تشخیص
```bash
# Install all CLIs and configure for OmniRoute (replace with your key and server URL)
OMNIROUTE_URL="http://localhost:20128/v1"
OMNIROUTE_KEY="sk-your-omniroute-key"
npm install -g @anthropic-ai/claude-code @openai/codex opencode-ai cline kilocode @qwen-code/qwen-code
# Kiro CLI
apt-get install -y unzip 2>/dev/null; curl -fsSL https://cli.kiro.dev/install | bash
# Write configs
mkdir -p ~/.claude ~/.codex ~/.config/opencode ~/.continue
cat > ~/.claude/settings.json <<< "{\"apiBaseUrl\":\"$OMNIROUTE_URL\",\"apiKey\":\"$OMNIROUTE_KEY\"}"
cat > ~/.codex/config.yaml <<< "model: auto\napiKey: $OMNIROUTE_KEY\napiBaseUrl: $OMNIROUTE_URL"
cat >> ~/.bashrc << EOF
export OPENAI_BASE_URL="$OMNIROUTE_URL"
export OPENAI_API_KEY="$OMNIROUTE_KEY"
export ANTHROPIC_BASE_URL="$OMNIROUTE_URL"
export ANTHROPIC_API_KEY="$OMNIROUTE_KEY"
EOF
source ~/.bashrc
echo "✅ All CLIs installed and configured for OmniRoute"
omniroute doctor # بررسی پیکربندی، پایگاه داده، پورت‌ها، زمان اجرا، حافظه، زنده بودن
omniroute doctor --json # JSON قابل خواندن توسط ماشین
omniroute doctor --no-liveness # رد کردن پروب سلامت HTTP
omniroute doctor --host 0.0.0.0 # بازنویسی میزبان زنده بودن
omniroute doctor --liveness-url <url> # بازنویسی کامل URL نقطه پایانی سلامت
```
دکتر این بررسی‌ها را انجام می‌دهد: `پیکربندی`, `پایگاه داده`, `ذخیره‌سازی/رمزگذاری`,
`دسترس‌پذیری پورت`, `زمان اجرای نود`, `باینری بومی` (better-sqlite3),
`حافظه`, و `زنده بودن سرور`. اگر هر بررسی `شکست` بخورد، با کد غیر صفر خارج می‌شود.
### مدیریت ارائه‌دهنده
```bash
omniroute providers available # کاتالوگ ارائه‌دهنده OmniRoute
omniroute providers available --search openai # فیلتر کاتالوگ بر اساس id/name/alias/category
omniroute providers available --category api-key # فیلتر بر اساس دسته (api-key, oauth, free, ...)
omniroute providers available --json # JSON قابل خواندن توسط ماشین
omniroute providers list # اتصالات ارائه‌دهنده پیکربندی شده
omniroute providers list --json
omniroute providers test <id|name> # تست یک اتصال پیکربندی شده
omniroute providers test-all # تست هر اتصال فعال
omniroute providers validate # اعتبارسنجی ساختاری محلی
omniroute providers add <provider> --credential-env PROVIDER_KEY
omniroute providers import ./providers.json --dry-run --json
omniroute providers auth <provider> # جریان OAuth موجود
omniroute providers edit <id|name> --default-model <model>
omniroute providers remove <id|name> --yes
```
`providers add/import/auth/edit/remove` API-first هستند و بنابراین بر اساس
زمینه محلی یا از راه دور فعال کار می‌کنند. ورودی اعتبارنامه باید از
`--credential-stdin` یا `--credential-env` استفاده کند؛ `--dry-run --json` فقط
حضور/شکل مخفی شده را گزارش می‌دهد. `providers available` کاتالوگ OmniRoute را می‌خواند؛
`providers list/test/test-all/validate` رفتار SQLite محلی خود را حفظ می‌کنند و
نیاز به اجرای سرور ندارند.
### بازیابی و بازنشانی
```bash
omniroute reset-password # بازنشانی رمز عبور مدیر (همچنین: omniroute-reset-password)
omniroute reset-encrypted-columns # نمایش هشدار + اجرای آزمایشی برای بازنشانی اعتبارنامه‌های رمزگذاری شده
omniroute reset-encrypted-columns --force # در واقع اعتبارنامه‌های رمزگذاری شده را در SQLite خنثی کنید
```
### صادرات اعتبارنامه (⚠ با احتیاط برخورد کنید)
```bash
omniroute auth export # نمایش هشدار + دروازه تأیید — بدون دسترسی به پایگاه داده
omniroute auth export --force # صادرات اعتبارنامه‌های DECRYPTED تمام اتصالات به stdout به عنوان JSON
omniroute auth export --force --id <id> # صادرات فقط اتصال مطابقت‌دهنده
omniroute auth export --force --format env # تولید خطوط OMNIROUTE_<PROVIDER>_<FIELD>=<value>
omniroute auth export --force --out creds.json # نوشتن در یک فایل (ایجاد شده با مجوز 0600)
```
`auth export` **فقط محلی** است (خواندن مستقیم SQLite، بدون مسیر HTTP) و عمداً
مقادیر **متن ساده** `apiKey`/`accessToken`/`refreshToken`/`idToken` را چاپ/می‌نویسد — این ویژگی است، نه یک
اشکال. هیچ چیزی از پایگاه داده خوانده نمی‌شود و هیچ چیزی بدون `--force` رمزگشایی نمی‌شود. یک بنر هشدار stderr همیشه قبل از هر متنی چاپ می‌شود. نیاز به تنظیم `STORAGE_ENCRYPTION_KEY` دارد. یک فیلدی که در رمزگشایی شکست می‌خورد (کلید منقضی، متن رمزگذاری شده خراب) به عنوان
`<field>DecryptFailed: true` گزارش می‌شود به جای اینکه کل صادرات را متوقف کند یا خطای زیرین را نشت دهد.
### سایر زیر دستورات
اینها فرض می‌کنند که یک سرور OmniRoute در حال اجرا است، مگر اینکه خلاف آن ذکر شده باشد:
```bash
omniroute status # وضعیت جامع زمان اجرا
omniroute logs # استریم لاگ‌های درخواست (--json, --search, --follow)
omniroute config show # نمایش پیکربندی فعلی
omniroute provider list # لیست ارائه‌دهندگان موجود (معادل لیست ارائه‌دهندگان)
omniroute provider add # ثبت OmniRoute به عنوان یک ارائه‌دهنده در یک ابزار
omniroute keys add | list | remove # مدیریت کلیدهای API
omniroute models [provider] # لیست مدل‌ها (--json, --search)
omniroute combo list | switch | create | delete
omniroute backup # عکس‌برداری از پیکربندی + پایگاه داده
omniroute restore # بازیابی از یک عکس‌برداری قبلی
omniroute health # سلامت دقیق (شکست‌ها، کش، حافظه)
omniroute quota # استفاده از سهم ارائه‌دهنده
omniroute cache # وضعیت کش
omniroute cache clear # پاک کردن کش‌های معنایی + امضا
omniroute mcp status | restart # وضعیت سرور MCP / راه‌اندازی مجدد
omniroute a2a status | card # وضعیت سرور A2A / کارت عامل
omniroute tunnel list | create | stop # مدیریت تونل‌ها (cloudflare/tailscale/ngrok)
omniroute env show | get <k> | set <k> <v> # بررسی / تنظیم متغیرهای محیطی (موقت)
omniroute test # تست اتصال به ارائه‌دهنده
omniroute update # بررسی به‌روزرسانی‌ها
omniroute completion # تولید تکمیل شل
```
### پرچم‌های رایج
| Flag | Description |
| ------------------- | -------------------------------------------------------------- |
| `--no-open` | به طور خودکار مرورگر را در شروع باز نکنید |
| `--port <n>` | بازنویسی پورت API (پیش‌فرض 20128) |
| `--mcp` | به عنوان سرور MCP بر روی stdio اجرا شود (برای IDEها) |
| `--non-interactive` | حالت CI (بدون درخواست؛ خواندن از env/flags) |
| `--json` | خروجی JSON قابل خواندن توسط ماشین (دکتر، ارائه‌دهندگان و غیره) |
| `--help`, `-h` | نمایش کمک خاص به دستور |
| `--version`, `-v` | چاپ نسخه نصب شده |
---
## نقاط پایانی API موجود
| نقطه پایانی | توضیحات | استفاده برای |
| -------------------------- | -------------------------------- | ---------------------------------------------- |
| `/v1/chat/completions` | چت استاندارد (همه ارائه‌دهندگان) | همه ابزارهای مدرن |
| `/v1/responses` | API پاسخ‌ها (فرمت OpenAI) | Codex، جریان‌های عاملی |
| `/v1/completions` | تکمیل متن قدیمی | ابزارهای قدیمی که از `prompt:` استفاده می‌کنند |
| `/v1/embeddings` | جاسازی‌های متنی | RAG، جستجو |
| `/v1/images/generations` | تولید تصویر | GPT-Image، Flux و غیره |
| `/v1/audio/speech` | تبدیل متن به گفتار | ElevenLabs، OpenAI TTS |
| `/v1/audio/transcriptions` | تبدیل گفتار به متن | Deepgram، AssemblyAI |
نمونه‌های آماده برای چسباندن با یک URL OmniRoute توکن‌شده:
```txt
مثال توکن: sk-a3ab3c080beaee3a-69f4a4-070d71af
پایه استاندارد OpenAI: http://localhost:20128/v1
مدل‌های VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/models
چت VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/chat/completions
پاسخ‌های VS Code: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/responses
برچسب‌های Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/tags
چت Ollama: http://localhost:20128/api/v1/vscode/sk-a3ab3c080beaee3a-69f4a4-070d71af/api/chat
```
---
## عیب‌یابی
| خطا | علت | راه حل |
| --------------------------------------------- | ----------------------------------- | ------------------------------------------------------- |
| `Connection refused` | OmniRoute در حال اجرا نیست | `omniroute serve` |
| `401 Unauthorized` | کلید API اشتباه | بررسی در `/dashboard/api-manager` |
| `No combo configured` | هیچ ترکیب مسیریابی فعالی وجود ندارد | تنظیم در `/dashboard/combos` |
| CLI نشان می‌دهد "not installed" | باینری در PATH نیست | بررسی `which <command>` |
| داشبورد بعد از نصب نشان می‌دهد "not detected" | کش قدیمی | کلیک بر روی "⟳ Refresh detection" در داشبورد |
| لینک قدیمی `/dashboard/cli-tools` | بوکمارک پیش از v3.8.6 | به طور خودکار به `/dashboard/cli-code` (308) هدایت شد |
| لینک قدیمی `/dashboard/agents` | بوکمارک پیش از v3.8.6 | به طور خودکار به `/dashboard/acp-agents` (308) هدایت شد |

View File

@@ -4,7 +4,7 @@
---
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 340 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
> OmniRoute is a free, open-source AI Gateway that acts as a universal API proxy for multi-provider LLMs. It provides smart routing, automatic fallback, load balancing, and format translation across 342 AI providers — all through a single OpenAI-compatible endpoint. Includes a built-in MCP Server (109 tools), A2A v0.3 protocol, Memory/Skills systems, Cloud Agents (codex, cursor, devin, jules), Guardrails framework, and an Electron desktop app.
## Overview
@@ -18,7 +18,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
- **Runtime:** Node.js `>=22.0.0 <23 || >=24.0.0 <27`, ES Modules (`"type": "module"`)
- **Framework:** Next.js 16 (App Router) with TypeScript 6
- **Database:** SQLite via better-sqlite3 (local, zero-config, 153 migrations)
- **Database:** SQLite via better-sqlite3 (local, zero-config, 154 migrations)
- **State management:** Zustand (client), SQLite (server persistence)
- **UI:** React 19, Tailwind CSS 4, Recharts for analytics, @lobehub/icons for 130+ provider SVG icons
- **Auth:** OAuth 2.0 (PKCE) for providers, bcrypt for local user auth
@@ -169,7 +169,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
│ │ └── manager.ts # MITM proxy manager
│ ├── shared/ # Shared utilities, components, and constants
│ │ ├── components/ # Reusable UI components (Card, Badge, Button, Modal, Sidebar, ProviderIcon, etc.)
│ │ ├── constants/ # Provider definitions (340), model lists, pricing, routing strategies, MCP scopes
│ │ ├── constants/ # Provider definitions (342), model lists, pricing, routing strategies, MCP scopes
│ │ ├── contracts/ # Shared API contracts
│ │ ├── hooks/ # React hooks
│ │ ├── middleware/ # Shared middleware utilities
@@ -281,7 +281,7 @@ OmniRoute solves the problem of managing multiple AI provider subscriptions, quo
## Key Features (v3.8.50)
### Core Proxy
- **340 AI providers** with automatic format translation
- **342 AI providers** with automatic format translation
- **Provider categories**: Free (90+ free tiers), OAuth, API Key, Self-Hosted, Custom (OpenAI/Anthropic-compatible)
- **18 routing strategies**: priority, weighted, round-robin, fill-first, p2c, random, least-used, cost-optimized, reset-aware, reset-window, headroom, strict-random, auto, lkgp, context-optimized, context-relay, fusion, pipeline
- **4-tier fallback**: Subscription → API Key → Cheap → Free
@@ -438,7 +438,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
4. **Environment variables:** All configuration is in `.env` (from `.env.example`). Key vars: `PORT`, `NEXT_PUBLIC_BASE_URL`, `API_KEY`, `ADMIN_PASSWORD`.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 153 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
5. **Database layer:** Operations go through `src/lib/db/` modules (120 domain-specific files, 154 migrations). `localDb.ts` is re-exports only — add new functions to the proper `db/*.ts` module.
6. **Tests** use Node.js built-in test runner + Vitest. Run `npm test`. Vitest for MCP/autoCombo (`npm run test:vitest`). Playwright for E2E (`npm run test:e2e`). Coverage gate: ratchet vs `quality-baseline.json`, absolute floor 60% statements/lines/functions/branches.
@@ -479,7 +479,7 @@ diagnostics) plus **memory**, **skill**, **agentSkill**, **githubSkill**, **pool
## v3.8.x Highlights
- **340-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **342-provider catalog** with 90+ free tiers, one-click account imports, and bulk key add
- **19 routing strategies** — including `fusion` (parallel panel + judge synthesis), `pipeline`, `reset-aware`, `reset-window`, `headroom`, and `context-relay`
- **14-factor Auto-Combo scoring** with bandit exploration and progressive cooldown
- **MCP server expanded to 109 tools / 33 scopes** (canonical + memory/skill/agentSkill/githubSkill/pool/notion/obsidian/localCorpus/gamification/plugin modules)

Some files were not shown because too many files have changed in this diff Show More