* feat(docs): mirror every docs/ page in all 65 locales Extends the documentation mirrors from the 22-page core set (#13940) to every Markdown page under docs/: 152 sources x 65 locales = 9,880 mirrors (6,208 new), language bars rewritten for the full locale list, state adopted so the blocking drift gate now covers all 152 pages. run-translation.mjs: an oversized block made only of table rows or list items (PROVIDER_REFERENCE.md 244-row table, FREE_TIERS.md 71-item list) is cut at item boundaries and rejoined without a blank line — the single 16-40 KB request outlived the backend socket for verbose scripts. 48 older mirrors whose tables had lost rows were retranslated with --force. * docs(i18n): refresh mirrors for the sources the base changed since the branch cut Section-level retranslation of the 29 docs (and README.md) whose source or mirrors moved on release/v3.8.51 during the run, then state adoption; the drift gate is green again on the merged tree.
7.9 KiB
OmniRoute CLI Plugin System (Deutsch)
🌐 Languages: 🇺🇸 English · 🇪🇹 am · 🇸🇦 ar · 🇦🇿 az · 🇧🇬 bg · 🇧🇩 bn · 🇨🇿 cs · 🇩🇰 da · 🇬🇷 el · 🇪🇸 es · 🇪🇪 et · 🇮🇷 fa · 🇫🇮 fi · 🇫🇷 fr · 🇮🇪 ga · 🇮🇳 gu · 🇳🇬 ha · 🇮🇱 he · 🇮🇳 hi · 🇭🇷 hr · 🇭🇺 hu · 🇦🇲 hy · 🇮🇩 id · 🇳🇬 ig · 🇮🇹 it · 🇯🇵 ja · 🇬🇪 ka · 🇰🇭 km · 🇮🇳 kn · 🇰🇷 ko · 🇱🇹 lt · 🇱🇻 lv · 🇮🇳 ml · 🇮🇳 mr · 🇲🇾 ms · 🇲🇹 mt · 🇲🇲 my · 🇳🇵 ne · 🇳🇱 nl · 🇳🇴 no · 🇮🇳 or · 🇮🇳 pa · 🇵🇭 phi · 🇵🇱 pl · 🇵🇹 pt · 🇧🇷 pt-BR · 🇷🇴 ro · 🇷🇺 ru · 🇱🇰 si · 🇸🇰 sk · 🇸🇮 sl · 🇷🇸 sr · 🇸🇪 sv · 🇰🇪 sw · 🇮🇳 ta · 🇮🇳 te · 🇹🇭 th · 🇹🇷 tr · 🇺🇦 uk-UA · 🇵🇰 ur · 🇺🇿 uz · 🇻🇳 vi · 🇳🇬 yo · 🇨🇳 zh-CN · 🇹🇼 zh-TW
Erweitere die omniroute-CLI, ohne ihren Kern zu verändern. Plugins folgen der Namenskonvention omniroute-cmd-*, ähnlich wie gh extension oder kubectl plugin.
Schnellstart
# Ein Plugin von npm installieren
omniroute plugin install stripe
# Ein lokales Plugin in der Entwicklung installieren
omniroute plugin install ./my-plugin
# Installierte Plugins auflisten
omniroute plugin list
# Ein Grundgerüst für ein neues Plugin erstellen
omniroute plugin scaffold myplugin
cd omniroute-cmd-myplugin
omniroute plugin install .
Aufbau eines Plugins
Ein Plugin ist ein npm-Paket mit dem Namen omniroute-cmd-<name> (oder @scope/omniroute-cmd-<name>).
omniroute-cmd-myplugin/
├── package.json # muss "type": "module" und "main": "index.mjs" enthalten
├── index.mjs # exportiert register(program, ctx) sowie optional meta
└── README.md
package.json
{
"name": "omniroute-cmd-myplugin",
"version": "0.1.0",
"type": "module",
"main": "index.mjs",
"engines": { "omniroute": ">=4.0.0" },
"keywords": ["omniroute-plugin", "omniroute-cmd"]
}
index.mjs
export const meta = {
name: "myplugin",
version: "0.1.0",
description: "My plugin for OmniRoute",
omnirouteApi: ">=4.0.0",
};
export function register(program, ctx) {
program
.command("myplugin")
.description(meta.description)
.option("-n, --name <name>")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
const res = await ctx.apiFetch("/api/combos", {
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const data = await res.json();
ctx.emit(data, gOpts);
});
}
Plugin-Kontext-API
Das an register(program, ctx) übergebene ctx-Objekt:
| Eigenschaft | Typ | Beschreibung |
|---|---|---|
ctx.apiFetch(path, opts) |
async function |
Authentifizierter Abruf vom OmniRoute-Server |
ctx.emit(data, opts) |
function |
Ausgabe als Tabelle/json/jsonl/csv entsprechend der Option --output |
ctx.t(key) |
async function |
Nachschlagen von i18n-Übersetzungen |
ctx.withSpinner(label, fn) |
async function |
Umschließt die asynchrone Funktion mit einem ora-Spinner |
ctx.baseUrl |
string |
Aufgelöste Basis-URL |
ctx.apiKey |
string | null |
API-Schlüssel, sofern angegeben |
Erkennung
Plugins werden an folgenden Orten gesucht:
~/.omniroute/plugins/<name>/— benutzerlokale Installationen- Umgebungsvariable
OMNIROUTE_PLUGIN_PATH— benutzerdefiniertes Verzeichnis
Beide gelten nur für die CLI. Die serverseitige Plugin-Laufzeitumgebung (die Marketplace-/plugin.json-Plugins, die innerhalb des Proxys ausgeführt werden) besitzt einen eigenen Scanner mit einer eigenen Überschreibung namens OMNIROUTE_PLUGINS_DIR — siehe
PLUGIN_MARKETPLACE.md → Plugin-Verzeichnis.
Das Festlegen der einen Option hat keine Auswirkungen auf die andere.
Fehler beim Laden werden abgefangen und als Warnungen ausgegeben — ein defektes Plugin bringt die CLI niemals zum Absturz.
Sicherheit
Plugins werden mit denselben Node.js-Prozessberechtigungen wie omniroute ausgeführt. Installiere nur Plugins aus Quellen, denen du vertraust. omniroute plugin install zeigt eine ausdrückliche Warnung an und erfordert entweder --yes oder eine interaktive Bestätigung.
Veröffentlichung
- Stelle sicher, dass
package.jsonden Eintrag"keywords": ["omniroute-plugin"]enthält - Führe
npm publishwie gewohnt aus - Benutzer finden Plugins über
omniroute plugin search <query>(durchsucht die npm-Registry)
Beispiel-Plugin
Unter examples/omniroute-cmd-hello/ findest du ein minimales funktionsfähiges Beispiel mit meta und register().