From 971bd30516fb2b245f87bdf79e36bb64e72265bc Mon Sep 17 00:00:00 2001 From: mridul <65942753+rexdotsh@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:43:23 +0530 Subject: [PATCH 001/102] fix(app): fallback to synthetic icon for unknown provider IDs (#15295) --- .../app/src/components/dialog-connect-provider.tsx | 3 +-- .../src/components/dialog-select-model-unpaid.tsx | 3 +-- .../app/src/components/dialog-select-provider.tsx | 8 +------- packages/app/src/components/prompt-input.tsx | 5 ++--- packages/app/src/components/settings-models.tsx | 3 +-- packages/app/src/components/settings-providers.tsx | 12 +++--------- packages/enterprise/src/routes/share/[shareID].tsx | 8 +++----- packages/ui/src/components/provider-icon.tsx | 7 ++++--- 8 files changed, 16 insertions(+), 33 deletions(-) diff --git a/packages/app/src/components/dialog-connect-provider.tsx b/packages/app/src/components/dialog-connect-provider.tsx index 90f4f41f7c6..b042205cf4d 100644 --- a/packages/app/src/components/dialog-connect-provider.tsx +++ b/packages/app/src/components/dialog-connect-provider.tsx @@ -4,7 +4,6 @@ import { useDialog } from "@opencode-ai/ui/context/dialog" import { Dialog } from "@opencode-ai/ui/dialog" import { Icon } from "@opencode-ai/ui/icon" import { IconButton } from "@opencode-ai/ui/icon-button" -import type { IconName } from "@opencode-ai/ui/icons/provider" import { List, type ListRef } from "@opencode-ai/ui/list" import { ProviderIcon } from "@opencode-ai/ui/provider-icon" import { Spinner } from "@opencode-ai/ui/spinner" @@ -447,7 +446,7 @@ export function DialogConnectProvider(props: { provider: string }) { >
Session[] |
-| `session.get({ path })` | جلب جلسة | يعيد Session |
-| `session.children({ path })` | سرد الجلسات الفرعية | يعيد Session[] |
-| `session.create({ body })` | إنشاء جلسة | يعيد Session |
-| `session.delete({ path })` | حذف جلسة | يعيد `boolean` |
-| `session.update({ path, body })` | تحديث خصائص الجلسة | يعيد Session |
-| `session.init({ path, body })` | تحليل التطبيق وإنشاء `AGENTS.md` | يعيد `boolean` |
-| `session.abort({ path })` | إيقاف جلسة قيد التشغيل | يعيد `boolean` |
-| `session.share({ path })` | مشاركة جلسة | يعيد Session |
-| `session.unshare({ path })` | إلغاء مشاركة جلسة | يعيد Session |
-| `session.summarize({ path, body })` | تلخيص جلسة | يعيد `boolean` |
-| `session.messages({ path })` | سرد الرسائل في جلسة | يعيد `{ info: `Message`, parts: `Part[]`}[]` |
-| `session.message({ path })` | جلب تفاصيل الرسالة | يعيد `{ info: `Message`, parts: `Part[]`}` |
-| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد AssistantMessage مع استجابة AI |
-| `session.command({ path, body })` | إرسال أمر إلى الجلسة | يعيد `{ info: `AssistantMessage`, parts: `Part[]`}` |
-| `session.shell({ path, body })` | تشغيل أمر shell | يعيد AssistantMessage |
-| `session.revert({ path, body })` | التراجع عن رسالة | يعيد Session |
-| `session.unrevert({ path })` | استعادة الرسائل المتراجع عنها | يعيد Session |
-| `postSessionByIdPermissionsByPermissionId({ path, body })` | الاستجابة لطلب إذن | يعيد `boolean` |
+| الطريقة | الوصف | ملاحظات |
+| ---------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `session.list()` | سرد الجلسات | يعيد Session[] |
+| `session.get({ path })` | جلب جلسة | يعيد Session |
+| `session.children({ path })` | سرد الجلسات الفرعية | يعيد Session[] |
+| `session.create({ body })` | إنشاء جلسة | يعيد Session |
+| `session.delete({ path })` | حذف جلسة | يعيد `boolean` |
+| `session.update({ path, body })` | تحديث خصائص الجلسة | يعيد Session |
+| `session.init({ path, body })` | تحليل التطبيق وإنشاء `AGENTS.md` | يعيد `boolean` |
+| `session.abort({ path })` | إيقاف جلسة قيد التشغيل | يعيد `boolean` |
+| `session.share({ path })` | مشاركة جلسة | يعيد Session |
+| `session.unshare({ path })` | إلغاء مشاركة جلسة | يعيد Session |
+| `session.summarize({ path, body })` | تلخيص جلسة | يعيد `boolean` |
+| `session.messages({ path })` | سرد الرسائل في جلسة | يعيد `{ info: `Message`, parts: `Part[]`}[]` |
+| `session.message({ path })` | جلب تفاصيل الرسالة | يعيد `{ info: `Message`, parts: `Part[]`}` |
+| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد AssistantMessage مع استجابة AI. يدعم `body.outputFormat` من أجل [المخرجات المنظمة](#المخرجات-المنظمة) |
+| `session.command({ path, body })` | إرسال أمر إلى الجلسة | يعيد `{ info: `AssistantMessage`, parts: `Part[]`}` |
+| `session.shell({ path, body })` | تشغيل أمر shell | يعيد AssistantMessage |
+| `session.revert({ path, body })` | التراجع عن رسالة | يعيد Session |
+| `session.unrevert({ path })` | استعادة الرسائل المتراجع عنها | يعيد Session |
+| `postSessionByIdPermissionsByPermissionId({ path, body })` | الاستجابة لطلب إذن | يعيد `boolean` |
---
diff --git a/packages/web/src/content/docs/ar/tui.mdx b/packages/web/src/content/docs/ar/tui.mdx
index 149f2909390..bef6fda3fa3 100644
--- a/packages/web/src/content/docs/ar/tui.mdx
+++ b/packages/web/src/content/docs/ar/tui.mdx
@@ -370,6 +370,9 @@ How is auth handled in @packages/functions/src/api/index.ts?
- `scroll_acceleration` - فعّل تسارع التمرير على نمط macOS لتمرير سلس وطبيعي. عند تفعيله، تزداد سرعة التمرير مع إيماءات التمرير السريعة وتبقى دقيقة للحركات الأبطأ. **يتقدّم هذا الإعداد على `scroll_speed` ويستبدله عند تفعيله.**
- `scroll_speed` - يتحكم في سرعة تمرير واجهة TUI عند استخدام أوامر التمرير (الحد الأدنى: `1`). القيمة الافتراضية هي `3`. **ملاحظة: يتم تجاهل هذا إذا تم ضبط `scroll_acceleration.enabled` على `true`.**
+- `diff_style` - يتحكم في عرض الفروقات (diff). القيمة `"auto"` تتكيف مع عرض terminal، و`"stacked"` تعرض عمودًا واحدًا دائمًا.
+
+استخدم `OPENCODE_TUI_CONFIG` لتحميل مسار إعدادات TUI مخصص.
---
diff --git a/packages/web/src/content/docs/ar/zen.mdx b/packages/web/src/content/docs/ar/zen.mdx
index f25b321a9b2..2810dea7dd3 100644
--- a/packages/web/src/content/docs/ar/zen.mdx
+++ b/packages/web/src/content/docs/ar/zen.mdx
@@ -59,6 +59,7 @@ OpenCode Zen هو بوابة للذكاء الاصطناعي تتيح لك ال
| النموذج | معرّف النموذج | نقطة النهاية | حزمة AI SDK |
| ------------------ | ------------------ | -------------------------------------------------- | --------------------------- |
+| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
| GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
| GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
| GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
@@ -68,22 +69,24 @@ OpenCode Zen هو بوابة للذكاء الاصطناعي تتيح لك ال
| GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
| GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
| GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` |
+| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
+| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
+| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
+| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
| Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
| Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
| Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
| Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
-| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
-| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
-| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
+| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` |
| Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` |
| Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` |
+| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
+| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
-| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |
+| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
-| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
-| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` |
@@ -111,29 +114,34 @@ https://opencode.ai/zen/v1/models
| النموذج | الإدخال | الإخراج | قراءة مخزنة | كتابة مخزنة |
| --------------------------------- | ------- | ------- | ----------- | ----------- |
| Big Pickle | Free | Free | Free | - |
-| MiniMax M2.1 Free | Free | Free | Free | - |
+| MiniMax M2.5 Free | Free | Free | Free | - |
+| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - |
| MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - |
-| GLM 4.7 Free | Free | Free | Free | - |
+| GLM 5 | $1.00 | $3.20 | $0.20 | - |
| GLM 4.7 | $0.60 | $2.20 | $0.10 | - |
| GLM 4.6 | $0.60 | $2.20 | $0.10 | - |
-| Kimi K2.5 Free | Free | Free | Free | - |
| Kimi K2.5 | $0.60 | $3.00 | $0.08 | - |
| Kimi K2 Thinking | $0.40 | $2.50 | - | - |
| Kimi K2 | $0.40 | $2.50 | - | - |
| Qwen3 Coder 480B | $0.45 | $1.50 | - | - |
+| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 |
+| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 |
+| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 |
+| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 |
+| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 |
+| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 |
| Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 |
| Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 |
| Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 |
| Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 |
| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 |
| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 |
-| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 |
-| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 |
-| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 |
-| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 |
+| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - |
+| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - |
| Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - |
| Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - |
| Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - |
+| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - |
| GPT 5.2 | $1.75 | $14.00 | $0.175 | - |
| GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - |
| GPT 5.1 | $1.07 | $8.50 | $0.107 | - |
@@ -152,9 +160,7 @@ https://opencode.ai/zen/v1/models
النماذج المجانية:
-- GLM 4.7 Free متاح على OpenCode لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
-- Kimi K2.5 Free متاح على OpenCode لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
-- MiniMax M2.1 Free متاح على OpenCode لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
+- MiniMax M2.5 Free متاح على OpenCode لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
- Big Pickle نموذج خفي ومتاح مجانا على OpenCode لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
تواصل معنا إذا كانت لديك أي أسئلة.
@@ -183,9 +189,7 @@ https://opencode.ai/zen/v1/models
تتم استضافة جميع نماذجنا في الولايات المتحدة. يلتزم مزوّدونا بسياسة عدم الاحتفاظ بالبيانات (zero-retention) ولا يستخدمون بياناتك لتدريب النماذج، مع الاستثناءات التالية:
- Big Pickle: خلال فترة إتاحته المجانية، قد تُستخدم البيانات المجمعة لتحسين النموذج.
-- GLM 4.7 Free: خلال فترة إتاحته المجانية، قد تُستخدم البيانات المجمعة لتحسين النموذج.
-- Kimi K2.5 Free: خلال فترة إتاحته المجانية، قد تُستخدم البيانات المجمعة لتحسين النموذج.
-- MiniMax M2.1 Free: خلال فترة إتاحته المجانية، قد تُستخدم البيانات المجمعة لتحسين النموذج.
+- MiniMax M2.5 Free: خلال فترة إتاحته المجانية، قد تُستخدم البيانات المجمعة لتحسين النموذج.
- OpenAI APIs: يتم الاحتفاظ بالطلبات لمدة 30 يوما وفقا لـ [سياسات بيانات OpenAI](https://platform.openai.com/docs/guides/your-data).
- Anthropic APIs: يتم الاحتفاظ بالطلبات لمدة 30 يوما وفقا لـ [سياسات بيانات Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage).
diff --git a/packages/web/src/content/docs/bs/cli.mdx b/packages/web/src/content/docs/bs/cli.mdx
index 049b43497f7..7fc594e6c39 100644
--- a/packages/web/src/content/docs/bs/cli.mdx
+++ b/packages/web/src/content/docs/bs/cli.mdx
@@ -555,6 +555,7 @@ OpenCode se može konfigurirati pomoću varijabli okruženja.
| `OPENCODE_AUTO_SHARE` | boolean | Automatski dijeli sesije |
| `OPENCODE_GIT_BASH_PATH` | string | Putanja do Git Bash izvršne datoteke na Windows-u |
| `OPENCODE_CONFIG` | string | Putanja do konfiguracijskog fajla |
+| `OPENCODE_TUI_CONFIG` | string | Putanja do TUI konfiguracijskog fajla |
| `OPENCODE_CONFIG_DIR` | string | Putanja do konfiguracijskog direktorija |
| `OPENCODE_CONFIG_CONTENT` | string | Inline json konfiguracijski sadržaj |
| `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Onemogući automatske provjere ažuriranja |
diff --git a/packages/web/src/content/docs/bs/config.mdx b/packages/web/src/content/docs/bs/config.mdx
index 3e20f1890d4..3183a2f92df 100644
--- a/packages/web/src/content/docs/bs/config.mdx
+++ b/packages/web/src/content/docs/bs/config.mdx
@@ -14,10 +14,11 @@ OpenCode podržava i **JSON** i **JSONC** (JSON sa komentarima) formate.
```jsonc title="opencode.jsonc"
{
"$schema": "https://opencode.ai/config.json",
- // Theme configuration
- "theme": "opencode",
"model": "anthropic/claude-sonnet-4-5",
"autoupdate": true,
+ "server": {
+ "port": 4096,
+ },
}
```
@@ -30,8 +31,10 @@ Možete postaviti svoju konfiguraciju na nekoliko različitih lokacija i one ima
:::note
Konfiguracijski fajlovi se **spajaju**, ne zamjenjuju.
:::
+
Konfiguracijski fajlovi se spajaju, ne zamjenjuju. Kombiniraju se postavke sa sljedećih konfiguracijskih lokacija. Kasnije konfiguracije poništavaju prethodne samo za konfliktne ključeve. Nekonfliktne postavke iz svih konfiguracija su sačuvane.
-Na primjer, ako vaša globalna konfiguracija postavlja `theme: "opencode"` i `autoupdate: true`, a vaša projektna konfiguracija postavlja `model: "anthropic/claude-sonnet-4-5"`, konačna konfiguracija će uključivati sve tri postavke.
+
+Na primjer, ako vaša globalna konfiguracija postavlja `autoupdate: true`, a vaša projektna konfiguracija postavlja `model: "anthropic/claude-sonnet-4-5"`, konačna konfiguracija će uključivati obje postavke.
---
@@ -40,23 +43,26 @@ Na primjer, ako vaša globalna konfiguracija postavlja `theme: "opencode"` i `au
Izvori konfiguracije se učitavaju ovim redoslijedom (kasniji izvori poništavaju ranije):
1. **Udaljena konfiguracija** (od `.well-known/opencode`) - organizacijske postavke
-2. **Globalna konfiguracija** (`~/.config/opencode/opencode.json`) - korisničke postavke
+2. **Globalna konfiguracija** (`~/.config/opencode/opencode.json`) - korisničke preferencije
3. **Prilagođena konfiguracija** (`OPENCODE_CONFIG` env var) - prilagođena preinačenja
4. **Konfiguracija projekta** (`opencode.json` u projektu) - postavke specifične za projekat
5. **`.opencode` direktoriji** - agenti, komande, dodaci
6. **Inline konfiguracija** (`OPENCODE_CONFIG_CONTENT` env var) - runtime preinačenja
- To znači da konfiguracije projekta mogu nadjačati globalne zadane postavke, a globalne konfiguracije mogu nadjačati postavke udaljene organizacije.
- :::note
- Direktoriji `.opencode` i `~/.config/opencode` koriste **imena u množini** za poddirektorije: `agents/`, `commands/`, `modes/`, `plugins/`, `skills/`, `tools/` i `themes/`. Pojedinačna imena (npr. `agent/`) su također podržana za kompatibilnost unatrag.
- :::
+To znači da konfiguracije projekta mogu nadjačati globalne zadane postavke, a globalne konfiguracije mogu nadjačati postavke udaljene organizacije.
+
+:::note
+Direktoriji `.opencode` i `~/.config/opencode` koriste **imena u množini** za poddirektorije: `agents/`, `commands/`, `modes/`, `plugins/`, `skills/`, `tools/` i `themes/`. Pojedinačna imena (npr. `agent/`) su također podržana za kompatibilnost unatrag.
+:::
---
### Udaljeno (Remote)
Organizacije mogu pružiti zadanu konfiguraciju preko `.well-known/opencode` krajnje tačke. Ovo se automatski preuzima kada se autentifikujete kod provajdera koji to podržava.
+
Prvo se učitava udaljena konfiguracija koja služi kao osnovni sloj. Svi ostali izvori konfiguracije (globalni, projektni) mogu nadjačati ove zadane postavke.
+
Na primjer, ako vaša organizacija nudi MCP servere koji su po defaultu onemogućeni:
```json title="Remote config from .well-known/opencode"
@@ -89,7 +95,10 @@ Možete omogućiti određene servere u vašoj lokalnoj konfiguraciji:
### Globalno
-Postavite svoju globalnu OpenCode konfiguraciju u `~/.config/opencode/opencode.json`. Koristite globalnu konfiguraciju za korisničke preferencije kao što su teme, provajderi ili veze tipki.
+Postavite svoju globalnu OpenCode konfiguraciju u `~/.config/opencode/opencode.json`. Koristite globalnu konfiguraciju za korisničke preferencije kao što su provajderi, modeli i dozvole.
+
+Za postavke specifične za TUI, koristite `~/.config/opencode/tui.json`.
+
Globalna konfiguracija poništava zadane postavke udaljene organizacije.
---
@@ -97,10 +106,15 @@ Globalna konfiguracija poništava zadane postavke udaljene organizacije.
### Projekt
Dodajte `opencode.json` u korijen projekta. Konfiguracija projekta ima najveći prioritet među standardnim konfiguracijskim datotekama - ona nadjačava globalne i udaljene konfiguracije.
+
+Za TUI postavke specifične za projekat, dodajte `tui.json` pored njega.
+
:::tip
Postavite specifičnu konfiguraciju projekta u korijen vašeg projekta.
:::
+
Kada se OpenCode pokrene, traži konfiguracijsku datoteku u trenutnom direktoriju ili prelazi do najbližeg Git direktorija.
+
Ovo je također sigurno provjeriti u Git i koristi istu shemu kao globalna.
---
@@ -134,33 +148,33 @@ Prilagođeni direktorij se učitava nakon direktorija globalne konfiguracije i `
## Šema
Konfiguracijski fajl ima šemu koja je definirana u [**`opencode.ai/config.json`**](https://opencode.ai/config.json).
+
+TUI konfiguracija koristi [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json).
+
Vaš editor bi trebao biti u mogućnosti da validira i autodovršava na osnovu šeme.
---
### TUI
-Možete konfigurirati postavke specifične za TUI putem opcije `tui`.
+Koristite namjenski `tui.json` (ili `tui.jsonc`) fajl za postavke specifične za TUI.
-```json title="opencode.json"
+```json title="tui.json"
{
- "$schema": "https://opencode.ai/config.json",
- "tui": {
- "scroll_speed": 3,
- "scroll_acceleration": {
- "enabled": true
- },
- "diff_style": "auto"
- }
+ "$schema": "https://opencode.ai/tui.json",
+ "scroll_speed": 3,
+ "scroll_acceleration": {
+ "enabled": true
+ },
+ "diff_style": "auto"
}
```
-Dostupne opcije:
+Koristite `OPENCODE_TUI_CONFIG` da pokažete na prilagođeni TUI konfiguracijski fajl.
+
+Stari `theme`, `keybinds`, i `tui` ključevi u `opencode.json` su zastarjeli i automatski će se migrirati kada je to moguće.
-- `scroll_acceleration.enabled` - Omogući ubrzanje skrolovanja u macOS stilu. **Ima prednost nad `scroll_speed`.**
-- `scroll_speed` - Prilagođeni množitelj brzine pomicanja (podrazumevano: `3`, minimalno: `1`). Zanemareno ako je `scroll_acceleration.enabled` `true`.
-- `diff_style` - Kontrola prikaza razlike. `"auto"` se prilagođava širini terminala, `"stacked"` uvijek prikazuje jednu kolonu.
- [Saznajte više o korištenju TUI](/docs/tui) ovdje.
+[Saznajte više o korištenju TUI ovdje](/docs/tui#configure).
---
@@ -188,7 +202,8 @@ Dostupne opcije:
- `mdns` - Omogući mDNS otkrivanje servisa. Ovo omogućava drugim uređajima na mreži da otkriju vaš OpenCode server.
- `mdnsDomain` - Prilagođeno ime domene za mDNS servis. Zadano je `opencode.local`. Korisno za pokretanje više instanci na istoj mreži.
- `cors` - Dodatni origini koji omogućavaju CORS kada koristite HTTP server iz klijenta baziranog na pretraživaču. Vrijednosti moraju biti puni origin (shema + host + opcijski port), npr. `https://app.example.com`.
- [Saznajte više o serveru](/docs/server) ovdje.
+
+[Saznajte više o serveru ovdje](/docs/server).
---
@@ -206,7 +221,7 @@ Možete upravljati alatima koje LLM može koristiti putem opcije `tools`.
}
```
-[Saznajte više o alatima](/docs/tools) ovdje.
+[Saznajte više o alatima ovdje](/docs/tools).
---
@@ -224,6 +239,7 @@ Možete konfigurirati dobavljače i modele koje želite koristiti u svojoj OpenC
```
Opcija `small_model` konfigurira poseban model za lagane zadatke poput generiranja naslova. Podrazumevano, OpenCode pokušava da koristi jeftiniji model ako je dostupan od vašeg provajdera, inače se vraća na vaš glavni model.
+
Opcije provajdera mogu uključivati `timeout` i `setCacheKey`:
```json title="opencode.json"
@@ -242,7 +258,8 @@ Opcije provajdera mogu uključivati `timeout` i `setCacheKey`:
- `timeout` - Vrijeme čekanja zahtjeva u milisekundama (podrazumevano: 300000). Postavite na `false` da onemogućite.
- `setCacheKey` - Osigurajte da je ključ keš memorije uvijek postavljen za određenog provajdera.
- Također možete konfigurirati [lokalne modele](/docs/models#local). [Saznajte više](/docs/models).
+
+Također možete konfigurirati [lokalne modele](/docs/models#local). [Saznajte više](/docs/models).
---
@@ -272,21 +289,23 @@ Amazon Bedrock podržava konfiguraciju specifičnu za AWS:
- `region` - AWS regija za Bedrock (zadano na `AWS_REGION` env var ili `us-east-1`)
- `profile` - AWS imenovani profil iz `~/.aws/credentials` (zadano na `AWS_PROFILE` env var)
- `endpoint` - URL prilagođene krajnje tačke za VPC krajnje tačke. Ovo je alias za generičku opciju `baseURL` koristeći terminologiju specifičnu za AWS. Ako su oba navedena, `endpoint` ima prednost.
- :::note
- Tokeni nosioca (`AWS_BEARER_TOKEN_BEDROCK` ili `/connect`) imaju prednost nad autentifikacijom zasnovanom na profilu. Pogledajte [prednost autentifikacije](/docs/providers#authentication-precedence) za detalje.
- :::
- [Saznajte više o konfiguraciji Amazon Bedrock](/docs/providers#amazon-bedrock).
+
+:::note
+Tokeni nosioca (`AWS_BEARER_TOKEN_BEDROCK` ili `/connect`) imaju prednost nad autentifikacijom zasnovanom na profilu. Pogledajte [prednost autentifikacije](/docs/providers#authentication-precedence) za detalje.
+:::
+
+[Saznajte više o konfiguraciji Amazon Bedrock](/docs/providers#amazon-bedrock).
---
-### Tema
+### Teme
-Možete konfigurirati temu koju želite koristiti u svojoj OpenCode konfiguraciji putem opcije `theme`.
+Postavite vašu UI temu u `tui.json`.
-```json title="opencode.json"
+```json title="tui.json"
{
- "$schema": "https://opencode.ai/config.json",
- "theme": ""
+ "$schema": "https://opencode.ai/tui.json",
+ "theme": "tokyonight"
}
```
@@ -332,6 +351,7 @@ Možete postaviti zadanog agenta koristeći opciju `default_agent`. Ovo određuj
```
Zadani agent mora biti primarni agent (ne podagent). Ovo može biti ugrađeni agent kao što je `"build"` ili `"plan"`, ili [prilagođeni agent](/docs/agents) koji ste definirali. Ako navedeni agent ne postoji ili je podagent, OpenCode će se vratiti na `"build"` s upozorenjem.
+
Ova postavka se primjenjuje na sva sučelja: TUI, CLI (`opencode run`), desktop aplikaciju i GitHub Action.
---
@@ -352,7 +372,8 @@ Ovo prihvata:
- `"manual"` - Dozvoli ručno dijeljenje putem naredbi (podrazumevano)
- `"auto"` - Automatski dijelite nove razgovore
- `"disabled"` - Onemogući dijeljenje u potpunosti
- Podrazumevano, dijeljenje je postavljeno na ručni način rada gdje trebate eksplicitno dijeliti razgovore pomoću naredbe `/share`.
+
+Podrazumevano, dijeljenje je postavljeno na ručni način rada gdje trebate eksplicitno dijeliti razgovore pomoću naredbe `/share`.
---
@@ -384,11 +405,11 @@ Također možete definirati naredbe koristeći markdown fajlove u `~/.config/ope
### Prečice tipki
-Možete prilagoditi svoje veze tipki putem opcije `keybinds`.
+Prilagodite prečice tipki u `tui.json`.
-```json title="opencode.json"
+```json title="tui.json"
{
- "$schema": "https://opencode.ai/config.json",
+ "$schema": "https://opencode.ai/tui.json",
"keybinds": {}
}
```
@@ -442,6 +463,7 @@ Možete konfigurirati formatere koda putem opcije `formatter`.
### Dozvole
Prema zadanim postavkama, OpenCode **dopušta sve operacije** bez potrebe za eksplicitnim dopuštenjem. Ovo možete promijeniti koristeći opciju `permission`.
+
Na primjer, da osigurate da alati `edit` i `bash` zahtijevaju odobrenje korisnika:
```json title="opencode.json"
@@ -467,13 +489,15 @@ Možete kontrolirati ponašanje sažimanja konteksta putem opcije `compaction`.
"$schema": "https://opencode.ai/config.json",
"compaction": {
"auto": true,
- "prune": true
+ "prune": true,
+ "reserved": 10000
}
}
```
- `auto` - Automatski sažimanje sesije kada je kontekst pun (podrazumevano: `true`).
- `prune` - Uklonite stare izlaze alata da sačuvate tokene (podrazumevano: `true`).
+- `reserved` - Token buffer za sažimanje. Ostavlja dovoljno prostora da se izbjegne prelijevanje tokom sažimanja
---
@@ -512,6 +536,7 @@ Možete konfigurirati MCP servere koje želite koristiti putem opcije `mcp`.
### Dodaci
[Plugins](/docs/plugins) proširuju OpenCode sa prilagođenim alatima, kukicama i integracijama.
+
Postavite datoteke dodataka u `.opencode/plugins/` ili `~/.config/opencode/plugins/`. Također možete učitati dodatke iz npm-a preko opcije `plugin`.
```json title="opencode.json"
@@ -554,6 +579,7 @@ Možete onemogućiti dobavljače koji se automatski učitavaju preko opcije `dis
:::note
`disabled_providers` ima prioritet nad `enabled_providers`.
:::
+
Opcija `disabled_providers` prihvata niz ID-ova provajdera. Kada je provajder onemogućen:
- Neće se učitati čak i ako su varijable okruženja postavljene.
@@ -574,9 +600,11 @@ Možete odrediti listu dozvoljenih dobavljača putem opcije `enabled_providers`.
```
Ovo je korisno kada želite da ograničite OpenCode da koristi samo određene provajdere umjesto da ih onemogućavate jednog po jednog.
+
:::note
`disabled_providers` ima prioritet nad `enabled_providers`.
:::
+
Ako se provajder pojavljuje i u `enabled_providers` i `disabled_providers`, `disabled_providers` ima prioritet za kompatibilnost unatrag.
---
@@ -649,7 +677,9 @@ Putanja fajla mogu biti:
- U odnosu na direktorij konfiguracijskih datoteka
- Ili apsolutne staze koje počinju sa `/` ili `~`
- Ovo je korisno za:
+
+Ovo je korisno za:
+
- Pohranjivanje osjetljivih podataka poput API ključeva u odvojenim datotekama.
- Uključujući velike datoteke instrukcija bez zatrpavanja vaše konfiguracije.
- Dijeljenje zajedničkih isječaka konfiguracije u više konfiguracijskih datoteka.
diff --git a/packages/web/src/content/docs/bs/custom-tools.mdx b/packages/web/src/content/docs/bs/custom-tools.mdx
index e452ce6a562..e933c7cb12e 100644
--- a/packages/web/src/content/docs/bs/custom-tools.mdx
+++ b/packages/web/src/content/docs/bs/custom-tools.mdx
@@ -79,6 +79,32 @@ Ovo stvara dva alata: `math_add` i `math_multiply`.
---
+#### Sukob imena s ugrađenim alatima
+
+Prilagođeni alati su prepoznati po imenu. Ako prilagođeni alat koristi isto ime kao ugrađeni alat, prilagođeni alat ima prednost.
+
+Na primjer, ova datoteka zamjenjuje ugrađeni `bash` alat:
+
+```ts title=".opencode/tools/bash.ts"
+import { tool } from "@opencode-ai/plugin"
+
+export default tool({
+ description: "Restricted bash wrapper",
+ args: {
+ command: tool.schema.string(),
+ },
+ async execute(args) {
+ return `blocked: ${args.command}`
+ },
+})
+```
+
+:::note
+Preferirajte jedinstvena imena osim ako namjerno ne želite zamijeniti ugrađeni alat. Ako želite onemogućiti ugrađeni alat, ali ne i nadjačati ga, koristite [dozvole](/docs/permissions).
+:::
+
+---
+
### Argumenti
Možete koristiti `tool.schema`, što je samo [Zod](https://zod.dev), da definirate tipove argumenata.
@@ -166,4 +192,4 @@ export default tool({
})
```
-Ovdje koristimo [`Bun.$`\_](https://bun.com/docs/runtime/shell) uslužni program za pokretanje Python skripte.
+Ovdje koristimo [`Bun.$`](https://bun.com/docs/runtime/shell) uslužni program za pokretanje Python skripte.
diff --git a/packages/web/src/content/docs/bs/index.mdx b/packages/web/src/content/docs/bs/index.mdx
index 5d21e994f9b..4af699485aa 100644
--- a/packages/web/src/content/docs/bs/index.mdx
+++ b/packages/web/src/content/docs/bs/index.mdx
@@ -80,9 +80,10 @@ Također ga možete instalirati pomoću sljedećih naredbi:
- **Korištenje Parua na Arch Linuxu**
-```bash
- paru -S opencode-bin
-```
+ ```bash
+ sudo pacman -S opencode # Arch Linux (Stable)
+ paru -S opencode-bin # Arch Linux (Latest from AUR)
+ ```
#### Windows
diff --git a/packages/web/src/content/docs/bs/keybinds.mdx b/packages/web/src/content/docs/bs/keybinds.mdx
index f35dd385257..a7a6d34a0de 100644
--- a/packages/web/src/content/docs/bs/keybinds.mdx
+++ b/packages/web/src/content/docs/bs/keybinds.mdx
@@ -3,11 +3,11 @@ title: Prečice tipki
description: Prilagodite svoje veze tipki.
---
-OpenCode ima listu veza tipki koje možete prilagoditi preko OpenCode konfiguracije.
+OpenCode ima listu veza tipki koje možete prilagoditi putem `tui.json`.
-```json title="opencode.json"
+```json title="tui.json"
{
- "$schema": "https://opencode.ai/config.json",
+ "$schema": "https://opencode.ai/tui.json",
"keybinds": {
"leader": "ctrl+x",
"app_exit": "ctrl+c,ctrl+d,Session[] |
-| `session.get({ path })` | Get session | Returns Session |
-| `session.children({ path })` | List child sessions | Returns Session[] |
-| `session.create({ body })` | Create session | Returns Session |
-| `session.delete({ path })` | Delete session | Returns `boolean` |
-| `session.update({ path, body })` | Update session properties | Returns Session |
-| `session.init({ path, body })` | Analyze app and create `AGENTS.md` | Returns `boolean` |
-| `session.abort({ path })` | Abort a running session | Returns `boolean` |
-| `session.share({ path })` | Share session | Returns Session |
-| `session.unshare({ path })` | Unshare session | Returns Session |
-| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
-| `session.messages({ path })` | List messages in a session | Returns `{ info: `Message`, parts: `Part[]`}[]` |
-| `session.message({ path })` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` |
-| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns AssistantMessage with AI response |
-| `session.command({ path, body })` | Send command to session | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` |
-| `session.shell({ path, body })` | Run a shell command | Returns AssistantMessage |
-| `session.revert({ path, body })` | Revert a message | Returns Session |
-| `session.unrevert({ path })` | Restore reverted messages | Returns Session |
-| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` |
+| Metoda | Opis | Napomene |
+| ---------------------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `session.list()` | List sessions | Returns Session[] |
+| `session.get({ path })` | Get session | Returns Session |
+| `session.children({ path })` | List child sessions | Returns Session[] |
+| `session.create({ body })` | Create session | Returns Session |
+| `session.delete({ path })` | Delete session | Returns `boolean` |
+| `session.update({ path, body })` | Update session properties | Returns Session |
+| `session.init({ path, body })` | Analyze app and create `AGENTS.md` | Returns `boolean` |
+| `session.abort({ path })` | Abort a running session | Returns `boolean` |
+| `session.share({ path })` | Share session | Returns Session |
+| `session.unshare({ path })` | Unshare session | Returns Session |
+| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
+| `session.messages({ path })` | List messages in a session | Returns `{ info: `Message`, parts: `Part[]`}[]` |
+| `session.message({ path })` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` |
+| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns AssistantMessage with AI response. Supports `body.outputFormat` for [structured output](#strukturirani-izlaz) |
+| `session.command({ path, body })` | Send command to session | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` |
+| `session.shell({ path, body })` | Run a shell command | Returns AssistantMessage |
+| `session.revert({ path, body })` | Revert a message | Returns Session |
+| `session.unrevert({ path })` | Restore reverted messages | Returns Session |
+| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` |
---
diff --git a/packages/web/src/content/docs/bs/server.mdx b/packages/web/src/content/docs/bs/server.mdx
index 7d270fb4aae..5237873d5f7 100644
--- a/packages/web/src/content/docs/bs/server.mdx
+++ b/packages/web/src/content/docs/bs/server.mdx
@@ -86,116 +86,116 @@ opencode server izlaže sljedece API-je.
### Globalno
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ---------------- | ------------------------------ | ------------------------------------ |
-| `GET` | `/global/health` | Get server health and version | `{ healthy: true, version: string }` |
-| `GET` | `/global/event` | Get global events (SSE stream) | Event stream |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | ---------------- | ----------------------------------- | ------------------------------------ |
+| `GET` | `/global/health` | Dohvati zdravlje i verziju servera | `{ healthy: true, version: string }` |
+| `GET` | `/global/event` | Dohvati globalne događaje (SSE tok) | Event stream |
---
### Projekt
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ------------------ | ----------------------- | --------------------------------------------- |
-| `GET` | `/project` | List all projects | Project[] |
-| `GET` | `/project/current` | Get the current project | Project |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | ------------------ | ------------------------ | --------------------------------------------- |
+| `GET` | `/project` | Izlistaj sve projekte | Project[] |
+| `GET` | `/project/current` | Dohvati trenutni projekt | Project |
---
### Putanja i VCS
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ------- | ------------------------------------ | ------------------------------------------- |
-| `GET` | `/path` | Get the current path | Path |
-| `GET` | `/vcs` | Get VCS info for the current project | VcsInfo |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | ------- | ------------------------------------------- | ------------------------------------------- |
+| `GET` | `/path` | Dohvati trenutnu putanju | Path |
+| `GET` | `/vcs` | Dohvati VCS informacije za trenutni projekt | VcsInfo |
---
### Instanca
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ------------------- | ---------------------------- | --------- |
-| `POST` | `/instance/dispose` | Dispose the current instance | `boolean` |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | ------------------- | ----------------------- | --------- |
+| `POST` | `/instance/dispose` | Ugasi trenutnu instancu | `boolean` |
---
### Konfiguracija
-| Metoda | Putanja | Opis | Odgovor |
-| ------- | ------------------- | --------------------------------- | ---------------------------------------------------------------------------------------- |
-| `GET` | `/config` | Get config info | Config |
-| `PATCH` | `/config` | Update config | Config |
-| `GET` | `/config/providers` | List providers and default models | `{ providers: `Provider[]`, default: { [key: string]: string } }` |
+| Metoda | Putanja | Opis | Odgovor |
+| ------- | ------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- |
+| `GET` | `/config` | Dohvati informacije o konfiguraciji | Config |
+| `PATCH` | `/config` | Ažuriraj konfiguraciju | Config |
+| `GET` | `/config/providers` | Izlistaj provajdere i zadane modele | `{ providers: `Provider[]`, default: { [key: string]: string } }` |
---
### Provajder
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- |
-| `GET` | `/provider` | List all providers | `{ all: `Provider[]`, default: {...}, connected: string[] }` |
-| `GET` | `/provider/auth` | Get provider authentication methods | `{ [providerID: string]: `ProviderAuthMethod[]` }` |
-| `POST` | `/provider/{id}/oauth/authorize` | Authorize a provider using OAuth | ProviderAuthAuthorization |
-| `POST` | `/provider/{id}/oauth/callback` | Handle OAuth callback for a provider | `boolean` |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | -------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- |
+| `GET` | `/provider` | Izlistaj sve provajdere | `{ all: `Provider[]`, default: {...}, connected: string[] }` |
+| `GET` | `/provider/auth` | Dohvati metode autentifikacije provajdera | `{ [providerID: string]: `ProviderAuthMethod[]` }` |
+| `POST` | `/provider/{id}/oauth/authorize` | Autoriziraj provajdera koristeći OAuth | ProviderAuthAuthorization |
+| `POST` | `/provider/{id}/oauth/callback` | Obradi OAuth povratni poziv za provajdera | `boolean` |
---
### Sesije
-| Metoda | Putanja | Opis | Napomene |
-| -------- | ---------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- |
-| `GET` | `/session` | List all sessions | Returns Session[] |
-| `POST` | `/session` | Create a new session | body: `{ parentID?, title? }`, returns Session |
-| `GET` | `/session/status` | Get session status for all sessions | Returns `{ [sessionID: string]: `SessionStatus` }` |
-| `GET` | `/session/:id` | Get session details | Returns Session |
-| `DELETE` | `/session/:id` | Delete a session and all its data | Returns `boolean` |
-| `PATCH` | `/session/:id` | Update session properties | body: `{ title? }`, returns Session |
-| `GET` | `/session/:id/children` | Get a session's child sessions | Returns Session[] |
-| `GET` | `/session/:id/todo` | Get the todo list for a session | Returns Todo[] |
-| `POST` | `/session/:id/init` | Analyze app and create `AGENTS.md` | body: `{ messageID, providerID, modelID }`, returns `boolean` |
-| `POST` | `/session/:id/fork` | Fork an existing session at a message | body: `{ messageID? }`, returns Session |
-| `POST` | `/session/:id/abort` | Abort a running session | Returns `boolean` |
-| `POST` | `/session/:id/share` | Share a session | Returns Session |
-| `DELETE` | `/session/:id/share` | Unshare a session | Returns Session |
-| `GET` | `/session/:id/diff` | Get the diff for this session | query: `messageID?`, returns FileDiff[] |
-| `POST` | `/session/:id/summarize` | Summarize the session | body: `{ providerID, modelID }`, returns `boolean` |
-| `POST` | `/session/:id/revert` | Revert a message | body: `{ messageID, partID? }`, returns `boolean` |
-| `POST` | `/session/:id/unrevert` | Restore all reverted messages | Returns `boolean` |
-| `POST` | `/session/:id/permissions/:permissionID` | Respond to a permission request | body: `{ response, remember? }`, returns `boolean` |
+| Metoda | Putanja | Opis | Napomene |
+| -------- | ---------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------- |
+| `GET` | `/session` | Izlistaj sve sesije | Returns Session[] |
+| `POST` | `/session` | Kreiraj novu sesiju | body: `{ parentID?, title? }`, returns Session |
+| `GET` | `/session/status` | Dohvati status sesije za sve sesije | Returns `{ [sessionID: string]: `SessionStatus` }` |
+| `GET` | `/session/:id` | Dohvati detalje sesije | Returns Session |
+| `DELETE` | `/session/:id` | Obriši sesiju i sve njene podatke | Returns `boolean` |
+| `PATCH` | `/session/:id` | Ažuriraj svojstva sesije | body: `{ title? }`, returns Session |
+| `GET` | `/session/:id/children` | Dohvati pod-sesije sesije | Returns Session[] |
+| `GET` | `/session/:id/todo` | Dohvati listu zadataka za sesiju | Returns Todo[] |
+| `POST` | `/session/:id/init` | Analiziraj aplikaciju i kreiraj `AGENTS.md` | body: `{ messageID, providerID, modelID }`, returns `boolean` |
+| `POST` | `/session/:id/fork` | Granaj postojeću sesiju na poruci | body: `{ messageID? }`, returns Session |
+| `POST` | `/session/:id/abort` | Prekini sesiju u toku | Returns `boolean` |
+| `POST` | `/session/:id/share` | Podijeli sesiju | Returns Session |
+| `DELETE` | `/session/:id/share` | Prestani dijeliti sesiju | Returns Session |
+| `GET` | `/session/:id/diff` | Dohvati razlike za ovu sesiju | query: `messageID?`, returns FileDiff[] |
+| `POST` | `/session/:id/summarize` | Rezimiraj sesiju | body: `{ providerID, modelID }`, returns `boolean` |
+| `POST` | `/session/:id/revert` | Vrati poruku | body: `{ messageID, partID? }`, returns `boolean` |
+| `POST` | `/session/:id/unrevert` | Vrati sve vraćene poruke | Returns `boolean` |
+| `POST` | `/session/:id/permissions/:permissionID` | Odgovori na zahtjev za dozvolu | body: `{ response, remember? }`, returns `boolean` |
---
### Poruke
-| Metoda | Putanja | Opis | Napomene |
-| ------ | --------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `GET` | `/session/:id/message` | List messages in a session | query: `limit?`, returns `{ info: `Message`, parts: `Part[]`}[]` |
-| `POST` | `/session/:id/message` | Send a message and wait for response | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `Message`, parts: `Part[]`}` |
-| `GET` | `/session/:id/message/:messageID` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` |
-| `POST` | `/session/:id/prompt_async` | Send a message asynchronously (no wait) | body: same as `/session/:id/message`, returns `204 No Content` |
-| `POST` | `/session/:id/command` | Execute a slash command | body: `{ messageID?, agent?, model?, command, arguments }`, returns `{ info: `Message`, parts: `Part[]`}` |
-| `POST` | `/session/:id/shell` | Run a shell command | body: `{ agent, model?, command }`, returns `{ info: `Message`, parts: `Part[]`}` |
+| Metoda | Putanja | Opis | Napomene |
+| ------ | --------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `GET` | `/session/:id/message` | Izlistaj poruke u sesiji | query: `limit?`, returns `{ info: `Message`, parts: `Part[]`}[]` |
+| `POST` | `/session/:id/message` | Pošalji poruku i čekaj odgovor | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `Message`, parts: `Part[]`}` |
+| `GET` | `/session/:id/message/:messageID` | Dohvati detalje poruke | Returns `{ info: `Message`, parts: `Part[]`}` |
+| `POST` | `/session/:id/prompt_async` | Pošalji poruku asinkrono (bez čekanja) | body: same as `/session/:id/message`, returns `204 No Content` |
+| `POST` | `/session/:id/command` | Izvrši slash naredbu | body: `{ messageID?, agent?, model?, command, arguments }`, returns `{ info: `Message`, parts: `Part[]`}` |
+| `POST` | `/session/:id/shell` | Pokreni shell naredbu | body: `{ agent, model?, command }`, returns `{ info: `Message`, parts: `Part[]`}` |
---
### Naredbe
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ---------- | ----------------- | --------------------------------------------- |
-| `GET` | `/command` | List all commands | Command[] |
+| Metoda | Putanja | Opis | Odgovor |
+| ------ | ---------- | -------------------- | --------------------------------------------- |
+| `GET` | `/command` | Izlistaj sve naredbe | Command[] |
---
### Datoteke
-| Metoda | Putanja | Opis | Odgovor |
-| ------ | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------- |
-| `GET` | `/find?pattern=` | Find files and directories by name | `string[]` (paths) | -| `GET` | `/find/symbol?query=` | Find workspace symbols |Symbol[]| -| `GET` | `/file?path=` | List files and directories | FileNode[]| -| `GET` | `/file/content?path=` | Read a file |
FileContent| -| `GET` | `/file/status` | Get status for tracked files |File[]| +| Metoda | Putanja | Opis | Odgovor | +| ------ | ------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------- | +| `GET` | `/find?pattern=` | Traži tekst u datotekama | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | +| `GET` | `/find/file?query= ` | Pronađi datoteke i direktorije po imenu | `string[]` (paths) | +| `GET` | `/find/symbol?query=` | Pronađi simbole radnog prostora |Symbol[]| +| `GET` | `/file?path=` | Izlistaj datoteke i direktorije | FileNode[]| +| `GET` | `/file/content?path=` | Pročitaj datoteku |
FileContent| +| `GET` | `/file/status` | Dohvati status za praćene datoteke |File[]| #### `/find/file` parametri upita @@ -209,10 +209,10 @@ opencode server izlaže sljedece API-je. ### Alati (Eksperimentalno) -| Metoda | Putanja | Opis | Odgovor | -| ------ | ------------------------------------------- | ---------------------------------------- | -------------------------------------------- | -| `GET` | `/experimental/tool/ids` | List all tool IDs |ToolIDs| -| `GET` | `/experimental/tool?provider=&model=
` | List tools with JSON schemas for a model | ToolList| +| Metoda | Putanja | Opis | Odgovor | +| ------ | ------------------------------------------- | -------------------------------------- | -------------------------------------------- | +| `GET` | `/experimental/tool/ids` | Izlistaj sve ID-ove alata |ToolIDs| +| `GET` | `/experimental/tool?provider=&model=
` | Izlistaj alate sa JSON šemama za model | ToolList| --- @@ -220,65 +220,65 @@ opencode server izlaže sljedece API-je. | Metoda | Putanja | Opis | Odgovor | | ------ | ------------ | -------------------------- | -------------------------------------------------------- | -| `GET` | `/lsp` | Get LSP server status |LSPStatus[]| -| `GET` | `/formatter` | Get formatter status |FormatterStatus[]| -| `GET` | `/mcp` | Get MCP server status | `{ [name: string]: `MCPStatus` }` | -| `POST` | `/mcp` | Add MCP server dynamically | body: `{ name, config }`, returns MCP status object | +| `GET` | `/lsp` | Dohvati status LSP servera |LSPStatus[]| +| `GET` | `/formatter` | Dohvati status formatera |FormatterStatus[]| +| `GET` | `/mcp` | Dohvati status MCP servera | `{ [name: string]: `MCPStatus` }` | +| `POST` | `/mcp` | Dodaj MCP server dinamički | body: `{ name, config }`, returns MCP status object | --- ### Agenti -| Metoda | Putanja | Opis | Odgovor | -| ------ | -------- | ------------------------- | ------------------------------------------- | -| `GET` | `/agent` | List all available agents |Agent[]| +| Metoda | Putanja | Opis | Odgovor | +| ------ | -------- | ---------------------------- | ------------------------------------------- | +| `GET` | `/agent` | Izlistaj sve dostupne agente |Agent[]| --- ### Bilježenje -| Metoda | Putanja | Opis | Odgovor | -| ------ | ------- | ------------------------------------------------------------ | --------- | -| `POST` | `/log` | Write log entry. Body: `{ service, level, message, extra? }` | `boolean` | +| Metoda | Putanja | Opis | Odgovor | +| ------ | ------- | ------------------------------------------------------------------- | --------- | +| `POST` | `/log` | Upiši zapis dnevnika. Tijelo: `{ service, level, message, extra? }` | `boolean` | --- ### TUI -| Metoda | Putanja | Opis | Odgovor | -| ------ | ----------------------- | ------------------------------------------- | ---------------------- | -| `POST` | `/tui/append-prompt` | Append text to the prompt | `boolean` | -| `POST` | `/tui/open-help` | Open the help dialog | `boolean` | -| `POST` | `/tui/open-sessions` | Open the session selector | `boolean` | -| `POST` | `/tui/open-themes` | Open the theme selector | `boolean` | -| `POST` | `/tui/open-models` | Open the model selector | `boolean` | -| `POST` | `/tui/submit-prompt` | Submit the current prompt | `boolean` | -| `POST` | `/tui/clear-prompt` | Clear the prompt | `boolean` | -| `POST` | `/tui/execute-command` | Execute a command (`{ command }`) | `boolean` | -| `POST` | `/tui/show-toast` | Show toast (`{ title?, message, variant }`) | `boolean` | -| `GET` | `/tui/control/next` | Wait for the next control request | Control request object | -| `POST` | `/tui/control/response` | Respond to a control request (`{ body }`) | `boolean` | +| Metoda | Putanja | Opis | Odgovor | +| ------ | ----------------------- | -------------------------------------------------------- | ---------------------- | +| `POST` | `/tui/append-prompt` | Dodaj tekst na prompt | `boolean` | +| `POST` | `/tui/open-help` | Otvori dijalog za pomoć | `boolean` | +| `POST` | `/tui/open-sessions` | Otvori selektor sesija | `boolean` | +| `POST` | `/tui/open-themes` | Otvori selektor tema | `boolean` | +| `POST` | `/tui/open-models` | Otvori selektor modela | `boolean` | +| `POST` | `/tui/submit-prompt` | Pošalji trenutni prompt | `boolean` | +| `POST` | `/tui/clear-prompt` | Očisti prompt | `boolean` | +| `POST` | `/tui/execute-command` | Izvrši naredbu (`{ command }`) | `boolean` | +| `POST` | `/tui/show-toast` | Prikaži toast obavijest (`{ title?, message, variant }`) | `boolean` | +| `GET` | `/tui/control/next` | Čekaj sljedeći kontrolni zahtjev | Control request object | +| `POST` | `/tui/control/response` | Odgovori na kontrolni zahtjev (`{ body }`) | `boolean` | --- ### Autentifikacija -| Metoda | Putanja | Opis | Odgovor | -| ------ | ----------- | --------------------------------------------------------------- | --------- | -| `PUT` | `/auth/:id` | Set authentication credentials. Body must match provider schema | `boolean` | +| Metoda | Putanja | Opis | Odgovor | +| ------ | ----------- | ------------------------------------------------------------------------------- | --------- | +| `PUT` | `/auth/:id` | Postavi autentifikacijske vjerodajnice. Tijelo mora odgovarati shemi provajdera | `boolean` | --- ### Događaji -| Metoda | Putanja | Opis | Odgovor | -| ------ | -------- | ----------------------------------------------------------------------------- | ------------------------- | -| `GET` | `/event` | Server-sent events stream. First event is `server.connected`, then bus events | Server-sent events stream | +| Metoda | Putanja | Opis | Odgovor | +| ------ | -------- | -------------------------------------------------------------------------------------- | ------------------------- | +| `GET` | `/event` | Tok događaja koje šalje server. Prvi događaj je `server.connected`, zatim bus događaji | Server-sent events stream | --- ### Dokumentacija -| Metoda | Putanja | Opis | Odgovor | -| ------ | ------- | ------------------------- | --------------------------- | -| `GET` | `/doc` | OpenAPI 3.1 specification | HTML page with OpenAPI spec | +| Metoda | Putanja | Opis | Odgovor | +| ------ | ------- | ------------------------- | --------------------------------------- | +| `GET` | `/doc` | OpenAPI 3.1 specifikacija | HTML stranica sa OpenAPI specifikacijom | diff --git a/packages/web/src/content/docs/bs/themes.mdx b/packages/web/src/content/docs/bs/themes.mdx index a513e5a2092..edb17e6fa4a 100644 --- a/packages/web/src/content/docs/bs/themes.mdx +++ b/packages/web/src/content/docs/bs/themes.mdx @@ -61,11 +61,11 @@ System tema je za korisnike koji: ## Korištenje teme -Temu mozete izabrati preko selektora tema komandom `/theme`. Mozete je navesti i u [configu](/docs/config). +Temu mozete izabrati preko selektora tema komandom `/theme`. Ili je možete navesti u `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/bs/tui.mdx b/packages/web/src/content/docs/bs/tui.mdx index 96b075aa130..ef09a4caa02 100644 --- a/packages/web/src/content/docs/bs/tui.mdx +++ b/packages/web/src/content/docs/bs/tui.mdx @@ -235,7 +235,7 @@ Podijelite trenutnu sesiju. [Saznajte više](/docs/share). Navedite dostupne teme. ```bash frame="none" -/theme +/themes ``` **Tastatura:** `ctrl+x t` @@ -358,24 +358,34 @@ Nekim uređivačima su potrebni argumenti komandne linije da bi se pokrenuli u n ## Konfiguracija -Možete prilagoditi TUI ponašanje putem vašeg OpenCode konfiguracionog fajla. +Možete prilagoditi TUI ponašanje putem `tui.json` (ili `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Ovo je odvojeno od `opencode.json`, koji konfiguriše ponašanje servera/izvršavanja. + ### Opcije -- `scroll_acceleration` - Omogućite ubrzanje pomicanja u macOS stilu za glatko, prirodno pomicanje. Kada je omogućeno, brzina pomicanja se povećava brzim pokretima pomicanja i ostaje precizna za sporije pokrete. **Ova postavka ima prednost nad `scroll_speed` i nadjačava je kada je omogućena.** -- `scroll_speed` - Kontrolira koliko brzo TUI skroluje kada se koriste komande za pomeranje (minimalno: `1`). Podrazumevano je `3`. **Napomena: Ovo se zanemaruje ako je `scroll_acceleration.enabled` postavljeno na `true`.** +- `theme` - Postavlja vašu UI temu. [Saznajte više](/docs/themes). +- `keybinds` - Prilagođava prečice na tastaturi. [Saznajte više](/docs/keybinds). +- `scroll_acceleration.enabled` - Omogućite ubrzanje pomicanja u macOS stilu za glatko, prirodno pomicanje. Kada je omogućeno, brzina pomicanja se povećava brzim pokretima pomicanja i ostaje precizna za sporije pokrete. **Ova postavka ima prednost nad `scroll_speed` i nadjačava je kada je omogućena.** +- `scroll_speed` - Kontrolira koliko brzo TUI skroluje kada se koriste komande za pomeranje (minimum: `0.001`, podržava decimalne vrijednosti). Podrazumevano je `3`. **Napomena: Ovo se zanemaruje ako je `scroll_acceleration.enabled` postavljeno na `true`.** +- `diff_style` - Kontrolira prikazivanje razlike. `"auto"` se prilagođava širini terminala, `"stacked"` uvijek prikazuje raspored u jednoj koloni. + +Koristite `OPENCODE_TUI_CONFIG` da učitate prilagođenu putanju TUI konfiguracije. --- diff --git a/packages/web/src/content/docs/bs/zen.mdx b/packages/web/src/content/docs/bs/zen.mdx index f9733370861..c7aeab0c763 100644 --- a/packages/web/src/content/docs/bs/zen.mdx +++ b/packages/web/src/content/docs/bs/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Kurirana lista modela koje nudi OpenCode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -55,6 +55,7 @@ Nasim modelima mozete pristupiti i preko sljedecih API endpointa. | Model | Model ID | Endpoint | AI SDK Package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -64,22 +65,24 @@ Nasim modelima mozete pristupiti i preko sljedecih API endpointa. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -106,29 +109,34 @@ Podrzavamo pay-as-you-go model. Ispod su cijene **po 1M tokena**. | Model | Input | Output | Cached Read | Cached Write | | --------------------------------- | ------ | ------ | ----------- | ------------ | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -147,10 +155,8 @@ Naknade kartica se prenose po stvarnom trosku (4.4% + $0.30 po transakciji) i ne Besplatni modeli: -- GLM 4.7 Free je dostupan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje feedbacka i unapredenje modela. -- Kimi K2.5 Free je dostupan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje feedbacka i unapredenje modela. -- MiniMax M2.1 Free je dostupan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje feedbacka i unapredenje modela. -- Big Pickle je stealth model koji je besplatan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje feedbacka i unapredenje modela. +- MiniMax M2.5 Free je dostupan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje povratnih informacija i poboljsanje modela. +- Big Pickle je stealth model koji je besplatan na OpenCode ograniceno vrijeme. Tim koristi taj period za prikupljanje povratnih informacija i poboljsanje modela. Ako imate pitanja, kontaktirajte nas. @@ -177,11 +183,9 @@ Na primjer, ako postavite mjesecni limit na $20, Zen nece potrositi vise od $20 Svi nasi modeli su hostovani u SAD-u. Provajderi prate zero-retention politiku i ne koriste vase podatke za treniranje modela, uz sljedece izuzetke: - Big Pickle: Tokom besplatnog perioda, prikupljeni podaci mogu se koristiti za poboljsanje modela. -- GLM 4.7 Free: Tokom besplatnog perioda, prikupljeni podaci mogu se koristiti za poboljsanje modela. -- Kimi K2.5 Free: Tokom besplatnog perioda, prikupljeni podaci mogu se koristiti za poboljsanje modela. -- MiniMax M2.1 Free: Tokom besplatnog perioda, prikupljeni podaci mogu se koristiti za poboljsanje modela. -- OpenAI API-ji: Zahtjevi se cuvaju 30 dana prema [OpenAI Data Policies](https://platform.openai.com/docs/guides/your-data). -- Anthropic API-ji: Zahtjevi se cuvaju 30 dana prema [Anthropic Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). +- MiniMax M2.5 Free: Tokom besplatnog perioda, prikupljeni podaci mogu se koristiti za poboljsanje modela. +- OpenAI API-ji: Zahtjevi se cuvaju 30 dana prema [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data). +- Anthropic API-ji: Zahtjevi se cuvaju 30 dana prema [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). --- diff --git a/packages/web/src/content/docs/da/cli.mdx b/packages/web/src/content/docs/da/cli.mdx index c29559df261..5eece6fd0ae 100644 --- a/packages/web/src/content/docs/da/cli.mdx +++ b/packages/web/src/content/docs/da/cli.mdx @@ -558,6 +558,7 @@ OpenCode kan konfigureres ved hjælp af miljøvariabler. | `OPENCODE_AUTO_SHARE` | boolean | Del automatisk session | | `OPENCODE_GIT_BASH_PATH` | string | Sti til Git Bash eksekverbar på Windows | | `OPENCODE_CONFIG` | string | Sti til konfigurationsfil | +| `OPENCODE_TUI_CONFIG` | string | Sti til TUI-konfigurationsfil | | `OPENCODE_CONFIG_DIR` | string | Sti til konfigurationsmappe | | `OPENCODE_CONFIG_CONTENT` | string | Indbygget json-konfigurationsindhold | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Deaktiver automatisk opdateringskontrol | @@ -582,7 +583,7 @@ OpenCode kan konfigureres ved hjælp af miljøvariabler. --- -### Flag +### Eksperimentel Disse miljøvariabler muliggør eksperimentelle funktioner, der kan ændres eller fjernes. diff --git a/packages/web/src/content/docs/da/config.mdx b/packages/web/src/content/docs/da/config.mdx index 5b45f8b0486..18b462580b7 100644 --- a/packages/web/src/content/docs/da/config.mdx +++ b/packages/web/src/content/docs/da/config.mdx @@ -14,10 +14,11 @@ OpenCode understøtter både **JSON** og **JSONC** (JSON med kommentarer) format ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -34,7 +35,7 @@ Konfigurationsfiler **flettes sammen**, erstattes ikke. Konfigurationsfiler flettes sammen, erstattes ikke. Indstillinger fra følgende konfigurationssteder kombineret. Senere konfigurationer tilsidesætter kun tidligere konfigurationer for modstridende nøgler. Ikke-modstridende indstillinger fra alle konfigurationer bevares. -For eksempel, hvis dine globale konfigurationssæt `theme: "opencode"` og `autoupdate: true`, og dine projektkonfigurationssæt `model: "anthropic/claude-sonnet-4-5"`, vil den endelige konfiguration integrere alle tre indstillinger. +For eksempel, hvis dine globale konfigurationssæt `autoupdate: true`, og dine projektkonfigurationssæt `model: "anthropic/claude-sonnet-4-5"`, vil den endelige konfiguration integrere begge indstillinger. --- @@ -490,13 +491,15 @@ Du kan styre kontekstkomprimeringsadfærd gennem indstillingen `compaction`. "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Komprimer automatisk sessionen, når konteksten er fuld (standard: `true`). - `prune` - Fjern gamle værktøjsudgange for at gemme tokens (standard: `true`). +- `reserved` - Tokenbuffer til komprimering. Efterlader nok vindue til at undgå overløb under komprimering --- @@ -582,8 +585,8 @@ Du kan deaktivere udbydere, der indlæses automatisk gennem `disabled_providers` Indstillingen `disabled_providers` accepterer en række udbyder-id'er. Når en udbyder er deaktiveret: -- Det vil ikke blive indlæst, omgivelserne miljøvariabler er indstillet. -- Den vil ikke blive indlæst, gennem API-nøgler er konfigureret kommandoen `/connect`. +- Den vil ikke blive indlæst, selvom miljøvariabler er indstillet. +- Den vil ikke blive indlæst, selvom API-nøgler er konfigureret via `/connect`-kommandoen. - Udbyderens modeller vises ikke på modelvalgslisten. --- diff --git a/packages/web/src/content/docs/da/custom-tools.mdx b/packages/web/src/content/docs/da/custom-tools.mdx index b0839b649c7..75746dcb49d 100644 --- a/packages/web/src/content/docs/da/custom-tools.mdx +++ b/packages/web/src/content/docs/da/custom-tools.mdx @@ -79,6 +79,32 @@ Dette skaber værktøjer: `math_add` og `math_multiply`. --- +#### Navnekollisioner med indbyggede værktøjer + +Brugerdefinerede værktøjer er identificeret ved værktøjsnavn. Hvis et brugerdefineret værktøj bruger samme navn som et indbygget værktøj, har det brugerdefinerede værktøj forrang. + +For eksempel erstatter denne fil det indbyggede `bash` værktøj: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Foretræk unikke navne, medmindre du bevidst ønsker at erstatte et indbygget værktøj. Hvis du vil deaktivere et indbygget værktøj, men ikke overskrive det, skal du bruge [tilladelser](/docs/permissions). +::: + +--- + ### Argumenter Du kan bruge `tool.schema`, som kun er [Zod](https://zod.dev), til at definere argumenttyper. diff --git a/packages/web/src/content/docs/da/keybinds.mdx b/packages/web/src/content/docs/da/keybinds.mdx index 2da3ff9426c..9c066fcb49c 100644 --- a/packages/web/src/content/docs/da/keybinds.mdx +++ b/packages/web/src/content/docs/da/keybinds.mdx @@ -3,11 +3,11 @@ title: Tastebindinger description: Tilpas dine nøglebindinger. --- -OpenCode har en liste over nøglebindinger, som du kan tilpasse gennem OpenCode-konfigurationen. +OpenCode har en liste over nøglebindinger, som du kan tilpasse gennem `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,q", @@ -117,11 +117,11 @@ Du behøver ikke bruge en ledernøgle til dine nøglebindinger, men vi anbefaler ## Deaktiver tastebinding -Du kan deaktivere en nøglebinding ved at tilføje nøglen til din konfiguration med værdien "ingen". +Du kan deaktivere en nøglebinding ved at tilføje nøglen til `tui.json` med værdien "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/da/lsp.mdx b/packages/web/src/content/docs/da/lsp.mdx index b0e0d353723..27d43b192b8 100644 --- a/packages/web/src/content/docs/da/lsp.mdx +++ b/packages/web/src/content/docs/da/lsp.mdx @@ -20,13 +20,14 @@ OpenCode leveres med flere indbyggede LSP-servere til populære sprog: | clojure-lsp | .clj,.cljs,.cljc,.edn | `clojure-lsp` kommando tilgængelig | | dart | .dart | `dart` kommando tilgængelig | | deno | .ts,.tsx,.js,.jsx,.mjs | `deno` kommando tilgængelig (auto-detects deno.json/deno.jsonc) | -| eliksir-ls | .ex,.exs | `elixir` kommando tilgængelig | +| elixir-ls | .ex,.exs | `elixir` kommando tilgængelig | | eslint | .ts,.tsx,.js,.jsx,.mjs,.cjs,.mts,.cts,.vue | `eslint` afhængighed i projekt | | fsharp | .fs,.fsi,.fsx,.fsscript | `.NET SDK` installere | | gleam | .gleam | `gleam` kommando tilgængelig | | gopls | .go | `go` kommando tilgængelig | | hls | .hs,.lhs | `haskell-language-server-wrapper` kommando tilgængelig | | jdtls | .java | `Java SDK (version 21+)` installere | +| julials | .jl | `julia` og `LanguageServer.jl` installeret | | kotlin-ls | .kt,.kts | Autoinstallationer til Kotlin-projekter | | lua-ls | .lua | Autoinstallationer til Lua-projekter | | nixd | .nix | `nixd` kommando tilgængelig | @@ -46,7 +47,7 @@ OpenCode leveres med flere indbyggede LSP-servere til populære sprog: | yaml-ls | .yaml,.yml | Autoinstallerer Red Hat yaml-language-server | | zls | .zig,.zon | `zig` kommando tilgængelig | -LSP-servere aktiveres automatisk, når en af ovnstående filtypenavne opdages, og kravene er opfyldt. +LSP-servere aktiveres automatisk, når en af ovenstående filtypenavne opdages, og kravene er opfyldt. :::note Du kan deaktivere automatisk LSP-serverdownloads ved at indstille miljøvariablen `OPENCODE_DISABLE_LSP_DOWNLOAD` til `true`. diff --git a/packages/web/src/content/docs/da/plugins.mdx b/packages/web/src/content/docs/da/plugins.mdx index a8532d599ce..908c6e11113 100644 --- a/packages/web/src/content/docs/da/plugins.mdx +++ b/packages/web/src/content/docs/da/plugins.mdx @@ -119,7 +119,7 @@ Plugin-funktionen modtager: - `directory`: Den aktuelle arbejdsmappe. - `worktree`: Git worktree-stien. - `client`: En opencode SDK klient til interaktion med AI. -- `-: Buns [shell API](https://bun.com/docs/runtime/shell) til udførelse af kommandoer. +- `$`: Buns [shell API](https://bun.com/docs/runtime/shell) til udførelse af kommandoer. --- @@ -308,6 +308,10 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { Dine tilpassede værktøjer vil være tilgængelige for opencode sammen med indbyggede værktøjer. +:::note +Hvis et plugin-værktøj bruger samme navn som et indbygget værktøj, har plugin-værktøjet forrang. +::: + --- ### Logning diff --git a/packages/web/src/content/docs/da/providers.mdx b/packages/web/src/content/docs/da/providers.mdx index 829ae46134b..c5cfe23fa88 100644 --- a/packages/web/src/content/docs/da/providers.mdx +++ b/packages/web/src/content/docs/da/providers.mdx @@ -81,6 +81,37 @@ Det fungerer som alle andre udbydere i OpenCode og er helt valgfrit at bruge. --- +## OpenCode Go + +OpenCode Go er en billig abonnementsplan, der giver pålidelig adgang til populære åbne kodningsmodeller leveret af OpenCode-teamet, som er testet og verificeret til at fungere godt med OpenCode. + +1. Kør kommandoen `/connect` i TUI, vælg `OpenCode Go`, og gå til [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Log ind, tilføj dine faktureringsoplysninger og kopier din API-nøgle. + +3. Indsæt din API-nøgle. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Kør `/models` i TUI for at se listen over modeller, vi anbefaler. + + ```txt + /models + ``` + +Det fungerer som alle andre udbydere i OpenCode og er helt valgfrit at bruge. + +--- + ## Katalog Lad os se på nogle af udbyderne i detaljer. Hvis du vil tilføje en udbyder til listen, er du velkommen til at åbne en PR. @@ -1474,6 +1505,39 @@ SAP AI Core giver adgang til 40+ modeller fra OpenAI, Anthropic, Google, Amazon, --- +### STACKIT + +STACKIT AI Model Serving leverer fuldt administreret suverænt hostingmiljø til AI-modeller, med fokus på LLM'er som Llama, Mistral og Qwen, med maksimal datasuverænitet på europæisk infrastruktur. + +1. Gå til [STACKIT Portal](https://portal.stackit.cloud), naviger til **AI Model Serving**, og opret en auth-token til dit projekt. + + :::tip + Du skal have en STACKIT-kundekonto, brugerkonto og projekt, før du opretter auth-tokens. + ::: + +2. Kør kommandoen `/connect` og søg efter **STACKIT**. + + ```txt + /connect + ``` + +3. Indtast din STACKIT AI Model Serving auth-token. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Kør kommandoen `/models` for at vælge fra tilgængelige modeller som _Qwen3-VL 235B_ eller _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Gå til [OVHcloud-panelet](https://ovh.com/manager). Naviger til `Public Cloud`-delen, `AI & Machine Learning` > `AI Endpoints` og i `API Keys`-fanen klikker du på **Opret en ny API-nøgle**. diff --git a/packages/web/src/content/docs/da/sdk.mdx b/packages/web/src/content/docs/da/sdk.mdx index 3feff27b3b0..cde874d5a2f 100644 --- a/packages/web/src/content/docs/da/sdk.mdx +++ b/packages/web/src/content/docs/da/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Struktureret output + +Du kan anmode om struktureret JSON-output fra modellen ved at angive et `format` med et JSON-skema. Modellen vil bruge et `StructuredOutput`-værktøj til at returnere valideret JSON, der matcher dit skema. + +### Grundlæggende brug + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Outputformat-typer + +| Type | Beskrivelse | +| ------------- | -------------------------------------------------------- | +| `text` | Standard. Standard tekstsvar (intet struktureret output) | +| `json_schema` | Returnerer valideret JSON, der matcher det angivne skema | + +### JSON-skemaformat + +Når du bruger `type: 'json_schema'`, skal du angive: + +| Felt | Type | Beskrivelse | +| ------------ | --------------- | ---------------------------------------------------------- | +| `type` | `'json_schema'` | Påkrævet. Angiver JSON-skematilstand | +| `schema` | `object` | Påkrævet. JSON-skemaobjekt, der definerer outputstrukturen | +| `retryCount` | `number` | Valgfri. Antal valideringsforsøg (standard: 2) | + +### Fejlhåndtering + +Hvis modellen ikke formår at producere gyldigt struktureret output efter alle forsøg, vil svaret inkludere en `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Bedste praksis + +1. **Giv klare beskrivelser** i dine skemaegenskaber for at hjælpe modellen med at forstå, hvilke data der skal udtrækkes +2. **Brug `required`** til at angive, hvilke felter der skal være til stede +3. **Hold skemaer fokuserede** - komplekse indlejrede skemaer kan være sværere for modellen at udfylde korrekt +4. **Indstil passende `retryCount`** - øg for komplekse skemaer, sænk for enkle + +--- + ## API'er SDK avslører alle server-APIer gjennom en typesikker klient. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sessioner -| Metode | Beskrivelse | Noter | -| ---------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `session.list()` | Liste sessioner | Returnerer Session[]| -| `session.get({ path })` | Få session | ReturnererSession| -| `session.children({ path })` | Liste over barnesessioner | ReturnererSession[]| -| `session.create({ body })` | Opret session | ReturnererSession| -| `session.delete({ path })` | Slett session | Returnerer `boolean` | -| `session.update({ path, body })` | Opdater sessionegenskaper | ReturnererSession| -| `session.init({ path, body })` | Analyser appen og lag `AGENTS.md` | Returnerer `boolean` | -| `session.abort({ path })` | Avbryt en løpesession | Returnerer `boolean` | -| `session.share({ path })` | Del sessionen | ReturnererSession| -| `session.unshare({ path })` | Slutt at dele sessionen | ReturnererSession| -| `session.summarize({ path, body })` | Oppsummer sessionen | Returnerer `boolean` | -| `session.messages({ path })` | Liste meldinger i en session | Returnerer `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Få meldingsdetaljer | Returnerer `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnererAssistantMessagemed AI svar | -| `session.command({ path, body })` | Send kommando til session | Returnerer `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Kjør en shell-kommando | ReturnererAssistantMessage| -| `session.revert({ path, body })` | Tilbakestill en melding | ReturnererSession| -| `session.unrevert({ path })` | Gjenopret nulstillete meldinger | ReturnererSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` | +| Metode | Beskrivelse | Noter | +| ---------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Liste sessioner | ReturnererSession[]| +| `session.get({ path })` | Få session | ReturnererSession| +| `session.children({ path })` | Liste over barnesessioner | ReturnererSession[]| +| `session.create({ body })` | Opret session | ReturnererSession| +| `session.delete({ path })` | Slett session | Returnerer `boolean` | +| `session.update({ path, body })` | Opdater sessionegenskaper | ReturnererSession| +| `session.init({ path, body })` | Analyser appen og lag `AGENTS.md` | Returnerer `boolean` | +| `session.abort({ path })` | Avbryt en løpesession | Returnerer `boolean` | +| `session.share({ path })` | Del sessionen | ReturnererSession| +| `session.unshare({ path })` | Slutt at dele sessionen | ReturnererSession| +| `session.summarize({ path, body })` | Oppsummer sessionen | Returnerer `boolean` | +| `session.messages({ path })` | Liste meldinger i en session | Returnerer `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Få meldingsdetaljer | Returnerer `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnererAssistantMessagemed AI svar. Understøtter `body.outputFormat` for [struktureret output](#struktureret-output) | +| `session.command({ path, body })` | Send kommando til session | Returnerer `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Kjør en shell-kommando | ReturnererAssistantMessage| +| `session.revert({ path, body })` | Tilbakestill en melding | ReturnererSession| +| `session.unrevert({ path })` | Gjenopret nulstillete meldinger | ReturnererSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` | --- diff --git a/packages/web/src/content/docs/da/themes.mdx b/packages/web/src/content/docs/da/themes.mdx index 533bef30eb0..d250e7f02f7 100644 --- a/packages/web/src/content/docs/da/themes.mdx +++ b/packages/web/src/content/docs/da/themes.mdx @@ -61,11 +61,11 @@ Systemtemaet er for brugere som: ## Brug et tema -Du kan velge et tema ved at hente frem temavalg med kommandoen `/theme`. Eller du kan spesifisere det i [config](/docs/config). +Du kan velge et tema ved at hente frem temavalg med kommandoen `/theme`. Eller du kan angive det i `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/da/tui.mdx b/packages/web/src/content/docs/da/tui.mdx index 21cdbe320e0..c1c0de0fd21 100644 --- a/packages/web/src/content/docs/da/tui.mdx +++ b/packages/web/src/content/docs/da/tui.mdx @@ -352,24 +352,34 @@ Nogle editorer kræver kommandolinjeargumenter for at køre i blokeringstilstand ## Konfigurer -Du kan tilpasse TUI-adfærden gennem OpenCode-konfigurationsfilen. +Du kan tilpasse TUI-adfærd gennem `tui.json` (eller `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Dette er adskilt fra `opencode.json`, som konfigurerer server-/kørselstidsadfærd. + ### Indstillinger -- `scroll_acceleration` - Aktiver rulleacceleration i macOS-stil for jævn, naturlig rulning. Når aktiveret, øger rullehastigheden med hurtige rullebevægelser og forbliver præcis for langsommere bevægelser. **Denne indstilling har forrang over `scroll_speed` og tilsidesætter den, når den er aktiveret.** -- `scroll_speed` - Styrer hvor hurtigt TUI ruller, når du bruger rullekommandoer (minimum: `1`). Standard er `3`. **Bemærk: Dette ignoreres hvis `scroll_acceleration.enabled` er sat til `true`.** +- `theme` - Indstiller dit brugergrænsefladetema. [Læs mere](/docs/themes). +- `keybinds` - Tilpasser tastaturgenveje. [Læs mere](/docs/keybinds). +- `scroll_acceleration.enabled` - Aktiver rulleacceleration i macOS-stil for jævn, naturlig rulning. Når aktiveret, øger rullehastigheden med hurtige rullebevægelser og forbliver præcis for langsommere bevægelser. **Denne indstilling har forrang over `scroll_speed` og tilsidesætter den, når den er aktiveret.** +- `scroll_speed` - Styrer hvor hurtigt TUI ruller, når du bruger rullekommandoer (minimum: `0.001`, understøtter decimalværdier). Standard er `3`. **Bemærk: Dette ignoreres hvis `scroll_acceleration.enabled` er sat til `true`.** +- `diff_style` - Styrer diff-gengivelse. `"auto"` tilpasser sig terminalbredde, `"stacked"` viser altid et enkeltkolonne-layout. + +Brug `OPENCODE_TUI_CONFIG` til at indlæse en brugerdefineret TUI-konfigurationssti. --- diff --git a/packages/web/src/content/docs/da/zen.mdx b/packages/web/src/content/docs/da/zen.mdx index 128583ad7ab..e99c626c575 100644 --- a/packages/web/src/content/docs/da/zen.mdx +++ b/packages/web/src/content/docs/da/zen.mdx @@ -64,6 +64,7 @@ Du kan også få adgang til vores modeller gennem følgende API-endpoints. | Model | Model ID | Endpoint | AI SDK Pakke | | ------------------- | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -73,22 +74,24 @@ Du kan også få adgang til vores modeller gennem følgende API-endpoints. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | -| Claude Sonnet 4.5 | claude-sonnett-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Sonnet 4 | claude-sonnett-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Gratis | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Gratis | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Gratis | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Gratis | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Tenker | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3-koder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -117,29 +120,34 @@ Vi støtter en pay-as-you-go-model. Nedenfor er priserne **per 1 million tokens* | Model | Input | Output | Cached Læs | Cached Skriv | | --------------------------------- | ------ | ------ | ---------- | ------------ | | Stor sylteagurk | Gratis | Gratis | Gratis | - | -| MiniMax M2.1 Gratis | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 Gratis | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 | $0,30 | $1,20 | $0,06 | - | | MiniMax M2.1 | $0,30 | $1,20 | $0,10 | - | -| GLM 4.7 Gratis | Gratis | Gratis | Gratis | - | +| GLM 5 | $1,00 | $3,20 | $0,20 | - | | GLM 4.7 | $0,60 | $2,20 | $0,10 | - | | GLM 4.6 | $0,60 | $2,20 | $0,10 | - | -| Kimi K2.5 Gratis | Gratis | Gratis | Gratis | - | | Kimi K2.5 | $0,60 | $3,00 | $0,08 | - | | Kimi K2 Tenker | $0,40 | $2,50 | - | - | | Kimi K2 | $0,40 | $2,50 | - | - | | Qwen3-koder 480B | $0,45 | $1,50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5,00 | $25,00 | $0,50 | $6,25 | +| Claude Opus 4.6 (> 200K tokens) | $10,00 | $37,50 | $1,00 | $12,50 | +| Claude Opus 4.5 | $5,00 | $25,00 | $0,50 | $6,25 | +| Claude Opus 4.1 | $15,00 | $75,00 | $1,50 | $18,75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | | Claude Sonnet 4.5 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Sonnet 4 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | | Claude Sonnet 4 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Haiku 4.5 | $1,00 | $5,00 | $0,10 | $1,25 | | Claude Haiku 3.5 | $0,80 | $4,00 | $0,08 | $1,00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5,00 | $25,00 | $0,50 | $6,25 | -| Claude Opus 4.6 (> 200K tokens) | $10,00 | $37,50 | $1,00 | $12,50 | -| Claude Opus 4.5 | $5,00 | $25,00 | $0,50 | $6,25 | -| Claude Opus 4.1 | $15,00 | $75,00 | $1,50 | $18,75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2,00 | $12,00 | $0,20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4,00 | $18,00 | $0,40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2,00 | $12,00 | $0,20 | - | | Gemini 3 Pro (> 200K tokens) | $4,00 | $18,00 | $0,40 | - | | Gemini 3 Flash | $0,50 | $3,00 | $0,05 | - | +| GPT 5.3 Codex | $1,75 | $14,00 | $0,175 | - | | GPT 5.2 | $1,75 | $14,00 | $0,175 | - | | GPT 5.2 Codex | $1,75 | $14,00 | $0,175 | - | | GPT 5.1 | $1,07 | $8,50 | $0,107 | - | @@ -158,9 +166,7 @@ Kreditkortgebyrer overføres til kostpris (4,4 % + $0,30 per transaktion); vi op De gratis modeller: -- GLM 4.7 Gratis er tilgængelig på OpenCode i en begrænset periode. Teamet bruger denne tid til at samle feedback og forbedre modellen. -- Kimi K2.5 Gratis er tilgængelig på OpenCode i en begrænset periode. Teamet bruger denne tid til at samle feedback og forbedre modellen. -- MiniMax M2.1 Gratis er tilgængelig på OpenCode i en begrænset periode. Teamet bruger denne tid til at samle feedback og forbedre modellen. +- MiniMax M2.5 Gratis er tilgængelig på OpenCode i en begrænset periode. Teamet bruger denne tid til at samle feedback og forbedre modellen. - Stor sylteagurk er en stealth-model som er gratis på OpenCode i en begrænset periode. Teamet bruger denne tid til at samle feedback og forbedre modellen. Kontakt os hvis du har spørgsmål. @@ -191,9 +197,7 @@ at opkræve dig mere end $20, hvis din saldo går under $5. Alle vores modeller er hostet i USA. Vores udbydere følger en nul-opbevaringspolitik og bruger ikke dine data til modeltræning, med følgende undtagelser: - Stor sylteagurk: I løbet af gratisperioden kan indsamlede data bruges til at forbedre modellen. -- GLM 4.7 Gratis: I løbet af gratisperioden kan indsamlede data bruges til at forbedre modellen. -- Kimi K2.5 Gratis: I løbet af gratisperioden kan indsamlede data bruges til at forbedre modellen. -- MiniMax M2.1 Gratis: I løbet af gratisperioden kan indsamlede data bruges til at forbedre modellen. +- MiniMax M2.5 Gratis: I løbet af gratisperioden kan indsamlede data bruges til at forbedre modellen. - OpenAI API'er: Anmodninger opbevares i 30 dage i overensstemmelse med [OpenAIs datapolitikker](https://platform.openai.com/docs/guides/your-data). - Anthropic API'er: Anmodninger opbevares i 30 dage i overensstemmelse med [Anthropics datapolitikker](https://docs.anthropic.com/en/docs/claude-code/data-usage). diff --git a/packages/web/src/content/docs/de/providers.mdx b/packages/web/src/content/docs/de/providers.mdx index d72ac5af3de..fa447594d62 100644 --- a/packages/web/src/content/docs/de/providers.mdx +++ b/packages/web/src/content/docs/de/providers.mdx @@ -84,6 +84,37 @@ Es funktioniert wie jeder andere Anbieter in OpenCode und ist völlig optional. --- +## OpenCode Go + +OpenCode Go ist ein kostenguenstiges Abonnement, das zuverlaessigen Zugriff auf beliebte Open-Coding-Modelle bietet, die vom OpenCode-Team getestet und verifiziert wurden, dass sie gut mit OpenCode funktionieren. + +1. Führen Sie den Befehl `/connect` in der TUI aus, waehlen Sie `OpenCode Go` und gehen Sie zu [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Melden Sie sich an, geben Sie Ihre Rechnungsdaten ein und kopieren Sie Ihren API-Schlüssel. + +3. Fügen Sie Ihren API-Schlüssel ein. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Führen Sie `/models` in der TUI aus, um die Liste der empfohlenen Modelle zu sehen. + + ```txt + /models + ``` + +Es funktioniert wie jeder andere Anbieter in OpenCode und ist völlig optional. + +--- + ## Verzeichnis Schauen wir uns einige der Anbieter im Detail an. Wenn Sie einen Anbieter hinzufügen möchten @@ -1480,6 +1511,39 @@ SAP AI Core bietet Zugriff auf 40+ Modelle von OpenAI, Anthropic, Google, Amazon --- +### STACKIT + +STACKIT AI Model Serving bietet eine voll verwaltete, souveraene Hosting-Umgebung fuer AI-Modelle, mit Fokus auf LLMs wie Llama, Mistral und Qwen, mit maximaler Datensouveraenitaet auf europaeischer Infrastruktur. + +1. Gehen Sie zum [STACKIT Portal](https://portal.stackit.cloud), navigieren Sie zu **AI Model Serving** und erstellen Sie ein Auth-Token fuer Ihr Projekt. + + :::tip + Sie benoetigen ein STACKIT-Kundenkonto, Benutzerkonto und Projekt, bevor Sie Auth-Tokens erstellen koennen. + ::: + +2. Führen Sie den Befehl `/connect` aus und suchen Sie nach **STACKIT**. + + ```txt + /connect + ``` + +3. Geben Sie Ihr STACKIT AI Model Serving Auth-Token ein. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Führen Sie den Befehl `/models` aus, um aus verfügbaren Modellen wie _Qwen3-VL 235B_ oder _Llama 3.3 70B_ auszuwählen. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Gehen Sie zum [OVHcloud panel](https://ovh.com/manager). Navigieren Sie zum Abschnitt `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` und klicken Sie auf der Registerkarte `API Keys` auf **Neuen API-Schlüssel erstellen**. diff --git a/packages/web/src/content/docs/de/sdk.mdx b/packages/web/src/content/docs/de/sdk.mdx index 21791db05de..22e70071d62 100644 --- a/packages/web/src/content/docs/de/sdk.mdx +++ b/packages/web/src/content/docs/de/sdk.mdx @@ -119,6 +119,78 @@ try { --- +## Structured Output + +Du kannst eine strukturierte JSON-Ausgabe vom Modell anfordern, indem du ein `format` mit einem JSON-Schema angibst. Das Modell verwendet dann ein `StructuredOutput`-Tool, um validiertes JSON zurueckzugeben, das deinem Schema entspricht. + +### Grundlegende Verwendung + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Recherchiere Anthropic und gib Firmeninfos zurueck" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Firmenname" }, + founded: { type: "number", description: "Gruendungsjahr" }, + products: { + type: "array", + items: { type: "string" }, + description: "Hauptprodukte", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Zugriff auf die strukturierte Ausgabe +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Ausgabeformate + +| Type | Description | +| ------------- | ----------------------------------------------------------- | +| `text` | Standard. Normale Textantwort (keine strukturierte Ausgabe) | +| `json_schema` | Gibt validiertes JSON zurueck, das dem Schema entspricht | + +### JSON-Schema-Format + +Bei Verwendung von `type: 'json_schema'` musst du Folgendes angeben: + +| Field | Type | Description | +| ------------ | --------------- | ------------------------------------------------------------- | +| `type` | `'json_schema'` | Erforderlich. Gibt den JSON-Schema-Modus an | +| `schema` | `object` | Erforderlich. JSON-Schema-Objekt, das die Struktur definiert | +| `retryCount` | `number` | Optional. Anzahl der Validierungswiederholungen (Standard: 2) | + +### Fehlerbehandlung + +Wenn das Modell nach allen Wiederholungen keine valide strukturierte Ausgabe liefert, enthaelt die Antwort einen `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Strukturierte Ausgabe fehlgeschlagen:", result.data.info.error.message) + console.error("Versuche:", result.data.info.error.retries) +} +``` + +### Best Practices + +1. **Klare Beschreibungen**: Gib in deinen Schema-Properties klare Beschreibungen an, damit das Modell versteht, welche Daten extrahiert werden sollen. +2. **`required` nutzen**: Definiere, welche Felder zwingend vorhanden sein muessen. +3. **Schemas einfach halten**: Komplexe verschachtelte Schemas sind fuer das Modell schwerer korrekt auszufuellen. +4. **`retryCount` anpassen**: Erhoehe den Wert bei komplexen Schemas, verringere ihn bei einfachen. + +--- + ## APIs Das SDK stellt alle Server-APIs ueber einen typsicheren Client bereit. @@ -127,9 +199,9 @@ Das SDK stellt alle Server-APIs ueber einen typsicheren Client bereit. ### Global -| Method | Description | Response | -| ----------------- | ------------------------------- | ------------------------------------ | -| `global.health()` | Check server health and version | `{ healthy: true, version: string }` | +| Method | Description | Response | +| ----------------- | -------------------------------- | ------------------------------------ | +| `global.health()` | Prueft Server-Status und Version | `{ healthy: true, version: string }` | --- @@ -144,10 +216,10 @@ console.log(health.data.version) ### App -| Method | Description | Response | -| -------------- | ------------------------- | ------------------------------------------- | -| `app.log()` | Write a log entry | `boolean` | -| `app.agents()` | List all available agents |Agent[]| +| Method | Description | Response | +| -------------- | -------------------------------- | ------------------------------------------- | +| `app.log()` | Schreibt einen Log-Eintrag | `boolean` | +| `app.agents()` | Listet alle verfuegbaren Agenten |Agent[]| --- @@ -171,10 +243,10 @@ const agents = await client.app.agents() ### Project -| Method | Description | Response | -| ------------------- | ------------------- | --------------------------------------------- | -| `project.list()` | List all projects |Project[]| -| `project.current()` | Get current project |Project| +| Method | Description | Response | +| ------------------- | ---------------------------- | --------------------------------------------- | +| `project.list()` | Listet alle Projekte |Project[]| +| `project.current()` | Ruft das aktuelle Projekt ab |Project| --- @@ -192,9 +264,9 @@ const currentProject = await client.project.current() ### Path -| Method | Description | Response | -| ------------ | ---------------- | ---------------------------------------- | -| `path.get()` | Get current path |Path| +| Method | Description | Response | +| ------------ | -------------------------- | ---------------------------------------- | +| `path.get()` | Ruft den aktuellen Pfad ab |Path| --- @@ -209,10 +281,10 @@ const pathInfo = await client.path.get() ### Config -| Method | Description | Response | -| -------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `config.get()` | Get config info |Config| -| `config.providers()` | List providers and default models | `{ providers: `Provider[]`, default: { [key: string]: string } }` | +| Method | Description | Response | +| -------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------- | +| `config.get()` | Ruft Konfigurationsinfos ab |Config| +| `config.providers()` | Listet Provider und Standard-Modelle | `{ providers: `Provider[]`, default: { [key: string]: string } }` | --- @@ -228,27 +300,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sessions -| Method | Description | Notes | -| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | List sessions | ReturnsSession[]| -| `session.get({ path })` | Get session | ReturnsSession| -| `session.children({ path })` | List child sessions | ReturnsSession[]| -| `session.create({ body })` | Create session | ReturnsSession| -| `session.delete({ path })` | Delete session | Returns `boolean` | -| `session.update({ path, body })` | Update session properties | ReturnsSession| -| `session.init({ path, body })` | Analyze app and create `AGENTS.md` | Returns `boolean` | -| `session.abort({ path })` | Abort a running session | Returns `boolean` | -| `session.share({ path })` | Share session | ReturnsSession| -| `session.unshare({ path })` | Unshare session | ReturnsSession| -| `session.summarize({ path, body })` | Summarize session | Returns `boolean` | -| `session.messages({ path })` | List messages in a session | Returns `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returnsAssistantMessagewith AI response | -| `session.command({ path, body })` | Send command to session | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Run a shell command | ReturnsAssistantMessage| -| `session.revert({ path, body })` | Revert a message | ReturnsSession| -| `session.unrevert({ path })` | Restore reverted messages | ReturnsSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` | +| Method | Description | Notes | +| ---------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Listet Sessions | GibtSession[]zurueck | +| `session.get({ path })` | Ruft Session ab | GibtSessionzurueck | +| `session.children({ path })` | Listet Kind-Sessions | GibtSession[]zurueck | +| `session.create({ body })` | Erstellt Session | GibtSessionzurueck | +| `session.delete({ path })` | Loescht Session | Gibt `boolean` zurueck | +| `session.update({ path, body })` | Aktualisiert Session-Eigenschaften | GibtSessionzurueck | +| `session.init({ path, body })` | Analysiert App und erstellt `AGENTS.md` | Gibt `boolean` zurueck | +| `session.abort({ path })` | Bricht eine laufende Session ab | Gibt `boolean` zurueck | +| `session.share({ path })` | Teilt Session | GibtSessionzurueck | +| `session.unshare({ path })` | Hebt Teilen der Session auf | GibtSessionzurueck | +| `session.summarize({ path, body })` | Fasst Session zusammen | Gibt `boolean` zurueck | +| `session.messages({ path })` | Listet Nachrichten einer Session | Gibt `{ info: `Message`, parts: `Part[]`}[]` zurueck | +| `session.message({ path })` | Ruft Nachrichtendetails ab | Gibt `{ info: `Message`, parts: `Part[]`}` zurueck | +| `session.prompt({ path, body })` | Sendet Prompt-Nachricht | `body.noReply: true` gibt UserMessage (nur Kontext) zurueck. Standard gibtAssistantMessagemit AI-Antwort zurueck. Unterstuetzt `body.outputFormat` fuer [strukturierte Ausgabe](#structured-output) | +| `session.command({ path, body })` | Sendet Befehl an Session | Gibt `{ info: `AssistantMessage`, parts: `Part[]`}` zurueck | +| `session.shell({ path, body })` | Fuehrt Shell-Befehl aus | GibtAssistantMessagezurueck | +| `session.revert({ path, body })` | Setzt Nachricht zurueck | GibtSessionzurueck | +| `session.unrevert({ path })` | Stellt zurueckgesetzte Nachrichten wieder her | GibtSessionzurueck | +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Antwortet auf eine Berechtigungsanfrage | Gibt `boolean` zurueck | --- @@ -285,19 +357,19 @@ await client.session.prompt({ ### Files -| Method | Description | Response | -| ------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------- | -| `find.text({ query })` | Search for text in files | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | -| `find.files({ query })` | Find files and directories by name | `string[]` (paths) | -| `find.symbols({ query })` | Find workspace symbols |Symbol[]| -| `file.read({ query })` | Read a file | `{ type: "raw" \| "patch", content: string }` | -| `file.status({ query? })` | Get status for tracked files |File[]| +| Method | Description | Response | +| ------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `find.text({ query })` | Sucht Text in Dateien | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | +| `find.files({ query })` | Findet Dateien und Verzeichnisse nach Namen | `string[]` (paths) | +| `find.symbols({ query })` | Findet Workspace-Symbole |Symbol[]| +| `file.read({ query })` | Liest eine Datei | `{ type: "raw" \| "patch", content: string }` | +| `file.status({ query? })` | Ruft Status fuer getrackte Dateien ab |File[]| -`find.files` supports a few optional query fields: +`find.files` unterstuetzt einige optionale Query-Felder: -- `type`: `"file"` or `"directory"` -- `directory`: override the project root for the search -- `limit`: max results (1–200) +- `type`: `"file"` oder `"directory"` +- `directory`: Ueberschreibt das Projekt-Root fuer die Suche +- `limit`: Maximale Ergebnisse (1–200) --- @@ -326,17 +398,17 @@ const content = await client.file.read({ ### TUI -| Method | Description | Response | -| ------------------------------ | ------------------------- | --------- | -| `tui.appendPrompt({ body })` | Append text to the prompt | `boolean` | -| `tui.openHelp()` | Open the help dialog | `boolean` | -| `tui.openSessions()` | Open the session selector | `boolean` | -| `tui.openThemes()` | Open the theme selector | `boolean` | -| `tui.openModels()` | Open the model selector | `boolean` | -| `tui.submitPrompt()` | Submit the current prompt | `boolean` | -| `tui.clearPrompt()` | Clear the prompt | `boolean` | -| `tui.executeCommand({ body })` | Execute a command | `boolean` | -| `tui.showToast({ body })` | Show toast notification | `boolean` | +| Method | Description | Response | +| ------------------------------ | ------------------------------ | --------- | +| `tui.appendPrompt({ body })` | Haengt Text an den Prompt an | `boolean` | +| `tui.openHelp()` | Oeffnet den Hilfedialog | `boolean` | +| `tui.openSessions()` | Oeffnet die Session-Auswahl | `boolean` | +| `tui.openThemes()` | Oeffnet die Theme-Auswahl | `boolean` | +| `tui.openModels()` | Oeffnet die Modell-Auswahl | `boolean` | +| `tui.submitPrompt()` | Sendet den aktuellen Prompt ab | `boolean` | +| `tui.clearPrompt()` | Leert den Prompt | `boolean` | +| `tui.executeCommand({ body })` | Fuehrt einen Befehl aus | `boolean` | +| `tui.showToast({ body })` | Zeigt Toast-Benachrichtigung | `boolean` | --- @@ -357,9 +429,9 @@ await client.tui.showToast({ ### Auth -| Method | Description | Response | -| ------------------- | ------------------------------ | --------- | -| `auth.set({ ... })` | Set authentication credentials | `boolean` | +| Method | Description | Response | +| ------------------- | ----------------------------- | --------- | +| `auth.set({ ... })` | Setzt Authentifizierungsdaten | `boolean` | --- @@ -378,7 +450,7 @@ await client.auth.set({ | Method | Description | Response | | ------------------- | ------------------------- | ------------------------- | -| `event.subscribe()` | Server-sent events stream | Server-sent events stream | +| `event.subscribe()` | Server-Sent Events Stream | Server-sent events stream | --- diff --git a/packages/web/src/content/docs/de/server.mdx b/packages/web/src/content/docs/de/server.mdx index dd4a565faff..64322bda856 100644 --- a/packages/web/src/content/docs/de/server.mdx +++ b/packages/web/src/content/docs/de/server.mdx @@ -93,28 +93,28 @@ Der opencode-Server stellt folgende APIs bereit. ### Global -| Method | Path | Description | Response | -| ------ | ---------------- | ------------------------------ | ------------------------------------ | -| `GET` | `/global/health` | Get server health and version | `{ healthy: true, version: string }` | -| `GET` | `/global/event` | Get global events (SSE stream) | Event stream | +| Method | Path | Description | Response | +| ------ | ---------------- | ----------------------------------- | ------------------------------------ | +| `GET` | `/global/health` | Ruft Server-Status und Version ab | `{ healthy: true, version: string }` | +| `GET` | `/global/event` | Ruft globale Events ab (SSE-Stream) | Event stream | --- ### Project -| Method | Path | Description | Response | -| ------ | ------------------ | ----------------------- | --------------------------------------------- | -| `GET` | `/project` | List all projects |Project[]| -| `GET` | `/project/current` | Get the current project |Project| +| Method | Path | Description | Response | +| ------ | ------------------ | ---------------------------- | --------------------------------------------- | +| `GET` | `/project` | Listet alle Projekte |Project[]| +| `GET` | `/project/current` | Ruft das aktuelle Projekt ab |Project| --- ### Path & VCS -| Method | Path | Description | Response | -| ------ | ------- | ------------------------------------ | ------------------------------------------- | -| `GET` | `/path` | Get the current path |Path| -| `GET` | `/vcs` | Get VCS info for the current project |VcsInfo| +| Method | Path | Description | Response | +| ------ | ------- | ------------------------------------------- | ------------------------------------------- | +| `GET` | `/path` | Ruft den aktuellen Pfad ab |Path| +| `GET` | `/vcs` | Ruft VCS-Infos fuer das aktuelle Projekt ab |VcsInfo| --- @@ -122,87 +122,87 @@ Der opencode-Server stellt folgende APIs bereit. | Method | Path | Description | Response | | ------ | ------------------- | ---------------------------- | --------- | -| `POST` | `/instance/dispose` | Dispose the current instance | `boolean` | +| `POST` | `/instance/dispose` | Beendet die aktuelle Instanz | `boolean` | --- ### Konfiguration -| Method | Path | Description | Response | -| ------- | ------------------- | --------------------------------- | ---------------------------------------------------------------------------------------- | -| `GET` | `/config` | Get config info |Config| -| `PATCH` | `/config` | Update config |Config| -| `GET` | `/config/providers` | List providers and default models | `{ providers: `Provider[]`, default: { [key: string]: string } }` | +| Method | Path | Description | Response | +| ------- | ------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------- | +| `GET` | `/config` | Ruft Konfigurationsinfos ab |Config| +| `PATCH` | `/config` | Aktualisiert Konfiguration |Config| +| `GET` | `/config/providers` | Listet Provider und Standard-Modelle | `{ providers: `Provider[]`, default: { [key: string]: string } }` | --- ### Anbieter -| Method | Path | Description | Response | -| ------ | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- | -| `GET` | `/provider` | List all providers | `{ all: `Provider[]`, default: {...}, connected: string[] }` | -| `GET` | `/provider/auth` | Get provider authentication methods | `{ [providerID: string]: `ProviderAuthMethod[]` }` | -| `POST` | `/provider/{id}/oauth/authorize` | Authorize a provider using OAuth |ProviderAuthAuthorization| -| `POST` | `/provider/{id}/oauth/callback` | Handle OAuth callback for a provider | `boolean` | +| Method | Path | Description | Response | +| ------ | -------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------- | +| `GET` | `/provider` | Listet alle Provider | `{ all: `Provider[]`, default: {...}, connected: string[] }` | +| `GET` | `/provider/auth` | Ruft Authentifizierungsmethoden der Provider ab | `{ [providerID: string]: `ProviderAuthMethod[]` }` | +| `POST` | `/provider/{id}/oauth/authorize` | Autorisiert einen Provider per OAuth |ProviderAuthAuthorization| +| `POST` | `/provider/{id}/oauth/callback` | Behandelt OAuth-Callback fuer einen Provider | `boolean` | --- ### Sitzungen -| Method | Path | Description | Notes | -| -------- | ---------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- | -| `GET` | `/session` | List all sessions | ReturnsSession[]| -| `POST` | `/session` | Create a new session | body: `{ parentID?, title? }`, returnsSession| -| `GET` | `/session/status` | Get session status for all sessions | Returns `{ [sessionID: string]: `SessionStatus` }` | -| `GET` | `/session/:id` | Get session details | ReturnsSession| -| `DELETE` | `/session/:id` | Delete a session and all its data | Returns `boolean` | -| `PATCH` | `/session/:id` | Update session properties | body: `{ title? }`, returnsSession| -| `GET` | `/session/:id/children` | Get a session's child sessions | ReturnsSession[]| -| `GET` | `/session/:id/todo` | Get the todo list for a session | ReturnsTodo[]| -| `POST` | `/session/:id/init` | Analyze app and create `AGENTS.md` | body: `{ messageID, providerID, modelID }`, returns `boolean` | -| `POST` | `/session/:id/fork` | Fork an existing session at a message | body: `{ messageID? }`, returnsSession| -| `POST` | `/session/:id/abort` | Abort a running session | Returns `boolean` | -| `POST` | `/session/:id/share` | Share a session | ReturnsSession| -| `DELETE` | `/session/:id/share` | Unshare a session | ReturnsSession| -| `GET` | `/session/:id/diff` | Get the diff for this session | query: `messageID?`, returnsFileDiff[]| -| `POST` | `/session/:id/summarize` | Summarize the session | body: `{ providerID, modelID }`, returns `boolean` | -| `POST` | `/session/:id/revert` | Revert a message | body: `{ messageID, partID? }`, returns `boolean` | -| `POST` | `/session/:id/unrevert` | Restore all reverted messages | Returns `boolean` | -| `POST` | `/session/:id/permissions/:permissionID` | Respond to a permission request | body: `{ response, remember? }`, returns `boolean` | +| Method | Path | Description | Notes | +| -------- | ---------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `GET` | `/session` | Listet alle Sitzungen | GibtSession[]zurueck | +| `POST` | `/session` | Erstellt eine neue Sitzung | body: `{ parentID?, title? }`, returnsSession| +| `GET` | `/session/status` | Ruft Status aller Sitzungen ab | Gibt `{ [sessionID: string]: `SessionStatus` }` zurueck | +| `GET` | `/session/:id` | Ruft Sitzungsdetails ab | GibtSessionzurueck | +| `DELETE` | `/session/:id` | Loescht eine Sitzung und alle Daten | Gibt `boolean` zurueck | +| `PATCH` | `/session/:id` | Aktualisiert Sitzungseigenschaften | body: `{ title? }`, returnsSession| +| `GET` | `/session/:id/children` | Ruft Kind-Sitzungen einer Sitzung ab | GibtSession[]zurueck | +| `GET` | `/session/:id/todo` | Ruft die Todo-Liste einer Sitzung ab | GibtTodo[]zurueck | +| `POST` | `/session/:id/init` | Analysiert App und erstellt `AGENTS.md` | body: `{ messageID, providerID, modelID }`, returns `boolean` | +| `POST` | `/session/:id/fork` | Forkt eine bestehende Sitzung an einer Nachricht | body: `{ messageID? }`, returnsSession| +| `POST` | `/session/:id/abort` | Bricht eine laufende Sitzung ab | Gibt `boolean` zurueck | +| `POST` | `/session/:id/share` | Teilt eine Sitzung | GibtSessionzurueck | +| `DELETE` | `/session/:id/share` | Hebt Teilen einer Sitzung auf | GibtSessionzurueck | +| `GET` | `/session/:id/diff` | Ruft den Diff fuer diese Sitzung ab | query: `messageID?`, returnsFileDiff[]| +| `POST` | `/session/:id/summarize` | Fasst die Sitzung zusammen | body: `{ providerID, modelID }`, returns `boolean` | +| `POST` | `/session/:id/revert` | Setzt eine Nachricht zurueck | body: `{ messageID, partID? }`, returns `boolean` | +| `POST` | `/session/:id/unrevert` | Stellt alle zurueckgesetzten Nachrichten wieder her | Gibt `boolean` zurueck | +| `POST` | `/session/:id/permissions/:permissionID` | Antwortet auf eine Berechtigungsanfrage | body: `{ response, remember? }`, returns `boolean` | --- ### Nachrichten -| Method | Path | Description | Notes | -| ------ | --------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `GET` | `/session/:id/message` | List messages in a session | query: `limit?`, returns `{ info: `Message`, parts: `Part[]`}[]` | -| `POST` | `/session/:id/message` | Send a message and wait for response | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `Message`, parts: `Part[]`}` | -| `GET` | `/session/:id/message/:messageID` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` | -| `POST` | `/session/:id/prompt_async` | Send a message asynchronously (no wait) | body: same as `/session/:id/message`, returns `204 No Content` | -| `POST` | `/session/:id/command` | Execute a slash command | body: `{ messageID?, agent?, model?, command, arguments }`, returns `{ info: `Message`, parts: `Part[]`}` | -| `POST` | `/session/:id/shell` | Run a shell command | body: `{ agent, model?, command }`, returns `{ info: `Message`, parts: `Part[]`}` | +| Method | Path | Description | Notes | +| ------ | --------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `GET` | `/session/:id/message` | Listet Nachrichten in einer Sitzung | query: `limit?`, returns `{ info: `Message`, parts: `Part[]`}[]` | +| `POST` | `/session/:id/message` | Sendet eine Nachricht und wartet auf Antwort | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `Message`, parts: `Part[]`}` | +| `GET` | `/session/:id/message/:messageID` | Ruft Nachrichtendetails ab | Returns `{ info: `Message`, parts: `Part[]`}` | +| `POST` | `/session/:id/prompt_async` | Sendet eine Nachricht asynchron (ohne Warten) | body: same as `/session/:id/message`, returns `204 No Content` | +| `POST` | `/session/:id/command` | Fuehrt einen Slash-Befehl aus | body: `{ messageID?, agent?, model?, command, arguments }`, returns `{ info: `Message`, parts: `Part[]`}` | +| `POST` | `/session/:id/shell` | Fuehrt einen Shell-Befehl aus | body: `{ agent, model?, command }`, returns `{ info: `Message`, parts: `Part[]`}` | --- ### Befehle -| Method | Path | Description | Response | -| ------ | ---------- | ----------------- | --------------------------------------------- | -| `GET` | `/command` | List all commands |Command[]| +| Method | Path | Description | Response | +| ------ | ---------- | ------------------- | --------------------------------------------- | +| `GET` | `/command` | Listet alle Befehle |Command[]| --- ### Dateien -| Method | Path | Description | Response | -| ------ | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------- | -| `GET` | `/find?pattern=` | Search for text in files | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | -| `GET` | `/find/file?query= ` | Find files and directories by name | `string[]` (paths) | -| `GET` | `/find/symbol?query=` | Find workspace symbols |Symbol[]| -| `GET` | `/file?path=` | List files and directories | FileNode[]| -| `GET` | `/file/content?path=` | Read a file |
FileContent| -| `GET` | `/file/status` | Get status for tracked files |File[]| +| Method | Path | Description | Response | +| ------ | ------------------------ | ------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `GET` | `/find?pattern=` | Sucht Text in Dateien | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | +| `GET` | `/find/file?query= ` | Findet Dateien und Verzeichnisse nach Namen | `string[]` (paths) | +| `GET` | `/find/symbol?query=` | Findet Workspace-Symbole |Symbol[]| +| `GET` | `/file?path=` | Listet Dateien und Verzeichnisse | FileNode[]| +| `GET` | `/file/content?path=` | Liest eine Datei |
FileContent| +| `GET` | `/file/status` | Ruft Status fuer getrackte Dateien ab |File[]| #### `/find/file` Abfrageparameter @@ -216,71 +216,71 @@ Der opencode-Server stellt folgende APIs bereit. ### Werkzeuge (Experimentell) -| Method | Path | Description | Response | -| ------ | ------------------------------------------- | ---------------------------------------- | -------------------------------------------- | -| `GET` | `/experimental/tool/ids` | List all tool IDs |ToolIDs| -| `GET` | `/experimental/tool?provider=&model=
` | List tools with JSON schemas for a model | ToolList| +| Method | Path | Description | Response | +| ------ | ------------------------------------------- | --------------------------------------------- | -------------------------------------------- | +| `GET` | `/experimental/tool/ids` | Listet alle Tool-IDs |ToolIDs| +| `GET` | `/experimental/tool?provider=&model=
` | Listet Tools mit JSON-Schemas fuer ein Modell | ToolList| --- ### LSP, Formatierer & MCP -| Method | Path | Description | Response | -| ------ | ------------ | -------------------------- | -------------------------------------------------------- | -| `GET` | `/lsp` | Get LSP server status |LSPStatus[]| -| `GET` | `/formatter` | Get formatter status |FormatterStatus[]| -| `GET` | `/mcp` | Get MCP server status | `{ [name: string]: `MCPStatus` }` | -| `POST` | `/mcp` | Add MCP server dynamically | body: `{ name, config }`, returns MCP status object | +| Method | Path | Description | Response | +| ------ | ------------ | -------------------------------- | -------------------------------------------------------- | +| `GET` | `/lsp` | Ruft LSP-Server-Status ab |LSPStatus[]| +| `GET` | `/formatter` | Ruft Formatter-Status ab |FormatterStatus[]| +| `GET` | `/mcp` | Ruft MCP-Server-Status ab | `{ [name: string]: `MCPStatus` }` | +| `POST` | `/mcp` | Fuegt MCP-Server dynamisch hinzu | body: `{ name, config }`, returns MCP status object | --- ### Agenten -| Method | Path | Description | Response | -| ------ | -------- | ------------------------- | ------------------------------------------- | -| `GET` | `/agent` | List all available agents |Agent[]| +| Method | Path | Description | Response | +| ------ | -------- | -------------------------------- | ------------------------------------------- | +| `GET` | `/agent` | Listet alle verfuegbaren Agenten |Agent[]| --- ### Logging -| Method | Path | Description | Response | -| ------ | ------ | ------------------------------------------------------------ | --------- | -| `POST` | `/log` | Write log entry. Body: `{ service, level, message, extra? }` | `boolean` | +| Method | Path | Description | Response | +| ------ | ------ | ----------------------------------------------------------------- | --------- | +| `POST` | `/log` | Schreibt Log-Eintrag. Body: `{ service, level, message, extra? }` | `boolean` | --- ### TUI -| Method | Path | Description | Response | -| ------ | ----------------------- | ------------------------------------------- | ---------------------- | -| `POST` | `/tui/append-prompt` | Append text to the prompt | `boolean` | -| `POST` | `/tui/open-help` | Open the help dialog | `boolean` | -| `POST` | `/tui/open-sessions` | Open the session selector | `boolean` | -| `POST` | `/tui/open-themes` | Open the theme selector | `boolean` | -| `POST` | `/tui/open-models` | Open the model selector | `boolean` | -| `POST` | `/tui/submit-prompt` | Submit the current prompt | `boolean` | -| `POST` | `/tui/clear-prompt` | Clear the prompt | `boolean` | -| `POST` | `/tui/execute-command` | Execute a command (`{ command }`) | `boolean` | -| `POST` | `/tui/show-toast` | Show toast (`{ title?, message, variant }`) | `boolean` | -| `GET` | `/tui/control/next` | Wait for the next control request | Control request object | -| `POST` | `/tui/control/response` | Respond to a control request (`{ body }`) | `boolean` | +| Method | Path | Description | Response | +| ------ | ----------------------- | ----------------------------------------------- | ---------------------- | +| `POST` | `/tui/append-prompt` | Haengt Text an den Prompt an | `boolean` | +| `POST` | `/tui/open-help` | Oeffnet den Hilfedialog | `boolean` | +| `POST` | `/tui/open-sessions` | Oeffnet die Session-Auswahl | `boolean` | +| `POST` | `/tui/open-themes` | Oeffnet die Theme-Auswahl | `boolean` | +| `POST` | `/tui/open-models` | Oeffnet die Modell-Auswahl | `boolean` | +| `POST` | `/tui/submit-prompt` | Sendet den aktuellen Prompt ab | `boolean` | +| `POST` | `/tui/clear-prompt` | Leert den Prompt | `boolean` | +| `POST` | `/tui/execute-command` | Fuehrt einen Befehl aus (`{ command }`) | `boolean` | +| `POST` | `/tui/show-toast` | Zeigt Toast (`{ title?, message, variant }`) | `boolean` | +| `GET` | `/tui/control/next` | Wartet auf die naechste Kontrollanfrage | Control request object | +| `POST` | `/tui/control/response` | Antwortet auf eine Kontrollanfrage (`{ body }`) | `boolean` | --- ### Authentifizierung -| Method | Path | Description | Response | -| ------ | ----------- | --------------------------------------------------------------- | --------- | -| `PUT` | `/auth/:id` | Set authentication credentials. Body must match provider schema | `boolean` | +| Method | Path | Description | Response | +| ------ | ----------- | ------------------------------------------------------------------------ | --------- | +| `PUT` | `/auth/:id` | Setzt Authentifizierungsdaten. Body muss dem Provider-Schema entsprechen | `boolean` | --- ### Events -| Method | Path | Description | Response | -| ------ | -------- | ----------------------------------------------------------------------------- | ------------------------- | -| `GET` | `/event` | Server-sent events stream. First event is `server.connected`, then bus events | Server-sent events stream | +| Method | Path | Description | Response | +| ------ | -------- | ------------------------------------------------------------------------------- | ------------------------- | +| `GET` | `/event` | Server-Sent Events Stream. Erstes Event ist `server.connected`, dann Bus-Events | Server-sent events stream | --- @@ -288,4 +288,4 @@ Der opencode-Server stellt folgende APIs bereit. | Method | Path | Description | Response | | ------ | ------ | ------------------------- | --------------------------- | -| `GET` | `/doc` | OpenAPI 3.1 specification | HTML page with OpenAPI spec | +| `GET` | `/doc` | OpenAPI 3.1 Spezifikation | HTML page with OpenAPI spec | diff --git a/packages/web/src/content/docs/de/skills.mdx b/packages/web/src/content/docs/de/skills.mdx index 63dbb126bbe..72fba3eb099 100644 --- a/packages/web/src/content/docs/de/skills.mdx +++ b/packages/web/src/content/docs/de/skills.mdx @@ -36,11 +36,11 @@ Globale Definitionen kommen zusaetzlich aus `~/.config/opencode/skills/*/SKILL.m Jede `SKILL.md` muss mit YAML-Frontmatter beginnen. Nur diese Felder werden ausgewertet: -- `name` (required) -- `description` (required) +- `name` (erforderlich) +- `description` (erforderlich) - `license` (optional) - `compatibility` (optional) -- `metadata` (optional, string-to-string map) +- `metadata` (optional, String-zu-String-Map) Unbekannte Frontmatter-Felder werden ignoriert. diff --git a/packages/web/src/content/docs/de/themes.mdx b/packages/web/src/content/docs/de/themes.mdx index b97816801d6..f3671220f96 100644 --- a/packages/web/src/content/docs/de/themes.mdx +++ b/packages/web/src/content/docs/de/themes.mdx @@ -83,29 +83,29 @@ Damit lassen sich Themes einfach erstellen und anpassen. ### Hierarchie -Themes are loaded from multiple directories in the following order where later directories override earlier ones: +Themes werden aus mehreren Verzeichnissen in folgender Reihenfolge geladen, wobei spaetere Verzeichnisse fruehere ueberschreiben: -1. **Built-in themes** - These are embedded in the binary -2. **User config directory** - Defined in `~/.config/opencode/themes/*.json` or `$XDG_CONFIG_HOME/opencode/themes/*.json` -3. **Project root directory** - Defined in the `/.opencode/themes/*.json` -4. **Current working directory** - Defined in `./.opencode/themes/*.json` +1. **Eingebaute Themes** - Diese sind im Binary eingebettet +2. **Benutzer-Config-Verzeichnis** - Definiert in `~/.config/opencode/themes/*.json` oder `$XDG_CONFIG_HOME/opencode/themes/*.json` +3. **Projekt-Root-Verzeichnis** - Definiert in ` /.opencode/themes/*.json` +4. **Aktuelles Arbeitsverzeichnis** - Definiert in `./.opencode/themes/*.json` -If multiple directories contain a theme with the same name, the theme from the directory with higher priority will be used. +Wenn mehrere Verzeichnisse ein Theme mit demselben Namen enthalten, wird das Theme aus dem Verzeichnis mit der hoeheren Prioritaet verwendet. --- ### Theme erstellen -To create a custom theme, create a JSON file in one of the theme directories. +Um ein eigenes Theme zu erstellen, lege eine JSON-Datei in einem der Theme-Verzeichnisse an. -For user-wide themes: +Fuer benutzerweite Themes: ```bash no-frame mkdir -p ~/.config/opencode/themes vim ~/.config/opencode/themes/my-theme.json ``` -And for project-specific themes. +Und fuer projektspezifische Themes: ```bash no-frame mkdir -p .opencode/themes @@ -116,34 +116,34 @@ vim .opencode/themes/my-theme.json ### JSON-Format -Themes use a flexible JSON format with support for: +Themes nutzen ein flexibles JSON-Format mit Unterstuetzung fuer: -- **Hex colors**: `"#ffffff"` -- **ANSI colors**: `3` (0-255) -- **Color references**: `"primary"` or custom definitions -- **Dark/light variants**: `{"dark": "#000", "light": "#fff"}` -- **No color**: `"none"` - Uses the terminal's default color or transparent +- **Hex-Farben**: `"#ffffff"` +- **ANSI-Farben**: `3` (0-255) +- **Farbreferenzen**: `"primary"` oder eigene Definitionen +- **Dunkel/Hell-Varianten**: `{"dark": "#000", "light": "#fff"}` +- **Keine Farbe**: `"none"` - Nutzt die Standardfarbe des Terminals oder transparent --- ### Farbdefinitionen -The `defs` section is optional and it allows you to define reusable colors that can be referenced in the theme. +Der `defs`-Abschnitt ist optional und erlaubt es dir, wiederverwendbare Farben zu definieren, die im Theme referenziert werden koennen. --- ### Terminal-Standardwerte -The special value `"none"` can be used for any color to inherit the terminal's default color. This is particularly useful for creating themes that blend seamlessly with your terminal's color scheme: +Der spezielle Wert `"none"` kann fuer jede Farbe verwendet werden, um die Standardfarbe des Terminals zu erben. Das ist besonders nuetzlich, um Themes zu erstellen, die nahtlos mit deinem Terminal-Farbschema verschmelzen: -- `"text": "none"` - Uses terminal's default foreground color -- `"background": "none"` - Uses terminal's default background color +- `"text": "none"` - Nutzt die Standard-Vordergrundfarbe des Terminals +- `"background": "none"` - Nutzt die Standard-Hintergrundfarbe des Terminals --- ### Beispiel -Here's an example of a custom theme: +Hier ist ein Beispiel fuer ein eigenes Theme: ```json title="my-theme.json" { diff --git a/packages/web/src/content/docs/de/tools.mdx b/packages/web/src/content/docs/de/tools.mdx index b7a41d87bb7..0038f251847 100644 --- a/packages/web/src/content/docs/de/tools.mdx +++ b/packages/web/src/content/docs/de/tools.mdx @@ -109,7 +109,7 @@ Das Tool `write` wird ueber die Berechtigung `edit` gesteuert. ### read -Read file contents from your codebase. +Liest Dateiinhalte aus deiner Codebasis. ```json title="opencode.json" {4} { @@ -120,13 +120,13 @@ Read file contents from your codebase. } ``` -This tool reads files and returns their contents. It supports reading specific line ranges for large files. +Dieses Tool liest Dateien und gibt deren Inhalt zurueck. Es unterstuetzt das Lesen spezifischer Zeilenbereiche bei grossen Dateien. --- ### grep -Search file contents using regular expressions. +Durchsucht Dateiinhalte mit regulaeren Ausdruecken. ```json title="opencode.json" {4} { @@ -137,13 +137,13 @@ Search file contents using regular expressions. } ``` -Fast content search across your codebase. Supports full regex syntax and file pattern filtering. +Schnelle Inhaltssuche in deiner Codebasis. Unterstuetzt volle Regex-Syntax und Filterung nach Dateimustern. --- ### glob -Find files by pattern matching. +Findet Dateien per Musterabgleich. ```json title="opencode.json" {4} { @@ -154,13 +154,13 @@ Find files by pattern matching. } ``` -Search for files using glob patterns like `**/*.js` or `src/**/*.ts`. Returns matching file paths sorted by modification time. +Sucht nach Dateien mit Glob-Mustern wie `**/*.js` oder `src/**/*.ts`. Gibt passende Dateipfade sortiert nach Aenderungsdatum zurueck. --- ### list -List files and directories in a given path. +Listet Dateien und Verzeichnisse in einem Pfad auf. ```json title="opencode.json" {4} { @@ -171,16 +171,16 @@ List files and directories in a given path. } ``` -This tool lists directory contents. It accepts glob patterns to filter results. +Dieses Tool listet Verzeichnisinhalte auf. Es akzeptiert Glob-Muster zum Filtern der Ergebnisse. --- -### lsp (experimental) +### lsp (experimentell) -Interact with your configured LSP servers to get code intelligence features like definitions, references, hover info, and call hierarchy. +Interagiere mit deinen konfigurierten LSP-Servern fuer Code-Intelligence-Features wie Definitionen, Referenzen, Hover-Infos und Call-Hierarchien. :::note -This tool is only available when `OPENCODE_EXPERIMENTAL_LSP_TOOL=true` (or `OPENCODE_EXPERIMENTAL=true`). +Dieses Tool ist nur verfuegbar, wenn `OPENCODE_EXPERIMENTAL_LSP_TOOL=true` (oder `OPENCODE_EXPERIMENTAL=true`) gesetzt ist. ::: ```json title="opencode.json" {4} @@ -192,15 +192,15 @@ This tool is only available when `OPENCODE_EXPERIMENTAL_LSP_TOOL=true` (or `OPEN } ``` -Supported operations include `goToDefinition`, `findReferences`, `hover`, `documentSymbol`, `workspaceSymbol`, `goToImplementation`, `prepareCallHierarchy`, `incomingCalls`, and `outgoingCalls`. +Unterstuetzte Operationen sind `goToDefinition`, `findReferences`, `hover`, `documentSymbol`, `workspaceSymbol`, `goToImplementation`, `prepareCallHierarchy`, `incomingCalls` und `outgoingCalls`. -To configure which LSP servers are available for your project, see [LSP Servers](/docs/lsp). +Um verfuegbare LSP-Server fuer dein Projekt zu konfigurieren, siehe [LSP-Server](/docs/lsp). --- ### patch -Apply patches to files. +Wendet Patches auf Dateien an. ```json title="opencode.json" {4} { @@ -211,17 +211,17 @@ Apply patches to files. } ``` -This tool applies patch files to your codebase. Useful for applying diffs and patches from various sources. +Dieses Tool wendet Patch-Dateien auf deine Codebasis an. Nuetzlich fuer Diffs und Patches aus verschiedenen Quellen. :::note -The `patch` tool is controlled by the `edit` permission, which covers all file modifications (`edit`, `write`, `patch`, `multiedit`). +Das Tool `patch` wird ueber die Berechtigung `edit` gesteuert, welche alle Datei-Aenderungen abdeckt (`edit`, `write`, `patch`, `multiedit`). ::: --- ### skill -Load a [skill](/docs/skills) (a `SKILL.md` file) and return its content in the conversation. +Laedt einen [Skill](/docs/skills) (eine `SKILL.md`-Datei) und gibt dessen Inhalt in der Unterhaltung zurueck. ```json title="opencode.json" {4} { @@ -236,7 +236,7 @@ Load a [skill](/docs/skills) (a `SKILL.md` file) and return its content in the c ### todowrite -Manage todo lists during coding sessions. +Verwaltet Todo-Listen waehrend Coding-Sessions. ```json title="opencode.json" {4} { @@ -247,17 +247,17 @@ Manage todo lists during coding sessions. } ``` -Creates and updates task lists to track progress during complex operations. The LLM uses this to organize multi-step tasks. +Erstellt und aktualisiert Aufgabenlisten, um den Fortschritt bei komplexen Operationen zu verfolgen. Das LLM nutzt dies, um mehrstufige Aufgaben zu organisieren. :::note -This tool is disabled for subagents by default, but you can enable it manually. [Learn more](/docs/agents/#permissions) +Dieses Tool ist fuer Sub-Agenten standardmaessig deaktiviert, kann aber manuell aktiviert werden. [Mehr dazu](/docs/agents/#permissions) ::: --- ### todoread -Read existing todo lists. +Liest existierende Todo-Listen. ```json title="opencode.json" {4} { @@ -268,17 +268,17 @@ Read existing todo lists. } ``` -Reads the current todo list state. Used by the LLM to track what tasks are pending or completed. +Liest den aktuellen Status der Todo-Liste. Wird vom LLM genutzt, um offene oder erledigte Aufgaben zu verfolgen. :::note -This tool is disabled for subagents by default, but you can enable it manually. [Learn more](/docs/agents/#permissions) +Dieses Tool ist fuer Sub-Agenten standardmaessig deaktiviert, kann aber manuell aktiviert werden. [Mehr dazu](/docs/agents/#permissions) ::: --- ### webfetch -Fetch web content. +Ruft Webinhalte ab. ```json title="opencode.json" {4} { @@ -289,18 +289,18 @@ Fetch web content. } ``` -Allows the LLM to fetch and read web pages. Useful for looking up documentation or researching online resources. +Erlaubt dem LLM, Webseiten abzurufen und zu lesen. Nuetzlich zum Nachschlagen von Dokumentation oder fuer Online-Recherche. --- ### websearch -Search the web for information. +Durchsucht das Web nach Informationen. :::note -This tool is only available when using the OpenCode provider or when the `OPENCODE_ENABLE_EXA` environment variable is set to any truthy value (e.g., `true` or `1`). +Dieses Tool ist nur verfuegbar, wenn der OpenCode-Provider genutzt wird oder die Umgebungsvariable `OPENCODE_ENABLE_EXA` auf einen 'truthy' Wert (z. B. `true` oder `1`) gesetzt ist. -To enable when launching OpenCode: +Zum Aktivieren beim Start von OpenCode: ```bash OPENCODE_ENABLE_EXA=1 opencode @@ -317,19 +317,19 @@ OPENCODE_ENABLE_EXA=1 opencode } ``` -Performs web searches using Exa AI to find relevant information online. Useful for researching topics, finding current events, or gathering information beyond the training data cutoff. +Fuehrt Websuchen mit Exa AI durch, um relevante Informationen online zu finden. Nuetzlich fuer Recherche, aktuelle Ereignisse oder Informationen jenseits des Trainingsdatums. -No API key is required — the tool connects directly to Exa AI's hosted MCP service without authentication. +Kein API-Key erforderlich — das Tool verbindet sich direkt mit dem gehosteten MCP-Service von Exa AI ohne Authentifizierung. :::tip -Use `websearch` when you need to find information (discovery), and `webfetch` when you need to retrieve content from a specific URL (retrieval). +Nutze `websearch` zum Finden von Informationen (Discovery) und `webfetch` zum Abrufen von Inhalten einer spezifischen URL (Retrieval). ::: --- ### question -Ask the user questions during execution. +Stellt dem Benutzer waehrend der Ausfuehrung Fragen. ```json title="opencode.json" {4} { @@ -340,14 +340,14 @@ Ask the user questions during execution. } ``` -This tool allows the LLM to ask the user questions during a task. It's useful for: +Dieses Tool erlaubt dem LLM, dem Benutzer waehrend einer Aufgabe Fragen zu stellen. Nuetzlich fuer: -- Gathering user preferences or requirements -- Clarifying ambiguous instructions -- Getting decisions on implementation choices -- Offering choices about what direction to take +- Sammeln von Benutzerpraeferenzen oder Anforderungen +- Klaerung mehrdeutiger Anweisungen +- Entscheidungen bei Implementierungsoptionen einholen +- Auswahlmoeglichkeiten fuer das weitere Vorgehen anbieten -Each question includes a header, the question text, and a list of options. Users can select from the provided options or type a custom answer. When there are multiple questions, users can navigate between them before submitting all answers. +Jede Frage enthaelt eine Ueberschrift, den Fragetext und eine Liste von Optionen. Benutzer koennen aus den Optionen waehlen oder eine eigene Antwort eingeben. Bei mehreren Fragen koennen Benutzer zwischen ihnen navigieren, bevor sie alle Antworten absenden. --- diff --git a/packages/web/src/content/docs/de/troubleshooting.mdx b/packages/web/src/content/docs/de/troubleshooting.mdx index 076200cbd95..e8286faca09 100644 --- a/packages/web/src/content/docs/de/troubleshooting.mdx +++ b/packages/web/src/content/docs/de/troubleshooting.mdx @@ -12,7 +12,7 @@ Wenn OpenCode Probleme macht, starte mit Logs und lokal gespeicherten Daten auf Logdateien werden hier gespeichert: - **macOS/Linux**: `~/.local/share/opencode/log/` -- **Windows**: Press `WIN+R` and paste `%USERPROFILE%\.local\share\opencode\log` +- **Windows**: Druecke `WIN+R` und fuege ein: `%USERPROFILE%\.local\share\opencode\log` Dateinamen enthalten Zeitstempel (z. B. `2025-01-09T123456.log`) und es bleiben die letzten 10 Logs erhalten. @@ -25,7 +25,7 @@ Mit `--log-level` bekommst du detailliertere Diagnoseinfos, z. B. `opencode --lo opencode speichert Sitzungs- und App-Daten auf der Festplatte unter: - **macOS/Linux**: `~/.local/share/opencode/` -- **Windows**: Press `WIN+R` and paste `%USERPROFILE%\.local\share\opencode` +- **Windows**: Druecke `WIN+R` und fuege ein: `%USERPROFILE%\.local\share\opencode` Dieses Verzeichnis enthaelt: @@ -52,17 +52,17 @@ Viele Probleme kommen von fehlerhaften Plugins, kaputtem Cache oder falschen Ser ### Plugins deaktivieren -If the desktop app is crashing on launch, hanging, or behaving strangely, start by disabling plugins. +Wenn die Desktop-App beim Start abstuerzt, haengt oder sich seltsam verhaelt, deaktiviere zunaechst Plugins. #### Globale Konfiguration prüfen -Open your global config file and look for a `plugin` key. +Oeffne deine globale Konfigurationsdatei und suche nach dem `plugin`-Schluessel. -- **macOS/Linux**: `~/.config/opencode/opencode.jsonc` (or `~/.config/opencode/opencode.json`) -- **macOS/Linux** (older installs): `~/.local/share/opencode/opencode.jsonc` -- **Windows**: Press `WIN+R` and paste `%USERPROFILE%\.config\opencode\opencode.jsonc` +- **macOS/Linux**: `~/.config/opencode/opencode.jsonc` (oder `~/.config/opencode/opencode.json`) +- **macOS/Linux** (aeltere Installationen): `~/.local/share/opencode/opencode.jsonc` +- **Windows**: Druecke `WIN+R` und fuege ein: `%USERPROFILE%\.config\opencode\opencode.jsonc` -If you have plugins configured, temporarily disable them by removing the key or setting it to an empty array: +Wenn du Plugins konfiguriert hast, deaktiviere sie voruebergehend, indem du den Schluessel entfernst oder auf ein leeres Array setzt: ```jsonc { @@ -73,100 +73,100 @@ If you have plugins configured, temporarily disable them by removing the key or #### Plugin-Verzeichnisse prüfen -OpenCode can also load local plugins from disk. Temporarily move these out of the way (or rename the folder) and restart the desktop app: +OpenCode kann auch lokale Plugins von der Festplatte laden. Verschiebe diese voruebergehend (oder benenne den Ordner um) und starte die Desktop-App neu: -- **Global plugins** +- **Globale Plugins** - **macOS/Linux**: `~/.config/opencode/plugins/` - - **Windows**: Press `WIN+R` and paste `%USERPROFILE%\.config\opencode\plugins` -- **Project plugins** (only if you use per-project config) + - **Windows**: Druecke `WIN+R` und fuege ein: `%USERPROFILE%\.config\opencode\plugins` +- **Projekt-Plugins** (nur bei projektspezifischer Konfig) - ` /.opencode/plugins/` -If the app starts working again, re-enable plugins one at a time to find which one is causing the issue. +Wenn die App wieder funktioniert, aktiviere Plugins nacheinander, um den Verursacher zu finden. --- ### Cache leeren -If disabling plugins doesn't help (or a plugin install is stuck), clear the cache so OpenCode can rebuild it. +Wenn das Deaktivieren von Plugins nicht hilft (oder eine Plugin-Installation haengt), leere den Cache, damit OpenCode ihn neu aufbauen kann. -1. Quit OpenCode Desktop completely. -2. Delete the cache directory: +1. Beende OpenCode Desktop komplett. +2. Loesche das Cache-Verzeichnis: -- **macOS**: Finder -> `Cmd+Shift+G` -> paste `~/.cache/opencode` -- **Linux**: delete `~/.cache/opencode` (or run `rm -rf ~/.cache/opencode`) -- **Windows**: Press `WIN+R` and paste `%USERPROFILE%\.cache\opencode` +- **macOS**: Finder -> `Cmd+Shift+G` -> einfuegen: `~/.cache/opencode` +- **Linux**: loesche `~/.cache/opencode` (oder fuehre aus: `rm -rf ~/.cache/opencode`) +- **Windows**: Druecke `WIN+R` und fuege ein: `%USERPROFILE%\.cache\opencode` -3. Restart OpenCode Desktop. +3. Starte OpenCode Desktop neu. --- ### Server-Verbindungsprobleme beheben -OpenCode Desktop can either start its own local server (default) or connect to a server URL you configured. +OpenCode Desktop kann entweder einen eigenen lokalen Server starten (Standard) oder sich mit einer konfigurierten Server-URL verbinden. -If you see a **"Connection Failed"** dialog (or the app never gets past the splash screen), check for a custom server URL. +Wenn du einen **"Connection Failed"**-Dialog siehst (oder die App beim Splash-Screen haengen bleibt), pruefe auf eine benutzerdefinierte Server-URL. #### Desktop-Standard-Server-URL löschen -From the Home screen, click the server name (with the status dot) to open the Server picker. In the **Default server** section, click **Clear**. +Klicke im Startbildschirm auf den Servernamen (mit dem Statuspunkt), um die Serverauswahl zu oeffnen. Klicke im Bereich **Default server** auf **Clear**. #### `server.port` / `server.hostname` aus Konfiguration entfernen -If your `opencode.json(c)` contains a `server` section, temporarily remove it and restart the desktop app. +Wenn deine `opencode.json(c)` einen `server`-Abschnitt enthaelt, entferne ihn voruebergehend und starte die Desktop-App neu. #### Umgebungsvariablen prüfen -If you have `OPENCODE_PORT` set in your environment, the desktop app will try to use that port for the local server. +Wenn du `OPENCODE_PORT` in deiner Umgebung gesetzt hast, versucht die Desktop-App diesen Port fuer den lokalen Server zu nutzen. -- Unset `OPENCODE_PORT` (or pick a free port) and restart. +- Setze `OPENCODE_PORT` zurueck (oder waehle einen freien Port) und starte neu. --- ### Linux: Wayland / X11-Probleme -On Linux, some Wayland setups can cause blank windows or compositor errors. +Unter Linux koennen manche Wayland-Setups leere Fenster oder Compositor-Fehler verursachen. -- If you're on Wayland and the app is blank/crashing, try launching with `OC_ALLOW_WAYLAND=1`. -- If that makes things worse, remove it and try launching under an X11 session instead. +- Wenn du Wayland nutzt und die App leer ist/abstuerzt, versuche den Start mit `OC_ALLOW_WAYLAND=1`. +- Wenn das es verschlimmert, entferne es und versuche den Start in einer X11-Session. --- ### Windows: WebView2-Laufzeit -On Windows, OpenCode Desktop requires the Microsoft Edge **WebView2 Runtime**. If the app opens to a blank window or won't start, install/update WebView2 and try again. +Unter Windows benoetigt OpenCode Desktop die Microsoft Edge **WebView2 Runtime**. Wenn die App ein leeres Fenster zeigt oder nicht startet, installiere/aktualisiere WebView2 und versuche es erneut. --- ### Windows: Allgemeine Performance-Probleme -If you're experiencing slow performance, file access issues, or terminal problems on Windows, try using [WSL (Windows Subsystem for Linux)](/docs/windows-wsl). WSL provides a Linux environment that works more seamlessly with OpenCode's features. +Wenn du langsame Performance, Dateizugriffsprobleme oder Terminal-Probleme unter Windows hast, versuche [WSL (Windows Subsystem for Linux)](/docs/windows-wsl). WSL bietet eine Linux-Umgebung, die nahtloser mit OpenCode-Features funktioniert. --- ### Benachrichtigungen werden nicht angezeigt -OpenCode Desktop only shows system notifications when: +OpenCode Desktop zeigt Systembenachrichtigungen nur wenn: -- notifications are enabled for OpenCode in your OS settings, and -- the app window is not focused. +- Benachrichtigungen fuer OpenCode in den OS-Einstellungen aktiviert sind, und +- das App-Fenster nicht fokussiert ist. --- ### Desktop-App-Speicher zurücksetzen (letzter Ausweg) -If the app won't start and you can't clear settings from inside the UI, reset the desktop app's saved state. +Wenn die App nicht startet und du Einstellungen nicht in der UI loeschen kannst, setze den gespeicherten Zustand der Desktop-App zurueck. -1. Quit OpenCode Desktop. -2. Find and delete these files (they live in the OpenCode Desktop app data directory): +1. Beende OpenCode Desktop. +2. Finde und loesche diese Dateien (im App-Data-Verzeichnis von OpenCode Desktop): - `opencode.settings.dat` (desktop default server URL) -- `opencode.global.dat` and `opencode.workspace.*.dat` (UI state like recent servers/projects) +- `opencode.global.dat` und `opencode.workspace.*.dat` (UI state like recent servers/projects) -To find the directory quickly: +So findest du das Verzeichnis schnell: -- **macOS**: Finder -> `Cmd+Shift+G` -> `~/Library/Application Support` (then search for the filenames above) -- **Linux**: search under `~/.local/share` for the filenames above -- **Windows**: Press `WIN+R` -> `%APPDATA%` (then search for the filenames above) +- **macOS**: Finder -> `Cmd+Shift+G` -> `~/Library/Application Support` (dann suche nach den Dateinamen oben) +- **Linux**: suche unter `~/.local/share` nach den Dateinamen oben +- **Windows**: Druecke `WIN+R` -> `%APPDATA%` (dann suche nach den Dateinamen oben) --- @@ -198,84 +198,83 @@ Hier sind typische Fehlerbilder und wie du sie loest. ### OpenCode startet nicht -1. Check the logs for error messages -2. Try running with `--print-logs` to see output in the terminal -3. Ensure you have the latest version with `opencode upgrade` +1. Pruefe die Logs auf Fehlermeldungen +2. Versuche den Start mit `--print-logs`, um Ausgaben im Terminal zu sehen +3. Stelle sicher, dass du die neueste Version hast: `opencode upgrade` --- ### Authentifizierungsprobleme -1. Try re-authenticating with the `/connect` command in the TUI -2. Check that your API keys are valid -3. Ensure your network allows connections to the provider's API +1. Versuche erneute Authentifizierung mit `/connect` in der TUI +2. Pruefe, ob deine API-Keys gueltig sind +3. Stelle sicher, dass dein Netzwerk Verbindungen zur Provider-API erlaubt --- ### Modell nicht verfügbar -1. Check that you've authenticated with the provider -2. Verify the model name in your config is correct -3. Some models may require specific access or subscriptions +1. Pruefe, ob du dich beim Provider authentifiziert hast +2. Verifiziere, dass der Modellname in deiner Config korrekt ist +3. Manche Modelle erfordern speziellen Zugriff oder Abonnements -If you encounter `ProviderModelNotFoundError` you are most likely incorrectly -referencing a model somewhere. -Models should be referenced like so: ` / ` +Wenn du `ProviderModelNotFoundError` erhaeltst, referenzierst du ein Modell wahrscheinlich falsch. +Modelle sollten so referenziert werden: ` / ` -Examples: +Beispiele: - `openai/gpt-4.1` - `openrouter/google/gemini-2.5-flash` - `opencode/kimi-k2` -To figure out what models you have access to, run `opencode models` +Um zu sehen, auf welche Modelle du Zugriff hast, fuehre `opencode models` aus. --- ### ProviderInitError -If you encounter a ProviderInitError, you likely have an invalid or corrupted configuration. +Wenn du einen ProviderInitError erhaeltst, hast du wahrscheinlich eine ungueltige oder korrupte Konfiguration. -To resolve this: +Zur Loesung: -1. First, verify your provider is set up correctly by following the [providers guide](/docs/providers) -2. If the issue persists, try clearing your stored configuration: +1. Pruefe zuerst, ob dein Provider korrekt eingerichtet ist, gemaess dem [Provider-Guide](/docs/providers) +2. Wenn das Problem besteht, versuche deine gespeicherte Konfiguration zu loeschen: ```bash rm -rf ~/.local/share/opencode ``` - On Windows, press `WIN+R` and delete: `%USERPROFILE%\.local\share\opencode` + Unter Windows druecke `WIN+R` und loesche: `%USERPROFILE%\.local\share\opencode` -3. Re-authenticate with your provider using the `/connect` command in the TUI. +3. Authentifiziere dich erneut beim Provider mit dem `/connect`-Befehl in der TUI. --- ### AI_APICallError und Provider-Paket-Probleme -If you encounter API call errors, this may be due to outdated provider packages. opencode dynamically installs provider packages (OpenAI, Anthropic, Google, etc.) as needed and caches them locally. +Wenn du API-Call-Fehler erhaeltst, kann das an veralteten Provider-Paketen liegen. opencode installiert Provider-Pakete (OpenAI, Anthropic, Google, etc.) dynamisch bei Bedarf und cached sie lokal. -To resolve provider package issues: +Um Provider-Paket-Probleme zu loesen: -1. Clear the provider package cache: +1. Leere den Provider-Paket-Cache: ```bash rm -rf ~/.cache/opencode ``` - On Windows, press `WIN+R` and delete: `%USERPROFILE%\.cache\opencode` + Unter Windows druecke `WIN+R` und loesche: `%USERPROFILE%\.cache\opencode` -2. Restart opencode to reinstall the latest provider packages +2. Starte opencode neu, um die neuesten Provider-Pakete zu installieren -This will force opencode to download the most recent versions of provider packages, which often resolves compatibility issues with model parameters and API changes. +Dies zwingt opencode, die neuesten Versionen der Provider-Pakete herunterzuladen, was oft Kompatibilitaetsprobleme mit Modellparametern und API-Aenderungen loest. --- ### Copy/Paste funktioniert nicht unter Linux -Linux users need to have one of the following clipboard utilities installed for copy/paste functionality to work: +Linux-Nutzer muessen eines der folgenden Clipboard-Utilities installiert haben, damit Copy/Paste funktioniert: -**For X11 systems:** +**Fuer X11-Systeme:** ```bash apt install -y xclip @@ -283,13 +282,13 @@ apt install -y xclip apt install -y xsel ``` -**For Wayland systems:** +**Fuer Wayland-Systeme:** ```bash apt install -y wl-clipboard ``` -**For headless environments:** +**Fuer Headless-Umgebungen:** ```bash apt install -y xvfb @@ -298,4 +297,4 @@ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=:99.0 ``` -opencode will detect if you're using Wayland and prefer `wl-clipboard`, otherwise it will try to find clipboard tools in order of: `xclip` and `xsel`. +opencode erkennt, ob du Wayland nutzt und bevorzugt `wl-clipboard`, sonst versucht es `xclip` und `xsel` (in dieser Reihenfolge). diff --git a/packages/web/src/content/docs/de/tui.mdx b/packages/web/src/content/docs/de/tui.mdx index ebd16fa76aa..144662c1195 100644 --- a/packages/web/src/content/docs/de/tui.mdx +++ b/packages/web/src/content/docs/de/tui.mdx @@ -74,7 +74,7 @@ Hier sind alle verfuegbaren Slash-Commands: ### connect -Add a provider to OpenCode. Allows you to select from available providers and add their API keys. +Fuegt einen Provider zu OpenCode hinzu. Erlaubt die Auswahl aus verfuegbaren Providern und das Hinzufuegen ihrer API-Keys. ```bash frame="none" /connect @@ -84,7 +84,7 @@ Add a provider to OpenCode. Allows you to select from available providers and ad ### compact -Compact the current session. _Alias_: `/summarize` +Kompaktiert die aktuelle Session. _Alias_: `/summarize` ```bash frame="none" /compact @@ -96,7 +96,7 @@ Compact the current session. _Alias_: `/summarize` ### details -Toggle tool execution details. +Schaltet Tool-Ausfuehrungsdetails um. ```bash frame="none" /details @@ -108,7 +108,7 @@ Toggle tool execution details. ### editor -Open external editor for composing messages. Uses the editor set in your `EDITOR` environment variable. [Learn more](#editor-setup). +Oeffnet externen Editor zum Verfassen von Nachrichten. Nutzt den in der `EDITOR`-Umgebungsvariable gesetzten Editor. [Mehr dazu](#editor-setup). ```bash frame="none" /editor @@ -120,7 +120,7 @@ Open external editor for composing messages. Uses the editor set in your `EDITOR ### exit -Exit OpenCode. _Aliases_: `/quit`, `/q` +Beendet OpenCode. _Aliase_: `/quit`, `/q` ```bash frame="none" /exit @@ -132,7 +132,7 @@ Exit OpenCode. _Aliases_: `/quit`, `/q` ### export -Export current conversation to Markdown and open in your default editor. Uses the editor set in your `EDITOR` environment variable. [Learn more](#editor-setup). +Exportiert die aktuelle Unterhaltung als Markdown und oeffnet sie in deinem Standard-Editor. Nutzt den in der `EDITOR`-Umgebungsvariable gesetzten Editor. [Mehr dazu](#editor-setup). ```bash frame="none" /export @@ -144,7 +144,7 @@ Export current conversation to Markdown and open in your default editor. Uses th ### help -Show the help dialog. +Zeigt den Hilfedialog. ```bash frame="none" /help @@ -156,7 +156,7 @@ Show the help dialog. ### init -Create or update `AGENTS.md` file. [Learn more](/docs/rules). +Erstellt oder aktualisiert die `AGENTS.md`-Datei. [Mehr dazu](/docs/rules). ```bash frame="none" /init @@ -168,7 +168,7 @@ Create or update `AGENTS.md` file. [Learn more](/docs/rules). ### models -List available models. +Listet verfuegbare Modelle. ```bash frame="none" /models @@ -180,7 +180,7 @@ List available models. ### new -Start a new session. _Alias_: `/clear` +Startet eine neue Session. _Alias_: `/clear` ```bash frame="none" /new @@ -192,14 +192,13 @@ Start a new session. _Alias_: `/clear` ### redo -Redo a previously undone message. Only available after using `/undo`. +Wiederholt eine zuvor rueckgaengig gemachte Nachricht. Nur verfuegbar nach Verwendung von `/undo`. :::tip -Any file changes will also be restored. +Auch Dateiaenderungen werden wiederhergestellt. ::: -Internally, this uses Git to manage the file changes. So your project **needs to -be a Git repository**. +Intern nutzt dies Git, um die Dateiaenderungen zu verwalten. Dein Projekt muss also **ein Git-Repository sein**. ```bash frame="none" /redo @@ -211,7 +210,7 @@ be a Git repository**. ### sessions -List and switch between sessions. _Aliases_: `/resume`, `/continue` +Listet Sessions und wechselt zwischen ihnen. _Aliase_: `/resume`, `/continue` ```bash frame="none" /sessions @@ -223,7 +222,7 @@ List and switch between sessions. _Aliases_: `/resume`, `/continue` ### share -Share current session. [Learn more](/docs/share). +Teilt die aktuelle Session. [Mehr dazu](/docs/share). ```bash frame="none" /share @@ -235,7 +234,7 @@ Share current session. [Learn more](/docs/share). ### themes -List available themes. +Listet verfuegbare Themes. ```bash frame="none" /theme @@ -247,10 +246,10 @@ List available themes. ### thinking -Toggle the visibility of thinking/reasoning blocks in the conversation. When enabled, you can see the model's reasoning process for models that support extended thinking. +Schaltet die Sichtbarkeit von Thinking/Reasoning-Bloecken in der Unterhaltung um. Wenn aktiviert, kannst du den Denkprozess des Modells sehen (bei Modellen, die das unterstuetzen). :::note -This command only controls whether thinking blocks are **displayed** - it does not enable or disable the model's reasoning capabilities. To toggle actual reasoning capabilities, use `ctrl+t` to cycle through model variants. +Dieser Befehl steuert nur, ob Thinking-Bloecke **angezeigt** werden - er aktiviert oder deaktiviert nicht die Reasoning-Faehigkeiten des Modells. Um die Reasoning-Faehigkeiten umzuschalten, nutze `ctrl+t`, um durch die Modell-Varianten zu wechseln. ::: ```bash frame="none" @@ -261,14 +260,13 @@ This command only controls whether thinking blocks are **displayed** - it does n ### undo -Undo last message in the conversation. Removes the most recent user message, all subsequent responses, and any file changes. +Macht die letzte Nachricht in der Unterhaltung rueckgaengig. Entfernt die letzte Benutzernachricht, alle folgenden Antworten und alle Dateiaenderungen. :::tip -Any file changes made will also be reverted. +Auch durchgefuehrte Dateiaenderungen werden rueckgaengig gemacht. ::: -Internally, this uses Git to manage the file changes. So your project **needs to -be a Git repository**. +Intern nutzt dies Git, um die Dateiaenderungen zu verwalten. Dein Projekt muss also **ein Git-Repository sein**. ```bash frame="none" /undo @@ -280,7 +278,7 @@ be a Git repository**. ### unshare -Unshare current session. [Learn more](/docs/share#un-sharing). +Hebt das Teilen der aktuellen Session auf. [Mehr dazu](/docs/share#un-sharing). ```bash frame="none" /unshare @@ -290,7 +288,7 @@ Unshare current session. [Learn more](/docs/share#un-sharing). ## Editor-Einrichtung -Both the `/editor` and `/export` commands use the editor specified in your `EDITOR` environment variable. +Sowohl `/editor` als auch `/export` nutzen den in deiner `EDITOR`-Umgebungsvariable spezifizierten Editor. -Popular editor options include: +Beliebte Editoren sind: - `code` - Visual Studio Code - `cursor` - Cursor - `windsurf` - Windsurf -- `nvim` - Neovim editor -- `vim` - Vim editor -- `nano` - Nano editor +- `nvim` - Neovim +- `vim` - Vim +- `nano` - Nano - `notepad` - Windows Notepad - `subl` - Sublime Text :::note -Some editors like VS Code need to be started with the `--wait` flag. +Einige Editoren wie VS Code muessen mit dem `--wait`-Flag gestartet werden. ::: -Some editors need command-line arguments to run in blocking mode. The `--wait` flag makes the editor process block until closed. +Einige Editoren benoetigen Befehlszeilenargumente, um im blockierenden Modus zu laufen. Das `--wait`-Flag sorgt dafuer, dass der Editor-Prozess blockiert, bis er geschlossen wird. --- ## Konfiguration -You can customize TUI behavior through your OpenCode config file. +Du kannst das Verhalten der TUI ueber die Datei `tui.json` (oder `tui.jsonc`) anpassen. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Dies ist getrennt von `opencode.json`, welche das Server-/Runtime-Verhalten konfiguriert. + ### Optionen -- `scroll_acceleration` - Enable macOS-style scroll acceleration for smooth, natural scrolling. When enabled, scroll speed increases with rapid scrolling gestures and stays precise for slower movements. **This setting takes precedence over `scroll_speed` and overrides it when enabled.** -- `scroll_speed` - Controls how fast the TUI scrolls when using scroll commands (minimum: `1`). Defaults to `3`. **Note: This is ignored if `scroll_acceleration.enabled` is set to `true`.** +- `theme` - Setzt dein UI-Theme. [Mehr dazu](/docs/themes). +- `keybinds` - Passt Tastenkombinationen an. [Mehr dazu](/docs/keybinds). +- `scroll_acceleration.enabled` - Aktiviert Scroll-Beschleunigung im macOS-Stil fuer weiches, natuerliches Scrollen. Wenn aktiviert, erhoeht sich die Scroll-Geschwindigkeit bei schnellen Gesten und bleibt praezise bei langsamen Bewegungen. **Diese Einstellung hat Vorrang vor `scroll_speed` und ueberschreibt es, wenn aktiviert.** +- `scroll_speed` - Steuert, wie schnell die TUI scrollt (Minimum: `0.001`, unterstuetzt Dezimalwerte). Standard ist `3`. **Hinweis: Wird ignoriert, wenn `scroll_acceleration.enabled` auf `true` gesetzt ist.** +- `diff_style` - Steuert die Diff-Darstellung. `"auto"` passt sich der Terminalbreite an, `"stacked"` zeigt immer ein einspaltiges Layout. + +Verwende `OPENCODE_TUI_CONFIG`, um einen benutzerdefinierten TUI-Konfigurationspfad zu laden. --- ## Anpassung -You can customize various aspects of the TUI view using the command palette (`ctrl+x h` or `/help`). These settings persist across restarts. +Du kannst verschiedene Aspekte der TUI-Ansicht ueber die Befehlspalette (`ctrl+x h` oder `/help`) anpassen. Diese Einstellungen bleiben ueber Neustarts hinweg erhalten. --- #### Benutzername-Anzeige -Toggle whether your username appears in chat messages. Access this through: +Schaltet um, ob dein Benutzername in Chat-Nachrichten erscheint. Zugriff hierueber: -- Command palette: Search for "username" or "hide username" -- The setting persists automatically and will be remembered across TUI sessions +- Befehlspalette: Suche nach "username" oder "hide username" +- Die Einstellung wird automatisch gespeichert und bleibt ueber TUI-Sessions hinweg erhalten. diff --git a/packages/web/src/content/docs/de/zen.mdx b/packages/web/src/content/docs/de/zen.mdx index f52ed5f363f..7545b10deb2 100644 --- a/packages/web/src/content/docs/de/zen.mdx +++ b/packages/web/src/content/docs/de/zen.mdx @@ -57,6 +57,7 @@ Du kannst unsere Modelle auch ueber die folgenden API-Endpunkte aufrufen. | Model | Model ID | Endpoint | AI SDK Package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -66,22 +67,24 @@ Du kannst unsere Modelle auch ueber die folgenden API-Endpunkte aufrufen. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -110,29 +113,34 @@ Unten siehst du die Preise **pro 1 Mio. Tokens**. | Model | Input | Output | Cached Read | Cached Write | | --------------------------------- | ------ | ------ | ----------- | ------------ | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -152,10 +160,8 @@ Kreditkartengebuehren geben wir zum Selbstkostenpreis weiter (4,4 % + $0.30 pro Die kostenlosen Modelle: -- GLM 4.7 Free ist fuer begrenzte Zeit verfuegbar, um Feedback zu sammeln und das Modell zu verbessern. -- Kimi K2.5 Free ist fuer begrenzte Zeit verfuegbar, um Feedback zu sammeln und das Modell zu verbessern. -- MiniMax M2.1 Free ist fuer begrenzte Zeit verfuegbar, um Feedback zu sammeln und das Modell zu verbessern. -- Big Pickle ist ein Stealth-Modell und ebenfalls zeitlich begrenzt kostenlos verfuegbar. +- MiniMax M2.5 Free ist fuer begrenzte Zeit auf OpenCode verfuegbar. Das Team nutzt diese Zeit, um Feedback zu sammeln und das Modell zu verbessern. +- Big Pickle ist ein Stealth-Modell, das fuer begrenzte Zeit kostenlos auf OpenCode verfuegbar ist. Das Team nutzt diese Zeit, um Feedback zu sammeln und das Modell zu verbessern. Wenn du Fragen hast, kontaktiere uns. @@ -183,12 +189,10 @@ Mit aktiviertem Auto-Reload kann die Abrechnung dennoch darueber liegen, falls d Alle Modelle werden in den USA gehostet. Unsere Provider arbeiten grundsaetzlich mit Zero-Retention und nutzen deine Daten nicht zum Training, mit folgenden Ausnahmen: -- Big Pickle: During its free period, collected data may be used to improve the model. -- GLM 4.7 Free: During its free period, collected data may be used to improve the model. -- Kimi K2.5 Free: During its free period, collected data may be used to improve the model. -- MiniMax M2.1 Free: During its free period, collected data may be used to improve the model. -- OpenAI APIs: Requests are retained for 30 days in accordance with [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data). -- Anthropic APIs: Requests are retained for 30 days in accordance with [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). +- Big Pickle: Waehrend der kostenlosen Phase koennen gesammelte Daten zur Verbesserung des Modells genutzt werden. +- MiniMax M2.5 Free: Waehrend der kostenlosen Phase koennen gesammelte Daten zur Verbesserung des Modells genutzt werden. +- OpenAI APIs: Anfragen werden fuer 30 Tage gemaess [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data) aufbewahrt. +- Anthropic APIs: Anfragen werden fuer 30 Tage gemaess [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage) aufbewahrt. --- @@ -232,8 +236,7 @@ Du kannst eigene OpenAI- oder Anthropic-API-Keys verwenden und trotzdem andere Z Bei eigenen Keys erfolgt die Token-Abrechnung direkt ueber den Provider, nicht ueber Zen. -For example, your organization might already have a key for OpenAI or Anthropic -and you want to use that instead of the one that Zen provides. +Zum Beispiel hat deine Organisation vielleicht bereits einen Key fuer OpenAI oder Anthropic und du moechtest diesen anstelle des von Zen bereitgestellten nutzen. --- diff --git a/packages/web/src/content/docs/es/custom-tools.mdx b/packages/web/src/content/docs/es/custom-tools.mdx index 76188e184e3..133abf4ab23 100644 --- a/packages/web/src/content/docs/es/custom-tools.mdx +++ b/packages/web/src/content/docs/es/custom-tools.mdx @@ -79,6 +79,32 @@ Esto crea dos herramientas: `math_add` y `math_multiply`. --- +#### Colisiones de nombres con herramientas integradas + +Las herramientas personalizadas están codificadas por el nombre de la herramienta. Si una herramienta personalizada utiliza el mismo nombre que una herramienta integrada, la herramienta personalizada tiene prioridad. + +Por ejemplo, este archivo reemplaza la herramienta `bash` integrada: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Prefiera nombres únicos a menos que intencionalmente desee reemplazar una herramienta integrada. Si desea deshabilitar una herramienta integrada pero no anularla, use [permisos](/docs/permissions). +::: + +--- + ### Argumentos Puedes usar `tool.schema`, que es simplemente [Zod](https://zod.dev), para definir tipos de argumentos. diff --git a/packages/web/src/content/docs/es/keybinds.mdx b/packages/web/src/content/docs/es/keybinds.mdx index 7ce014f0a22..d4880db2fa5 100644 --- a/packages/web/src/content/docs/es/keybinds.mdx +++ b/packages/web/src/content/docs/es/keybinds.mdx @@ -3,11 +3,11 @@ title: Combinaciones de teclas description: Personaliza tus combinaciones de teclas. --- -OpenCode tiene una lista de combinaciones de teclas que puede personalizar a través de la configuración OpenCode. +OpenCode tiene una lista de combinaciones de teclas que puede personalizar a través de `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, @@ -304,7 +302,7 @@ Both the `/editor` and `/export` commands use the editor specified in your `EDIT export EDITOR="code --wait" ``` - To make it permanent, add this to your shell profile; + Um es dauerhaft zu machen, fuege dies zu deinem Shell-Profil hinzu; `~/.bashrc`, `~/.zshrc`, etc. @@ -318,8 +316,7 @@ Both the `/editor` and `/export` commands use the editor specified in your `EDIT set EDITOR=code --wait ``` - To make it permanent, use **System Properties** > **Environment - Variables**. + Um es dauerhaft zu machen, nutze **Systemeigenschaften** > **Umgebungsvariablen**. @@ -332,62 +329,72 @@ Both the `/editor` and `/export` commands use the editor specified in your `EDIT $env:EDITOR = "code --wait" ``` - To make it permanent, add this to your PowerShell profile. + Um es dauerhaft zu machen, fuege dies zu deinem PowerShell-Profil hinzu.q", @@ -117,11 +117,11 @@ No es necesario utilizar una tecla líder para las combinaciones de teclas, pero ## Desactivar combinación de teclas -Puede deshabilitar una combinación de teclas agregando la clave a su configuración con un valor de "ninguno". +Puede deshabilitar una combinación de teclas agregando la clave a `tui.json` con un valor de "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/es/lsp.mdx b/packages/web/src/content/docs/es/lsp.mdx index fc741ca898f..27eab4cadf1 100644 --- a/packages/web/src/content/docs/es/lsp.mdx +++ b/packages/web/src/content/docs/es/lsp.mdx @@ -27,6 +27,7 @@ OpenCode viene con varios servidores LSP integrados para idiomas populares: | gopls | .go | Comando `go` disponible | | hls | .hs, .lhs | Comando `haskell-language-server-wrapper` disponible | | jdtls | .java | `Java SDK (version 21+)` instalado | +| julials | .jl | `julia` y `LanguageServer.jl` instalados | | kotlin-ls | .kt, .kts | Autoinstalaciones para proyectos Kotlin | | lua-ls | .lua | Autoinstalaciones para proyectos Lua | | nixd | .nix | Comando `nixd` disponible | diff --git a/packages/web/src/content/docs/es/plugins.mdx b/packages/web/src/content/docs/es/plugins.mdx index 904821bdb83..dc441807251 100644 --- a/packages/web/src/content/docs/es/plugins.mdx +++ b/packages/web/src/content/docs/es/plugins.mdx @@ -308,6 +308,10 @@ El ayudante `tool` crea una herramienta personalizada a la que opencode puede ll Sus herramientas personalizadas estarán disponibles para opencode junto con las herramientas integradas. +:::note +Si una herramienta de complemento utiliza el mismo nombre que una herramienta integrada, la herramienta de complemento tiene prioridad. +::: + --- ### Registro diff --git a/packages/web/src/content/docs/es/providers.mdx b/packages/web/src/content/docs/es/providers.mdx index 8d86612538b..2ee033f00d0 100644 --- a/packages/web/src/content/docs/es/providers.mdx +++ b/packages/web/src/content/docs/es/providers.mdx @@ -84,6 +84,38 @@ Funciona como cualquier otro proveedor en OpenCode y su uso es completamente opc --- +## OpenCode Go + +OpenCode Go es un plan de suscripción de bajo costo que brinda acceso confiable a modelos de codificación abiertos populares proporcionados por el equipo de OpenCode que han sido +probado y verificado para funcionar bien con OpenCode. + +1. Ejecute el comando `/connect` en TUI, seleccione `OpenCode Go` y diríjase a [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Inicie sesión, agregue sus datos de facturación y copie su clave API. + +3. Pegue su clave API. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Ejecute `/models` en TUI para ver la lista de modelos que recomendamos. + + ```txt + /models + ``` + +Funciona como cualquier otro proveedor en OpenCode y su uso es completamente opcional. + +--- + ## Directorio Veamos algunos de los proveedores en detalle. Si desea agregar un proveedor a la @@ -792,8 +824,6 @@ Para utilizar su suscripción GitHub Copilot con opencode: :::note Algunos modelos pueden necesitar un [Pro+ suscripción](https://github.com/features/copilot/plans) para usar. - -Algunos modelos deben habilitarse manualmente en su [GitHub configuración del copiloto](https://docs.github.com/en/copilot/how-tos/use-ai-models/configure-access-to-ai-models#setup-for-individual-use). ::: 1. Ejecute el comando `/connect` y busque GitHub Copilot. @@ -1483,6 +1513,39 @@ SAP AI Core brinda acceso a más de 40 modelos de OpenAI, Anthropic, Google, Ama --- +### STACKIT + +STACKIT AI Model Serving proporciona un entorno de alojamiento soberano totalmente gestionado para modelos de IA, centrándose en LLM como Llama, Mistral y Qwen, con máxima soberanía de datos en infraestructura europea. + +1. Diríjase al [Portal STACKIT](https://portal.stackit.cloud), navegue hasta **AI Model Serving** y cree un token de autenticación para su proyecto. + + :::tip + Necesita una cuenta de cliente STACKIT, una cuenta de usuario y un proyecto antes de crear tokens de autenticación. + ::: + +2. Ejecute el comando `/connect` y busque **STACKIT**. + + ```txt + /connect + ``` + +3. Ingrese su token de autenticación de STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Ejecute el comando `/models` para seleccionar entre los modelos disponibles como _Qwen3-VL 235B_ o _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Dirígete al [panel de OVHcloud](https://ovh.com/manager). Navegue a la sección `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` y en la pestaña `API Keys`, haga clic en **Crear una nueva clave API**. diff --git a/packages/web/src/content/docs/es/sdk.mdx b/packages/web/src/content/docs/es/sdk.mdx index d1282b95e9a..d75149cde85 100644 --- a/packages/web/src/content/docs/es/sdk.mdx +++ b/packages/web/src/content/docs/es/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Salida Estructurada + +Puede solicitar una salida JSON estructurada del modelo especificando un `format` con un esquema JSON. El modelo utilizará una herramienta `StructuredOutput` para devolver un JSON validado que coincida con su esquema. + +### Uso Básico + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Tipos de Formato de Salida + +| Tipo | Descripción | +| ------------- | --------------------------------------------------------------------- | +| `text` | Predeterminado. Respuesta de texto estándar (sin salida estructurada) | +| `json_schema` | Devuelve JSON validado que coincide con el esquema proporcionado | + +### Formato de Esquema JSON + +Cuando use `type: 'json_schema'`, proporcione: + +| Campo | Tipo | Descripción | +| ------------ | --------------- | ---------------------------------------------------------------- | +| `type` | `'json_schema'` | Requerido. Especifica el modo de esquema JSON | +| `schema` | `object` | Requerido. Objeto JSON Schema que define la estructura de salida | +| `retryCount` | `number` | Opcional. Número de reintentos de validación (predeterminado: 2) | + +### Manejo de Errores + +Si el modelo no logra producir una salida estructurada válida después de todos los reintentos, la respuesta incluirá un `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Mejores Prácticas + +1. **Proporcione descripciones claras** en las propiedades de su esquema para ayudar al modelo a entender qué datos extraer +2. **Use `required`** para especificar qué campos deben estar presentes +3. **Mantenga los esquemas enfocados** - los esquemas anidados complejos pueden ser más difíciles de completar correctamente para el modelo +4. **Establezca un `retryCount` apropiado** - aumente para esquemas complejos, disminuya para simples + +--- + ## API El SDK expone todas las API del servidor a través de un cliente con seguridad de tipos. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sesiones -| Método | Descripción | Notas | -| ---------------------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | Listar sesiones | Devuelve Session[]| -| `session.get({ path })` | Obtener sesión | DevuelveSession| -| `session.children({ path })` | Listar sesiones secundarias | DevuelveSession[]| -| `session.create({ body })` | Crear sesión | DevuelveSession| -| `session.delete({ path })` | Eliminar sesión | Devuelve `boolean` | -| `session.update({ path, body })` | Actualizar propiedades de sesión | DevuelveSession| -| `session.init({ path, body })` | Analizar aplicación y crear `AGENTS.md` | Devuelve `boolean` | -| `session.abort({ path })` | Cancelar una sesión en ejecución | Devuelve `boolean` | -| `session.share({ path })` | Compartir sesión | DevuelveSession| -| `session.unshare({ path })` | Dejar de compartir sesión | DevuelveSession| -| `session.summarize({ path, body })` | Resumir sesión | Devuelve `boolean` | -| `session.messages({ path })` | Listar mensajes en una sesión | Devuelve `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Obtener detalles del mensaje | Devuelve `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelveAssistantMessagecon respuesta de IA | -| `session.command({ path, body })` | Enviar comando a la sesión | Devuelve `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Ejecute un comando de shell | DevuelveAssistantMessage| -| `session.revert({ path, body })` | Revertir un mensaje | DevuelveSession| -| `session.unrevert({ path })` | Restaurar mensajes revertidos | DevuelveSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a una solicitud de permiso | Devuelve `boolean` | +| Método | Descripción | Notas | +| ---------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Listar sesiones | DevuelveSession[]| +| `session.get({ path })` | Obtener sesión | DevuelveSession| +| `session.children({ path })` | Listar sesiones secundarias | DevuelveSession[]| +| `session.create({ body })` | Crear sesión | DevuelveSession| +| `session.delete({ path })` | Eliminar sesión | Devuelve `boolean` | +| `session.update({ path, body })` | Actualizar propiedades de sesión | DevuelveSession| +| `session.init({ path, body })` | Analizar aplicación y crear `AGENTS.md` | Devuelve `boolean` | +| `session.abort({ path })` | Cancelar una sesión en ejecución | Devuelve `boolean` | +| `session.share({ path })` | Compartir sesión | DevuelveSession| +| `session.unshare({ path })` | Dejar de compartir sesión | DevuelveSession| +| `session.summarize({ path, body })` | Resumir sesión | Devuelve `boolean` | +| `session.messages({ path })` | Listar mensajes en una sesión | Devuelve `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Obtener detalles del mensaje | Devuelve `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelveAssistantMessagecon respuesta de IA. Admite `body.outputFormat` para [salida estructurada](#salida-estructurada) | +| `session.command({ path, body })` | Enviar comando a la sesión | Devuelve `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Ejecute un comando de shell | DevuelveAssistantMessage| +| `session.revert({ path, body })` | Revertir un mensaje | DevuelveSession| +| `session.unrevert({ path })` | Restaurar mensajes revertidos | DevuelveSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a una solicitud de permiso | Devuelve `boolean` | --- diff --git a/packages/web/src/content/docs/es/themes.mdx b/packages/web/src/content/docs/es/themes.mdx index d7c7426267c..8c8028eb6e0 100644 --- a/packages/web/src/content/docs/es/themes.mdx +++ b/packages/web/src/content/docs/es/themes.mdx @@ -61,11 +61,11 @@ El tema del sistema es para usuarios que: ## Usar un tema -Puede seleccionar un tema abriendo la selección de tema con el comando `/theme`. O puede especificarlo en su [config](/docs/config). +Puede seleccionar un tema abriendo la selección de tema con el comando `/theme`. O puede especificarlo en `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/es/tui.mdx b/packages/web/src/content/docs/es/tui.mdx index ba7430f5020..02f14d55ad8 100644 --- a/packages/web/src/content/docs/es/tui.mdx +++ b/packages/web/src/content/docs/es/tui.mdx @@ -355,24 +355,34 @@ Algunos editores necesitan argumentos de línea de comandos para ejecutarse en m ## Configurar -Puede personalizar el comportamiento de TUI a través de su archivo de configuración OpenCode. +Puede personalizar el comportamiento de TUI a través de `tui.json` (o `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Esto es independiente de `opencode.json`, que configura el comportamiento del servidor/tiempo de ejecución. + ### Opciones -- `scroll_acceleration`: habilite la aceleración de desplazamiento estilo macOS para un desplazamiento suave y natural. Cuando está habilitado, la velocidad de desplazamiento aumenta con gestos de desplazamiento rápido y se mantiene precisa para movimientos más lentos. **Esta configuración tiene prioridad sobre `scroll_speed` y la anula cuando está habilitada.** -- `scroll_speed`: controla la rapidez con la que se desplaza el TUI cuando se utilizan comandos de desplazamiento (mínimo: `1`). El valor predeterminado es `3`. **Nota: Esto se ignora si `scroll_acceleration.enabled` está configurado en `true`.** +- `theme`: establece su tema de interfaz de usuario. [Más información](/docs/themes). +- `keybinds`: personaliza los atajos de teclado. [Más información](/docs/keybinds). +- `scroll_acceleration.enabled`: habilite la aceleración de desplazamiento estilo macOS para un desplazamiento suave y natural. Cuando está habilitado, la velocidad de desplazamiento aumenta con gestos de desplazamiento rápido y se mantiene precisa para movimientos más lentos. **Esta configuración tiene prioridad sobre `scroll_speed` y la anula cuando está habilitada.** +- `scroll_speed`: controla la rapidez con la que se desplaza el TUI cuando se utilizan comandos de desplazamiento (mínimo: `0.001`, admite valores decimales). El valor predeterminado es `3`. **Nota: Esto se ignora si `scroll_acceleration.enabled` está configurado en `true`.** +- `diff_style`: controla la representación de diferencias. `"auto"` se adapta al ancho del terminal, `"stacked"` siempre muestra un diseño de una sola columna. + +Utilice `OPENCODE_TUI_CONFIG` para cargar una ruta de configuración de TUI personalizada. --- diff --git a/packages/web/src/content/docs/es/zen.mdx b/packages/web/src/content/docs/es/zen.mdx index 10847b452e4..94838902a51 100644 --- a/packages/web/src/content/docs/es/zen.mdx +++ b/packages/web/src/content/docs/es/zen.mdx @@ -62,6 +62,7 @@ También puede acceder a nuestros modelos a través de los siguientes puntos fin | Modelo | Model ID | Endpoint | AI SDK package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -71,22 +72,24 @@ También puede acceder a nuestros modelos a través de los siguientes puntos fin | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -115,29 +118,34 @@ Apoyamos un modelo de pago por uso. A continuación se muestran los precios **po | Modelo | Entrada | Salida | Lectura en caché | Escritura en caché | | ------------------------------------ | ------- | ------ | ---------------- | ------------------ | | Big Pickle | Gratis | Gratis | Gratis | - | -| MiniMax M2.1 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 | $0,30 | $1,20 | $0,06 | - | | MiniMax M2.1 | $0,30 | $1,20 | $0,10 | - | -| GLM 4.7 Free | Gratis | Gratis | Gratis | - | +| GLM 5 | $1,00 | $3,20 | $0,20 | - | | GLM 4.7 | $0,60 | $2.20 | $0,10 | - | | GLM 4.6 | $0,60 | $2.20 | $0,10 | - | -| Kimi K2.5 Free | Gratis | Gratis | Gratis | - | | Kimi K2.5 | $0,60 | $3.00 | $0,08 | - | | Kimi K2 Thinking | $0,40 | $2.50 | - | - | | Kimi K2 | $0,40 | $2.50 | - | - | | Qwen3 Coder 480B | $0,45 | $1,50 | - | - | +| Claude Opus 4.6 (≤ 200.000 tokens) | $5.00 | $25.00 | $0,50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37,50 | $1.00 | $12,50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0,50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1,50 | $18,75 | +| Claude Sonnet 4.6 (≤ 200.000 tokens) | $3.00 | $15.00 | $0,30 | $3,75 | +| Claude Sonnet 4.6 (> 200.000 tokens) | $6.00 | $22,50 | $0,60 | $7.50 | | Claude Sonnet 4.5 (≤ 200.000 tokens) | $3.00 | $15.00 | $0,30 | $3,75 | | Claude Sonnet 4.5 (> 200.000 tokens) | $6.00 | $22,50 | $0,60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0,30 | $3,75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22,50 | $0,60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0,10 | $1,25 | | Claude Haiku 3.5 | $0,80 | $4.00 | $0,08 | $1.00 | -| Claude Opus 4.6 (≤ 200.000 tokens) | $5.00 | $25.00 | $0,50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37,50 | $1.00 | $12,50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0,50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1,50 | $18,75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0,20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0,40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0,20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0,40 | - | | Gemini 3 Flash | $0,50 | $3.00 | $0,05 | - | +| GPT 5.3 Codex | $1,75 | $14.00 | $0,175 | - | | GPT 5.2 | $1,75 | $14.00 | $0,175 | - | | GPT 5.2 Codex | $1,75 | $14.00 | $0,175 | - | | GPT 5.1 | $1.07 | $8,50 | $0,107 | - | @@ -156,9 +164,7 @@ Las tarifas de las tarjetas de crédito se trasladan al costo (4,4% + 0,30 dóla Los modelos gratuitos: -- GLM 4.7 Free está disponible en OpenCode por tiempo limitado. El equipo está aprovechando este tiempo para recopilar comentarios y mejorar el modelo. -- Kimi K2.5 Free está disponible en OpenCode por tiempo limitado. El equipo está aprovechando este tiempo para recopilar comentarios y mejorar el modelo. -- MiniMax M2.1 Free está disponible en OpenCode por tiempo limitado. El equipo está aprovechando este tiempo para recopilar comentarios y mejorar el modelo. +- MiniMax M2.5 Free está disponible en OpenCode por tiempo limitado. El equipo está aprovechando este tiempo para recopilar comentarios y mejorar el modelo. - Big Pickle es un modelo sigiloso gratuito en OpenCode por tiempo limitado. El equipo está aprovechando este tiempo para recopilar comentarios y mejorar el modelo. Contáctenos si tiene alguna pregunta. @@ -189,9 +195,7 @@ cobrarle más de $20 si su saldo es inferior a $5. Todos nuestros modelos están alojados en los EE. UU. Nuestros proveedores siguen una política de retención cero y no utilizan sus datos para la capacitación de modelos, con las siguientes excepciones: - Big Pickle: Durante su periodo gratuito, los datos recopilados podrán utilizarse para mejorar el modelo. -- GLM 4.7 Gratis: Durante su periodo gratuito, los datos recopilados podrán utilizarse para mejorar el modelo. -- Kimi K2.5 Free: Durante su periodo gratuito, los datos recopilados podrán utilizarse para mejorar el modelo. -- MiniMax M2.1 Free: Durante su período gratuito, los datos recopilados podrán utilizarse para mejorar el modelo. +- MiniMax M2.5 Free: Durante su período gratuito, los datos recopilados podrán utilizarse para mejorar el modelo. - API de OpenAI: las solicitudes se conservan durante 30 días de acuerdo con las [Políticas de datos de OpenAI](https://platform.openai.com/docs/guides/your-data). - API de Anthropic: las solicitudes se conservan durante 30 días de acuerdo con las [Políticas de datos de Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). diff --git a/packages/web/src/content/docs/fr/cli.mdx b/packages/web/src/content/docs/fr/cli.mdx index 8773d941f37..92a473d34b8 100644 --- a/packages/web/src/content/docs/fr/cli.mdx +++ b/packages/web/src/content/docs/fr/cli.mdx @@ -558,6 +558,7 @@ OpenCode peut être configuré à l'aide de variables d'environnement. | `OPENCODE_AUTO_SHARE` | booléen | Partager automatiquement des sessions | | `OPENCODE_GIT_BASH_PATH` | chaîne | Chemin vers l'exécutable Git Bash sur Windows | | `OPENCODE_CONFIG` | chaîne | Chemin d'accès au fichier de configuration | +| `OPENCODE_TUI_CONFIG` | chaîne | Chemin d'accès au fichier de configuration TUI | | `OPENCODE_CONFIG_DIR` | chaîne | Chemin d'accès au répertoire de configuration | | `OPENCODE_CONFIG_CONTENT` | chaîne | Contenu de configuration JSON en ligne | | `OPENCODE_DISABLE_AUTOUPDATE` | booléen | Désactiver les vérifications automatiques des mises à jour | diff --git a/packages/web/src/content/docs/fr/config.mdx b/packages/web/src/content/docs/fr/config.mdx index 8c0d15e183a..c576fe2da11 100644 --- a/packages/web/src/content/docs/fr/config.mdx +++ b/packages/web/src/content/docs/fr/config.mdx @@ -14,10 +14,11 @@ OpenCode prend en charge les formats **JSON** et **JSONC** (JSON avec commentair ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -34,7 +35,7 @@ Les fichiers de configuration sont **fusionnés**, pas remplacés. Les fichiers de configuration sont fusionnés et non remplacés. Les paramètres des emplacements de configuration suivants sont combinés. Les configurations ultérieures remplacent les précédentes uniquement en cas de clés en conflit. Les paramètres non conflictuels de toutes les configurations sont conservés. -Par exemple, si votre configuration globale définit `theme: "opencode"` et `autoupdate: true` et que la configuration de votre projet définit `model: "anthropic/claude-sonnet-4-5"`, la configuration finale inclura les trois paramètres. +Par exemple, si votre configuration globale définit `autoupdate: true` et que la configuration de votre projet définit `model: "anthropic/claude-sonnet-4-5"`, la configuration finale inclura les deux paramètres. --- @@ -95,7 +96,9 @@ Vous pouvez activer des serveurs spécifiques dans votre configuration locale : ### Globale -Placez votre configuration globale OpenCode dans `~/.config/opencode/opencode.json`. Utilisez la configuration globale pour les préférences de l'utilisateur telles que les thèmes, les fournisseurs ou les raccourcis clavier. +Placez votre configuration globale OpenCode dans `~/.config/opencode/opencode.json`. Utilisez la configuration globale pour les préférences de l'utilisateur telles que les fournisseurs, les modèles et les autorisations. + +Pour les paramètres spécifiques à TUI, utilisez `~/.config/opencode/tui.json`. La configuration globale remplace les paramètres par défaut de l'organisation distante. @@ -105,6 +108,8 @@ La configuration globale remplace les paramètres par défaut de l'organisation Ajoutez `opencode.json` à la racine de votre projet. La configuration du projet a la priorité la plus élevée parmi les fichiers de configuration standard : elle remplace les configurations globales et distantes. +Pour les paramètres TUI spécifiques au projet, ajoutez `tui.json` à côté. + :::tip Placez la configuration spécifique au projet à la racine de votre projet. ::: @@ -145,34 +150,32 @@ Le répertoire personnalisé est chargé après les répertoires de configuratio Le fichier de configuration a un schéma défini dans [**`opencode.ai/config.json`**](https://opencode.ai/config.json). +La configuration TUI utilise [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json). + Votre éditeur doit être capable de valider et de compléter automatiquement en fonction du schéma. --- ### TUI -Vous pouvez configurer les paramètres spécifiques à TUI via l'option `tui`. +Utilisez un fichier dédié `tui.json` (ou `tui.jsonc`) pour les paramètres spécifiques à TUI. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Options disponibles : +Utilisez `OPENCODE_TUI_CONFIG` pour pointer vers un fichier de configuration TUI personnalisé. -- `scroll_acceleration.enabled` - Active l'accélération de défilement de style macOS. **A priorité sur `scroll_speed`.** -- `scroll_speed` - Multiplicateur de vitesse de défilement personnalisé (par défaut : `3`, minimum : `1`). Ignoré si `scroll_acceleration.enabled` est `true`. -- `diff_style` - Contrôle le rendu différentiel. `"auto"` s'adapte à la largeur du terminal, `"stacked"` affiche toujours une seule colonne. +Les anciennes clés `theme`, `keybinds` et `tui` dans `opencode.json` sont obsolètes et migrées automatiquement lorsque cela est possible. -[En savoir plus sur l'utilisation du TUI ici](/docs/tui). +[En savoir plus sur l'utilisation du TUI ici](/docs/tui#configure). --- @@ -298,12 +301,12 @@ Les jetons du porteur (`AWS_BEARER_TOKEN_BEDROCK` ou `/connect`) ont priorité s ### Thèmes -Vous pouvez configurer le thème que vous souhaitez utiliser dans votre configuration OpenCode via l'option `theme`. +Définissez votre thème d'interface utilisateur dans `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -403,11 +406,11 @@ Vous pouvez également définir des commandes à l'aide de fichiers markdown dan ### Raccourcis clavier -Vous pouvez personnaliser vos raccourcis clavier via l'option `keybinds`. +Personnalisez les raccourcis clavier dans `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -487,13 +490,15 @@ Vous pouvez contrôler le comportement de compactage du contexte via l'option `c "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Compacte automatiquement la session lorsque le contexte est plein (par défaut : `true`). - `prune` - Supprimez les anciennes sorties de l'outil pour économiser des tokens (par défaut : `true`). +- `reserved` - Tampon de jetons pour le compactage. Laisse suffisamment de marge pour éviter le débordement lors du compactage. --- diff --git a/packages/web/src/content/docs/fr/lsp.mdx b/packages/web/src/content/docs/fr/lsp.mdx index cf2dfb6180d..8a83370da05 100644 --- a/packages/web/src/content/docs/fr/lsp.mdx +++ b/packages/web/src/content/docs/fr/lsp.mdx @@ -27,6 +27,7 @@ OpenCode est livré avec plusieurs serveurs LSP intégrés pour les langages pop | gopls | .go | Commande `go` disponible | | hls | .hs, .lhs | Commande `haskell-language-server-wrapper` disponible | | jdtls | .java | `Java SDK (version 21+)` installé | +| julials | .jl | `julia` et `LanguageServer.jl` installés | | kotlin-ls | .kt, .kts | Installation automatique pour les projets Kotlin | | lua-ls | .lua | Installation automatique pour les projets Lua | | nixd | .nix | Commande `nixd` disponible | diff --git a/packages/web/src/content/docs/fr/mcp-servers.mdx b/packages/web/src/content/docs/fr/mcp-servers.mdx index e1d1f24e7c0..5d012868799 100644 --- a/packages/web/src/content/docs/fr/mcp-servers.mdx +++ b/packages/web/src/content/docs/fr/mcp-servers.mdx @@ -375,9 +375,9 @@ Si vous disposez d'un grand nombre de serveurs MCP, vous souhaiterez peut-être --- -#### Patterns glob +#### Modèles globaux -Le pattern glob utilise des modèles de globbing regex simples : +Le modèle glob utilise des modèles de globbing regex simples : - `*` correspond à zéro ou plusieurs caractères (par exemple, `"my-mcp*"` correspond à `my-mcp_search`, `my-mcp_list`, etc.) - `?` correspond exactement à un caractère @@ -509,473 +509,3 @@ Alternativement, vous pouvez ajouter quelque chose comme ceci à votre [AGENTS.m ```md title="AGENTS.md" If you are unsure how to do something, use `gh_grep` to search code examples from GitHub. ``` - -Vous pouvez également désactiver un serveur en définissant `enabled` sur `false`. Ceci est utile si vous souhaitez désactiver temporairement un serveur sans le supprimer de votre configuration. - ---- - -### Remplacement des valeurs par défaut distantes - -Les organisations peuvent fournir des serveurs MCP par défaut via leur point de terminaison `.well-known/opencode`. Ces serveurs peuvent être désactivés par défaut, permettant aux utilisateurs de choisir ceux dont ils ont besoin. - -Pour activer un serveur spécifique à partir de la configuration distante de votre organisation, ajoutez-le à votre configuration locale avec `enabled: true` : - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "jira": { - "type": "remote", - "url": "https://jira.example.com/mcp", - "enabled": true - } - } -} -``` - -Vos valeurs de configuration locales remplacent les valeurs par défaut distantes. Voir [config precedence](/docs/config#precedence-order) pour plus de détails. - ---- - -## Local - -Ajoutez des serveurs MCP locaux en utilisant `type` à `"local"` dans l'objet MCP. - -```jsonc title="opencode.jsonc" {15} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-local-mcp-server": { - "type": "local", - // Or ["bun", "x", "my-mcp-command"] - "command": ["npx", "-y", "my-mcp-command"], - "enabled": true, - "environment": { - "MY_ENV_VAR": "my_env_var_value", - }, - }, - }, -} -``` - -La commande indique comment le serveur MCP local est démarré. Vous pouvez également transmettre une liste de variables d’environnement. - -Par exemple, voici comment ajouter le serveur de test [`@modelcontextprotocol/server-everything`](https://www.npmjs.com/package/@modelcontextprotocol/server-everything) MCP. - -```jsonc title="opencode.jsonc" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "mcp_everything": { - "type": "local", - "command": ["npx", "-y", "@modelcontextprotocol/server-everything"], - }, - }, -} -``` - -Et pour l'utiliser, je peux ajouter `use the mcp_everything tool` à mes invites. - -```txt "mcp_everything" -use the mcp_everything tool to add the number 3 and 4 -``` - ---- - -#### Options - -Voici toutes les options pour configurer un serveur MCP local. - -| Options | Tapez | Obligatoire | Descriptif | -| ------------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `type` | Chaîne | Oui | Le type de connexion au serveur MCP doit être `"local"`. | -| `command` | Tableau | Oui | Commande et arguments pour exécuter le serveur MCP. | -| `environment` | Objet | | Variables d'environnement à définir lors de l'exécution du serveur. | -| `enabled` | Booléen | | Activez ou désactivez le serveur MCP au démarrage. | -| `timeout` | Numéro | | Délai d'expiration en ms pour la récupération des outils depuis le serveur MCP. La valeur par défaut est 5 000 (5 secondes). | - ---- - -## Remote - -Ajoutez des serveurs MCP distants en définissant `type` sur `"remote"`. - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-remote-mcp": { - "type": "remote", - "url": "https://my-mcp-server.com", - "enabled": true, - "headers": { - "Authorization": "Bearer MY_API_KEY" - } - } - } -} -``` - -Le champ `url` est l'URL du serveur MCP distant et l'option `headers` vous permet de transmettre des en-têtes. - ---- - -#### Options - -| Options | Tapez | Obligatoire | Descriptif | -| --------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `type` | Chaîne | Oui | Le type de connexion au serveur MCP doit être `"remote"`. | -| `url` | Chaîne | Oui | URL du serveur MCP distant. | -| `enabled` | Booléen | | Activez ou désactivez le serveur MCP au démarrage. | -| `headers` | Objet | | En-têtes à envoyer avec la demande. | -| `oauth` | Objet | | Configuration de l'authentification OAuth. Voir la section [OAuth](#oauth) ci-dessous. | -| `timeout` | Numéro | | Délai d'expiration en ms pour la récupération des outils depuis le serveur MCP. La valeur par défaut est 5 000 (5 secondes). | - ---- - -## OAuth - -OpenCode gère automatiquement l'authentification OAuth pour les serveurs MCP distants. Lorsqu'un serveur nécessite une authentification, OpenCode : - -1. Détectez la réponse 401 et lancez le flux OAuth -2. Utilisez **Enregistrement client dynamique (RFC 7591)** s'il est pris en charge par le serveur. -3. Stockez les jetons en toute sécurité pour les demandes futures - ---- - -### Automatique - -Pour la plupart des serveurs MCP compatibles OAuth, aucune configuration particulière n'est nécessaire. Configurez simplement le serveur distant : - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-oauth-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp" - } - } -} -``` - -Si le serveur nécessite une authentification, OpenCode vous demandera de vous authentifier lorsque vous essayez de l'utiliser pour la première fois. Sinon, vous pouvez [déclencher manuellement le flux](#authenticating) avec `opencode mcp auth`. - ---- - -### Pré-inscrit - -Si vous disposez des informations d'identification client du fournisseur de serveur MCP, vous pouvez les configurer : - -```json title="opencode.json" {7-11} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-oauth-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp", - "oauth": { - "clientId": "{env:MY_MCP_CLIENT_ID}", - "clientSecret": "{env:MY_MCP_CLIENT_SECRET}", - "scope": "tools:read tools:execute" - } - } - } -} -``` - ---- - -### Authentification - -Vous pouvez déclencher manuellement l'authentification ou gérer les informations d'identification. - -Authentifiez-vous auprès d'un serveur MCP spécifique : - -```bash -opencode mcp auth my-oauth-server -``` - -Répertoriez tous les serveurs MCP et leur statut d'authentification : - -```bash -opencode mcp list -``` - -Supprimez les informations d'identification stockées : - -```bash -opencode mcp logout my-oauth-server -``` - -La commande `mcp auth` ouvrira votre navigateur pour autorisation. Après votre autorisation, OpenCode stockera les jetons en toute sécurité dans `~/.local/share/opencode/mcp-auth.json`. - ---- - -#### Désactivation de OAuth - -Si vous souhaitez désactiver le OAuth automatique pour un serveur (par exemple, pour les serveurs qui utilisent les clés API à la place), définissez `oauth` sur `false` : - -```json title="opencode.json" {7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-api-key-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp", - "oauth": false, - "headers": { - "Authorization": "Bearer {env:MY_API_KEY}" - } - } - } -} -``` - ---- - -#### Options OAuth - -| Options | Tapez | Descriptif | -| -------------- | ------------- | ---------------------------------------------------------------------------------------- | -| `oauth` | Objet \| faux | Objet de configuration OAuth, ou `false` pour désactiver la détection automatique OAuth. | -| `clientId` | Chaîne | ID client OAuth. S’il n’est pas fourni, l’enregistrement dynamique du client sera tenté. | -| `clientSecret` | Chaîne | OAuth secret client, si requis par le serveur d'autorisation. | -| `scope` | Chaîne | OAuth scopes à demander lors de l'autorisation. | - -#### Débogage - -Si un serveur MCP distant ne parvient pas à s'authentifier, vous pouvez diagnostiquer les problèmes avec : - -```bash -# View auth status for all OAuth-capable servers -opencode mcp auth list - -# Debug connection and OAuth flow for a specific server -opencode mcp debug my-oauth-server -``` - -La commande `mcp debug` affiche l'état d'authentification actuel, teste la connectivité HTTP et tente le flux de découverte OAuth. - ---- - -## Gérer - -Vos MCP sont disponibles sous forme d'outils dans OpenCode, aux côtés des outils intégrés. Vous pouvez donc les gérer via la configuration OpenCode comme n'importe quel autre outil. - ---- - -### Global - -Cela signifie que vous pouvez les activer ou les désactiver globalement. - -```json title="opencode.json" {14} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp-foo": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-foo"] - }, - "my-mcp-bar": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-bar"] - } - }, - "tools": { - "my-mcp-foo": false - } -} -``` - -Nous pouvons également utiliser un modèle global pour désactiver tous les MCP correspondants. - -```json title="opencode.json" {14} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp-foo": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-foo"] - }, - "my-mcp-bar": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-bar"] - } - }, - "tools": { - "my-mcp*": false - } -} -``` - -Ici, nous utilisons le modèle global `my-mcp*` pour désactiver tous les MCP. - ---- - -### Par agent - -Si vous disposez d'un grand nombre de serveurs MCP, vous souhaiterez peut-être les activer uniquement par agent et les désactiver globalement. Pour ce faire : - -1. Désactivez-le en tant qu'outil à l'échelle mondiale. -2. Dans votre [agent config](/docs/agents#tools), activez le serveur MCP en tant qu'outil. - -```json title="opencode.json" {11, 14-18} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp": { - "type": "local", - "command": ["bun", "x", "my-mcp-command"], - "enabled": true - } - }, - "tools": { - "my-mcp*": false - }, - "agent": { - "my-agent": { - "tools": { - "my-mcp*": true - } - } - } -} -``` - ---- - -#### Modèles globaux - -Le modèle glob utilise des modèles de globbing regex simples : - -- `*` correspond à zéro ou plusieurs caractères (par exemple, `"my-mcp*"` correspond à `my-mcp_search`, `my-mcp_list`, etc.) -- `?` correspond exactement à un caractère -- Tous les autres caractères correspondent littéralement - -:::note -Les outils serveur MCP sont enregistrés avec le nom du serveur comme préfixe, donc pour désactiver tous les outils d'un serveur, utilisez simplement : - -``` -"mymcpservername_*": false -``` - -::: - ---- - -## Exemples - -Vous trouverez ci-dessous des exemples de serveurs MCP courants. Vous pouvez soumettre un PR si vous souhaitez documenter d'autres serveurs. - ---- - -### Sentry - -Ajoutez le [serveur Sentry MCP](https://mcp.sentry.dev) pour interagir avec vos projets et problèmes Sentry. - -```json title="opencode.json" {4-8} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "sentry": { - "type": "remote", - "url": "https://mcp.sentry.dev/mcp", - "oauth": {} - } - } -} -``` - -Après avoir ajouté la configuration, authentifiez-vous auprès de Sentry : - -```bash -opencode mcp auth sentry -``` - -Cela ouvrira une fenêtre de navigateur pour terminer le flux OAuth et connecter OpenCode à votre compte Sentry. - -Une fois authentifié, vous pouvez utiliser les outils Sentry dans vos invites pour interroger les problèmes, les projets et les données d'erreur. - -```txt "use sentry" -Show me the latest unresolved issues in my project. use sentry -``` - ---- - -### Contexte7 - -Ajoutez le [Context7 MCP server](https://github.com/upstash/context7) pour effectuer une recherche dans les documents. - -```json title="opencode.json" {4-7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "context7": { - "type": "remote", - "url": "https://mcp.context7.com/mcp" - } - } -} -``` - -Si vous avez créé un compte gratuit, vous pouvez utiliser votre clé API et obtenir des limites de débit plus élevées. - -```json title="opencode.json" {7-9} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "context7": { - "type": "remote", - "url": "https://mcp.context7.com/mcp", - "headers": { - "CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}" - } - } - } -} -``` - -Ici, nous supposons que la variable d'environnement `CONTEXT7_API_KEY` est définie. - -Ajoutez `use context7` à vos invites pour utiliser le serveur Context7 MCP. - -```txt "use context7" -Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7 -``` - -Alternativement, vous pouvez ajouter quelque chose comme ceci à votre [AGENTS.md](/docs/rules/). - -```md title="AGENTS.md" -When you need to search docs, use `context7` tools. -``` - ---- - -### Grep by Vercel - -Ajoutez le serveur [Grep by Vercel](https://grep.app) MCP pour rechercher des extraits de code sur GitHub. - -```json title="opencode.json" {4-7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "gh_grep": { - "type": "remote", - "url": "https://mcp.grep.app" - } - } -} -``` - -Puisque nous avons nommé notre serveur MCP `gh_grep`, vous pouvez ajouter `use the gh_grep tool` à vos invites pour que l'agent l'utilise. - -```txt "use the gh_grep tool" -What's the right way to set a custom domain in an SST Astro component? use the gh_grep tool -``` - -Alternativement, vous pouvez ajouter quelque chose comme ceci à votre [AGENTS.md](/docs/rules/). - -```md title="AGENTS.md" -If you are unsure how to do something, use `gh_grep` to search code examples from GitHub. -``` diff --git a/packages/web/src/content/docs/fr/providers.mdx b/packages/web/src/content/docs/fr/providers.mdx index b65e9c00a15..36e1ed2d2bf 100644 --- a/packages/web/src/content/docs/fr/providers.mdx +++ b/packages/web/src/content/docs/fr/providers.mdx @@ -84,6 +84,38 @@ Il fonctionne comme n’importe quel autre fournisseur dans OpenCode et son util --- +## OpenCode Go + +OpenCode Go est un plan d'abonnement à faible coût qui offre un accès fiable aux modèles de codage ouverts populaires fournis par l'équipe OpenCode qui ont été +testé et vérifié pour fonctionner correctement avec OpenCode. + +1. Exécutez la commande `/connect` dans le TUI, sélectionnez `OpenCode Go` et rendez-vous sur [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Connectez-vous, ajoutez vos informations de facturation et copiez votre clé API. + +3. Collez votre clé API. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Exécutez `/models` dans le TUI pour voir la liste des modèles que nous recommandons. + + ```txt + /models + ``` + +Il fonctionne comme n’importe quel autre fournisseur dans OpenCode et son utilisation est totalement facultative. + +--- + ## Annuaire Examinons certains fournisseurs en détail. Si vous souhaitez ajouter un fournisseur au @@ -1487,6 +1519,39 @@ Ou ajoutez-le à votre profil bash : --- +### STACKIT + +STACKIT AI Model Serving fournit un environnement d'hébergement souverain entièrement géré pour les modèles d'IA, se concentrant sur les LLM comme Llama, Mistral et Qwen, avec une souveraineté maximale des données sur l'infrastructure européenne. + +1. Rendez-vous sur le [portail STACKIT](https://portal.stackit.cloud), accédez à **AI Model Serving** et créez un jeton d'authentification pour votre projet. + + :::tip + Vous avez besoin d'un compte client STACKIT, d'un compte utilisateur et d'un projet avant de créer des jetons d'authentification. + ::: + +2. Exécutez la commande `/connect` et recherchez **STACKIT**. + + ```txt + /connect + ``` + +3. Entrez votre jeton d'authentification STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Exécutez la commande `/models` pour sélectionner parmi les modèles disponibles tels que _Qwen3-VL 235B_ ou _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Rendez-vous sur le [Panneau OVHcloud](https://ovh.com/manager). Accédez à la section `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` et dans l'onglet `API Keys`, cliquez sur **Créer une nouvelle clé API**. diff --git a/packages/web/src/content/docs/fr/sdk.mdx b/packages/web/src/content/docs/fr/sdk.mdx index 0e67aebd00a..ee3a2dc49c2 100644 --- a/packages/web/src/content/docs/fr/sdk.mdx +++ b/packages/web/src/content/docs/fr/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Sortie structurée + +Vous pouvez demander une sortie JSON structurée au modèle en spécifiant un `format` avec un schéma JSON. Le modèle utilisera un outil `StructuredOutput` pour renvoyer un JSON validé correspondant à votre schéma. + +### Utilisation de base + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Types de format de sortie + +| Type | Description | +| ------------- | ----------------------------------------------------------------- | +| `text` | Par défaut. Réponse textuelle standard (pas de sortie structurée) | +| `json_schema` | Renvoie un JSON validé correspondant au schéma fourni | + +### Format de schéma JSON + +Lors de l'utilisation de `type: 'json_schema'`, fournissez : + +| Champ | Type | Description | +| ------------ | --------------- | --------------------------------------------------------------- | +| `type` | `'json_schema'` | Requis. Spécifie le mode de schéma JSON | +| `schema` | `object` | Requis. Objet JSON Schema définissant la structure de sortie | +| `retryCount` | `number` | Facultatif. Nombre de tentatives de validation (par défaut : 2) | + +### Gestion des erreurs + +Si le modèle ne parvient pas à produire une sortie structurée valide après toutes les tentatives, la réponse inclura une `StructuredOutputError` : + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Bonnes pratiques + +1. **Fournissez des descriptions claires** dans les propriétés de votre schéma pour aider le modèle à comprendre quelles données extraire +2. **Utilisez `required`** pour spécifier quels champs doivent être présents +3. **Gardez les schémas ciblés** - les schémas imbriqués complexes peuvent être plus difficiles à remplir correctement pour le modèle +4. **Définissez un `retryCount` approprié** - augmentez-le pour les schémas complexes, diminuez-le pour les simples + +--- + ## APIs Le SDK expose toutes les API du serveur via un client de type sécurisé. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Séances -| Méthode | Descriptif | Remarques | -| ---------------------------------------------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | Liste des séances | Renvoie Session[]| -| `session.get({ path })` | Obtenir une session | RenvoieSession| -| `session.children({ path })` | Liste des sessions enfants | RenvoieSession[]| -| `session.create({ body })` | Créer une séance | RenvoieSession| -| `session.delete({ path })` | Supprimer la séance | Renvoie `boolean` | -| `session.update({ path, body })` | Mettre à jour les propriétés de la session | RenvoieSession| -| `session.init({ path, body })` | Analysez l'application et créez `AGENTS.md` | Renvoie `boolean` | -| `session.abort({ path })` | Abandonner une session en cours | Renvoie `boolean` | -| `session.share({ path })` | Séance de partage | RenvoieSession| -| `session.unshare({ path })` | Annuler le partage de la session | RenvoieSession| -| `session.summarize({ path, body })` | Résumer la séance | Renvoie `boolean` | -| `session.messages({ path })` | Liste des messages dans une session | Renvoie `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Obtenir les détails du message | Renvoie `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoieAssistantMessageavec réponse IA | -| `session.command({ path, body })` | Envoyer la commande à la session | Renvoie `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Exécuter une commande shell | RenvoieAssistantMessage| -| `session.revert({ path, body })` | Rétablir un message | RenvoieSession| -| `session.unrevert({ path })` | Restaurer les messages annulés | RenvoieSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Répondre à une demande d'autorisation | Renvoie `boolean` | +| Méthode | Descriptif | Remarques | +| ---------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Liste des séances | RenvoieSession[]| +| `session.get({ path })` | Obtenir une session | RenvoieSession| +| `session.children({ path })` | Liste des sessions enfants | RenvoieSession[]| +| `session.create({ body })` | Créer une séance | RenvoieSession| +| `session.delete({ path })` | Supprimer la séance | Renvoie `boolean` | +| `session.update({ path, body })` | Mettre à jour les propriétés de la session | RenvoieSession| +| `session.init({ path, body })` | Analysez l'application et créez `AGENTS.md` | Renvoie `boolean` | +| `session.abort({ path })` | Abandonner une session en cours | Renvoie `boolean` | +| `session.share({ path })` | Séance de partage | RenvoieSession| +| `session.unshare({ path })` | Annuler le partage de la session | RenvoieSession| +| `session.summarize({ path, body })` | Résumer la séance | Renvoie `boolean` | +| `session.messages({ path })` | Liste des messages dans une session | Renvoie `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Obtenir les détails du message | Renvoie `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoieAssistantMessageavec réponse IA. Prend en charge `body.outputFormat` pour [sortie structurée](#structured-output) | +| `session.command({ path, body })` | Envoyer la commande à la session | Renvoie `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Exécuter une commande shell | RenvoieAssistantMessage| +| `session.revert({ path, body })` | Rétablir un message | RenvoieSession| +| `session.unrevert({ path })` | Restaurer les messages annulés | RenvoieSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Répondre à une demande d'autorisation | Renvoie `boolean` | --- diff --git a/packages/web/src/content/docs/fr/themes.mdx b/packages/web/src/content/docs/fr/themes.mdx index d17f2169c71..696e56d59ce 100644 --- a/packages/web/src/content/docs/fr/themes.mdx +++ b/packages/web/src/content/docs/fr/themes.mdx @@ -61,11 +61,11 @@ Le thème système est destiné aux utilisateurs qui : ## Utiliser un thème -Vous pouvez sélectionner un thème en affichant la sélection de thème avec la commande `/theme`. Ou vous pouvez le spécifier dans votre [config](/docs/config). +Vous pouvez sélectionner un thème en affichant la sélection de thème avec la commande `/theme`. Ou vous pouvez le spécifier dans `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/fr/tui.mdx b/packages/web/src/content/docs/fr/tui.mdx index f9078508dd5..8129eb20124 100644 --- a/packages/web/src/content/docs/fr/tui.mdx +++ b/packages/web/src/content/docs/fr/tui.mdx @@ -355,24 +355,34 @@ Certains éditeurs ont besoin d'arguments de ligne de commande pour s'exécuter ## Configurer -Vous pouvez personnaliser le comportement de TUI via votre fichier de configuration OpenCode. +Vous pouvez personnaliser le comportement de TUI via `tui.json` (ou `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Ceci est séparé de `opencode.json`, qui configure le comportement du serveur/d'exécution. + ### Options -- `scroll_acceleration` - Activez l'accélération de défilement de style macOS pour un défilement fluide et naturel. Lorsqu'elle est activée, la vitesse de défilement augmente avec les gestes de défilement rapides et reste précise pour les mouvements plus lents. **Ce paramètre est prioritaire sur `scroll_speed` et le remplace lorsqu'il est activé.** -- `scroll_speed` - Contrôle la vitesse de défilement du TUI lors de l'utilisation des commandes de défilement (minimum : `1`). La valeur par défaut est `3`. **Remarque : Ceci est ignoré si `scroll_acceleration.enabled` est défini sur `true`.** +- `theme` - Définit votre thème d'interface utilisateur. [En savoir plus](/docs/themes). +- `keybinds` - Personnalise les raccourcis clavier. [En savoir plus](/docs/keybinds). +- `scroll_acceleration.enabled` - Activez l'accélération de défilement de style macOS pour un défilement fluide et naturel. Lorsqu'elle est activée, la vitesse de défilement augmente avec les gestes de défilement rapides et reste précise pour les mouvements plus lents. **Ce paramètre est prioritaire sur `scroll_speed` et le remplace lorsqu'il est activé.** +- `scroll_speed` - Contrôle la vitesse de défilement du TUI lors de l'utilisation des commandes de défilement (minimum : `0.001`, prend en charge les valeurs décimales). La valeur par défaut est `3`. **Remarque : Ceci est ignoré si `scroll_acceleration.enabled` est défini sur `true`.** +- `diff_style` - Contrôle le rendu différentiel. `"auto"` s'adapte à la largeur du terminal, `"stacked"` affiche toujours une seule colonne. + +Utilisez `OPENCODE_TUI_CONFIG` pour charger un chemin de configuration TUI personnalisé. --- diff --git a/packages/web/src/content/docs/fr/zen.mdx b/packages/web/src/content/docs/fr/zen.mdx index c69f2632f65..b973c2809b1 100644 --- a/packages/web/src/content/docs/fr/zen.mdx +++ b/packages/web/src/content/docs/fr/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Liste organisée de modèles fournis par OpenCode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -13,33 +13,25 @@ OpenCode Zen est une liste de modèles testés et vérifiés fournie par l'équi OpenCode Zen est actuellement en version bêta. ::: -Zen fonctionne comme n'importe quel autre fournisseur dans OpenCode. Vous vous connectez à OpenCode Zen et obtenez -votre clé API. C'est **complètement facultatif** et vous n'avez pas besoin de l'utiliser pour l'utiliser -OpenCode. +Zen fonctionne comme n'importe quel autre fournisseur dans OpenCode. Vous vous connectez à OpenCode Zen et obtenez votre clé API. C'est **complètement facultatif** et vous n'avez pas besoin de l'utiliser pour utiliser OpenCode. --- ## Arrière-plan -Il existe un grand nombre de modèles, mais seulement quelques-uns d'entre eux -ces modèles fonctionnent bien comme agents de codage. De plus, la plupart des fournisseurs sont -configuré très différemment; vous obtenez donc des performances et une qualité très différentes. +Il existe un grand nombre de modèles, mais seulement quelques-uns d'entre eux fonctionnent bien comme agents de codage. De plus, la plupart des fournisseurs sont configurés très différemment; vous obtenez donc des performances et une qualité très différentes. :::tip Nous avons testé un groupe sélectionné de modèles et de fournisseurs qui fonctionnent bien avec OpenCode. ::: -Donc, si vous utilisez un modèle via quelque chose comme OpenRouter, vous ne pourrez jamais être -assurez-vous que vous obtenez la meilleure version du modèle que vous souhaitez. +Donc, si vous utilisez un modèle via quelque chose comme OpenRouter, vous ne pourrez jamais être sûr que vous obtenez la meilleure version du modèle que vous souhaitez. -Pour résoudre ce problème, nous avons effectué plusieurs opérations : +Pour résoudre ce problème, nous avons effectué plusieurs opérations : -1. Nous avons testé un groupe sélectionné de modèles et discuté avec leurs équipes de la manière de - mieux vaut les exécuter. -2. Nous avons ensuite travaillé avec quelques prestataires pour nous assurer qu'ils étaient servis. - correctement. -3. Enfin, nous avons comparé la combinaison modèle/fournisseur et sommes arrivés - avec une liste que nous nous ferons un plaisir de recommander. +1. Nous avons testé un groupe sélectionné de modèles et discuté avec leurs équipes de la manière de mieux les exécuter. +2. Nous avons ensuite travaillé avec quelques prestataires pour nous assurer qu'ils étaient servis correctement. +3. Enfin, nous avons comparé la combinaison modèle/fournisseur et sommes arrivés avec une liste que nous nous ferons un plaisir de recommander. OpenCode Zen est une passerelle IA qui vous donne accès à ces modèles. @@ -49,8 +41,7 @@ OpenCode Zen est une passerelle IA qui vous donne accès à ces modèles. OpenCode Zen fonctionne comme n'importe quel autre fournisseur dans OpenCode. -1. Vous vous connectez à **OpenCode Zen**, ajoutez votre facturation - détails et copiez votre clé API. +1. Vous vous connectez à **OpenCode Zen**, ajoutez vos informations de facturation et copiez votre clé API. 2. Vous exécutez la commande `/connect` dans le TUI, sélectionnez OpenCode Zen et collez votre clé API. 3. Exécutez `/models` dans le TUI pour voir la liste des modèles que nous recommandons. @@ -64,6 +55,7 @@ Vous pouvez également accéder à nos modèles via les points de terminaison AP | Modèle | ID du modèle | Point de terminaison | Package SDK IA | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -73,36 +65,36 @@ Vous pouvez également accéder à nos modèles via les points de terminaison AP | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Big Pickle | big-pickle | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -Le [id du modèle](/docs/config/#models) dans votre configuration OpenCode -utilise le format `opencode/`. Par exemple, pour GPT 5.2 Codex, vous devez -utilisez `opencode/gpt-5.2-codex` dans votre configuration. +Le [id du modèle](/docs/config/#models) dans votre configuration OpenCode utilise le format `opencode/ `. Par exemple, pour GPT 5.2 Codex, vous devez utilisez `opencode/gpt-5.2-codex` dans votre configuration. --- ### Modèles -Vous pouvez récupérer la liste complète des modèles disponibles et leurs métadonnées à partir de : +Vous pouvez récupérer la liste complète des modèles disponibles et leurs métadonnées à partir de : ``` https://opencode.ai/zen/v1/models @@ -117,29 +109,34 @@ Nous soutenons un modèle de paiement à l'utilisation. Vous trouverez ci-dessou | Modèle | Entrée | Sortie | Lecture en cache | Écriture en cache | | --------------------------------- | ------- | ------- | ---------------- | ----------------- | | Big Pickle | Gratuit | Gratuit | Gratuit | - | -| MiniMax M2.1 Free | Gratuit | Gratuit | Gratuit | - | +| MiniMax M2.5 Free | Gratuit | Gratuit | Gratuit | - | +| MiniMax M2.5 | 0,30 $ | 1,20 $ | 0,06 $ | - | | MiniMax M2.1 | 0,30 $ | 1,20 $ | 0,10 $ | - | -| GLM 4.7 Free | Gratuit | Gratuit | Gratuit | - | +| GLM 5 | 1,00 $ | 3,20 $ | 0,20 $ | - | | GLM 4.7 | 0,60 $ | 2,20 $ | 0,10 $ | - | | GLM 4.6 | 0,60 $ | 2,20 $ | 0,10 $ | - | -| Kimi K2.5 Free | Gratuit | Gratuit | Gratuit | - | | Kimi K2.5 | 0,60 $ | 3,00 $ | 0,08 $ | - | | Kimi K2 Thinking | 0,40 $ | 2,50 $ | - | - | | Kimi K2 | 0,40 $ | 2,50 $ | - | - | | Qwen3 Coder 480B | 0,45 $ | 1,50 $ | - | - | +| Claude Opus 4.6 (≤ 200K jetons) | 5,00 $ | 25,00 $ | 0,50 $ | 6,25 $ | +| Claude Opus 4.6 (> 200K jetons) | 10,00 $ | 37,50 $ | 1,00 $ | 12,50 $ | +| Claude Opus 4.5 | 5,00 $ | 25,00 $ | 0,50 $ | 6,25 $ | +| Claude Opus 4.1 | 15,00 $ | 75,00 $ | 1,50 $ | 18,75 $ | +| Claude Sonnet 4.6 (≤ 200K jetons) | 3,00 $ | 15,00 $ | 0,30 $ | 3,75 $ | +| Claude Sonnet 4.6 (> 200K jetons) | 6,00 $ | 22,50 $ | 0,60 $ | 7,50 $ | | Claude Sonnet 4.5 (≤ 200K jetons) | 3,00 $ | 15,00 $ | 0,30 $ | 3,75 $ | | Claude Sonnet 4.5 (> 200K jetons) | 6,00 $ | 22,50 $ | 0,60 $ | 7,50 $ | | Claude Sonnet 4 (≤ 200K jetons) | 3,00 $ | 15,00 $ | 0,30 $ | 3,75 $ | | Claude Sonnet 4 (> 200K jetons) | 6,00 $ | 22,50 $ | 0,60 $ | 7,50 $ | | Claude Haiku 4.5 | 1,00 $ | 5,00 $ | 0,10 $ | 1,25 $ | | Claude Haiku 3.5 | 0,80 $ | 4,00 $ | 0,08 $ | 1,00 $ | -| Claude Opus 4.6 (≤ 200K jetons) | 5,00 $ | 25,00 $ | 0,50 $ | 6,25 $ | -| Claude Opus 4.6 (> 200K jetons) | 10,00 $ | 37,50 $ | 1,00 $ | 12,50 $ | -| Claude Opus 4.5 | 5,00 $ | 25,00 $ | 0,50 $ | 6,25 $ | -| Claude Opus 4.1 | 15,00 $ | 75,00 $ | 1,50 $ | 18,75 $ | -| Gemini 3 Pro (≤ 200 000 jetons) | 2,00 $ | 12,00 $ | 0,20 $ | - | -| Gemini 3 Pro (> 200 000 jetons) | 4,00 $ | 18,00 $ | 0,40 $ | - | +| Gemini 3.1 Pro (≤ 200K jetons) | 2,00 $ | 12,00 $ | 0,20 $ | - | +| Gemini 3.1 Pro (> 200K jetons) | 4,00 $ | 18,00 $ | 0,40 $ | - | +| Gemini 3 Pro (≤ 200K jetons) | 2,00 $ | 12,00 $ | 0,20 $ | - | +| Gemini 3 Pro (> 200K jetons) | 4,00 $ | 18,00 $ | 0,40 $ | - | | Gemini 3 Flash | 0,50 $ | 3,00 $ | 0,05 $ | - | +| GPT 5.3 Codex | 1,75 $ | 14,00 $ | 0,175 $ | - | | GPT 5.2 | 1,75 $ | 14,00 $ | 0,175 $ | - | | GPT 5.2 Codex | 1,75 $ | 14,00 $ | 0,175 $ | - | | GPT 5.1 | 1,07 $ | 8,50 $ | 0,107 $ | - | @@ -158,9 +155,7 @@ Les frais de carte de crédit sont répercutés au prix coûtant (4,4 % + 0,30 $ Les modèles gratuits : -- GLM 4.7 Free est disponible sur OpenCode pour une durée limitée. L’équipe profite de ce temps pour recueillir des commentaires et améliorer le modèle. -- Kimi K2.5 Free est disponible sur OpenCode pour une durée limitée. L’équipe profite de ce temps pour recueillir des commentaires et améliorer le modèle. -- MiniMax M2.1 Free est disponible sur OpenCode pour une durée limitée. L’équipe profite de ce temps pour recueillir des commentaires et améliorer le modèle. +- MiniMax M2.5 Free est disponible sur OpenCode pour une durée limitée. L’équipe profite de ce temps pour recueillir des commentaires et améliorer le modèle. - Big Pickle est un modèle furtif gratuit sur OpenCode pour une durée limitée. L’équipe profite de ce temps pour recueillir des commentaires et améliorer le modèle. Contactez-nous si vous avez des questions. @@ -177,48 +172,41 @@ Vous pouvez modifier le montant du rechargement automatique. Vous pouvez égalem ### Limites mensuelles -Vous pouvez également définir une limite d'utilisation mensuelle pour l'ensemble de l'espace de travail et pour chaque -membre de votre équipe. +Vous pouvez également définir une limite d'utilisation mensuelle pour l'ensemble de l'espace de travail et pour chaque membre de votre équipe. -Par exemple, disons que vous définissez une limite d'utilisation mensuelle à 20 $, Zen n'utilisera pas -plus de 20 $ par mois. Mais si le rechargement automatique est activé, Zen pourrait finir par -vous facturant plus de 20 $ si votre solde descend en dessous de 5 $. +Par exemple, disons que vous définissez une limite d'utilisation mensuelle à 20 $, Zen n'utilisera pas plus de 20 $ par mois. Mais si le rechargement automatique est activé, Zen pourrait finir par vous facturant plus de 20 $ si votre solde descend en dessous de 5 $. --- ## Confidentialité -Tous nos modèles sont hébergés aux États-Unis. Nos fournisseurs suivent une politique de rétention zéro et n'utilisent pas vos données pour la formation de modèles, avec les exceptions suivantes : +Tous nos modèles sont hébergés aux États-Unis. Nos fournisseurs suivent une politique de rétention zéro et n'utilisent pas vos données pour la formation de modèles, avec les exceptions suivantes : - Big Pickle : Pendant sa période gratuite, les données collectées peuvent être utilisées pour améliorer le modèle. -- GLM 4.7 Gratuit : Pendant sa période gratuite, les données collectées peuvent être utilisées pour améliorer le modèle. -- Kimi K2.5 Gratuit : Pendant sa période gratuite, les données collectées peuvent être utilisées pour améliorer le modèle. -- MiniMax M2.1 Gratuit : Pendant sa période gratuite, les données collectées peuvent être utilisées pour améliorer le modèle. -- API OpenAI : les demandes sont conservées pendant 30 jours conformément aux politiques de données de [OpenAI](https://platform.openai.com/docs/guides/your-data). -- API Anthropic : les demandes sont conservées pendant 30 jours conformément aux [Politiques de données d'Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). +- MiniMax M2.5 Free : Pendant sa période gratuite, les données collectées peuvent être utilisées pour améliorer le modèle. +- API OpenAI : Les demandes sont conservées pendant 30 jours conformément aux politiques de données de [OpenAI](https://platform.openai.com/docs/guides/your-data). +- API Anthropic : Les demandes sont conservées pendant 30 jours conformément aux [Politiques de données d'Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). --- ## Pour les équipes -Zen fonctionne également très bien pour les équipes. Vous pouvez inviter des coéquipiers, attribuer des rôles, organiser -les modèles utilisés par votre équipe, et bien plus encore. +Zen fonctionne également très bien pour les équipes. Vous pouvez inviter des coéquipiers, attribuer des rôles, organiser les modèles utilisés par votre équipe, et bien plus encore. :::note Les espaces de travail sont actuellement gratuits pour les équipes dans le cadre de la version bêta. ::: -La gestion de votre espace de travail est actuellement gratuite pour les équipes dans le cadre de la version bêta. Nous serons -partagera bientôt plus de détails sur les prix. +La gestion de votre espace de travail est actuellement gratuite pour les équipes dans le cadre de la version bêta. Nous partagerons bientôt plus de détails sur les prix. --- ### Rôles -Vous pouvez inviter des coéquipiers dans votre espace de travail et attribuer des rôles : +Vous pouvez inviter des coéquipiers dans votre espace de travail et attribuer des rôles : -- **Administrateur** : gérez les modèles, les membres, les clés API et la facturation. -- **Membre** : gérer uniquement ses propres clés API +- **Administrateur** : gérez les modèles, les membres, les clés API et la facturation. +- **Membre** : gérer uniquement ses propres clés API Les administrateurs peuvent également définir des limites de dépenses mensuelles pour chaque membre afin de garder les coûts sous contrôle. @@ -228,8 +216,7 @@ Les administrateurs peuvent également définir des limites de dépenses mensuel Les administrateurs peuvent activer ou désactiver des modèles spécifiques pour l'espace de travail. Les requêtes adressées à un modèle désactivé renverront une erreur. -Ceci est utile dans les cas où vous souhaitez désactiver l'utilisation d'un modèle qui -collecte des données. +Ceci est utile dans les cas où vous souhaitez désactiver l'utilisation d'un modèle qui collecte des données. --- @@ -239,8 +226,7 @@ Vous pouvez utiliser vos propres clés OpenAI ou Anthropic API tout en accédant Lorsque vous utilisez vos propres clés, les tokens sont facturés directement par le fournisseur et non par Zen. -Par exemple, votre organisation dispose peut-être déjà d'une clé pour OpenAI ou Anthropic -et vous souhaitez l'utiliser à la place de celui fourni par Zen. +Par exemple, votre organisation dispose peut-être déjà d'une clé pour OpenAI ou Anthropic et vous souhaitez l'utiliser à la place de celui fourni par Zen. --- @@ -250,5 +236,5 @@ Nous avons créé OpenCode Zen pour : 1. **Benchmark** les meilleurs modèles/fournisseurs d'agents de codage. 2. Ayez accès aux options de **la plus haute qualité** et ne dégradez pas les performances ni ne vous dirigez vers des fournisseurs moins chers. -3. Répercutez toute **baisse de prix** en vendant au prix coûtant ; la seule majoration est donc pour couvrir nos frais de traitement. +3. Répercutez toute **baisse de prix** en vendant au prix coûtant ; la seule majoration est donc pour couvrir nos frais de traitement. 4. N'ayez **aucun verrouillage** en vous permettant de l'utiliser avec n'importe quel autre agent de codage. Et laissez-vous toujours utiliser n'importe quel autre fournisseur avec OpenCode également. diff --git a/packages/web/src/content/docs/it/cli.mdx b/packages/web/src/content/docs/it/cli.mdx index a97bbde1c96..b35292a0a51 100644 --- a/packages/web/src/content/docs/it/cli.mdx +++ b/packages/web/src/content/docs/it/cli.mdx @@ -558,6 +558,7 @@ OpenCode può essere configurato tramite variabili d'ambiente. | `OPENCODE_AUTO_SHARE` | boolean | Condivide automaticamente le sessioni | | `OPENCODE_GIT_BASH_PATH` | string | Percorso all'eseguibile Git Bash su Windows | | `OPENCODE_CONFIG` | string | Percorso al file di configurazione | +| `OPENCODE_TUI_CONFIG` | string | Percorso al file di configurazione TUI | | `OPENCODE_CONFIG_DIR` | string | Percorso alla directory di configurazione | | `OPENCODE_CONFIG_CONTENT` | string | Contenuto JSON di config inline | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Disabilita i controlli automatici di aggiornamento | diff --git a/packages/web/src/content/docs/it/config.mdx b/packages/web/src/content/docs/it/config.mdx index c94cc59a9b3..05741e172ed 100644 --- a/packages/web/src/content/docs/it/config.mdx +++ b/packages/web/src/content/docs/it/config.mdx @@ -14,10 +14,11 @@ OpenCode supporta sia **JSON** sia **JSONC** (JSON con commenti). ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -33,7 +34,7 @@ I file di configurazione vengono **uniti (merge)**, non sostituiti. I file di configurazione vengono uniti (merge), non sostituiti. Le impostazioni provenienti dalle posizioni qui sotto vengono combinate. Le configurazioni caricate dopo sovrascrivono quelle precedenti solo per le chiavi in conflitto. Le impostazioni non in conflitto vengono preservate. -Per esempio, se la tua configurazione globale imposta `theme: "opencode"` e `autoupdate: true`, e la configurazione del progetto imposta `model: "anthropic/claude-sonnet-4-5"`, la configurazione finale includera tutte e tre le impostazioni. +Per esempio, se la tua configurazione globale imposta `autoupdate: true` e la configurazione del progetto imposta `model: "anthropic/claude-sonnet-4-5"`, la configurazione finale includera entrambe le impostazioni. --- @@ -94,7 +95,9 @@ Puoi abilitare server specifici nella tua configurazione locale: ### Configurazione globale -Metti la configurazione globale di OpenCode in `~/.config/opencode/opencode.json`. Usa la configurazione globale per preferenze valide per l'utente (ad es. temi, provider o keybind). +Metti la configurazione globale di OpenCode in `~/.config/opencode/opencode.json`. Usa la configurazione globale per preferenze server/runtime valide per l'utente come provider, modelli e permessi. + +Per le impostazioni specifiche della TUI, usa `~/.config/opencode/tui.json`. La configurazione globale sovrascrive i default remoti dell'organizzazione. @@ -104,6 +107,8 @@ La configurazione globale sovrascrive i default remoti dell'organizzazione. Aggiungi `opencode.json` nella root del progetto. La configurazione di progetto ha la precedenza piu alta tra i file standard: sovrascrive sia la configurazione globale sia quella remota. +Per le impostazioni TUI specifiche del progetto, aggiungi `tui.json` nella stessa posizione. + :::tip Metti la configurazione specifica del progetto nella root del progetto. ::: @@ -144,34 +149,32 @@ La directory personalizzata viene caricata dopo la configurazione globale e le d Il file di configurazione ha uno schema definito in [**`opencode.ai/config.json`**](https://opencode.ai/config.json). +La configurazione TUI usa [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json). + Il tuo editor dovrebbe poter validare e suggerire l'autocompletamento in base allo schema. --- ### TUI -Puoi configurare impostazioni specifiche della TUI tramite l'opzione `tui`. +Usa un file dedicato `tui.json` (o `tui.jsonc`) per le impostazioni specifiche della TUI. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Opzioni disponibili: +Usa `OPENCODE_TUI_CONFIG` per puntare a un file di configurazione TUI personalizzato. -- `scroll_acceleration.enabled` - Abilita l'accelerazione di scorrimento in stile macOS. **Ha precedenza su `scroll_speed`.** -- `scroll_speed` - Moltiplicatore personalizzato della velocita di scorrimento (predefinito: `3`, minimo: `1`). Ignorato se `scroll_acceleration.enabled` e `true`. -- `diff_style` - Controlla la resa delle diff. `"auto"` si adatta alla larghezza del terminale, `"stacked"` mostra sempre una singola colonna. +Le chiavi legacy `theme`, `keybinds` e `tui` in `opencode.json` sono deprecate e vengono migrate automaticamente quando possibile. -[Scopri di piu sull'uso della TUI](/docs/tui). +[Scopri di piu sulla configurazione TUI](/docs/tui#configure). --- @@ -297,12 +300,12 @@ I bearer token (`AWS_BEARER_TOKEN_BEDROCK` o `/connect`) hanno precedenza sull'a ### Temi -Puoi configurare il tema da usare in OpenCode tramite l'opzione `theme`. +Imposta il tuo tema UI in `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -402,11 +405,11 @@ Puoi anche definire comandi usando file markdown in `~/.config/opencode/commands ### Scorciatoie -Puoi personalizzare i keybind tramite l'opzione `keybinds`. +Personalizza i keybind in `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -486,13 +489,15 @@ Puoi controllare il comportamento di compattazione del contesto tramite l'opzion "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Compatta automaticamente la sessione quando il contesto e pieno (predefinito: `true`). - `prune` - Rimuove output vecchi degli strumenti per risparmiare token (predefinito: `true`). +- `reserved` - Token buffer per la compattazione. Lascia abbastanza margine per evitare overflow durante la compattazione --- diff --git a/packages/web/src/content/docs/it/custom-tools.mdx b/packages/web/src/content/docs/it/custom-tools.mdx index 43f69c43c6c..a0ef1c46c25 100644 --- a/packages/web/src/content/docs/it/custom-tools.mdx +++ b/packages/web/src/content/docs/it/custom-tools.mdx @@ -79,6 +79,32 @@ Questo crea due strumenti: `math_add` e `math_multiply`. --- +#### Collisioni di nomi con strumenti integrati + +Gli strumenti personalizzati sono indicizzati per nome. Se uno strumento personalizzato usa lo stesso nome di uno strumento integrato, quello personalizzato ha la precedenza. + +Per esempio, questo file sostituisce lo strumento `bash` integrato: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Preferisci nomi univoci a meno che tu non voglia intenzionalmente sostituire uno strumento integrato. Se vuoi disabilitare uno strumento integrato ma non sovrascriverlo, usa i [permessi](/docs/permissions). +::: + +--- + ### Argomenti Puoi usare `tool.schema`, che e semplicemente [Zod](https://zod.dev), per definire i tipi degli argomenti. diff --git a/packages/web/src/content/docs/it/formatters.mdx b/packages/web/src/content/docs/it/formatters.mdx index c264da3f4b7..58e4c60ed03 100644 --- a/packages/web/src/content/docs/it/formatters.mdx +++ b/packages/web/src/content/docs/it/formatters.mdx @@ -11,33 +11,34 @@ OpenCode formatta automaticamente i file dopo che vengono scritti o modificati u OpenCode include diversi formattatori integrati per linguaggi e framework popolari. Qui sotto trovi la lista dei formattatori, delle estensioni supportate e dei comandi o opzioni di config richiesti. -| Formattatore | Estensioni | Requisiti | -| -------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| gofmt | .go | `gofmt` command available | -| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` command available | -| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | `prettier` dependency in `package.json` | -| biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | `biome.json(c)` config file | -| zig | .zig, .zon | `zig` command available | -| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file | -| ktlint | .kt, .kts | `ktlint` command available | -| ruff | .py, .pyi | `ruff` command available with config | -| rustfmt | .rs | `rustfmt` command available | -| cargofmt | .rs | `cargo fmt` command available | -| uv | .py, .pyi | `uv` command available | -| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available | -| standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available | -| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available | -| air | .R | `air` command available | -| dart | .dart | `dart` command available | -| dfmt | .d | `dfmt` command available | -| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file | -| terraform | .tf, .tfvars | `terraform` command available | -| gleam | .gleam | `gleam` command available | -| nixfmt | .nix | `nixfmt` command available | -| shfmt | .sh, .bash | `shfmt` command available | -| pint | .php | `laravel/pint` dependency in `composer.json` | -| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experimental env variable flag](/docs/cli/#experimental) | -| ormolu | .hs | `ormolu` command available | +| Formattatore | Estensioni | Requisiti | +| -------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | +| air | .R | comando `air` disponibile | +| biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | file di configurazione `biome.json(c)` | +| cargofmt | .rs | comando `cargo fmt` disponibile | +| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | file di configurazione `.clang-format` | +| cljfmt | .clj, .cljs, .cljc, .edn | comando `cljfmt` disponibile | +| dart | .dart | comando `dart` disponibile | +| dfmt | .d | comando `dfmt` disponibile | +| gleam | .gleam | comando `gleam` disponibile | +| gofmt | .go | comando `gofmt` disponibile | +| htmlbeautifier | .erb, .html.erb | comando `htmlbeautifier` disponibile | +| ktlint | .kt, .kts | comando `ktlint` disponibile | +| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | comando `mix` disponibile | +| nixfmt | .nix | comando `nixfmt` disponibile | +| ocamlformat | .ml, .mli | comando `ocamlformat` disponibile e file di configurazione `.ocamlformat` | +| ormolu | .hs | comando `ormolu` disponibile | +| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | dipendenza `oxfmt` in `package.json` e una [flag variabile d'ambiente sperimentale](/docs/cli/#experimental) | +| pint | .php | dipendenza `laravel/pint` in `composer.json` | +| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | dipendenza `prettier` in `package.json` | +| rubocop | .rb, .rake, .gemspec, .ru | comando `rubocop` disponibile | +| ruff | .py, .pyi | comando `ruff` disponibile con config | +| rustfmt | .rs | comando `rustfmt` disponibile | +| shfmt | .sh, .bash | comando `shfmt` disponibile | +| standardrb | .rb, .rake, .gemspec, .ru | comando `standardrb` disponibile | +| terraform | .tf, .tfvars | comando `terraform` disponibile | +| uv | .py, .pyi | comando `uv` disponibile | +| zig | .zig, .zon | comando `zig` disponibile | Quindi, se il progetto ha `prettier` in `package.json`, OpenCode lo usera automaticamente. diff --git a/packages/web/src/content/docs/it/keybinds.mdx b/packages/web/src/content/docs/it/keybinds.mdx index eb08c2c286a..548805e6bae 100644 --- a/packages/web/src/content/docs/it/keybinds.mdx +++ b/packages/web/src/content/docs/it/keybinds.mdx @@ -3,11 +3,11 @@ title: Scorciatoie description: Personalizza le scorciatoie da tastiera. --- -OpenCode ha una lista di scorciatoie che puoi personalizzare tramite la configurazione di OpenCode. +OpenCode ha una lista di scorciatoie che puoi personalizzare tramite `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ Non sei obbligato a usare un tasto leader per le scorciatoie, ma lo consigliamo. ## Disabilitare una scorciatoia -Puoi disabilitare una scorciatoia aggiungendo la chiave nella configurazione con valore "none". +Puoi disabilitare una scorciatoia aggiungendo la chiave in `tui.json` con valore "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/it/lsp.mdx b/packages/web/src/content/docs/it/lsp.mdx index 765475dba07..a21133b141d 100644 --- a/packages/web/src/content/docs/it/lsp.mdx +++ b/packages/web/src/content/docs/it/lsp.mdx @@ -27,6 +27,7 @@ OpenCode include diversi server LSP integrati per linguaggi popolari: | gopls | .go | comando `go` disponibile | | hls | .hs, .lhs | comando `haskell-language-server-wrapper` disponibile | | jdtls | .java | `Java SDK (version 21+)` installato | +| julials | .jl | `julia` e `LanguageServer.jl` installati | | kotlin-ls | .kt, .kts | Installazione automatica per progetti Kotlin | | lua-ls | .lua | Installazione automatica per progetti Lua | | nixd | .nix | comando `nixd` disponibile | diff --git a/packages/web/src/content/docs/it/plugins.mdx b/packages/web/src/content/docs/it/plugins.mdx index ea73f40ffdd..3fc22a78c56 100644 --- a/packages/web/src/content/docs/it/plugins.mdx +++ b/packages/web/src/content/docs/it/plugins.mdx @@ -3,7 +3,7 @@ title: Plugin description: Scrivi plugin per estendere OpenCode. --- -I plugin ti permettono di estendere OpenCode agganciandoti a vari eventi e personalizzando il comportamento. Puoi creare plugin per aggiungere nuove funzionalita', integrare servizi esterni o modificare il comportamento predefinito di OpenCode. +I plugin ti permettono di estendere OpenCode agganciandoti a vari eventi e personalizzando il comportamento. Puoi creare plugin per aggiungere nuove funzionalità, integrare servizi esterni o modificare il comportamento predefinito di OpenCode. Per esempi, dai un'occhiata ai [plugin](/docs/ecosystem#plugins) creati dalla community. @@ -53,7 +53,7 @@ I **plugin locali** vengono caricati direttamente dalla directory dei plugin. Pe ### Ordine di caricamento -I plugin vengono caricati da tutte le sorgenti e tutti gli hook vengono eseguiti in sequenza. L'ordine di caricamento e': +I plugin vengono caricati da tutte le sorgenti e tutti gli hook vengono eseguiti in sequenza. L'ordine di caricamento è: 1. Config globale (`~/.config/opencode/opencode.json`) 2. Config di progetto (`opencode.json`) @@ -66,7 +66,7 @@ I pacchetti npm duplicati con lo stesso nome e versione vengono caricati una sol ## Creare un plugin -Un plugin e' un **modulo JavaScript/TypeScript** che esporta una o piu' funzioni di plugin. Ogni funzione riceve un oggetto di contesto e restituisce un oggetto di hook. +Un plugin è un **modulo JavaScript/TypeScript** che esporta una o più funzioni di plugin. Ogni funzione riceve un oggetto di contesto e restituisce un oggetto di hook. --- @@ -234,7 +234,7 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr Stiamo usando `osascript` per eseguire AppleScript su macOS. Qui lo usiamo per inviare notifiche. :::note -Se usi l'app desktop di OpenCode, puo' inviare automaticamente notifiche di sistema quando una risposta e' pronta o quando una sessione va in errore. +Se usi l'app desktop di OpenCode, può inviare automaticamente notifiche di sistema quando una risposta è pronta o quando una sessione va in errore. ::: --- @@ -299,7 +299,7 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { } ``` -L'helper `tool` crea uno strumento personalizzato che opencode puo' chiamare. Accetta una funzione di schema Zod e restituisce una definizione di tool con: +L'helper `tool` crea uno strumento personalizzato che opencode può chiamare. Accetta una funzione di schema Zod e restituisce una definizione di tool con: - `description`: cosa fa lo strumento - `args`: schema Zod per gli argomenti dello strumento @@ -307,6 +307,10 @@ L'helper `tool` crea uno strumento personalizzato che opencode puo' chiamare. Ac I tuoi strumenti personalizzati saranno disponibili in opencode insieme agli strumenti integrati. +:::note +Se uno strumento di un plugin usa lo stesso nome di uno strumento integrato, lo strumento del plugin ha la precedenza. +::: + --- ### Logging @@ -381,4 +385,4 @@ Format as a structured prompt that a new agent can use to resume work. } ``` -Quando `output.prompt` e' impostato, sostituisce completamente il prompt di compaction predefinito. In questo caso l'array `output.context` viene ignorato. +Quando `output.prompt` è impostato, sostituisce completamente il prompt di compaction predefinito. In questo caso l'array `output.context` viene ignorato. diff --git a/packages/web/src/content/docs/it/providers.mdx b/packages/web/src/content/docs/it/providers.mdx index 9b4c07b665d..c0c5489d080 100644 --- a/packages/web/src/content/docs/it/providers.mdx +++ b/packages/web/src/content/docs/it/providers.mdx @@ -818,7 +818,7 @@ Alcuni modelli devono essere abilitati manualmente nelle tue [impostazioni GitHu │ │ Enter code: 8F43-6FCF │ - └ Waiting for authorization... + │ └ Waiting for authorization... ``` 3. Ora esegui il comando `/models` per selezionare il modello che vuoi. @@ -1488,6 +1488,39 @@ SAP AI Core fornisce accesso a oltre 40 modelli di OpenAI, Anthropic, Google, Am --- +### STACKIT + +STACKIT AI Model Serving fornisce un ambiente di hosting completamente gestito e sovrano per modelli AI, concentrandosi su LLM come Llama, Mistral e Qwen, con la massima sovranità dei dati su infrastruttura europea. + +1. Vai al [Portale STACKIT](https://portal.stackit.cloud), naviga in **AI Model Serving** e crea un token di autenticazione per il tuo progetto. + + :::tip + Devi avere un account cliente STACKIT, un account utente e un progetto prima di creare token di autenticazione. + ::: + +2. Esegui il comando `/connect` e cerca **STACKIT**. + + ```txt + /connect + ``` + +3. Inserisci il tuo token di autenticazione STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Esegui il comando `/models` per selezionare tra i modelli disponibili come _Qwen3-VL 235B_ o _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Vai al [pannello OVHcloud](https://ovh.com/manager). Naviga nella sezione `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` e nella scheda `API Keys`, clicca **Create a new API key**. diff --git a/packages/web/src/content/docs/it/sdk.mdx b/packages/web/src/content/docs/it/sdk.mdx index 9cf7e4eae52..d7cfd8489d1 100644 --- a/packages/web/src/content/docs/it/sdk.mdx +++ b/packages/web/src/content/docs/it/sdk.mdx @@ -3,7 +3,7 @@ title: SDK description: Client JS type-safe per il server opencode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const typesUrl = `${config.github}/blob/dev/packages/sdk/js/src/gen/types.gen.ts` L'SDK JS/TS di opencode fornisce un client type-safe per interagire con il server. @@ -117,6 +117,78 @@ try { --- +## Output Strutturato + +Puoi richiedere un output JSON strutturato dal modello specificando un `format` con uno schema JSON. Il modello usera un tool `StructuredOutput` per restituire JSON validato che corrisponde al tuo schema. + +### Uso Base + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Tipi di Formato Output + +| Tipo | Descrizione | +| ------------- | ------------------------------------------------------------------- | +| `text` | Predefinito. Risposta di testo standard (nessun output strutturato) | +| `json_schema` | Restituisce JSON validato che corrisponde allo schema fornito | + +### Formato Schema JSON + +Quando usi `type: 'json_schema'`, fornisci: + +| Campo | Tipo | Descrizione | +| ------------ | --------------- | --------------------------------------------------------------------- | +| `type` | `'json_schema'` | Richiesto. Specifica la modalita schema JSON | +| `schema` | `object` | Richiesto. Oggetto JSON Schema che definisce la struttura dell'output | +| `retryCount` | `number` | Opzionale. Numero di tentativi di validazione (default: 2) | + +### Gestione Errori + +Se il modello non riesce a produrre un output strutturato valido dopo tutti i tentativi, la risposta includera un `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Best Practices + +1. **Fornisci descrizioni chiare** nelle proprieta del tuo schema per aiutare il modello a capire quali dati estrarre +2. **Usa `required`** per specificare quali campi devono essere presenti +3. **Mantieni gli schemi focalizzati** - schemi annidati complessi potrebbero essere piu difficili da compilare correttamente per il modello +4. **Imposta un `retryCount` appropriato** - aumenta per schemi complessi, diminuisci per quelli semplici + +--- + ## API L'SDK espone tutte le API del server tramite un client type-safe. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sessioni -| Metodo | Descrizione | Note | -| ---------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | Elenca le sessioni | Returns Session[]| -| `session.get({ path })` | Ottieni una sessione | ReturnsSession| -| `session.children({ path })` | Elenca sessioni figlie | ReturnsSession[]| -| `session.create({ body })` | Crea una sessione | ReturnsSession| -| `session.delete({ path })` | Elimina una sessione | Returns `boolean` | -| `session.update({ path, body })` | Aggiorna proprieta della sessione | ReturnsSession| -| `session.init({ path, body })` | Analizza app e crea `AGENTS.md` | Returns `boolean` | -| `session.abort({ path })` | Interrompe una sessione in corso | Returns `boolean` | -| `session.share({ path })` | Condivide la sessione | ReturnsSession| -| `session.unshare({ path })` | Rimuove la condivisione | ReturnsSession| -| `session.summarize({ path, body })` | Riassume la sessione | Returns `boolean` | -| `session.messages({ path })` | Elenca i messaggi della sessione | Returns `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Ottieni dettagli di un messaggio | Returns `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritornaAssistantMessagecon risposta AI | -| `session.command({ path, body })` | Invia un comando alla sessione | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Esegue un comando shell | ReturnsAssistantMessage| -| `session.revert({ path, body })` | Ripristina un messaggio | ReturnsSession| -| `session.unrevert({ path })` | Ripristina messaggi revertiti | ReturnsSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Risponde a una richiesta permessi | Returns `boolean` | +| Metodo | Descrizione | Note | +| ---------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Elenca le sessioni | ReturnsSession[]| +| `session.get({ path })` | Ottieni una sessione | ReturnsSession| +| `session.children({ path })` | Elenca sessioni figlie | ReturnsSession[]| +| `session.create({ body })` | Crea una sessione | ReturnsSession| +| `session.delete({ path })` | Elimina una sessione | Returns `boolean` | +| `session.update({ path, body })` | Aggiorna proprieta della sessione | ReturnsSession| +| `session.init({ path, body })` | Analizza app e crea `AGENTS.md` | Returns `boolean` | +| `session.abort({ path })` | Interrompe una sessione in corso | Returns `boolean` | +| `session.share({ path })` | Condivide la sessione | ReturnsSession| +| `session.unshare({ path })` | Rimuove la condivisione | ReturnsSession| +| `session.summarize({ path, body })` | Riassume la sessione | Returns `boolean` | +| `session.messages({ path })` | Elenca i messaggi della sessione | Returns `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Ottieni dettagli di un messaggio | Returns `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritornaAssistantMessagecon risposta AI. Supporta `body.outputFormat` per [output strutturato](#output-strutturato) | +| `session.command({ path, body })` | Invia un comando alla sessione | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Esegue un comando shell | ReturnsAssistantMessage| +| `session.revert({ path, body })` | Ripristina un messaggio | ReturnsSession| +| `session.unrevert({ path })` | Ripristina messaggi revertiti | ReturnsSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Risponde a una richiesta permessi | Returns `boolean` | --- diff --git a/packages/web/src/content/docs/it/themes.mdx b/packages/web/src/content/docs/it/themes.mdx index 6752470e0f1..055e108727b 100644 --- a/packages/web/src/content/docs/it/themes.mdx +++ b/packages/web/src/content/docs/it/themes.mdx @@ -45,13 +45,13 @@ E altri ancora: aggiungiamo costantemente nuovi temi. ## Tema di sistema -Il tema `system` e progettato per adattarsi automaticamente allo schema colori del tuo terminale. A differenza dei temi tradizionali con colori fissi, il tema _system_: +Il tema `system` è progettato per adattarsi automaticamente allo schema colori del tuo terminale. A differenza dei temi tradizionali con colori fissi, il tema _system_: - **Genera una scala di grigi**: crea una scala di grigi personalizzata in base al colore di sfondo del terminale, garantendo un contrasto ottimale. - **Usa colori ANSI**: sfrutta i colori ANSI standard (0-15) per evidenziazione della sintassi ed elementi UI, rispettando la palette del terminale. - **Preserva i default del terminale**: usa `none` per testo e sfondo per mantenere l'aspetto nativo del terminale. -Il tema di sistema e pensato per chi: +Il tema di sistema è pensato per chi: - Vuole che OpenCode corrisponda all'aspetto del terminale - Usa schemi colori personalizzati del terminale @@ -61,11 +61,11 @@ Il tema di sistema e pensato per chi: ## Usare un tema -Puoi selezionare un tema aprendo la selezione temi con il comando `/theme`. In alternativa, puoi specificarlo nella tua [configurazione](/docs/config). +Puoi selezionare un tema aprendo la selezione temi con il comando `/theme`. In alternativa, puoi specificarlo in `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` @@ -80,14 +80,14 @@ OpenCode supporta un sistema di temi flessibile basato su JSON che permette di c ### Gerarchia -I temi vengono caricati da piu directory nel seguente ordine, dove le directory successive sovrascrivono le precedenti: +I temi vengono caricati da più directory nel seguente ordine, dove le directory successive sovrascrivono le precedenti: 1. **Temi integrati** - incorporati nel binario 2. **Directory di configurazione utente** - in `~/.config/opencode/themes/*.json` o `$XDG_CONFIG_HOME/opencode/themes/*.json` 3. **Directory root del progetto** - in `/.opencode/themes/*.json` 4. **Directory di lavoro corrente** - in `./.opencode/themes/*.json` -Se piu directory contengono un tema con lo stesso nome, verra usato il tema della directory con priorita piu alta. +Se più directory contengono un tema con lo stesso nome, verrà usato il tema della directory con priorità più alta. --- @@ -125,13 +125,13 @@ I temi usano un formato JSON flessibile che supporta: ### Definizioni dei colori -La sezione `defs` e opzionale e ti permette di definire colori riutilizzabili che possono essere referenziati nel tema. +La sezione `defs` è opzionale e ti permette di definire colori riutilizzabili che possono essere referenziati nel tema. --- ### Valori predefiniti del terminale -Il valore speciale `"none"` puo essere usato per qualunque colore per ereditare il colore predefinito del terminale. E particolarmente utile per creare temi che si fondono con lo schema colori del terminale: +Il valore speciale `"none"` può essere usato per qualunque colore per ereditare il colore predefinito del terminale. È particolarmente utile per creare temi che si fondono con lo schema colori del terminale: - `"text": "none"` - usa il colore del testo predefinito del terminale - `"background": "none"` - usa il colore di sfondo predefinito del terminale diff --git a/packages/web/src/content/docs/it/troubleshooting.mdx b/packages/web/src/content/docs/it/troubleshooting.mdx index 51405715072..7c168979daf 100644 --- a/packages/web/src/content/docs/it/troubleshooting.mdx +++ b/packages/web/src/content/docs/it/troubleshooting.mdx @@ -57,8 +57,8 @@ Se l'app desktop va in crash all'avvio, si blocca o si comporta in modo strano, Apri il tuo file di configurazione globale e cerca la chiave `plugin`. -- **macOS/Linux**: `~/.config/opencode/opencode.jsonc` (or `~/.config/opencode/opencode.json`) -- **macOS/Linux** (older installs): `~/.local/share/opencode/opencode.jsonc` +- **macOS/Linux**: `~/.config/opencode/opencode.jsonc` (o `~/.config/opencode/opencode.json`) +- **macOS/Linux** (installazioni vecchie): `~/.local/share/opencode/opencode.jsonc` - **Windows**: premi `WIN+R` e incolla `%USERPROFILE%\.config\opencode\opencode.jsonc` Se hai plugin configurati, disabilitali temporaneamente rimuovendo la chiave o impostandola a un array vuoto: @@ -88,14 +88,14 @@ Se l'app ricomincia a funzionare, riabilita i plugin uno alla volta per capire q Se disabilitare i plugin non aiuta (o l'installazione di un plugin e bloccata), svuota la cache in modo che OpenCode possa ricostruirla. -1. Quit OpenCode Desktop completely. +1. Chiudi completamente OpenCode Desktop. 2. Elimina la directory della cache: - **macOS**: Finder -> `Cmd+Shift+G` -> paste `~/.cache/opencode` - **Linux**: elimina `~/.cache/opencode` (oppure esegui `rm -rf ~/.cache/opencode`) - **Windows**: premi `WIN+R` e incolla `%USERPROFILE%\.cache\opencode` -3. Restart OpenCode Desktop. +3. Riavvia OpenCode Desktop. --- @@ -155,7 +155,7 @@ OpenCode Desktop mostra le notifiche di sistema solo quando: Se l'app non si avvia e non riesci a ripulire le impostazioni dall'interfaccia, reimposta lo stato salvato dell'app desktop. -1. Quit OpenCode Desktop. +1. Chiudi OpenCode Desktop. 2. Trova ed elimina questi file (si trovano nella directory dati dell'app OpenCode Desktop): - `opencode.settings.dat` (desktop default server URL) diff --git a/packages/web/src/content/docs/it/tui.mdx b/packages/web/src/content/docs/it/tui.mdx index 8a09c97a3ee..2e4efa26080 100644 --- a/packages/web/src/content/docs/it/tui.mdx +++ b/packages/web/src/content/docs/it/tui.mdx @@ -63,7 +63,7 @@ Quando usi la TUI di OpenCode, puoi digitare `/` seguito dal nome di un comando /help ``` -Molti comandi hanno anche una scorciatoia da tastiera che usa `ctrl+x` come tasto leader (predefinito). [Scopri di piu](/docs/keybinds). +Molti comandi hanno anche una scorciatoia da tastiera che usa `ctrl+x` come tasto leader (predefinito). [Scopri di più](/docs/keybinds). Ecco tutti i comandi slash disponibili: @@ -105,7 +105,7 @@ Attiva/disattiva i dettagli di esecuzione degli strumenti. ### editor -Apre un editor esterno per comporre messaggi. Usa l'editor impostato nella variabile d'ambiente `EDITOR`. [Scopri di piu](#editor-setup). +Apre un editor esterno per comporre messaggi. Usa l'editor impostato nella variabile d'ambiente `EDITOR`. [Scopri di più](#editor-setup). ```bash frame="none" /editor @@ -129,7 +129,7 @@ Esce da OpenCode. _Alias_: `/quit`, `/q` ### esporta -Esporta la conversazione corrente in Markdown e la apre nell'editor predefinito. Usa l'editor impostato nella variabile d'ambiente `EDITOR`. [Scopri di piu](#editor-setup). +Esporta la conversazione corrente in Markdown e la apre nell'editor predefinito. Usa l'editor impostato nella variabile d'ambiente `EDITOR`. [Scopri di più](#editor-setup). ```bash frame="none" /export @@ -153,7 +153,7 @@ Mostra la finestra di aiuto. ### inizializza -Crea o aggiorna il file `AGENTS.md`. [Scopri di piu](/docs/rules). +Crea o aggiorna il file `AGENTS.md`. [Scopri di più](/docs/rules). ```bash frame="none" /init @@ -219,7 +219,7 @@ Elenca e passa tra le sessioni. _Alias_: `/resume`, `/continue` ### condividi -Condivide la sessione corrente. [Scopri di piu](/docs/share). +Condivide la sessione corrente. [Scopri di più](/docs/share). ```bash frame="none" /share @@ -234,7 +234,7 @@ Condivide la sessione corrente. [Scopri di piu](/docs/share). Elenca i temi disponibili. ```bash frame="none" -/theme +/themes ``` **Scorciatoia:** `ctrl+x t` @@ -243,10 +243,10 @@ Elenca i temi disponibili. ### ragionamento -Attiva/disattiva la visibilita dei blocchi thinking/reasoning nella conversazione. Quando abilitato, puoi vedere il ragionamento del modello per i modelli che supportano extended thinking. +Attiva/disattiva la visibilità dei blocchi thinking/reasoning nella conversazione. Quando abilitato, puoi vedere il ragionamento del modello per i modelli che supportano extended thinking. :::note -Questo comando controlla solo se i blocchi di thinking vengono **mostrati**: non abilita o disabilita le capacita di ragionamento del modello. Per cambiare le capacita di ragionamento effettive, usa `ctrl+t` per ciclare tra le varianti del modello. +Questo comando controlla solo se i blocchi di thinking vengono **mostrati**: non abilita o disabilita le capacità di ragionamento del modello. Per cambiare le capacità di ragionamento effettive, usa `ctrl+t` per ciclare tra le varianti del modello. ::: ```bash frame="none" @@ -275,7 +275,7 @@ Internamente usa Git per gestire le modifiche ai file. Quindi il progetto **deve ### annulla condivisione -Annulla la condivisione della sessione corrente. [Scopri di piu](/docs/share#un-sharing). +Annulla la condivisione della sessione corrente. [Scopri di più](/docs/share#un-sharing). ```bash frame="none" /unshare @@ -346,30 +346,40 @@ Opzioni comuni per l'editor includono: Alcuni editor come VS Code devono essere avviati con il flag `--wait`. ::: -Alcuni editor richiedono argomenti da riga di comando per funzionare in modalita bloccante. Il flag `--wait` fa si che il processo dell'editor resti in attesa finche non viene chiuso. +Alcuni editor richiedono argomenti da riga di comando per funzionare in modalità bloccante. Il flag `--wait` fa sì che il processo dell'editor resti in attesa finché non viene chiuso. --- ## Configurazione -Puoi personalizzare il comportamento della TUI tramite il file di config di OpenCode. +Puoi personalizzare il comportamento della TUI tramite `tui.json` (o `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Questo è separato da `opencode.json`, che configura il comportamento di server/runtime. + ### Opzioni -- `scroll_acceleration` - Abilita l'accelerazione di scroll in stile macOS per uno scorrimento fluido e naturale. Quando abilitata, la velocita aumenta con gesture rapide e resta precisa con movimenti lenti. **Questa impostazione ha precedenza su `scroll_speed` e lo sovrascrive quando attiva.** -- `scroll_speed` - Controlla la velocita di scorrimento della TUI quando usi i comandi di scroll (minimo: `1`). Default: `3`. **Nota: viene ignorata se `scroll_acceleration.enabled` e impostato a `true`.** +- `theme` - Imposta il tema della UI. [Scopri di più](/docs/themes). +- `keybinds` - Personalizza le scorciatoie da tastiera. [Scopri di più](/docs/keybinds). +- `scroll_acceleration.enabled` - Abilita l'accelerazione di scroll in stile macOS per uno scorrimento fluido e naturale. Quando abilitata, la velocità aumenta con gesture rapide e resta precisa con movimenti lenti. **Questa impostazione ha precedenza su `scroll_speed` e lo sovrascrive quando attiva.** +- `scroll_speed` - Controlla la velocità di scorrimento della TUI quando usi i comandi di scroll (minimo: `0.001`, supporta valori decimali). Default: `3`. **Nota: viene ignorata se `scroll_acceleration.enabled` è impostato a `true`.** +- `diff_style` - Controlla il rendering delle diff. `"auto"` si adatta alla larghezza del terminale, `"stacked"` mostra sempre un layout a colonna singola. + +Usa `OPENCODE_TUI_CONFIG` per caricare un path di configurazione TUI personalizzato. --- diff --git a/packages/web/src/content/docs/it/zen.mdx b/packages/web/src/content/docs/it/zen.mdx index 8ea628aee2a..95170fc542d 100644 --- a/packages/web/src/content/docs/it/zen.mdx +++ b/packages/web/src/content/docs/it/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Lista curata di modelli fornita da OpenCode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -55,6 +55,7 @@ Puoi anche accedere ai nostri modelli tramite i seguenti endpoint API. | Modello | ID modello | Endpoint | Pacchetto AI SDK | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -64,22 +65,24 @@ Puoi anche accedere ai nostri modelli tramite i seguenti endpoint API. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -106,29 +109,34 @@ Supportiamo un modello pay-as-you-go. Qui sotto trovi i prezzi **per 1M token**. | Modello | Input | Output | Lettura in cache | Scrittura in cache | | --------------------------------- | ------ | ------ | ---------------- | ------------------ | | Big Pickle | Gratis | Gratis | Gratis | - | -| MiniMax M2.1 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Gratis | Gratis | Gratis | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Gratis | Gratis | Gratis | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -147,9 +155,7 @@ Le commissioni della carta di credito vengono ribaltate al costo (4.4% + $0.30 p I modelli gratuiti: -- GLM 4.7 Free e disponibile su OpenCode per un periodo limitato. Il team usa questo tempo per raccogliere feedback e migliorare il modello. -- Kimi K2.5 Free e disponibile su OpenCode per un periodo limitato. Il team usa questo tempo per raccogliere feedback e migliorare il modello. -- MiniMax M2.1 Free e disponibile su OpenCode per un periodo limitato. Il team usa questo tempo per raccogliere feedback e migliorare il modello. +- MiniMax M2.5 Free e disponibile su OpenCode per un periodo limitato. Il team usa questo tempo per raccogliere feedback e migliorare il modello. - Big Pickle e un modello stealth gratuito su OpenCode per un periodo limitato. Il team usa questo tempo per raccogliere feedback e migliorare il modello. Contattaci se hai domande. @@ -177,9 +183,7 @@ Per esempio, se imposti un limite mensile a $20, Zen non usera piu di $20 in un Tutti i nostri modelli sono ospitati negli US. I nostri provider seguono una policy di zero-retention e non usano i tuoi dati per training dei modelli, con le seguenti eccezioni: - Big Pickle: durante il periodo gratuito, i dati raccolti potrebbero essere usati per migliorare il modello. -- GLM 4.7 Free: durante il periodo gratuito, i dati raccolti potrebbero essere usati per migliorare il modello. -- Kimi K2.5 Free: durante il periodo gratuito, i dati raccolti potrebbero essere usati per migliorare il modello. -- MiniMax M2.1 Free: durante il periodo gratuito, i dati raccolti potrebbero essere usati per migliorare il modello. +- MiniMax M2.5 Free: durante il periodo gratuito, i dati raccolti potrebbero essere usati per migliorare il modello. - OpenAI APIs: le richieste vengono conservate per 30 giorni in conformita alle [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data). - Anthropic APIs: le richieste vengono conservate per 30 giorni in conformita alle [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). diff --git a/packages/web/src/content/docs/ja/cli.mdx b/packages/web/src/content/docs/ja/cli.mdx index aeae74731f2..dcb411c8331 100644 --- a/packages/web/src/content/docs/ja/cli.mdx +++ b/packages/web/src/content/docs/ja/cli.mdx @@ -335,20 +335,20 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript" #### フラグ -| フラグ | ショート | 説明 | -| ------------ | ----------- | ----------------------------------------------------------------------------------------- | -| `--command` | | 実行するコマンド。引数には message を使用します。 | -| `--continue` | `-c` | 最後のセッションを続行 | -| `--session` | | 続行時にセッションをフォーク (`-s` または `--fork` と併用) | -| `--continue` | `--session` | 続行するセッション ID | -| `--share` | | セッションを共有する | -| `--model` | `-m` | プロバイダー/モデルの形式で使用するモデル | -| `--agent` | | 使用するエージェント | -| `--file` | `-f` | メッセージに添付するファイル | -| `--format` | | 形式: デフォルト (フォーマット済み) または json (生の JSON イベント) | -| `--title` | | セッションのタイトル (値が指定されていない場合は、切り詰められたプロンプトが使用されます) | -| `--attach` | | 実行中の opencode サーバー (http://localhost:4096 など) に接続します。 | -| `--port` | | ローカルサーバーのポート (デフォルトはランダムポート) | +| フラグ | ショート | 説明 | +| ------------ | -------- | ----------------------------------------------------------------------------------------- | +| `--command` | | 実行するコマンド。引数には message を使用します。 | +| `--continue` | `-c` | 最後のセッションを続行 | +| `--session` | `-s` | 続行するセッション ID | +| `--fork` | | 続行時にセッションをフォーク (`--continue` または `--session` と併用) | +| `--share` | | セッションを共有する | +| `--model` | `-m` | プロバイダー/モデルの形式で使用するモデル | +| `--agent` | | 使用するエージェント | +| `--file` | `-f` | メッセージに添付するファイル | +| `--format` | | 形式: デフォルト (フォーマット済み) または json (生の JSON イベント) | +| `--title` | | セッションのタイトル (値が指定されていない場合は、切り詰められたプロンプトが使用されます) | +| `--attach` | | 実行中の opencode サーバー (http://localhost:4096 など) に接続します。 | +| `--port` | | ローカルサーバーのポート (デフォルトはランダムポート) | --- diff --git a/packages/web/src/content/docs/ja/config.mdx b/packages/web/src/content/docs/ja/config.mdx index 114336d43c9..20e29190dae 100644 --- a/packages/web/src/content/docs/ja/config.mdx +++ b/packages/web/src/content/docs/ja/config.mdx @@ -14,10 +14,11 @@ OpenCode は、**JSON** と **JSONC** (コメント付きの JSON) 形式の両 ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -25,14 +26,15 @@ OpenCode は、**JSON** と **JSONC** (コメント付きの JSON) 形式の両 ## ファイルの場所 -設定をいくつかの異なる場所に配置できます。 -優先順位が異なります。 +設定をいくつかの異なる場所に配置できます。それらは異なる優先順位を持ちます。 :::note -設定ファイルは置き換えられるのではなく、**マージ**されます。設定は、次の構成場所から結合されます。後続の設定は、競合するキーに対してのみ以前の設定をオーバーライドします。すべての設定の競合しない設定は保持されます。 +設定ファイルは置き換えられるのではなく、**マージ**されます。 ::: -たとえば、グローバル設定で `theme: "opencode"` と `autoupdate: true` が設定され、プロジェクト設定で `model: "anthropic/claude-sonnet-4-5"` が設定されている場合、最終的な設定には 3 つの設定がすべて含まれます。 +設定ファイルは結合され、置き換えられません。次の構成場所からの設定が結合されます。競合するキーに対してのみ、後の設定が前の設定を上書きします。すべての構成からの競合しない設定は保持されます。 + +たとえば、グローバル設定で `autoupdate: true` を設定し、プロジェクト設定で `model: "anthropic/claude-sonnet-4-5"` を設定した場合、最終的な構成には両方の設定が含まれます。 --- @@ -93,7 +95,9 @@ OpenCode は、**JSON** と **JSONC** (コメント付きの JSON) 形式の両 ### グローバル -グローバル OpenCode 設定を `~/.config/opencode/opencode.json` に配置します。テーマ、プロバイダー、キーバインドなどのユーザー全体の設定にはグローバル設定を使用します。 +グローバル OpenCode 設定を `~/.config/opencode/opencode.json` に配置します。プロバイダー、モデル、権限などのユーザー全体の設定にはグローバル設定を使用します。 + +TUI 固有の設定には、`~/.config/opencode/tui.json` を使用します。 グローバル設定はリモート組織のデフォルトをオーバーライドします。 @@ -103,6 +107,8 @@ OpenCode は、**JSON** と **JSONC** (コメント付きの JSON) 形式の両 プロジェクトのルートに `opencode.json` を追加します。プロジェクト設定は、標準設定ファイルの中で最も高い優先順位を持ち、グローバル設定とリモート設定の両方をオーバーライドします。 +プロジェクト固有の TUI 設定については、その横に `tui.json` を追加します。 + :::tip プロジェクト固有の設定をプロジェクトのルートに配置します。 ::: @@ -144,7 +150,9 @@ opencode run "Hello world" ## スキーマ -設定ファイルには、[**`opencode.ai/config.json`**](https://opencode.ai/config.json) を使用します。 +サーバー/ランタイム構成スキーマは [**`opencode.ai/config.json`**](https://opencode.ai/config.json) で定義されています。 + +TUI 設定は [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json) を使用します。 エディターはスキーマに基づいて検証し、オートコンプリートできる必要があります。 @@ -152,28 +160,24 @@ opencode run "Hello world" ### TUI -`tui` オプションを使用して TUI 固有の設定を構成できます。 +TUI 固有の設定には、専用の `tui.json` (または `tui.jsonc`) ファイルを使用します。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -利用可能なオプション: +カスタム TUI 設定ファイルを指定するには、`OPENCODE_TUI_CONFIG` を使用します。 -- `scroll_acceleration.enabled` - macOS スタイルのスクロールアクセラレーションを有効にします。 **`scroll_speed` よりも優先されます。** -- `scroll_speed` - カスタムのスクロール速度乗数 (デフォルト: `3`、最小: `1`)。 `scroll_acceleration.enabled` が `true` の場合は無視されます。 -- `diff_style` - 差分レンダリングを制御します。 `"auto"` はターミナルの幅に適応し、`"stacked"` は常に 1 列を表示します。 +`opencode.json` 内の従来の `theme`、`keybinds`、および `tui` キーは非推奨となり、可能であれば自動的に移行されます。 -[TUI の使用方法の詳細については、こちら](/docs/tui) をご覧ください。 +[TUI の設定の詳細については、こちら](/docs/tui#configure) をご覧ください。 --- @@ -237,7 +241,7 @@ LLM が使用できるツールは、`tools` オプションを通じて管理 } ``` -`small_model` オプションは、タイトル生成などの軽量タスク用に別のモデルを構成します。デフォルトでは、OpenCode は、プロバイダーから安価なモデルが入手可能な場合は、より安価なモデルを使用しようとします。そうでない場合は、メインモデルにフォールバックします。 +`small_model` オプションは、タイトルの生成などの軽量タスク用に個別のモデルを構成します。デフォルトでは、OpenCode は、プロバイダーから安価なモデルが入手可能な場合は、より安価なモデルを使用しようとします。そうでない場合は、メインモデルにフォールバックします。 プロバイダーオプションには、`timeout` および `setCacheKey` を含めることができます。 @@ -258,7 +262,7 @@ LLM が使用できるツールは、`tools` オプションを通じて管理 - `timeout` - リクエストのタイムアウト (ミリ秒単位) (デフォルト: 300000)。無効にするには、`false` に設定します。 - `setCacheKey` - 指定されたプロバイダーに対してキャッシュキーが常に設定されていることを確認します。 -[ローカルモデル](/docs/models#local). [詳細はこちら](/docs/models)。 +[ローカルモデル](/docs/models#local) も設定できます。[詳細はこちら](/docs/models)。 --- @@ -290,21 +294,21 @@ Amazon Bedrock は、AWS 固有の設定をサポートしています。 - `endpoint` - VPC エンドポイントのカスタムエンドポイント URL。これは、AWS 固有の用語を使用した汎用 `baseURL` オプションのエイリアスです。両方を指定した場合は、`endpoint` が優先されます。 :::note -ベアラー トークン (`AWS_BEARER_TOKEN_BEDROCK` または `/connect`) は、プロファイルベースの認証より優先されます。詳細については、「認証優先順位](/docs/providers#authentication-precedence)」を参照してください。 +ベアラー トークン (`AWS_BEARER_TOKEN_BEDROCK` または `/connect`) は、プロファイルベースの認証より優先されます。詳細については、「[認証優先順位](/docs/providers#authentication-precedence)」を参照してください。 ::: -[Amazon Bedrock 設定 ](/docs/providers#amazon-bedrock) の詳細をご覧ください。 +[Amazon Bedrock 設定](/docs/providers#amazon-bedrock) の詳細をご覧ください。 --- ### テーマ -`theme` オプションを使用して、OpenCode 設定で使用するテーマを構成できます。 +UI テーマを `tui.json` で設定します。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -404,11 +408,11 @@ Amazon Bedrock は、AWS 固有の設定をサポートしています。 ### キーバインド -`keybinds` オプションを使用してキーバインドをカスタマイズできます。 +`tui.json` でキーバインドをカスタマイズします。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` diff --git a/packages/web/src/content/docs/ja/custom-tools.mdx b/packages/web/src/content/docs/ja/custom-tools.mdx index badf50c627d..2377fc77308 100644 --- a/packages/web/src/content/docs/ja/custom-tools.mdx +++ b/packages/web/src/content/docs/ja/custom-tools.mdx @@ -79,6 +79,32 @@ export const multiply = tool({ --- +#### 組み込みツールとの名前の衝突 + +カスタムツールはツール名でキー設定されます。カスタムツールが組み込みツールと同じ名前を使用する場合、カスタムツールが優先されます。 + +たとえば、このファイルは組み込みの `bash` ツールを置き換えます。 + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +組み込みツールを意図的に置き換えたい場合を除き、一意の名前を使用することをお勧めします。組み込みツールを無効にしたいがオーバーライドしたくない場合は、[権限](/docs/permissions) を使用してください。 +::: + +--- + ### 引数 引数の型を定義するには、`tool.schema` (つまり [Zod](https://zod.dev)) を使用できます。 diff --git a/packages/web/src/content/docs/ja/formatters.mdx b/packages/web/src/content/docs/ja/formatters.mdx index 26bcbb5de5c..8769b9760d1 100644 --- a/packages/web/src/content/docs/ja/formatters.mdx +++ b/packages/web/src/content/docs/ja/formatters.mdx @@ -13,31 +13,32 @@ OpenCode には、一般的な言語およびフレームワーク用のいく | Formatter | Extensions | Requirements | | -------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| gofmt | .go | `gofmt` command available | -| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` command available | -| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | `prettier` dependency in `package.json` | +| air | .R | `air` command available | | biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | `biome.json(c)` config file | -| zig | .zig, .zon | `zig` command available | -| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file | -| ktlint | .kt, .kts | `ktlint` command available | -| ruff | .py, .pyi | `ruff` command available with config | -| rustfmt | .rs | `rustfmt` command available | | cargofmt | .rs | `cargo fmt` command available | -| uv | .py, .pyi | `uv` command available | -| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available | -| standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available | -| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available | -| air | .R | `air` command available | +| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file | +| cljfmt | .clj, .cljs, .cljc, .edn | `cljfmt` command available | | dart | .dart | `dart` command available | | dfmt | .d | `dfmt` command available | -| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file | -| terraform | .tf, .tfvars | `terraform` command available | | gleam | .gleam | `gleam` command available | +| gofmt | .go | `gofmt` command available | +| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available | +| ktlint | .kt, .kts | `ktlint` command available | +| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` command available | | nixfmt | .nix | `nixfmt` command available | -| shfmt | .sh, .bash | `shfmt` command available | -| pint | .php | `laravel/pint` dependency in `composer.json` | -| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experimental env variable flag](/docs/cli/#experimental) | +| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file | | ormolu | .hs | `ormolu` command available | +| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experimental env variable flag](/docs/cli/#experimental) | +| pint | .php | `laravel/pint` dependency in `composer.json` | +| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | `prettier` dependency in `package.json` | +| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available | +| ruff | .py, .pyi | `ruff` command available with config | +| rustfmt | .rs | `rustfmt` command available | +| shfmt | .sh, .bash | `shfmt` command available | +| standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available | +| terraform | .tf, .tfvars | `terraform` command available | +| uv | .py, .pyi | `uv` command available | +| zig | .zig, .zon | `zig` command available | したがって、プロジェクトの `prettier` に `package.json` が含まれている場合、OpenCode は自動的にそれを使用します。 diff --git a/packages/web/src/content/docs/ja/keybinds.mdx b/packages/web/src/content/docs/ja/keybinds.mdx index 66466a7f72d..09a3b0d7cba 100644 --- a/packages/web/src/content/docs/ja/keybinds.mdx +++ b/packages/web/src/content/docs/ja/keybinds.mdx @@ -3,11 +3,11 @@ title: キーバインド description: キーバインドをカスタマイズします。 --- -OpenCode には、OpenCode 設定を通じてカスタマイズできるキーバインドのリストがあります。 +OpenCode には、`tui.json` を通じてカスタマイズできるキーバインドのリストがあります。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ OpenCode は、ほとんどのキーバインドに `leader` キーを使用し ## キーバインドを無効にする -キーバインドを無効にするには、値「none」を指定してキーを構成に追加します。 +キーバインドを無効にするには、値「none」を指定してキーを `tui.json` に追加します。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/ja/lsp.mdx b/packages/web/src/content/docs/ja/lsp.mdx index 7b42c373327..948e743503f 100644 --- a/packages/web/src/content/docs/ja/lsp.mdx +++ b/packages/web/src/content/docs/ja/lsp.mdx @@ -27,6 +27,7 @@ OpenCode には、一般的な言語用のいくつかの組み込み LSP サー | gopls | .go | `go` command available | | hls | .hs, .lhs | `haskell-language-server-wrapper` command available | | jdtls | .java | `Java SDK (version 21+)` installed | +| julials | .jl | `julia` and `LanguageServer.jl` installed | | kotlin-ls | .kt, .kts | Auto-installs for Kotlin projects | | lua-ls | .lua | Auto-installs for Lua projects | | nixd | .nix | `nixd` command available | diff --git a/packages/web/src/content/docs/ja/mcp-servers.mdx b/packages/web/src/content/docs/ja/mcp-servers.mdx index a4b2485337e..3ac9edc811b 100644 --- a/packages/web/src/content/docs/ja/mcp-servers.mdx +++ b/packages/web/src/content/docs/ja/mcp-servers.mdx @@ -16,7 +16,8 @@ MCP サーバーを使用すると、コンテキストが追加されます。 :::tip MCP サーバーはコンテキストに追加されるため、どのサーバーを有効にするかには注意してください。 ::: -特定の MCP サーバーは、大量のトークンを追加する傾向があり、コンテキスト制限を簡単に超える可能性があります。 + +特定の MCP サーバー (GitHub MCP サーバーなど) は、大量のトークンを追加する傾向があり、コンテキスト制限を簡単に超える可能性があります。 --- @@ -157,7 +158,7 @@ use the mcp_everything tool to add the number 3 and 4 | `url` | 文字列 | Y | リモート MCP サーバーの URL。 | | `enabled` | ブール値 | | 起動時に MCP サーバーを有効または無効にします。 | | `headers` | オブジェクト | | リクエストとともに送信するヘッダー。 | -| `oauth` | オブジェクト | | OAuth 認証設定。以下の「OAuth](#oauth)」セクションを参照してください。 | +| `oauth` | オブジェクト | | OAuth 認証設定。以下の「[OAuth](#oauth)」セクションを参照してください。 | | `timeout` | 数値 | | MCP サーバーからツールを取得する際のタイムアウト (ミリ秒)。デフォルトは 5000 (5 秒) です。 | --- @@ -391,6 +392,8 @@ MCP サーバーツールはサーバー名をプレフィックスとして登 ::: +--- + ## 例 以下に、一般的な MCP サーバーの例をいくつか示します。他のサーバーを文書化したい場合は、PR を送信できます。 @@ -506,471 +509,3 @@ What's the right way to set a custom domain in an SST Astro component? use the g ```md title="AGENTS.md" If you are unsure how to do something, use `gh_grep` to search code examples from GitHub. ``` - -`enabled` を `false` に設定してサーバーを無効にすることもできます。これは、サーバーを構成から削除せずに一時的に無効にする場合に便利です。 - ---- - -### リモートのデフォルトを上書きする - -組織は、`.well-known/opencode` エンドポイント経由でデフォルトの MCP サーバーを提供できます。これらのサーバーはデフォルトで無効になっている場合があり、ユーザーは必要なサーバーにオプトインできます。 - -組織のリモート構成から特定のサーバーを有効にするには、`enabled: true` を使用してローカル構成に追加します。 - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "jira": { - "type": "remote", - "url": "https://jira.example.com/mcp", - "enabled": true - } - } -} -``` - -ローカルの設定値はリモートのデフォルト値をオーバーライドします。詳細については、「config precedence](/docs/config#precedence-order)」を参照してください。 - ---- - -## ローカル - -MCP オブジェクト内の `type` から `"local"` を使用してローカル MCP サーバーを追加します。 - -```jsonc title="opencode.jsonc" {15} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-local-mcp-server": { - "type": "local", - // Or ["bun", "x", "my-mcp-command"] - "command": ["npx", "-y", "my-mcp-command"], - "enabled": true, - "environment": { - "MY_ENV_VAR": "my_env_var_value", - }, - }, - }, -} -``` - -このコマンドは、ローカル MCP サーバーの起動方法を示します。環境変数のリストを渡すこともできます。 - -たとえば、テスト [`@modelcontextprotocol/server-everything`](https://www.npmjs.com/package/@modelcontextprotocol/server-everything) MCP サーバー] を追加する方法は次のとおりです。 - -```jsonc title="opencode.jsonc" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "mcp_everything": { - "type": "local", - "command": ["npx", "-y", "@modelcontextprotocol/server-everything"], - }, - }, -} -``` - -これを使用するには、プロンプトに `use the mcp_everything tool` を追加します。 - -```txt "mcp_everything" -use the mcp_everything tool to add the number 3 and 4 -``` - ---- - -#### オプション - -ここでは、ローカル MCP サーバーを構成するためのすべてのオプションを示します。 - -| オプション | タイプ | 必須 | 説明 | -| ------------- | ------------ | ---- | ------------------------------------------------------------------------------------------ | -| `type` | 文字列 | Y | MCP サーバー接続のタイプは、`"local"` である必要があります。 | -| `command` | 配列 | Y | MCP サーバーを実行するためのコマンドと引数。 | -| `environment` | オブジェクト | | サーバーの実行時に設定する環境変数。 | -| `enabled` | ブール値 | | 起動時に MCP サーバーを有効または無効にします。 | -| `timeout` | 番号 | | MCP サーバーからツールを取得する際のタイムアウト (ミリ秒)。デフォルトは 5000 (5 秒) です。 | - ---- - -## リモート - -`type` を `"remote"` に設定して、リモート MCP サーバーを追加します。 - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-remote-mcp": { - "type": "remote", - "url": "https://my-mcp-server.com", - "enabled": true, - "headers": { - "Authorization": "Bearer MY_API_KEY" - } - } - } -} -``` - -`url` はリモート MCP サーバーの URL で、`headers` オプションを使用するとヘッダーのリストを渡すことができます。 - ---- - -#### オプション - -| オプション | タイプ | 必須 | 説明 | -| ---------- | ------------ | ---- | ------------------------------------------------------------------------------------------ | -| `type` | 文字列 | Y | MCP サーバー接続のタイプは、`"remote"` である必要があります。 | -| `url` | 文字列 | Y | リモート MCP サーバーの URL。 | -| `enabled` | ブール値 | | 起動時に MCP サーバーを有効または無効にします。 | -| `headers` | オブジェクト | | リクエストとともに送信するヘッダー。 | -| `oauth` | オブジェクト | | OAuth認証構成。以下の「OAuth](#oauth)」セクションを参照してください。 | -| `timeout` | 番号 | | MCP サーバーからツールを取得する際のタイムアウト (ミリ秒)。デフォルトは 5000 (5 秒) です。 | - ---- - -## OAuth - -OpenCode は、リモート MCP サーバーの OAuth 認証を自動的に処理します。サーバーが認証を必要とする場合、OpenCode は次のことを行います。 - -1. 401 応答を検出し、OAuth フローを開始します。 -2. サーバーでサポートされている場合は **動的クライアント登録 (RFC 7591)** を使用します -3. 今後のリクエストに備えてトークンを安全に保管する - ---- - -### 自動 - -ほとんどの OAuth 対応 MCP サーバーでは、特別な構成は必要ありません。リモートサーバーを設定するだけです。 - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-oauth-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp" - } - } -} -``` - -サーバーが認証を必要とする場合、OpenCode を初めて使用しようとすると、認証を求めるプロンプトが表示されます。そうでない場合は、`opencode mcp auth ` を使用して flow](#authenticating) を手動でトリガーできます。 - ---- - -### 事前登録済み - -MCP サーバープロバイダーからクライアント認証情報を取得している場合は、それらを構成できます。 - -```json title="opencode.json" {7-11} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-oauth-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp", - "oauth": { - "clientId": "{env:MY_MCP_CLIENT_ID}", - "clientSecret": "{env:MY_MCP_CLIENT_SECRET}", - "scope": "tools:read tools:execute" - } - } - } -} -``` - ---- - -### 認証中 - -手動で認証をトリガーしたり、資格情報を管理したりできます。 - -特定の MCP サーバーで認証します。 - -```bash -opencode mcp auth my-oauth-server -``` - -すべての MCP サーバーとその認証ステータスをリストします。 - -```bash -opencode mcp list -``` - -保存されている認証情報を削除します。 - -```bash -opencode mcp logout my-oauth-server -``` - -`mcp auth` コマンドは、認証のためにブラウザを開きます。承認後、OpenCode はトークンを `~/.local/share/opencode/mcp-auth.json` に安全に保存します。 - ---- - -#### OAuthの無効化 - -サーバー (代わりに API キーを使用するサーバーなど) の自動 OAuth を無効にする場合は、`oauth` を `false` に設定します。 - -```json title="opencode.json" {7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-api-key-server": { - "type": "remote", - "url": "https://mcp.example.com/mcp", - "oauth": false, - "headers": { - "Authorization": "Bearer {env:MY_API_KEY}" - } - } - } -} -``` - ---- - -#### OAuth オプション - -| オプション | タイプ | 説明 | -| -------------- | --------------- | -------------------------------------------------------------------------------- | -| `oauth` | Object \| false | OAuth config object, or `false` to disable OAuth auto-detection. | -| `clientId` | String | OAuth client ID. If not provided, dynamic client registration will be attempted. | -| `clientSecret` | String | OAuth client secret, if required by the authorization server. | -| `scope` | String | OAuth scopes to request during authorization. | - -#### デバッグ - -リモート MCP サーバーが認証に失敗した場合は、次の方法で問題を診断できます。 - -```bash -# View auth status for all OAuth-capable servers -opencode mcp auth list - -# Debug connection and OAuth flow for a specific server -opencode mcp debug my-oauth-server -``` - -`mcp debug` コマンドは、現在の認証ステータスを表示し、HTTP 接続をテストし、OAuth 検出フローを試行します。 - ---- - -## 管理 - -MCP は、組み込みツールと並んで、OpenCode のツールとして利用できます。したがって、他のツールと同様に、OpenCode config を通じてそれらを管理できます。 - ---- - -### グローバル - -これは、それらをグローバルに有効または無効にできることを意味します。 - -```json title="opencode.json" {14} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp-foo": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-foo"] - }, - "my-mcp-bar": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-bar"] - } - }, - "tools": { - "my-mcp-foo": false - } -} -``` - -グロブ パターンを使用して、一致するすべての MCP を無効にすることもできます。 - -```json title="opencode.json" {14} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp-foo": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-foo"] - }, - "my-mcp-bar": { - "type": "local", - "command": ["bun", "x", "my-mcp-command-bar"] - } - }, - "tools": { - "my-mcp*": false - } -} -``` - -ここでは、グロブ パターン `my-mcp*` を使用して、すべての MCP を無効にしています。 - ---- - -### エージェントごと - -多数の MCP サーバーがある場合は、エージェントごとにのみ有効にし、グローバルに無効にすることができます。これを行うには: - -1. ツールとしてグローバルに無効にします。 -2. [エージェント config](/docs/agents#tools) で、MCP サーバーをツールとして有効にします。 - -```json title="opencode.json" {11, 14-18} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "my-mcp": { - "type": "local", - "command": ["bun", "x", "my-mcp-command"], - "enabled": true - } - }, - "tools": { - "my-mcp*": false - }, - "agent": { - "my-agent": { - "tools": { - "my-mcp*": true - } - } - } -} -``` - ---- - -#### グロブパターン - -グロブ パターンでは、単純な正規表現のグロブ パターンを使用します。 - -- `*` は 0 個以上の任意の文字に一致します (例: `"my-mcp*"` は `my-mcp_search`、`my-mcp_list` などに一致します)。 -- `?` は 1 つの文字に正確に一致します -- 他のすべての文字は文字通り一致します - -:::note -MCP サーバー ツールはサーバー名をプレフィックスとして登録されているため、サーバーのすべてのツールを無効にするには、次のコマンドを使用するだけです。 - -``` -"mymcpservername_*": false -``` - -::: - -## 例 - -以下に、一般的な MCP サーバーの例をいくつか示します。他のサーバーを文書化したい場合は、PR を送信できます。 - ---- - -### Sentry - -[Sentry MCP サーバー ](https://mcp.sentry.dev) を追加して、Sentry プロジェクトや問題と対話します。 - -```json title="opencode.json" {4-8} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "sentry": { - "type": "remote", - "url": "https://mcp.sentry.dev/mcp", - "oauth": {} - } - } -} -``` - -構成を追加した後、Sentry で認証します。 - -```bash -opencode mcp auth sentry -``` - -これにより、ブラウザ ウィンドウが開き、OAuth フローが完了し、OpenCode が Sentry アカウントに接続されます。 - -認証が完了すると、プロンプトで Sentry ツールを使用して、問題、プロジェクト、エラー データをクエリできるようになります。 - -```txt "use sentry" -Show me the latest unresolved issues in my project. use sentry -``` - ---- - -### Context7 - -ドキュメントを検索するために [Context7 MCP server](https://github.com/upstash/context7) を追加します。 - -```json title="opencode.json" {4-7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "context7": { - "type": "remote", - "url": "https://mcp.context7.com/mcp" - } - } -} -``` - -無料アカウントにサインアップしている場合は、API キーを使用して、より高いレート制限を取得できます。 - -```json title="opencode.json" {7-9} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "context7": { - "type": "remote", - "url": "https://mcp.context7.com/mcp", - "headers": { - "CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}" - } - } - } -} -``` - -ここでは、`CONTEXT7_API_KEY` 環境変数が設定されていることを前提としています。 - -Context7 MCP サーバーを使用するには、プロンプトに `use context7` を追加します。 - -```txt "use context7" -Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7 -``` - -あるいは、次のようなものを [AGENTS.md](/docs/rules/). - -```md title="AGENTS.md" -When you need to search docs, use `context7` tools. -``` - ---- - -### Grep by Vercel - -GitHub 上のコード スニペットを検索するには、[Grep by Vercel](https://grep.app) MCP サーバーを追加します。 - -```json title="opencode.json" {4-7} -{ - "$schema": "https://opencode.ai/config.json", - "mcp": { - "gh_grep": { - "type": "remote", - "url": "https://mcp.grep.app" - } - } -} -``` - -MCP サーバーに `gh_grep` という名前を付けたので、プロンプトに `use the gh_grep tool` を追加して、エージェントにそれを使用させることができます。 - -```txt "use the gh_grep tool" -What's the right way to set a custom domain in an SST Astro component? use the gh_grep tool -``` - -あるいは、次のようなものを [AGENTS.md](/docs/rules/). - -```md title="AGENTS.md" -If you are unsure how to do something, use `gh_grep` to search code examples from GitHub. -``` diff --git a/packages/web/src/content/docs/ja/plugins.mdx b/packages/web/src/content/docs/ja/plugins.mdx index 39fc1dda217..06a0dca9adf 100644 --- a/packages/web/src/content/docs/ja/plugins.mdx +++ b/packages/web/src/content/docs/ja/plugins.mdx @@ -235,11 +235,87 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr macOS 上で AppleScript を実行するために `osascript` を使用しています。ここでは通知を送信するために使用しています。 :::note -OpenCode デスクトップアプリを使用している場合は、応答の準備ができたとき、またはセッションエラーが発生したときにシステム通知を自動的に送信できます。 +組み込みツールと同じ名前のプラグインツールを使用すると、プラグインツールが優先されます。 ::: --- +### ロギング + +構造化ログには `console.log` の代わりに `client.app.log()` を使用します。 + +```ts title=".opencode/plugins/my-plugin.ts" +export const MyPlugin = async ({ client }) => { + await client.app.log({ + body: { + service: "my-plugin", + level: "info", + message: "Plugin initialized", + extra: { foo: "bar" }, + }, + }) +} +``` + +レベル: `debug`、`info`、`warn`、`error`。詳細については、[SDK ドキュメント](https://opencode.ai/docs/sdk) を参照してください。 + +--- + +### 圧縮フック + +セッションが圧縮されたときに含まれるコンテキストをカスタマイズします。 + +```ts title=".opencode/plugins/compaction.ts" +import type { Plugin } from "@opencode-ai/plugin" + +export const CompactionPlugin: Plugin = async (ctx) => { + return { + "experimental.session.compacting": async (input, output) => { + // Inject additional context into the compaction prompt + output.context.push(` +## Custom Context + +Include any state that should persist across compaction: +- Current task status +- Important decisions made +- Files being actively worked on +`) + }, + } +} +``` + +`experimental.session.compacting` フックは、LLM が継続概要を生成する前に起動します。これを使用して、デフォルトの圧縮プロンプトでは見逃されるドメイン固有のコンテキストを挿入します。 + +`output.prompt` を設定することで、圧縮プロンプトを完全に置き換えることもできます。 + +```ts title=".opencode/plugins/custom-compaction.ts" +import type { Plugin } from "@opencode-ai/plugin" + +export const CustomCompactionPlugin: Plugin = async (ctx) => { + return { + "experimental.session.compacting": async (input, output) => { + // Replace the entire compaction prompt + output.prompt = ` +You are generating a continuation prompt for a multi-agent swarm session. + +Summarize: +1. The current task and its status +2. Which files are being modified and by whom +3. Any blockers or dependencies between agents +4. The next steps to complete the work + +Format as a structured prompt that a new agent can use to resume work. +` + }, + } +} +``` + +`output.prompt` を設定すると、デフォルトの圧縮プロンプトが完全に置き換えられます。この場合、`output.context` 配列は無視されます。 + +--- + ### .env の保護 OpenCode が `.env` ファイルを読み取らないようにします。 diff --git a/packages/web/src/content/docs/ja/providers.mdx b/packages/web/src/content/docs/ja/providers.mdx index 2602f8ef22a..388dc8e41dc 100644 --- a/packages/web/src/content/docs/ja/providers.mdx +++ b/packages/web/src/content/docs/ja/providers.mdx @@ -57,7 +57,38 @@ OpenCode で適切に動作することがテストおよび検証されてい 初めての方は、OpenCode Zen から始めることをお勧めします。 ::: -1. TUI で `/connect` コマンドを実行し、opencode を選択して、[opencode.ai/auth](https://opencode.ai/auth) で認証します。 +1. TUI で `/connect` コマンドを実行し、`OpenCode Zen` を選択して、[opencode.ai/zen](https://opencode.ai/zen) にアクセスします。 + + ```txt + /connect + ``` + +2. サインインし、お支払いの詳細を追加し、API キーをコピーします。 + +3. API キーを貼り付けます。 + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. TUI で `/models` を実行すると、推奨されるモデルのリストが表示されます。 + + ```txt + /models + ``` + +これは OpenCode の他のプロバイダーと同様に機能し、使用は完全にオプションです。 + +--- + +## OpenCode Go + +OpenCode Go は、OpenCode チームによって提供される、人気のあるオープンコーディングモデルへの信頼性の高いアクセスを提供する低コストのサブスクリプションプランです。これらは OpenCode でうまく機能することがテストおよび検証されています。 + +1. TUI で `/connect` コマンドを実行し、`OpenCode Go` を選択して、[opencode.ai/zen](https://opencode.ai/zen) にアクセスします。 ```txt /connect @@ -126,105 +157,111 @@ OpenCode で適切に動作することがテストおよび検証されてい OpenCode で Amazon Bedrock を使用するには: -1. Amazon Bedrock コンソールの **モデルカタログ** に移動してリクエストします。 - 必要なモデルにアクセスします。 +1. Amazon Bedrock コンソールの **モデルカタログ** に移動し、必要なモデルへのアクセスをリクエストします。 -:::tip -Amazon Bedrock で必要なモデルにアクセスできる必要があります。 -::: + :::tip + Amazon Bedrock で必要なモデルにアクセスできる必要があります。 + ::: -2. **次のいずれかの方法を使用して認証を構成します**。 +2. **次のいずれかの方法を使用して認証を構成します**: + + *** #### 環境変数 (クイックスタート) -opencode の実行中に次の環境変数のいずれかを設定します。 + opencode の実行中に次の環境変数のいずれかを設定します。 -```bash - # Option 1: Using AWS access keys + ```bash + # オプション 1: AWS アクセスキーの使用 AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=YYY opencode - # Option 2: Using named AWS profile + # オプション 2: 名前付き AWS プロファイルの使用 AWS_PROFILE=my-profile opencode - # Option 3: Using Bedrock bearer token + # オプション 3: Bedrock ベアラートークンの使用 AWS_BEARER_TOKEN_BEDROCK=XXX opencode -``` + ``` -または、それらを bash プロファイルに追加します。 + または、それらを bash プロファイルに追加します。 -```bash title="~/.bash_profile" + ```bash title="~/.bash_profile" export AWS_PROFILE=my-dev-profile export AWS_REGION=us-east-1 -``` + ``` -#### 設定ファイル (推奨) + *** -プロジェクト固有の設定または永続的な設定の場合は、`opencode.json` を使用します。 + #### 設定ファイル (推奨) -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "amazon-bedrock": { - "options": { - "region": "us-east-1", - "profile": "my-aws-profile" - } - } - } -} -``` + プロジェクト固有の設定または永続的な設定の場合は、`opencode.json` を使用します。 -**利用可能なオプション:** + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "amazon-bedrock": { + "options": { + "region": "us-east-1", + "profile": "my-aws-profile" + } + } + } + } + ``` -- `region` - AWS リージョン (例: `us-east-1`、`eu-west-1`) -- `profile` - `~/.aws/credentials` からの AWS 名前付きプロファイル -- `endpoint` - VPC エンドポイントのカスタムエンドポイント URL (汎用 `baseURL` オプションのエイリアス) + **利用可能なオプション:** + - `region` - AWS リージョン (例: `us-east-1`、`eu-west-1`) + - `profile` - `~/.aws/credentials` からの AWS 名前付きプロファイル + - `endpoint` - VPC エンドポイントのカスタムエンドポイント URL (汎用 `baseURL` オプションのエイリアス) -:::tip -設定ファイルのオプションは環境変数より優先されます。 -::: + :::tip + 設定ファイルのオプションは環境変数より優先されます。 + ::: -#### 上級: VPC エンドポイント + *** -Bedrock の VPC エンドポイントを使用している場合: + #### 上級: VPC エンドポイント -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "amazon-bedrock": { - "options": { - "region": "us-east-1", - "profile": "production", - "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" - } - } - } -} -``` + Bedrock の VPC エンドポイントを使用している場合: -:::note -`endpoint` オプションは、AWS 固有の用語を使用した汎用の `baseURL` オプションのエイリアスです。 `endpoint` と `baseURL` の両方が指定された場合は、`endpoint` が優先されます。 -::: + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "amazon-bedrock": { + "options": { + "region": "us-east-1", + "profile": "production", + "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" + } + } + } + } + ``` -#### 認証方法 + :::note + `endpoint` オプションは、AWS 固有の用語を使用した汎用の `baseURL` オプションのエイリアスです。 `endpoint` と `baseURL` の両方が指定された場合は、`endpoint` が優先されます。 + ::: -- **`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`**: IAM ユーザーを作成し、AWS コンソールでアクセスキーを生成します。 -- **`AWS_PROFILE`**: `~/.aws/credentials` の名前付きプロファイルを使用します。最初に `aws configure --profile my-profile` または `aws sso login` を設定します -- **`AWS_BEARER_TOKEN_BEDROCK`**: Amazon Bedrock コンソールから長期 API キーを生成します -- **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**: EKS IRSA (サービスアカウントの IAM ロール) または OIDC フェデレーションを備えた他の Kubernetes 環境の場合。これらの環境変数は、サービスアカウントアノテーションを使用するときに Kubernetes によって自動的に挿入されます。 + *** -#### 認証の優先順位 + #### 認証方法 + - **`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`**: IAM ユーザーを作成し、AWS コンソールでアクセスキーを生成します + - **`AWS_PROFILE`**: `~/.aws/credentials` の名前付きプロファイルを使用します。最初に `aws configure --profile my-profile` または `aws sso login` を設定します + - **`AWS_BEARER_TOKEN_BEDROCK`**: Amazon Bedrock コンソールから長期 API キーを生成します + - **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**: EKS IRSA (サービスアカウントの IAM ロール) または OIDC フェデレーションを備えた他の Kubernetes 環境の場合。これらの環境変数は、サービスアカウントアノテーションを使用するときに Kubernetes によって自動的に挿入されます。 -Amazon Bedrock は次の認証優先度を使用します。 + *** -1. **ベアラー トークン** - `AWS_BEARER_TOKEN_BEDROCK` 環境変数または `/connect` コマンドからのトークン -2. **AWS 認証情報チェーン** - プロファイル、アクセスキー、共有認証情報、IAM ロール、Web ID トークン (EKS IRSA)、インスタンスメタデータ + #### 認証の優先順位 -:::note -ベアラー トークンが (`/connect` または `AWS_BEARER_TOKEN_BEDROCK` 経由で) 設定されると、設定されたプロファイルを含むすべての AWS 認証情報方法よりも優先されます。 -::: + Amazon Bedrock は次の認証優先度を使用します。 + 1. **ベアラー トークン** - `AWS_BEARER_TOKEN_BEDROCK` 環境変数または `/connect` コマンドからのトークン + 2. **AWS 認証情報チェーン** - プロファイル、アクセスキー、共有認証情報、IAM ロール、Web ID トークン (EKS IRSA)、インスタンスメタデータ + + :::note + ベアラー トークンが (`/connect` または `AWS_BEARER_TOKEN_BEDROCK` 経由で) 設定されると、設定されたプロファイルを含むすべての AWS 認証情報方法よりも優先されます。 + ::: 3. `/models` コマンドを実行して、必要なモデルを選択します。 @@ -234,6 +271,7 @@ Amazon Bedrock は次の認証優先度を使用します。 :::note カスタム推論プロファイルの場合、キーでモデルとプロバイダー名を使用し、`id` プロパティを arn に設定します。これにより、正しいキャッシュが保証されます。 +::: ```json title="opencode.json" { @@ -251,8 +289,6 @@ Amazon Bedrock は次の認証優先度を使用します。 } ``` -::: - --- ### Anthropic @@ -672,9 +708,42 @@ GitLab Duo は、GitLab の Anthropic プロキシを介したネイティブツ 6. `/models` コマンドを実行して、利用可能なモデルを確認します。 - ```txt - /models - ``` +```txt +/models +``` + +--- + +### STACKIT + +STACKIT AI Model Serving は、Llama、Mistral、Qwen などの LLM に焦点を当て、ヨーロッパのインフラストラクチャでの最大限のデータ主権を備えた、AI モデル用の完全に管理された主権ホスティング環境を提供します。 + +1. [STACKIT Portal](https://portal.stackit.cloud) に移動し、**AI Model Serving** に移動して、プロジェクトの認証トークンを作成します。 + + :::tip + 認証トークンを作成する前に、STACKIT 顧客アカウント、ユーザーアカウント、およびプロジェクトが必要です。 + ::: + +2. `/connect` コマンドを実行し、**STACKIT** を検索します。 + + ```txt + /connect + ``` + +3. STACKIT AI Model Serving 認証トークンを入力します。 + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. `/models` コマンドを実行して、_Qwen3-VL 235B_ や _Llama 3.3 70B_ などの利用可能なモデルから選択します。 + + ```txt + /models + ``` 3 つの Claude ベースのモデルが利用可能です。 diff --git a/packages/web/src/content/docs/ja/sdk.mdx b/packages/web/src/content/docs/ja/sdk.mdx index ee5fd3645ac..5afaeb4a130 100644 --- a/packages/web/src/content/docs/ja/sdk.mdx +++ b/packages/web/src/content/docs/ja/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## 構造化出力 + +`format` を JSON スキーマで指定することで、モデルから構造化された JSON 出力をリクエストできます。モデルは `StructuredOutput` ツールを使用して、スキーマに一致する検証済み JSON を返します。 + +### 基本的な使用法 + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### 出力フォーマットの種類 + +| タイプ | 説明 | +| ------------- | ---------------------------------------------------- | +| `text` | デフォルト。標準テキスト応答 (構造化出力なし) | +| `json_schema` | 提供されたスキーマに一致する検証済み JSON を返します | + +### JSON スキーマフォーマット + +`type: 'json_schema'` を使用する場合は、以下を指定します: + +| フィールド | タイプ | 説明 | +| ------------ | --------------- | -------------------------------------------------- | +| `type` | `'json_schema'` | 必須。JSON スキーマモードを指定します | +| `schema` | `object` | 必須。出力構造を定義する JSON スキーマオブジェクト | +| `retryCount` | `number` | オプション。検証の再試行回数 (デフォルト: 2) | + +### エラー処理 + +すべての再試行後にモデルが有効な構造化出力を生成できない場合、応答には `StructuredOutputError` が含まれます: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### ベストプラクティス + +1. **明確な説明を提供する**: モデルが抽出するデータを理解できるように、スキーマプロパティに明確な説明を提供します +2. **`required` を使用する**: 存在する必要があるフィールドを指定します +3. **スキーマを焦点を絞ったものにする**: 複雑なネストされたスキーマは、モデルが正しく入力するのが難しい場合があります +4. **適切な `retryCount` を設定する**: 複雑なスキーマの場合は増やし、単純なスキーマの場合は減らします + +--- + ## API SDK は、型安全なクライアントを通じてすべてのサーバー API を公開します。 @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sessions -| メソッド | 説明 | 詳細 | -| ---------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `session.list()` | セッションをリストする | 戻り値 Session[]| -| `session.get({ path })` | セッションを取得 | 戻り値Session| -| `session.children({ path })` | 子セッションをリストする | 戻り値Session[]| -| `session.create({ body })` | セッションの作成 | 戻り値Session| -| `session.delete({ path })` | セッションを削除 | 戻り値 `boolean` | -| `session.update({ path, body })` | セッションのプロパティを更新する | 戻り値Session| -| `session.init({ path, body })` | アプリを分析して `AGENTS.md` を作成する | 戻り値 `boolean` | -| `session.abort({ path })` | 実行中のセッションを中止する | 戻り値 `boolean` | -| `session.share({ path })` | セッションを共有する | 戻り値Session| -| `session.unshare({ path })` | セッションの共有を解除 | 戻り値Session| -| `session.summarize({ path, body })` | セッションを要約する | 戻り値 `boolean` | -| `session.messages({ path })` | セッション内のメッセージをリストする | 戻り値 `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | メッセージの詳細を取得する | 戻り値 `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含むAssistantMessageを返します。 | -| `session.command({ path, body })` | コマンドをセッションに送信 | 戻り値 `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | シェルコマンドを実行する | 戻り値AssistantMessage| -| `session.revert({ path, body })` | メッセージを元に戻す | 戻り値Session| -| `session.unrevert({ path })` | 元に戻したメッセージを復元する | 戻り値Session| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | 許可リクエストに応答する | 戻り値 `boolean` | +| メソッド | 説明 | 詳細 | +| ---------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | セッションをリストする | 戻り値Session[]| +| `session.get({ path })` | セッションを取得 | 戻り値Session| +| `session.children({ path })` | 子セッションをリストする | 戻り値Session[]| +| `session.create({ body })` | セッションの作成 | 戻り値Session| +| `session.delete({ path })` | セッションを削除 | 戻り値 `boolean` | +| `session.update({ path, body })` | セッションのプロパティを更新する | 戻り値Session| +| `session.init({ path, body })` | アプリを分析して `AGENTS.md` を作成する | 戻り値 `boolean` | +| `session.abort({ path })` | 実行中のセッションを中止する | 戻り値 `boolean` | +| `session.share({ path })` | セッションを共有する | 戻り値Session| +| `session.unshare({ path })` | セッションの共有を解除 | 戻り値Session| +| `session.summarize({ path, body })` | セッションを要約する | 戻り値 `boolean` | +| `session.messages({ path })` | セッション内のメッセージをリストする | 戻り値 `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | メッセージの詳細を取得する | 戻り値 `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含むAssistantMessageを返します。[構造化出力](#構造化出力) のための `body.outputFormat` をサポートします。 | +| `session.command({ path, body })` | コマンドをセッションに送信 | 戻り値 `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | シェルコマンドを実行する | 戻り値AssistantMessage| +| `session.revert({ path, body })` | メッセージを元に戻す | 戻り値Session| +| `session.unrevert({ path })` | 元に戻したメッセージを復元する | 戻り値Session| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | 許可リクエストに応答する | 戻り値 `boolean` | --- diff --git a/packages/web/src/content/docs/ja/themes.mdx b/packages/web/src/content/docs/ja/themes.mdx index dd76651d6a5..1e4bf421805 100644 --- a/packages/web/src/content/docs/ja/themes.mdx +++ b/packages/web/src/content/docs/ja/themes.mdx @@ -61,11 +61,11 @@ OpenCode にはいくつかの組み込みテーマが付属しています。 ## テーマの使用 -テーマを選択するには、`/theme` コマンドでテーマ選択を表示します。または、[config](/docs/config) で設定します。 +テーマを選択するには、`/theme` コマンドでテーマ選択を表示します。または、`tui.json` で指定することもできます。 -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/ja/tui.mdx b/packages/web/src/content/docs/ja/tui.mdx index 36c94fffcf7..0049c7b0147 100644 --- a/packages/web/src/content/docs/ja/tui.mdx +++ b/packages/web/src/content/docs/ja/tui.mdx @@ -349,24 +349,34 @@ VS Code などの一部のエディターは、`--wait` フラグを使用して ## 設定 -OpenCode 設定ファイルを通じて TUI の動作をカスタマイズできます。 +`tui.json` (または `tui.jsonc`) ファイルを通じて TUI の動作をカスタマイズできます。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +これは、サーバー/ランタイムの動作を構成する `opencode.json` とは別です。 + ### オプション -- `scroll_acceleration` - macOS スタイルのスクロールアクセラレーションを有効にして、スムーズで自然なスクロールを実現します。有効にすると、高速スクロールジェスチャではスクロール速度が向上し、ゆっくりとした動きでは正確なままになります。 **この設定は `scroll_speed` よりも優先され、有効になっている場合は上書きされます。** -- `scroll_speed` - スクロールコマンドを使用するときに TUI がスクロールする速度を制御します (最小: `1`)。デフォルトは `3` です。 **注: `scroll_acceleration.enabled` が `true` に設定されている場合、これは無視されます。** +- `theme` - UI テーマを設定します。[詳細はこちら](/docs/themes)。 +- `keybinds` - キーボードショートカットをカスタマイズします。[詳細はこちら](/docs/keybinds)。 +- `scroll_acceleration.enabled` - macOS スタイルのスクロールアクセラレーションを有効にして、スムーズで自然なスクロールを実現します。有効にすると、高速スクロールジェスチャではスクロール速度が向上し、ゆっくりとした動きでは正確なままになります。 **この設定は `scroll_speed` よりも優先され、有効になっている場合は上書きされます。** +- `scroll_speed` - スクロールコマンドを使用するときに TUI がスクロールする速度を制御します (最小: `0.001`、小数をサポート)。デフォルトは `3` です。 **注: `scroll_acceleration.enabled` が `true` に設定されている場合、これは無視されます。** +- `diff_style` - 差分レンダリングを制御します。 `"auto"` はターミナルの幅に適応し、`"stacked"` は常に 1 列のレイアウトを表示します。 + +カスタム TUI 設定パスをロードするには、`OPENCODE_TUI_CONFIG` を使用します。 --- diff --git a/packages/web/src/content/docs/ja/zen.mdx b/packages/web/src/content/docs/ja/zen.mdx index 751ca45e45d..c7121fb3b79 100644 --- a/packages/web/src/content/docs/ja/zen.mdx +++ b/packages/web/src/content/docs/ja/zen.mdx @@ -18,23 +18,19 @@ Zen は OpenCode の他のプロバイダーと同様に機能します。 OpenC ## 背景 -モデルはたくさんありますが、そのうちのほんの一部です -これらのモデルはコーディングエージェントとしてうまく機能します。さらに、ほとんどのプロバイダーは、 -構成が大きく異なります。したがって、まったく異なるパフォーマンスと品質が得られます。 +世の中には多数のモデルがありますが、コーディングエージェントとしてうまく機能するのはごく一部です。さらに、ほとんどのプロバイダーは構成が大きく異なるため、パフォーマンスと品質も大きく異なります。 :::tip -私たちは、OpenCode で適切に動作するモデルとプロバイダーの選択されたグループをテストしました。 +OpenCode で適切に動作する、厳選されたモデルとプロバイダーのグループをテストしました。 ::: -OpenRouter などを通じてモデルを使用している場合は、決してそうすることはできません。 -必要なモデルの最高のバージョンを入手しているかどうかを確認してください。 + +OpenRouter などを通じてモデルを使用している場合、必要なモデルの最高のバージョンを取得できているか確信が持てません。 これを修正するために、いくつかのことを行いました。 -1. 私たちは選択したモデルのグループをテストし、その方法についてチームと話し合いました。 - それらを実行するのが最善です。 +1. 選抜したモデルグループをテストし、それらを最適に実行する方法についてチームと話し合いました。 2. その後、いくつかのプロバイダーと協力して、これらが確実に提供されるようにしました。 -3. 最後に、モデルとプロバイダーの組み合わせをベンチマークし、次の結果を導き出しました。 - 私たちが自信を持ってお勧めするリストをご紹介します。 +3. 最後に、モデルとプロバイダーの組み合わせをベンチマークし、自信を持ってお勧めできるリストを作成しました。 OpenCode Zen は、これらのモデルへのアクセスを可能にする AI ゲートウェイです。 @@ -44,8 +40,7 @@ OpenCode Zen は、これらのモデルへのアクセスを可能にする AI OpenCode Zen は、OpenCode の他のプロバイダーと同様に機能します。 -1. **OpenCode Zen** にログインし、請求内容を追加します - 詳細を確認し、API キーをコピーします。 +1. **OpenCode Zen** にサインインし、請求情報を追加して、API キーをコピーします。 2. TUI で `/connect` コマンドを実行し、OpenCode Zen を選択して API キーを貼り付けます。 3. TUI で `/models` を実行すると、推奨されるモデルのリストが表示されます。 @@ -59,6 +54,7 @@ OpenCode Zen は、OpenCode の他のプロバイダーと同様に機能しま | Model | Model ID | Endpoint | AI SDK Package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -68,22 +64,24 @@ OpenCode Zen は、OpenCode の他のプロバイダーと同様に機能しま | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -112,29 +110,34 @@ https://opencode.ai/zen/v1/models | Model | Input | Output | Cached Read | Cached Write | | --------------------------------- | ------ | ------ | ----------- | ------------ | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -151,10 +154,10 @@ https://opencode.ai/zen/v1/models クレジットカード手数料は実費で引き継がれます (4.4% + 取引ごとに 0.30 ドル)。それ以上の料金はかかりません。 ::: -- GLM 4.7 Free は期間限定で OpenCode で入手できます。チームはこの時間を利用してフィードバックを収集し、モデルを改善します。 -- Kim K2.5 Free は OpenCode で期間限定で利用可能です。チームはこの時間を利用してフィードバックを収集し、モデルを改善します。 -- MiniMax M2.1 Free は期間限定で OpenCode で入手できます。チームはこの時間を利用してフィードバックを収集し、モデルを改善します。 -- Big Pickle は、期間限定で OpenCode で無料で利用できるステルスモデルです。チームはこの時間を利用してフィードバックを収集し、モデルを改善します。 +無料のモデル: + +- MiniMax M2.5 Free は期間限定で OpenCode で利用可能です。チームはこの期間を利用してフィードバックを収集し、モデルを改善します。 +- Big Pickle は、期間限定で OpenCode で無料で利用できるステルスモデルです。チームはこの期間を利用してフィードバックを収集し、モデルを改善します。 ご質問がございましたら、お問い合わせください。 @@ -170,12 +173,9 @@ https://opencode.ai/zen/v1/models ### 月ごとの制限 -ワークスペース全体およびワークスペースごとに月ごとの使用制限を設定することもできます。 -あなたのチームのメンバー。 +ワークスペース全体およびチームの各メンバーの月ごとの使用制限を設定することもできます。 -たとえば、毎月の使用制限を 20 ドルに設定したとします。Zen は使用しません。 -月に20ドル以上。ただし、自動リロードを有効にしている場合、Zen が終了する可能性があります。 -残高が 5 ドルを下回ると、20 ドル以上の請求が行われます。 +たとえば、毎月の使用制限を 20 ドルに設定したとします。Zen は月に 20 ドル以上を使用しません。ただし、自動リロードを有効にしている場合、残高が 5 ドルを下回ると、Zen が 20 ドル以上の請求を行う可能性があります。 --- @@ -183,24 +183,22 @@ https://opencode.ai/zen/v1/models すべてのモデルは米国でホストされています。当社のプロバイダーはゼロ保持ポリシーに従い、次の例外を除いて、モデルのトレーニングにデータを使用しません。 -- Big Pickle: 無料期間中に、収集されたデータはモデルの改善に使用される場合があります。 -- GLM 4.7 無料: 無料期間中、収集されたデータはモデルを改善するために使用される場合があります。 -- Kimi K2.5 Free: 無料期間中、収集されたデータはモデルの改善に使用される場合があります。 -- MiniMax M2.1 無料: 無料期間中、収集されたデータはモデルを改善するために使用される場合があります。 -- OpenAI API: リクエストは [OpenAI のデータポリシー](https://platform.openai.com/docs/guides/your-data)に従います。 -- Anthropic API: リクエストは、[Anthropic のデータポリシー](https://docs.anthropic.com/en/docs/claude-code/data-usage)に従います。 +- Big Pickle: 無料期間中、収集されたデータはモデルの改善に使用される場合があります。 +- MiniMax M2.5 Free: 無料期間中、収集されたデータはモデルの改善に使用される場合があります。 +- OpenAI API: リクエストは [OpenAI のデータポリシー](https://platform.openai.com/docs/guides/your-data) に従い、30 日間保持されます。 +- Anthropic API: リクエストは [Anthropic のデータポリシー](https://docs.anthropic.com/en/docs/claude-code/data-usage) に従い、30 日間保持されます。 --- ## チーム向け -Zen はチームにも効果的です。チームメイトを招待し、役割を割り当て、キュレートすることができます -チームが使用するモデルなど。 +Zen はチームにも効果的です。チームメイトを招待し、役割を割り当て、チームが使用するモデルをキュレートすることなどができます。 :::note ワークスペースは現在、ベータ版の一部としてチームに無料で提供されています。 ::: -価格の詳細については近日中にお知らせします。 + +ワークスペースの管理は現在、ベータ版の一部としてチームに無料で提供されています。価格の詳細については近日中にお知らせします。 --- diff --git a/packages/web/src/content/docs/ko/config.mdx b/packages/web/src/content/docs/ko/config.mdx index e906eaf47b2..2f08824d699 100644 --- a/packages/web/src/content/docs/ko/config.mdx +++ b/packages/web/src/content/docs/ko/config.mdx @@ -14,10 +14,11 @@ OpenCode는 **JSON**과 **JSONC**(주석이 포함된 JSON) 형식을 모두 지 ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -33,7 +34,7 @@ config 파일은 **교체되지 않고 병합**됩니다. config 파일은 서로 대체되는 방식이 아니라 병합됩니다. 아래 config 위치의 설정이 결합되며, 충돌하는 key에 대해서만 나중에 로드된 config가 앞선 값을 override합니다. 충돌하지 않는 설정은 모두 유지됩니다. -예를 들어, 전역 config에 `theme: "opencode"`와 `autoupdate: true`가 있고 프로젝트 config에 `model: "anthropic/claude-sonnet-4-5"`가 있으면 최종 config에는 이 세 설정이 모두 포함됩니다. +예를 들어, 전역 config에 `autoupdate: true`가 있고 프로젝트 config에 `model: "anthropic/claude-sonnet-4-5"`가 있으면 최종 config에는 이 설정이 모두 포함됩니다. --- @@ -94,7 +95,9 @@ Remote config는 가장 먼저 로드되어 기본 레이어 역할을 합니다 ### Global -전역 OpenCode config는 `~/.config/opencode/opencode.json`에 두세요. theme, provider, keybind 같은 사용자 전체 기본 설정은 전역 config로 관리하세요. +전역 OpenCode config는 `~/.config/opencode/opencode.json`에 두세요. provider, model, permissions 같은 사용자 전체 기본 설정은 전역 config로 관리하세요. + +TUI 관련 설정은 `~/.config/opencode/tui.json`을 사용하세요. 전역 config는 조직의 Remote 기본값을 override합니다. @@ -104,6 +107,8 @@ Remote config는 가장 먼저 로드되어 기본 레이어 역할을 합니다 프로젝트 루트에 `opencode.json`을 추가하세요. 프로젝트 config는 표준 config 파일 중 우선순위가 가장 높아 전역 및 Remote config를 모두 override합니다. +프로젝트별 TUI 설정은 `tui.json`을 함께 추가하세요. + :::tip 프로젝트별 config는 프로젝트 루트에 두세요. ::: @@ -142,7 +147,9 @@ custom 디렉토리는 전역 config와 `.opencode` 디렉토리 뒤에 로드 ## Schema -config 파일의 schema는 [**`opencode.ai/config.json`**](https://opencode.ai/config.json)에 정의되어 있습니다. +server/runtime config schema는 [**`opencode.ai/config.json`**](https://opencode.ai/config.json)에 정의되어 있습니다. + +TUI config는 [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json)을 사용합니다. 편집기에서 이 schema를 기반으로 validation과 autocomplete를 사용할 수 있습니다. @@ -150,28 +157,24 @@ config 파일의 schema는 [**`opencode.ai/config.json`**](https://opencode.ai/c ### TUI -`tui` 옵션으로 TUI 관련 설정을 구성할 수 있습니다. +TUI 관련 설정에는 전용 `tui.json` (또는 `tui.jsonc`) 파일을 사용하세요. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -사용 가능한 옵션: +`OPENCODE_TUI_CONFIG`를 사용하여 사용자 지정 TUI 설정 파일을 가리킬 수 있습니다. -- `scroll_acceleration.enabled` - macOS 스타일 스크롤 가속을 활성화합니다. **`scroll_speed`보다 우선합니다.** -- `scroll_speed` - 사용자 정의 스크롤 속도 배수(기본: `3`, 최소: `1`). `scroll_acceleration.enabled`가 `true`이면 무시됩니다. -- `diff_style` - diff 렌더링 방식을 제어합니다. `"auto"`는 터미널 너비에 맞춰 조정되고, `"stacked"`는 항상 단일 컬럼으로 표시합니다. +`opencode.json`의 기존 `theme`, `keybinds`, `tui` 키는 더 이상 사용되지 않으며(deprecated) 가능한 경우 자동으로 마이그레이션됩니다. -[TUI에 대해 더 알아보기](/docs/tui). +[TUI 구성에 대해 더 알아보기](/docs/tui#configure). --- @@ -297,12 +300,12 @@ Bearer token(`AWS_BEARER_TOKEN_BEDROCK` 또는 `/connect`)은 profile 기반 인 ### Themes -`theme` 옵션으로 OpenCode config에서 사용할 theme를 설정할 수 있습니다. +`tui.json`에서 UI 테마를 설정하세요. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -402,11 +405,11 @@ Bearer token(`AWS_BEARER_TOKEN_BEDROCK` 또는 `/connect`)은 profile 기반 인 ### Keybinds -`keybinds` 옵션으로 keybind를 커스터마이즈할 수 있습니다. +`tui.json`에서 단축키를 사용자 지정하세요. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` diff --git a/packages/web/src/content/docs/ko/custom-tools.mdx b/packages/web/src/content/docs/ko/custom-tools.mdx index 77310557faa..c90db16f1d7 100644 --- a/packages/web/src/content/docs/ko/custom-tools.mdx +++ b/packages/web/src/content/docs/ko/custom-tools.mdx @@ -79,6 +79,32 @@ export const multiply = tool({ --- +#### 기본 도구와 이름 충돌 + +커스텀 도구는 도구 이름으로 식별됩니다. 커스텀 도구가 기본 도구와 같은 이름을 사용하면 커스텀 도구가 우선순위를 갖습니다. + +예를 들어, 이 파일은 기본 `bash` 도구를 대체합니다: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +의도적으로 기본 도구를 대체하려는 경우가 아니라면 고유한 이름을 사용하는 것이 좋습니다. 도구를 오버라이드하지 않고 비활성화만 하려면 [permissions](/docs/permissions)를 사용하세요. +::: + +--- + ### 인자 인자 타입은 `tool.schema`로 정의할 수 있습니다. `tool.schema`는 [Zod](https://zod.dev) 기반입니다. diff --git a/packages/web/src/content/docs/ko/keybinds.mdx b/packages/web/src/content/docs/ko/keybinds.mdx index aef7ae357a3..2920a223574 100644 --- a/packages/web/src/content/docs/ko/keybinds.mdx +++ b/packages/web/src/content/docs/ko/keybinds.mdx @@ -3,11 +3,11 @@ title: 키바인드 description: 키바인드를 커스터마이즈하세요. --- -OpenCode에는 OpenCode config를 통해 커스터마이즈할 수 있는 keybinds 목록이 있습니다. +OpenCode에는 `tui.json`을 통해 커스터마이즈할 수 있는 키바인드 목록이 있습니다. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,q", @@ -117,11 +117,11 @@ keybinds에 리더 키를 꼭 사용할 필요는 없지만, 사용하는 것을 ## 키바인드 비활성화 -config에 해당 키를 값 `"none"`으로 추가하면 keybind를 비활성화할 수 있습니다. +`tui.json`에 해당 키를 값 `"none"`으로 추가하면 키바인드를 비활성화할 수 있습니다. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/ko/plugins.mdx b/packages/web/src/content/docs/ko/plugins.mdx index 7214f326587..f20eb90c46c 100644 --- a/packages/web/src/content/docs/ko/plugins.mdx +++ b/packages/web/src/content/docs/ko/plugins.mdx @@ -3,7 +3,7 @@ title: 플러그인 description: OpenCode를 확장하기 위해 자신만의 플러그인을 작성하세요. --- -플러그인은 다양한 이벤트와 사용자 정의 행동으로 후킹하여 opencode를 확장 할 수 있습니다. 플러그인을 만들 수 있습니다 새로운 기능을 추가, 외부 서비스와 통합, 또는 opencode의 기본 동작을 수정. +플러그인은 다양한 이벤트와 사용자 정의 행동으로 후킹하여 opencode를 확장 할 수 있습니다. 플러그인을 사용하여 새로운 기능을 추가하거나, 외부 서비스와 통합하거나, opencode의 기본 동작을 수정할 수 있습니다. 예를 들어, 커뮤니티에 의해 생성 된 [plugins](/docs/ecosystem#plugins)를 확인하십시오. @@ -11,18 +11,18 @@ description: OpenCode를 확장하기 위해 자신만의 플러그인을 작성 ## 플러그인 사용 -플러그인을로드하는 두 가지 방법이 있습니다. +플러그인을 로드하는 두 가지 방법이 있습니다. --- -## 로컬 파일에서 +### 로컬 파일에서 플러그인 디렉토리에 JavaScript 또는 TypeScript 파일을 배치합니다. - `.opencode/plugins/` - 프로젝트 레벨 플러그인 - `~/.config/opencode/plugins/` - 글로벌 플러그인 -이 디렉토리의 파일은 자동으로 시작에로드됩니다. +이 디렉토리의 파일은 시작 시 자동으로 로드됩니다. --- @@ -37,43 +37,42 @@ config 파일에 npm 패키지를 지정합니다. } ``` -일반 및 범위의 npm 패키지 모두 지원됩니다. +일반 패키지 및 스코프 npm 패키지 모두 지원됩니다. [ecosystem](/docs/ecosystem#plugins)에서 사용할 수 있는 플러그인을 찾아보세요. --- -## 플러그인이 설치되는 방법 +### 플러그인이 설치되는 방법 -**npm 플러그인**은 시작시 Bun을 사용하여 자동으로 설치됩니다. 패키지와 그들의 의존성은 `~/.cache/opencode/node_modules/`에서 캐시됩니다. +**npm 플러그인**은 시작시 Bun을 사용하여 자동으로 설치됩니다. 패키지와 그 의존성은 `~/.cache/opencode/node_modules/`에 캐시됩니다. -**로컬 플러그인**은 플러그인 디렉토리에서 직접로드됩니다. 외부 패키지를 사용하려면 구성 디렉토리 내 `package.json`를 작성해야 합니다 ([Dependencies](#dependencies)), 또는 플러그인을 npm에 게시하고 [config에 추가](/docs/config#plugins). +**로컬 플러그인**은 플러그인 디렉토리에서 직접 로드됩니다. 외부 패키지를 사용하려면 구성 디렉토리 내에 `package.json`을 작성해야 하거나([의존성](#의존성) 참조), 플러그인을 npm에 게시하고 [config에 추가](/docs/config#plugins)해야 합니다. --- -## 로드 순서 +### 로드 순서 -플러그인은 모든 소스에서로드되며 모든 후크는 순서대로 실행됩니다. 로드 순서는 다음과 같습니다: +플러그인은 모든 소스에서 로드되며 모든 후크는 순서대로 실행됩니다. 로드 순서는 다음과 같습니다: 1. 글로벌 구성 (`~/.config/opencode/opencode.json`) 2. 프로젝트 구성 (`opencode.json`) 3. 글로벌 플러그인 디렉토리 (`~/.config/opencode/plugins/`) 4. 프로젝트 플러그인 디렉토리 (`.opencode/plugins/`) -중복 npm 패키지는 한 번만 로드됩니다. 하지만, 로컬 플러그인과 같은 이름과 npm 플러그인은 모두 별도로로드됩니다. +중복된 이름과 버전의 npm 패키지는 한 번만 로드됩니다. 하지만 로컬 플러그인과 npm 플러그인의 이름이 비슷하더라도 둘 다 별도로 로드됩니다. --- ## 플러그인 만들기 -플러그인은 **JavaScript/TypeScript 모듈**입니다. -기능. 각 함수는 context 객체를 수신하고 Hooks 객체를 반환합니다. +플러그인은 하나 이상의 플러그인 함수를 내보내는 **JavaScript/TypeScript 모듈**입니다. 각 함수는 context 객체를 수신하고 hooks 객체를 반환합니다. --- ### 의존성 -로컬 플러그인 및 사용자 정의 도구는 외부 npm 패키지를 사용할 수 있습니다. `package.json`를 config 디렉토리에 추가하면 필요한 의존도가 있습니다. +로컬 플러그인 및 사용자 정의 도구는 외부 npm 패키지를 사용할 수 있습니다. config 디렉토리에 `package.json`을 추가하고 필요한 의존성을 명시하십시오. ```json title=".opencode/package.json" { @@ -83,7 +82,7 @@ config 파일에 npm 패키지를 지정합니다. } ``` -opencode는 `bun install`를 시작합니다. 플러그인 및 도구가 가져올 수 있습니다. +opencode는 시작 시 `bun install`을 실행하여 이를 설치합니다. 이후 플러그인 및 도구에서 가져올 수 있습니다. ```ts title=".opencode/plugins/my-plugin.ts" import { escape } from "shescape" @@ -113,19 +112,19 @@ export const MyPlugin = async ({ project, client, $, directory, worktree }) => { } ``` -플러그인 기능 수신: +플러그인 함수가 받는 인자: - `project`: 현재 프로젝트 정보. - `directory`: 현재 작업 디렉토리. - `worktree`: git worktree 경로. - `client`: AI와 상호 작용을 위한 opencode SDK 클라이언트. -- `$`: Bun's [shell API](https://bun.com/docs/runtime/shell) 명령어를 실행합니다. +- `$`: 명령어를 실행하기 위한 Bun의 [shell API](https://bun.com/docs/runtime/shell). --- ### TypeScript 지원 -TypeScript 플러그인의 경우 플러그인 패키지에서 유형을 가져올 수 있습니다. +TypeScript 플러그인의 경우 플러그인 패키지에서 타입을 가져올 수 있습니다. ```ts title="my-plugin.ts" {1} import type { Plugin } from "@opencode-ai/plugin" @@ -139,29 +138,29 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree --- -## 이벤트 +### 이벤트 -플러그인은 예제 섹션에서 아래에서 볼 때 이벤트에 가입 할 수 있습니다. 여기에 다른 이벤트의 목록입니다. +플러그인은 아래 예제 섹션에서 볼 수 있듯이 이벤트를 구독할 수 있습니다. 사용 가능한 이벤트 목록은 다음과 같습니다. -### 명령어 이벤트 +#### 명령어 이벤트 - `command.executed` -### 파일 이벤트 +#### 파일 이벤트 - `file.edited` - `file.watcher.updated` -### 설치 이벤트 +#### 설치 이벤트 - `installation.updated` -### LSP 이벤트 +#### LSP 이벤트 - `lsp.client.diagnostics` - `lsp.updated` -### 메시지 이벤트 +#### 메시지 이벤트 - `message.part.removed` - `message.part.updated` @@ -173,11 +172,11 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree - `permission.asked` - `permission.replied` -### 서버 이벤트 +#### 서버 이벤트 - `server.connected` -### 세션 이벤트 +#### 세션 이벤트 - `session.created` - `session.compacted` @@ -188,7 +187,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree - `session.status` - `session.updated` -### Todo 이벤트 +#### Todo 이벤트 - `todo.updated` @@ -196,7 +195,7 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree - `shell.env` -##### 도구 이벤트 +#### 도구 이벤트 - `tool.execute.after` - `tool.execute.before` @@ -211,11 +210,11 @@ export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree ## 예제 -opencode를 확장하기 위해 사용할 수있는 플러그인의 몇 가지 예입니다. +opencode를 확장하기 위해 사용할 수 있는 플러그인 예제입니다. --- -## 알림 보내기 +### 알림 보내기 특정 이벤트가 발생할 때 알림을 전송: @@ -232,7 +231,7 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr } ``` -macOS에서 AppleScript를 실행하려면 `osascript`를 사용하고 있습니다. 여기에 우리는 그것을 사용하여 알림을 보낼 수 있습니다. +macOS에서 AppleScript를 실행하기 위해 `osascript`를 사용하고 있습니다. 여기서는 알림을 보내는 데 사용합니다. :::note opencode 데스크톱 앱을 사용하는 경우 응답이 준비되어 있거나 세션 오류가 있을 때 시스템 알림을 자동으로 보낼 수 있습니다. @@ -242,7 +241,7 @@ opencode 데스크톱 앱을 사용하는 경우 응답이 준비되어 있거 ### .env 보호 -읽기 `.env` 파일에서 opencode를 방지하십시오: +opencode가 `.env` 파일을 읽지 못하도록 방지: ```javascript title=".opencode/plugins/env-protection.js" export const EnvProtection = async ({ project, client, $, directory, worktree }) => { @@ -260,7 +259,7 @@ export const EnvProtection = async ({ project, client, $, directory, worktree }) ### Inject 환경 변수 -환경 변수를 모든 shell 실행 (AI 도구 및 사용자 terminal)로 주사하십시오. +모든 shell 실행(AI 도구 및 사용자 terminal)에 환경 변수 주입: ```javascript title=".opencode/plugins/inject-env.js" export const InjectEnvPlugin = async () => { @@ -277,7 +276,7 @@ export const InjectEnvPlugin = async () => { ### 사용자 정의 도구 -플러그인은 opencode에 사용자 정의 도구를 추가 할 수 있습니다 : +플러그인은 opencode에 사용자 정의 도구를 추가할 수 있습니다: ```ts title=".opencode/plugins/custom-tools.ts" import { type Plugin, tool } from "@opencode-ai/plugin" @@ -300,13 +299,17 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { } ``` -`tool` helper는 opencode가 호출 할 수있는 사용자 정의 도구를 만듭니다. Zod schema 기능을 가지고 도구 정의를 반환: +`tool` helper는 opencode가 호출할 수 있는 사용자 정의 도구를 만듭니다. Zod 스키마 함수를 받고 다음을 포함하는 도구 정의를 반환합니다: -- `description`: 도구는 무엇을 +- `description`: 도구가 하는 일 - `args`: 도구의 인수에 대한 Zod 스키마 -- `execute`: 도구가 호출될 때 실행되는 기능 +- `execute`: 도구가 호출될 때 실행되는 함수 -사용자 정의 도구는 내장 도구와 함께 opencode를 사용할 수 있습니다. +사용자 정의 도구는 내장 도구와 함께 opencode에서 사용할 수 있습니다. + +:::note +플러그인 도구가 내장 도구와 같은 이름을 사용하면 플러그인 도구가 우선순위를 갖습니다. +::: --- @@ -331,9 +334,9 @@ export const MyPlugin = async ({ client }) => { --- -## Compaction 훅 +### Compaction 훅 -세션이 압축 될 때 포함 된 컨텍스트를 사용자 지정: +세션이 압축될 때 포함되는 컨텍스트를 사용자 지정할 수 있습니다: ```ts title=".opencode/plugins/compaction.ts" import type { Plugin } from "@opencode-ai/plugin" @@ -355,9 +358,9 @@ Include any state that should persist across compaction: } ``` -LLM이 압축 요약을 생성하기 전에 `experimental.session.compacting` 훅이 실행됩니다. 기본 압축 프롬프트를 대체할 수 있도록 도메인 별 컨텍스트를 주입합니다. +`experimental.session.compacting` 훅은 LLM이 연속 요약을 생성하기 전에 실행됩니다. 기본 압축 프롬프트가 놓칠 수 있는 도메인별 컨텍스트를 주입하는 데 사용하세요. -당신은 또한 `output.prompt`를 조정해서 조밀함을 전적으로 대체할 수 있습니다: +또한 `output.prompt`를 설정하여 압축 프롬프트를 완전히 대체할 수도 있습니다: ```ts title=".opencode/plugins/custom-compaction.ts" import type { Plugin } from "@opencode-ai/plugin" @@ -382,4 +385,4 @@ Format as a structured prompt that a new agent can use to resume work. } ``` -`output.prompt`가 설정되면 완전히 기본 압축 프롬프트를 대체합니다. `output.context` 배열은 이 경우에 무시됩니다. +`output.prompt`가 설정되면 기본 압축 프롬프트를 완전히 대체합니다. 이 경우 `output.context` 배열은 무시됩니다. diff --git a/packages/web/src/content/docs/ko/providers.mdx b/packages/web/src/content/docs/ko/providers.mdx index ea48dbfb0a9..95b4907e242 100644 --- a/packages/web/src/content/docs/ko/providers.mdx +++ b/packages/web/src/content/docs/ko/providers.mdx @@ -3,7 +3,7 @@ title: 공급자 description: OpenCode에서 LLM 공급자를 사용합니다. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console OpenCode는 [AI SDK](https://ai-sdk.dev/) 및 [Models.dev](https://models.dev)를 사용하여 **75개 이상의 LLM 공급자**를 지원하며 로컬 모델도 실행할 수 있습니다. @@ -22,13 +22,13 @@ OpenCode는 [AI SDK](https://ai-sdk.dev/) 및 [Models.dev](https://models.dev) --- -#### 구성 +### 구성 OpenCode 설정의 `provider` 섹션을 통해 공급자를 사용자 정의할 수 있습니다. --- -### 기본 URL +#### 기본 URL `baseURL` 옵션을 설정하여 모든 공급자를 위한 기본 URL을 사용자 정의할 수 있습니다. 프록시 서비스 또는 사용자 정의 엔드포인트를 사용할 때 유용합니다. @@ -55,7 +55,38 @@ OpenCode Zen은 OpenCode 팀이 OpenCode와 잘 작동하도록 테스트하고 처음이라면 OpenCode Zen으로 시작하는 것이 좋습니다. ::: -1. TUI에서 `/connect` 명령을 실행하고 `opencode`를 선택한 뒤, [opencode.ai/auth](https://opencode.ai/auth)로 이동합니다. +1. TUI에서 `/connect` 명령을 실행하고 `OpenCode Zen`을 선택한 뒤, [opencode.ai/auth](https://opencode.ai/zen)로 이동합니다. + + ```txt + /connect + ``` + +2. 로그인하고 결제 정보를 입력한 후 API 키를 복사하십시오. + +3. API 키를 붙여넣습니다. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. TUI에서 `/models`를 실행하여 추천 모델 목록을 볼 수 있습니다. + + ```txt + /models + ``` + +OpenCode의 다른 공급자처럼 작동하며 사용은 완전히 선택 사항입니다. + +--- + +## OpenCode Go + +OpenCode Go는 OpenCode 팀이 테스트하고 검증하여 OpenCode와 잘 작동하는 인기 있는 오픈 코딩 모델에 안정적으로 액세스할 수 있는 저렴한 구독 요금제입니다. + +1. TUI에서 `/connect` 명령을 실행하고 `OpenCode Go`를 선택한 뒤 [opencode.ai/auth](https://opencode.ai/zen)로 이동하십시오. ```txt /connect @@ -129,15 +160,15 @@ OpenCode로 Amazon Bedrock을 사용하려면: Amazon Bedrock에서 원하는 모델에 대한 액세스 권한이 있어야 합니다. ::: -2. 다음 방법 중 하나를 사용하여 **설정**합니다: +2. 다음 방법 중 하나를 사용하여 **인증을 구성**합니다: ---- + *** -### 환경 변수 (빠른 시작) + #### 환경 변수 (빠른 시작) -OpenCode를 실행하는 동안 다음 환경 변수 중 하나를 설정합니다: + OpenCode를 실행하는 동안 다음 환경 변수 중 하나를 설정합니다: -```bash + ```bash # Option 1: Using AWS access keys AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=YYY opencode @@ -146,87 +177,84 @@ OpenCode를 실행하는 동안 다음 환경 변수 중 하나를 설정합니 # Option 3: Using Bedrock bearer token AWS_BEARER_TOKEN_BEDROCK=XXX opencode -``` + ``` -또는 bash 프로필에 추가합니다: + 또는 bash 프로필에 추가합니다: -```bash title="~/.bash_profile" + ```bash title="~/.bash_profile" export AWS_PROFILE=my-dev-profile export AWS_REGION=us-east-1 -``` - ---- - -#### 설정 파일 (권장) - -프로젝트별 또는 영구 구성을 위해 `opencode.json`을 사용하십시오. + ``` -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "amazon-bedrock": { - "options": { - "region": "us-east-1", - "profile": "my-aws-profile" - } - } - } -} -``` + *** -**유효한 옵션:** + #### 구성 파일 (권장) -- `region` - AWS 리전 (예: `us-east-1`, `eu-west-1`) -- `profile` - `~/.aws/credentials`의 AWS 프로필 이름 -- `endpoint` - VPC 엔드포인트 등을 위한 사용자 정의 엔드포인트 URL (일반 `baseURL` 옵션의 별칭) + 프로젝트별 또는 영구 구성을 위해 `opencode.json`을 사용하십시오: - :::tip - 구성 파일 옵션은 환경 변수보다 우선 순위가 높습니다. - ::: + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "amazon-bedrock": { + "options": { + "region": "us-east-1", + "profile": "my-aws-profile" + } + } + } + } + ``` ---- + **유효한 옵션:** + - `region` - AWS 리전 (예: `us-east-1`, `eu-west-1`) + - `profile` - `~/.aws/credentials`의 AWS 프로필 이름 + - `endpoint` - VPC 엔드포인트 등을 위한 사용자 정의 엔드포인트 URL (일반 `baseURL` 옵션의 별칭) -#### 고급: VPC 엔드포인트 + :::tip + 구성 파일 옵션은 환경 변수보다 우선 순위가 높습니다. + ::: -Bedrock의 VPC 엔드포인트를 사용하는 경우: + *** -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "amazon-bedrock": { - "options": { - "region": "us-east-1", - "profile": "production", - "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" - } - } - } -} -``` + #### 고급: VPC 엔드포인트 -:::note -`endpoint` 옵션은 일반적인 `baseURL` 옵션의 별칭입니다. `endpoint`와 `baseURL` 둘 다 지정된 경우 `endpoint`가 우선합니다. -::: + Bedrock의 VPC 엔드포인트를 사용하는 경우: ---- + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "amazon-bedrock": { + "options": { + "region": "us-east-1", + "profile": "production", + "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" + } + } + } + } + ``` -#### 인증 방법 + :::note + `endpoint` 옵션은 일반적인 `baseURL` 옵션의 별칭입니다. `endpoint`와 `baseURL` 둘 다 지정된 경우 `endpoint`가 우선합니다. + ::: -- **`AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`**: IAM 사용자 및 AWS 콘솔에서 액세스 키 생성 -- **`AWS_PROFILE`**: `~/.aws/credentials`의 프로필 이름을 사용합니다. `aws configure --profile my-profile` 또는 `aws sso login`으로 먼저 구성하십시오. -- **`AWS_BEARER_TOKEN_BEDROCK`**: Amazon Bedrock 콘솔에서 임시 API 키 생성 -- **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**: EKS IRSA (서비스 계정용 IAM 역할) 또는 다른 Kubernetes 환경의 OIDC 연동. 이 환경 변수는 서비스 계정을 사용할 때 Kubernetes에 의해 자동으로 주입됩니다. + *** ---- + #### 인증 방법 + - **`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`**: IAM 사용자 및 AWS 콘솔에서 액세스 키 생성 + - **`AWS_PROFILE`**: `~/.aws/credentials`의 프로필 이름을 사용합니다. `aws configure --profile my-profile` 또는 `aws sso login`으로 먼저 구성하십시오. + - **`AWS_BEARER_TOKEN_BEDROCK`**: Amazon Bedrock 콘솔에서 임시 API 키 생성 + - **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**: EKS IRSA (서비스 계정용 IAM 역할) 또는 다른 Kubernetes 환경의 OIDC 연동. 이 환경 변수는 서비스 계정을 사용할 때 Kubernetes에 의해 자동으로 주입됩니다. -#### 인증 우선 순위 + *** -Amazon Bedrock은 다음과 같은 인증 우선 순위를 사용합니다. + #### 인증 우선 순위 -1. **Bearer Token** - `AWS_BEARER_TOKEN_BEDROCK` 환경 변수 또는 `/connect` 명령의 토큰 -2. **AWS Credential Chain** - 프로필, 액세스 키, 공유 자격 증명, IAM 역할, 웹 ID 토큰 (EKS IRSA), 인스턴스 메타데이터 + Amazon Bedrock은 다음과 같은 인증 우선 순위를 사용합니다. + 1. **Bearer Token** - `AWS_BEARER_TOKEN_BEDROCK` 환경 변수 또는 `/connect` 명령의 토큰 + 2. **AWS Credential Chain** - 프로필, 액세스 키, 공유 자격 증명, IAM 역할, 웹 ID 토큰 (EKS IRSA), 인스턴스 메타데이터 :::note Bearer 토큰을 설정할 때 (`/connect` 또는 `AWS_BEARER_TOKEN_BEDROCK`를 통해), 구성된 프로필을 포함한 모든 AWS 자격 증명 방법보다 우선 순위가 높습니다. @@ -260,7 +288,7 @@ Amazon Bedrock은 다음과 같은 인증 우선 순위를 사용합니다. --- -#### Anthropic +### Anthropic 1. 가입 후 `/connect` 명령을 실행하고 **Anthropic**을 선택합니다. @@ -268,7 +296,7 @@ Amazon Bedrock은 다음과 같은 인증 우선 순위를 사용합니다. /connect ``` -2. **Claude Pro/Max** 옵션을 선택하면 브라우저가 열립니다. +2. **Claude Pro/Max** 옵션을 선택하면 브라우저가 열리고 인증을 요청합니다. ```txt ┌ Select auth method @@ -300,7 +328,7 @@ Pro/Max 구독이 없는 경우 **Create an API Key**를 선택할 수 있습니 ### Azure OpenAI :::note -"I'm sorry, but I can't support that request" 오류가 발생하면, Azure 리소스의 콘텐츠 필터를 **DefaultV2**에서 **Default**로 변경해 보세요. +"I'm sorry, but I cannot assist with that request" 오류가 발생하면, Azure 리소스의 콘텐츠 필터를 **DefaultV2**에서 **Default**로 변경해 보세요. ::: 1. [Azure 포털](https://portal.azure.com/)로 이동하여 **Azure OpenAI** 리소스를 만듭니다. 다음이 필요합니다: @@ -395,7 +423,7 @@ Pro/Max 구독이 없는 경우 **Create an API Key**를 선택할 수 있습니 --- -#### Baseten +### Baseten 1. [Baseten](https://app.baseten.co/)으로 이동하여 계정을 만들고 API 키를 생성합니다. @@ -422,7 +450,7 @@ Pro/Max 구독이 없는 경우 **Create an API Key**를 선택할 수 있습니 --- -#### Cerebras +### Cerebras 1. [Cerebras 콘솔](https://inference.cerebras.ai/)로 이동하여 계정을 만들고 API 키를 생성합니다. @@ -441,7 +469,7 @@ Pro/Max 구독이 없는 경우 **Create an API Key**를 선택할 수 있습니 └ enter ``` -4. `/models` 명령을 실행하여 모델(예: Qwen 3 Coder 480B)을 선택하십시오. +4. `/models` 명령을 실행하여 모델(예: _Qwen 3 Coder 480B_)을 선택하십시오. ```txt /models @@ -449,7 +477,7 @@ Pro/Max 구독이 없는 경우 **Create an API Key**를 선택할 수 있습니 --- -## Cloudflare AI Gateway +### Cloudflare AI Gateway Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세스할 수 있으며, 통합된 엔드포인트를 통해 더 많은 기능을 제공합니다. [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/)을 사용하면 각 공급자의 별도 API 키가 필요하지 않습니다. @@ -507,7 +535,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 --- -#### Cortecs +### Cortecs 1. [Cortecs 콘솔](https://cortecs.ai/)로 이동하여 계정을 만들고 API 키를 생성합니다. @@ -526,7 +554,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 └ enter ``` -4. `/models` 명령을 실행하여 모델(예: Kimi K2 Instruct)을 선택하십시오. +4. `/models` 명령을 실행하여 모델(예: _Kimi K2 Instruct_)을 선택하십시오. ```txt /models @@ -534,7 +562,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 --- -## DeepSeek +### DeepSeek 1. [DeepSeek 콘솔](https://platform.deepseek.com/)로 이동하여 계정을 만들고 **API Keys**를 클릭하여 키를 생성합니다. @@ -553,7 +581,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 └ enter ``` -4. `/models` 명령을 실행하여 DeepSeek 모델(예: DeepSeek Reasoner)을 선택하십시오. +4. `/models` 명령을 실행하여 DeepSeek 모델(예: _DeepSeek Reasoner_)을 선택하십시오. ```txt /models @@ -561,7 +589,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 --- -## Deep Infra +### Deep Infra 1. [Deep Infra 대시보드](https://deepinfra.com/dash)로 이동하여 계정을 만들고 API 키를 생성합니다. @@ -588,7 +616,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 --- -## Firmware +### Firmware 1. [Firmware 대시보드](https://app.firmware.ai/signup)로 이동하여 계정을 만들고 API 키를 생성합니다. @@ -615,7 +643,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 --- -## Fireworks AI +### Fireworks AI 1. [Fireworks AI 콘솔](https://app.fireworks.ai/)로 이동하여 계정을 만들고 **API Keys**를 클릭합니다. @@ -634,7 +662,7 @@ Cloudflare AI Gateway는 OpenAI, Anthropic, Workers AI 등의 모델에 액세 └ enter ``` -4. `/models` 명령을 실행하여 모델(예: Kimi K2 Instruct)을 선택하십시오. +4. `/models` 명령을 실행하여 모델(예: _Kimi K2 Instruct_)을 선택하십시오. ```txt /models @@ -662,38 +690,33 @@ GitLab Duo는 GitLab의 Anthropic 프록시를 통해 기본 도구 호출 기 └ ``` -#### OAuth 사용 (권장) - -**OAuth**를 선택하면 브라우저에서 권한 부여를 요청합니다. - ---- + #### OAuth 사용 (권장) -### 개인 액세스 토큰 사용 + **OAuth**를 선택하면 브라우저가 열리고 인증을 요청합니다. -1. [GitLab User Settings > Access Tokens](https://gitlab.com/-/user_settings/personal_access_tokens)로 이동 -2. 새 토큰 추가 -3. 이름: `OpenCode`, 범위: `api` -4. 토큰 복사 (`glpat-`로 시작) -5. 터미널에 입력하십시오. + #### 개인 액세스 토큰 사용 + 1. [GitLab User Settings > Access Tokens](https://gitlab.com/-/user_settings/personal_access_tokens)로 이동 + 2. **Add new token** 클릭 + 3. 이름: `OpenCode`, 범위: `api` + 4. 토큰 복사 (`glpat-`로 시작) + 5. 터미널에 입력 -6. 사용 가능한 모델을 보려면 `/models` 명령을 실행하십시오. +3. `/models` 명령을 실행하여 사용 가능한 모델을 확인하십시오. ```txt /models ``` -세 가지 Claude 기반 모델을 사용할 수 있습니다: - -- **duo-chat-haiku-4-5** (기본값) - 빠른 작업을 위한 빠른 응답 -- **duo-chat-sonnet-4-5** - 대부분의 워크플로우에 균형 잡힌 성능 -- **duo-chat-opus-4-5** - 복잡한 분석 가능 + 세 가지 Claude 기반 모델을 사용할 수 있습니다: + - **duo-chat-haiku-4-5** (기본값) - 빠른 작업을 위한 빠른 응답 + - **duo-chat-sonnet-4-5** - 대부분의 워크플로우에 균형 잡힌 성능 + - **duo-chat-opus-4-5** - 복잡한 분석에 적합 :::note -`GITLAB_TOKEN` 환경 변수를 지정할 수도 있습니다. -OpenCode는 인증 저장소에 토큰을 저장합니다. +`GITLAB_TOKEN` 환경 변수를 지정하여 토큰을 저장하지 않고 사용할 수도 있습니다. ::: -#### 셀프 호스팅 GitLab (Self-Hosted) +#### 셀프 호스팅 GitLab :::note[규정 준수 참고 사항] OpenCode는 세션 제목 생성과 같은 일부 AI 작업을 위해 작은 모델을 사용합니다. @@ -711,7 +734,7 @@ OpenCode를 자체 호스팅 GitLab 인스턴스만 사용하도록 제한하려 ::: -자체 호스팅 GitLab 인스턴스: +자체 호스팅 GitLab 인스턴스의 경우: ```bash export GITLAB_INSTANCE_URL=https://gitlab.company.com @@ -721,7 +744,7 @@ export GITLAB_TOKEN=glpat-... 인스턴스가 사용자 정의 AI Gateway를 실행하는 경우: ```bash -export GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com +GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com ``` 또는 bash 프로필에 추가: @@ -737,19 +760,18 @@ GitLab 관리자는 다음을 활성화해야 합니다: 1. [Duo Agent Platform](https://docs.gitlab.com/user/gitlab_duo/turn_on_off/) (사용자, 그룹 또는 인스턴스) 2. 기능 플래그 (Rails 콘솔을 통해): - -- `agent_platform_claude_code` -- `third_party_agents_enabled` - ::: + - `agent_platform_claude_code` + - `third_party_agents_enabled` + ::: #### 셀프 호스팅 인스턴스용 OAuth 자체 호스팅 인스턴스에 대해 OAuth를 작동시키려면 새로운 애플리케이션(Settings → Applications)을 만들어야 합니다. 콜백 URL `http://127.0.0.1:8080/callback` 및 다음 범위가 필요합니다: -- `api` (사용자 대신 API 액세스) -- `read_user` (개인 정보 읽기) -- `read_repository` (리포지토리 읽기 전용 액세스) +- api (사용자 대신 API 액세스) +- read_user (개인 정보 읽기) +- read_repository (리포지토리 읽기 전용 액세스) 그런 다음 애플리케이션 ID를 환경 변수로 노출하십시오: @@ -759,7 +781,7 @@ export GITLAB_OAUTH_CLIENT_ID=your_application_id_here [opencode-gitlab-auth](https://www.npmjs.com/package/@gitlab/opencode-gitlab-auth) 홈페이지에 추가 문서가 있습니다. -##### 구성 +#### 구성 `opencode.json`을 통해 사용자 정의: @@ -780,7 +802,7 @@ export GITLAB_OAUTH_CLIENT_ID=your_application_id_here } ``` -##### GitLab API 도구 (선택 사항이지만 강력 권장) +#### GitLab API 도구 (선택 사항이지만 강력 권장) GitLab 도구(병합 요청, 이슈, 파이프라인, CI/CD 등)에 액세스하려면: @@ -797,13 +819,10 @@ GitLab 도구(병합 요청, 이슈, 파이프라인, CI/CD 등)에 액세스하 ### GitHub Copilot -GitHub Copilot 구독을 사용하여 opencode: +OpenCode에서 GitHub Copilot 구독을 사용하려면: :::note -몇몇 모형은 [Pro+를 필요로 할지도 모릅니다 -구독](https://github.com/features/copilot/plans) 사용. - -일부 모델은 수동으로 활성화해야합니다 [GitHub Copilot 설정](https://docs.github.com/en/copilot/how-tos/use-ai-models/configure-access-to-ai-models#setup-for-individual-use). +일부 모델은 [Pro+ 구독](https://github.com/features/copilot/plans)이 필요할 수 있습니다. ::: 1. `/connect` 명령을 실행하고 GitHub Copilot을 검색하십시오. @@ -821,7 +840,8 @@ GitHub Copilot 구독을 사용하여 opencode: │ │ Enter code: 8F43-6FCF │ - └ Waiting for authorization... + │ Waiting for authorization... + └ ``` 3. 이제 원하는 모델을 선택하기 위해 `/models` 명령을 실행합니다. @@ -832,44 +852,42 @@ GitHub Copilot 구독을 사용하여 opencode: --- -### 구글 Vertex AI +### Google Vertex AI -opencode로 Google Vertex AI를 사용하려면: +OpenCode로 Google Vertex AI를 사용하려면: -1. Google Cloud Console에서 ** Model Garden**을 통해 헤드를 확인하고 확인하십시오. - 당신의 지역에서 유효한 모형. +1. Google Cloud Console의 **Model Garden**으로 이동하여 해당 리전에서 사용 가능한 모델을 확인하십시오. :::note - Vertex AI API를 사용하여 Google Cloud 프로젝트를 수행해야합니다. + Vertex AI API가 활성화된 Google Cloud 프로젝트가 있어야 합니다. ::: 2. 필요한 환경 변수를 설정: + - `GOOGLE_CLOUD_PROJECT`: 구글 클라우드 프로젝트 ID + - `VERTEX_LOCATION` (선택): Vertex AI 리전 (기본값: `global`) + - 인증 (하나 선택): + - `GOOGLE_APPLICATION_CREDENTIALS`: 서비스 계정 JSON 키 파일 경로 + - gcloud CLI 사용: `gcloud auth application-default login` -- `GOOGLE_CLOUD_PROJECT`: 당신의 구글 클라우드 프로젝트 ID -- `VERTEX_LOCATION` (선택): Vertex AI를 위한 지구 (`global`에 기본) -- 인증(초당): -- `GOOGLE_APPLICATION_CREDENTIALS`: 서비스 계정 JSON 키 파일 경로 -- gcloud CLI를 사용하여 인증 : `gcloud auth application-default login` + OpenCode를 실행할 때 설정: -opencode를 실행하면서 설정한다. - -```bash + ```bash GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GOOGLE_CLOUD_PROJECT=your-project-id opencode -``` + ``` -또는 bash 프로파일에 추가하십시오. + 또는 bash 프로필에 추가: -```bash title="~/.bash_profile" + ```bash title="~/.bash_profile" export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json export GOOGLE_CLOUD_PROJECT=your-project-id export VERTEX_LOCATION=global -``` + ``` :::tip -`global` 지구는 가용성을 개량하고 추가 비용 없이 과실을 감소시킵니다. 데이터 거주 요건에 대한 지역 엔드포인트(e.g., `us-central1`)를 사용하십시오. [더 알아보기](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#regional and global endpoints) +`global` 리전은 가용성을 높이고 오류를 줄이며 추가 비용이 없습니다. 데이터 거주 요건이 있는 경우 지역 엔드포인트(예: `us-central1`)를 사용하십시오. [더 알아보기](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#regional_and_global_endpoints) ::: -3. 당신이 원하는 모형을 선정하기 위하여 `/models` 명령을 실행하십시오. +3. `/models` 명령을 실행하여 원하는 모델을 선택하십시오. ```txt /models @@ -877,17 +895,17 @@ opencode를 실행하면서 설정한다. --- -##### Groq +### Groq -1. [Groq 콘솔](https://console.groq.com/)에 머리, click **Create API Key**, 키 복사. +1. [Groq 콘솔](https://console.groq.com/)로 이동하여 **Create API Key**를 클릭하고 키를 복사합니다. -2. `/connect` 명령을 실행하고 Groq에 대한 검색. +2. `/connect` 명령을 실행하고 Groq를 검색하십시오. ```txt /connect ``` -3. 공급자를 위한 API 열쇠를 입력하십시오. +3. API 키를 입력하십시오. ```txt ┌ API key @@ -896,7 +914,7 @@ opencode를 실행하면서 설정한다. └ enter ``` -4. `/models` 명령을 실행하여 원하는 것을 선택합니다. +4. `/models` 명령을 실행하여 원하는 모델을 선택합니다. ```txt /models @@ -906,9 +924,9 @@ opencode를 실행하면서 설정한다. ### Hugging Face -[Hugging Face Inference Provider](https://huggingface.co/docs/inference-providers)는 17+ 공급자가 지원하는 오픈 모델에 대한 액세스를 제공합니다. +[Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers)는 17개 이상의 공급자가 지원하는 오픈 모델에 대한 액세스를 제공합니다. -1. [Hugging Face settings](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained)를 통해 토큰을 Inference Provider에게 호출할 권한을 부여합니다. +1. [Hugging Face settings](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained)로 이동하여 Inference Providers에 호출할 권한이 있는 토큰을 생성합니다. 2. `/connect` 명령을 실행하고 **Hugging Face**를 검색하십시오. @@ -925,7 +943,7 @@ opencode를 실행하면서 설정한다. └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Kimi-K2-Instruct 또는 GLM-4.6 . +4. `/models` 명령을 실행하여 모델(예: _Kimi-K2-Instruct_ 또는 _GLM-4.6_)을 선택하십시오. ```txt /models @@ -935,17 +953,17 @@ opencode를 실행하면서 설정한다. ### Helicone -[Helicone](https://helicone.ai)는 AI 애플리케이션에 대한 로깅, 모니터링 및 분석 기능을 제공하는 LLM Observability 플랫폼입니다. Helicone AI Gateway는 모델을 기반으로 적절한 공급자에게 요청을 자동으로 전달합니다. +[Helicone](https://helicone.ai)는 AI 애플리케이션을 위한 로깅, 모니터링 및 분석 기능을 제공하는 LLM 관찰 가능성(Observability) 플랫폼입니다. Helicone AI Gateway는 모델을 기반으로 적절한 공급자에게 요청을 자동으로 라우팅합니다. -1. [Helicone](https://helicone.ai)에 머리, 계정을 만들고, 대시보드에서 API 키를 생성합니다. +1. [Helicone](https://helicone.ai)로 이동하여 계정을 만들고 대시보드에서 API 키를 생성합니다. -2. `/connect` 명령을 실행하고 ** Helicone**를 검색하십시오. +2. `/connect` 명령을 실행하고 **Helicone**를 검색하십시오. ```txt /connect ``` -3. Helicone API 열쇠를 입력하십시오. +3. Helicone API 키를 입력하십시오. ```txt ┌ API key @@ -954,19 +972,19 @@ opencode를 실행하면서 설정한다. └ enter ``` -4. 모델을 선택하려면 `/models` 명령을 실행하십시오. +4. `/models` 명령을 실행하여 모델을 선택하십시오. ```txt /models ``` -캐싱 및 속도 제한과 같은 더 많은 공급자와 고급 기능을 위해 [Helicone 문서](https://docs.helicone.ai)를 확인하십시오. +캐싱 및 속도 제한과 같은 더 많은 공급자와 고급 기능은 [Helicone 문서](https://docs.helicone.ai)를 확인하십시오. -#### 선택 사항 +#### 선택적 구성 -이벤트에서 opencode를 통해 자동으로 구성되지 않는 Helicone의 기능 또는 모델을 볼 수 있습니다. +OpenCode를 통해 자동으로 구성되지 않는 Helicone의 기능이나 모델이 있는 경우 직접 구성할 수 있습니다. -여기에 [Helicone의 모델 디렉토리](https://helicone.ai/models), 당신은 당신이 추가 할 모델의 ID를 잡아이 필요. +[Helicone의 모델 디렉토리](https://helicone.ai/models)에서 추가하려는 모델의 ID를 확인하십시오. ```jsonc title="~/.config/opencode/opencode.jsonc" { @@ -992,7 +1010,7 @@ opencode를 실행하면서 설정한다. } ``` -##### 사용자 정의 헤더 +#### 사용자 정의 헤더 Helicone는 캐싱, 사용자 추적 및 세션 관리와 같은 기능을 위한 사용자 정의 헤더를 지원합니다. `options.headers`를 사용하여 공급자 구성에 추가하십시오: @@ -1017,7 +1035,7 @@ Helicone는 캐싱, 사용자 추적 및 세션 관리와 같은 기능을 위 ##### 세션 추적 -Helicone's [Sessions](https://docs.helicone.ai/features/sessions) 기능으로 그룹 관련 LLM 요청이 가능합니다. [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) 플러그인을 사용하여 각 opencode 대화를 Helicone 세션으로 자동 로그인하십시오. +Helicone의 [Sessions](https://docs.helicone.ai/features/sessions) 기능을 사용하면 관련 LLM 요청을 그룹화할 수 있습니다. [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) 플러그인을 사용하여 각 OpenCode 대화를 Helicone 세션으로 자동 기록하십시오. ```bash npm install -g opencode-helicone-session @@ -1031,24 +1049,24 @@ npm install -g opencode-helicone-session } ``` -플러그인은 `Helicone-Session-Id` 및 `Helicone-Session-Name` 헤더를 귀하의 요청에 주사합니다. Helicone의 세션 페이지에서는 별도의 세션으로 나열된 각 opencode 대화를 볼 수 있습니다. +이 플러그인은 `Helicone-Session-Id` 및 `Helicone-Session-Name` 헤더를 요청에 주입합니다. Helicone의 세션 페이지에서 각 OpenCode 대화가 별도의 세션으로 나열되는 것을 볼 수 있습니다. -###### 공통 Helicone 헤더 +##### 공통 Helicone 헤더 -| 헤드러 | Description | +| 헤더 | 설명 | | -------------------------- | ---------------------------------------------------------- | -| `Helicone-Cache-Enabled` | 대응 캐싱 (`true`/`false`) | -| `Helicone-User-Id` | 사용자별 추적 가능 | +| `Helicone-Cache-Enabled` | 응답 캐싱 활성화 (`true`/`false`) | +| `Helicone-User-Id` | 사용자별 지표 추적 | | `Helicone-Property-[Name]` | 사용자 정의 속성 추가(예: `Helicone-Property-Environment`) | -| `Helicone-Prompt-Id` | prompt 대응 | +| `Helicone-Prompt-Id` | 요청을 프롬프트 버전과 연관 | -모든 사용 가능한 헤더에 대한 [Helicone Header Directory](https://docs.helicone.ai/helicone-headers/header-directory)를 참조하십시오. +사용 가능한 모든 헤더는 [Helicone Header Directory](https://docs.helicone.ai/helicone-headers/header-directory)를 참조하십시오. --- -#### llama.cpp +### llama.cpp -[llama.cpp's](https://github.com/ggml-org/llama.cpp) llama-server 유틸리티를 통해 로컬 모델을 사용할 수 있습니다. +[llama.cpp](https://github.com/ggml-org/llama.cpp)의 llama-server 유틸리티를 통해 로컬 모델을 사용하도록 구성할 수 있습니다. ```json title="opencode.json" "llama.cpp" {5, 6, 8, 10-15} { @@ -1076,21 +1094,21 @@ npm install -g opencode-helicone-session 이 예제에서: -- `llama.cpp`는 주문 공급자 ID입니다. 원하는 문자열이 될 수 있습니다. -- `npm`는 이 공급자를 위해 사용할 포장을 지정합니다. 여기, `@ai-sdk/openai-compatible`는 OpenAI 호환 API에 사용됩니다. -- `name`는 UI에 있는 공급자를 위한 전시 이름입니다. -- `options.baseURL`는 로컬 서버의 엔드포인트입니다. -- `models`는 모델 ID를 구성하는 맵입니다. 모델 이름은 모델 선택 목록에 표시됩니다. +- `llama.cpp`는 사용자 정의 공급자 ID입니다. 원하는 문자열로 지정할 수 있습니다. +- `npm`은 이 공급자에 사용할 패키지를 지정합니다. 여기서는 OpenAI 호환 API를 위해 `@ai-sdk/openai-compatible`을 사용합니다. +- `name`은 UI에 표시될 공급자 이름입니다. +- `options.baseURL`은 로컬 서버의 엔드포인트입니다. +- `models`는 모델 ID와 해당 구성을 매핑합니다. 모델 이름은 모델 선택 목록에 표시됩니다. --- -###### IO.NET +### IO.NET IO.NET은 다양한 사용 사례에 최적화된 17개의 모델을 제공합니다: -1. [IO.NET 콘솔](https://ai.io.net/)에 머리, 계정을 만들고 API 키를 생성합니다. +1. [IO.NET 콘솔](https://ai.io.net/)로 이동하여 계정을 만들고 API 키를 생성합니다. -2. `/connect` 명령을 실행하고 **IO.NET**를 검색하십시오. +2. `/connect` 명령을 실행하고 **IO.NET**을 검색하십시오. ```txt /connect @@ -1115,7 +1133,7 @@ IO.NET은 다양한 사용 사례에 최적화된 17개의 모델을 제공합 ### LM Studio -LM Studio를 통해 로컬 모델을 사용할 수 있습니다. +LM Studio를 통해 로컬 모델을 사용하도록 구성할 수 있습니다. ```json title="opencode.json" "lmstudio" {5, 6, 8, 10-14} { @@ -1139,19 +1157,19 @@ LM Studio를 통해 로컬 모델을 사용할 수 있습니다. 이 예제에서: -- `lmstudio`는 주문 공급자 ID입니다. 원하는 문자열이 될 수 있습니다. -- `npm`는 이 공급자를 위해 사용할 포장을 지정합니다. 여기, `@ai-sdk/openai-compatible`는 OpenAI 호환 API에 사용됩니다. -- `name`는 UI에 있는 공급자를 위한 전시 이름입니다. -- `options.baseURL`는 로컬 서버의 엔드포인트입니다. -- `models`는 모델 ID를 구성하는 맵입니다. 모델 이름은 모델 선택 목록에 표시됩니다. +- `lmstudio`는 사용자 정의 공급자 ID입니다. 원하는 문자열로 지정할 수 있습니다. +- `npm`은 이 공급자에 사용할 패키지를 지정합니다. 여기서는 OpenAI 호환 API를 위해 `@ai-sdk/openai-compatible`을 사용합니다. +- `name`은 UI에 표시될 공급자 이름입니다. +- `options.baseURL`은 로컬 서버의 엔드포인트입니다. +- `models`는 모델 ID와 해당 구성을 매핑합니다. 모델 이름은 모델 선택 목록에 표시됩니다. --- -## Moonshot AI +### Moonshot AI -Moonshot AI에서 Kimi K2 사용 : +Moonshot AI에서 Kimi K2를 사용하려면: -1. [Moonshot AI 콘솔](https://platform.moonshot.ai/console)에 머리, 계정을 만들고, ** API 키**를 클릭합니다. +1. [Moonshot AI 콘솔](https://platform.moonshot.ai/console)로 이동하여 계정을 만들고 **Create API key**를 클릭합니다. 2. `/connect` 명령을 실행하고 **Moonshot AI**를 검색하십시오. @@ -1168,7 +1186,7 @@ Moonshot AI에서 Kimi K2 사용 : └ enter ``` -4. `/models` 명령을 실행하여 Kimi K2 . +4. `/models` 명령을 실행하여 *Kimi K2*를 선택하십시오. ```txt /models @@ -1176,9 +1194,9 @@ Moonshot AI에서 Kimi K2 사용 : --- -## MiniMax +### MiniMax -1. [MiniMax API 콘솔](https://platform.minimax.io/login)에 머리, 계정을 만들고 API 키를 생성합니다. +1. [MiniMax API 콘솔](https://platform.minimax.io/login)로 이동하여 계정을 만들고 API 키를 생성합니다. 2. `/connect` 명령을 실행하고 **MiniMax**를 검색하십시오. @@ -1195,7 +1213,7 @@ Moonshot AI에서 Kimi K2 사용 : └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 M2.1 . +4. `/models` 명령을 실행하여 모델(예: _M2.1_)을 선택하십시오. ```txt /models @@ -1203,9 +1221,9 @@ Moonshot AI에서 Kimi K2 사용 : --- -## Nebius Token Factory +### Nebius Token Factory -1. [Nebius Token Factory 콘솔](https://tokenfactory.nebius.com/)에 머리, 계정을 만들고, ** 키 추가 **. +1. [Nebius Token Factory 콘솔](https://tokenfactory.nebius.com/)로 이동하여 계정을 만들고 **Add Key**를 클릭합니다. 2. `/connect` 명령을 실행하고 **Nebius Token Factory**를 검색하십시오. @@ -1213,7 +1231,7 @@ Moonshot AI에서 Kimi K2 사용 : /connect ``` -3. Nebius 토큰 공장 API 키를 입력하십시오. +3. Nebius Token Factory API 키를 입력하십시오. ```txt ┌ API key @@ -1222,7 +1240,7 @@ Moonshot AI에서 Kimi K2 사용 : └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Kimi K2 Instruct . +4. `/models` 명령을 실행하여 모델(예: _Kimi K2 Instruct_)을 선택하십시오. ```txt /models @@ -1230,12 +1248,12 @@ Moonshot AI에서 Kimi K2 사용 : --- -#### Ollama +### Ollama -Ollama를 통해 로컬 모델을 사용할 수 있습니다. +Ollama를 통해 로컬 모델을 사용하도록 구성할 수 있습니다. :::tip -Ollama는 opencode를 자동으로 구성할 수 있습니다. 자세한 내용은 [Ollama 통합 문서](https://docs.ollama.com/integrations/opencode)를 참조하십시오. +Ollama는 OpenCode에 대해 자동으로 구성될 수 있습니다. 자세한 내용은 [Ollama 통합 문서](https://docs.ollama.com/integrations/opencode)를 참조하십시오. ::: ```json title="opencode.json" "ollama" {5, 6, 8, 10-14} @@ -1260,35 +1278,35 @@ Ollama는 opencode를 자동으로 구성할 수 있습니다. 자세한 내용 이 예제에서: -- `ollama`는 주문 공급자 ID입니다. 원하는 문자열이 될 수 있습니다. -- `npm`는 이 공급자를 위해 사용할 포장을 지정합니다. 여기, `@ai-sdk/openai-compatible`는 OpenAI 호환 API에 사용됩니다. -- `name`는 UI에 있는 공급자를 위한 전시 이름입니다. -- `options.baseURL`는 로컬 서버의 엔드포인트입니다. -- `models`는 모델 ID를 구성하는 맵입니다. 모델 이름은 모델 선택 목록에 표시됩니다. +- `ollama`는 사용자 정의 공급자 ID입니다. 원하는 문자열로 지정할 수 있습니다. +- `npm`은 이 공급자에 사용할 패키지를 지정합니다. 여기서는 OpenAI 호환 API를 위해 `@ai-sdk/openai-compatible`을 사용합니다. +- `name`은 UI에 표시될 공급자 이름입니다. +- `options.baseURL`은 로컬 서버의 엔드포인트입니다. +- `models`는 모델 ID와 해당 구성을 매핑합니다. 모델 이름은 모델 선택 목록에 표시됩니다. :::tip -도구 호출이 작동하지 않는 경우, Ollama에서 `num_ctx` 증가. 주위 시작 16k - 32k. +도구 호출이 작동하지 않는 경우, Ollama에서 `num_ctx`를 늘려보십시오. 16k - 32k 정도에서 시작하십시오. ::: --- -## Ollama Cloud +### Ollama Cloud -opencode로 Ollama Cloud를 사용하려면: +OpenCode로 Ollama Cloud를 사용하려면: -1. [https://ollama.com/](https://ollama.com/) 이상 머리와 로그인하거나 계정을 만들 수 있습니다. +1. [https://ollama.com/](https://ollama.com/)으로 이동하여 로그인하거나 계정을 만듭니다. -2. Navigate to**Settings** > **Keys** 및 click **API Key**를 추가하여 새로운 API 키 생성. +2. **Settings** > **Keys**로 이동하여 **Add API Key**를 클릭해 새 API 키를 생성합니다. -3. opencode에서 사용을 위한 API 열쇠를 복사하십시오. +3. OpenCode에서 사용할 API 키를 복사합니다. -4. `/connect` 명령을 실행하고 ** Ollama Cloud**를 검색하십시오. +4. `/connect` 명령을 실행하고 **Ollama Cloud**를 검색하십시오. ```txt /connect ``` -5. Ollama Cloud API 키 입력. +5. Ollama Cloud API 키를 입력하십시오. ```txt ┌ API key @@ -1297,7 +1315,7 @@ opencode로 Ollama Cloud를 사용하려면: └ enter ``` -6. ** 중요 **: opencode의 클라우드 모델을 사용하기 전에, 로컬 모델 정보를 끌어야 합니다: +6. **중요**: OpenCode에서 클라우드 모델을 사용하기 전에, 로컬에서 모델 정보를 가져와야 합니다: ```bash ollama pull gpt-oss:20b-cloud @@ -1315,14 +1333,13 @@ opencode로 Ollama Cloud를 사용하려면: [ChatGPT Plus 또는 Pro](https://chatgpt.com/pricing)에 가입하는 것이 좋습니다. -1. 가입하면 `/connect` 명령을 실행하고 OpenAI를 선택하십시오. +1. 가입 후 `/connect` 명령을 실행하고 OpenAI를 선택하십시오. ```txt /connect ``` -2. **ChatGPT Plus/Pro** 옵션을 선택하고 브라우저를 열 수 있습니다. - 자주 묻는 질문 +2. **ChatGPT Plus/Pro** 옵션을 선택하면 브라우저가 열리고 인증을 요청합니다. ```txt ┌ Select auth method @@ -1332,7 +1349,7 @@ opencode로 Ollama Cloud를 사용하려면: └ ``` -3. 이제 모든 OpenAI 모델은 `/models` 명령을 사용할 때 사용할 수 있어야합니다. +3. 이제 `/models` 명령을 사용할 때 모든 OpenAI 모델을 사용할 수 있습니다. ```txt /models @@ -1340,23 +1357,23 @@ opencode로 Ollama Cloud를 사용하려면: ##### API 키 사용 -API 키가 이미 있다면 ** 수동으로 API 키**를 입력하고 terminal에서 붙여넣을 수 있습니다. +이미 API 키가 있다면 **Manually enter API Key**를 선택하고 터미널에 붙여넣을 수 있습니다. --- -## OpenCode Zen +### OpenCode Zen -OpenCode Zen은 opencode 팀에서 제공하는 테스트 및 검증된 모델 목록입니다. [더 알아보기](/docs/zen). +OpenCode Zen은 OpenCode 팀에서 제공하는 테스트 및 검증된 모델 목록입니다. [더 알아보기](/docs/zen). -1. 로그인 **OpenCode Zen** and click**Create API Key**. +1. **OpenCode Zen**에 로그인하고 **Create API Key**를 클릭합니다. -2. `/connect` 명령을 실행하고 **OpenCode Zen**를 검색하십시오. +2. `/connect` 명령을 실행하고 **OpenCode Zen**을 검색하십시오. ```txt /connect ``` -3. opencode API 키를 입력하십시오. +3. OpenCode API 키를 입력하십시오. ```txt ┌ API key @@ -1365,7 +1382,7 @@ OpenCode Zen은 opencode 팀에서 제공하는 테스트 및 검증된 모델 └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Qwen 3 Coder 480B . +4. `/models` 명령을 실행하여 모델(예: _Qwen 3 Coder 480B_)을 선택하십시오. ```txt /models @@ -1373,9 +1390,9 @@ OpenCode Zen은 opencode 팀에서 제공하는 테스트 및 검증된 모델 --- -## OpenRouter +### OpenRouter -1. [OpenRouter 대시보드](https://openrouter.ai/settings/keys)에 머리, click ** API Key**를 클릭하고 키를 복사합니다. +1. [OpenRouter 대시보드](https://openrouter.ai/settings/keys)로 이동하여 **Create API Key**를 클릭하고 키를 복사합니다. 2. `/connect` 명령을 실행하고 OpenRouter를 검색하십시오. @@ -1383,7 +1400,7 @@ OpenCode Zen은 opencode 팀에서 제공하는 테스트 및 검증된 모델 /connect ``` -3. 공급자를 위한 API 열쇠를 입력하십시오. +3. API 키를 입력하십시오. ```txt ┌ API key @@ -1392,28 +1409,28 @@ OpenCode Zen은 opencode 팀에서 제공하는 테스트 및 검증된 모델 └ enter ``` -4. 많은 OpenRouter 모델은 기본적으로 `/models` 명령을 실행하여 원하는 것을 선택합니다. +4. 많은 OpenRouter 모델은 기본적으로 미리 로드되어 있으므로 `/models` 명령을 실행하여 원하는 것을 선택하십시오. ```txt /models ``` -opencode config를 통해 추가 모델을 추가할 수 있습니다. + OpenCode 구성을 통해 모델을 추가할 수도 있습니다. -```json title="opencode.json" {6} -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "openrouter": { - "models": { - "somecoolnewmodel": {} - } - } - } -} -``` + ```json title="opencode.json" {6} + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "openrouter": { + "models": { + "somecoolnewmodel": {} + } + } + } + } + ``` -5. 당신은 또한 당신의 opencode config를 통해 그들을 주문을 받아서 만들 수 있습니다. 공급자 지정의 예입니다. +5. 또한 OpenCode 구성을 통해 사용자 정의할 수도 있습니다. 다음은 공급자 순서를 지정하는 예입니다. ```json title="opencode.json" { @@ -1439,12 +1456,12 @@ opencode config를 통해 추가 모델을 추가할 수 있습니다. ### SAP AI Core -SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40+ 모델에 대한 액세스를 제공합니다. +SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40개 이상의 모델에 대한 액세스를 제공합니다. -1. [SAP BTP Cockpit](https://account.hana.ondemand.com/)로 이동하여 SAP AI Core 서비스 인스턴스로 이동하고 서비스 키를 만듭니다. +1. [SAP BTP Cockpit](https://account.hana.ondemand.com/)으로 이동하여 SAP AI Core 서비스 인스턴스로 이동하고 서비스 키를 만듭니다. :::tip - 서비스 키는 `clientid`, `clientsecret`, `url` 및 `serviceurls.AI_API_URL`를 포함하는 JSON 객체입니다. **Services** > **Instances 및 Subscriptions** 아래 AI Core 인스턴스를 찾을 수 있습니다. + 서비스 키는 `clientid`, `clientsecret`, `url` 및 `serviceurls.AI_API_URL`을 포함하는 JSON 객체입니다. **Services** > **Instances and Subscriptions** 아래에서 AI Core 인스턴스를 찾을 수 있습니다. ::: 2. `/connect` 명령을 실행하고 **SAP AI Core**를 검색하십시오. @@ -1462,29 +1479,29 @@ SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40+ └ enter ``` -또는 `AICORE_SERVICE_KEY` 환경 변수를 설정: + 또는 `AICORE_SERVICE_KEY` 환경 변수를 설정합니다: -```bash + ```bash AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' opencode -``` + ``` -또는 bash 프로파일에 추가: + 또는 bash 프로필에 추가합니다: -```bash title="~/.bash_profile" + ```bash title="~/.bash_profile" export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' -``` + ``` -4. 선택적으로 배치 ID 및 자원 그룹: +4. 선택적으로 배포 ID 및 리소스 그룹을 설정합니다: ```bash AICORE_DEPLOYMENT_ID=your-deployment-id AICORE_RESOURCE_GROUP=your-resource-group opencode ``` :::note - 이 설정은 선택 사항이며 SAP AI Core 설정에 따라 구성해야합니다. + 이 설정은 선택 사항이며 SAP AI Core 설정에 따라 구성해야 합니다. ::: -5. `/models` 명령을 실행하여 40+ 유효한 모형에서 선택하십시오. +5. `/models` 명령을 실행하여 40개 이상의 사용 가능한 모델 중에서 선택하십시오. ```txt /models @@ -1492,11 +1509,44 @@ SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40+ --- -### OVHcloud AI 엔드포인트 +### STACKIT -1. [OVHcloud 패널](https://ovh.com/manager)에 머리. `Public Cloud` 섹션으로 이동, `AI & Machine Learning` > `AI Endpoints` 및 `API Keys` 탭에서, ** 새로운 API 키 활성화 **. +STACKIT AI Model Serving은 Llama, Mistral, Qwen과 같은 LLM에 초점을 맞추고 유럽 인프라에서 데이터 주권을 최대한 보장하는 완전 관리형 AI 모델 호스팅 환경을 제공합니다. -2. `/connect` 명령을 실행하고 ** OVHcloud AI Endpoints**를 검색하십시오. +1. [STACKIT Portal](https://portal.stackit.cloud)로 이동하여 **AI Model Serving**으로 이동한 다음 프로젝트의 인증 토큰을 만듭니다. + + :::tip + 인증 토큰을 만들기 전에 STACKIT 고객 계정, 사용자 계정 및 프로젝트가 필요합니다. + ::: + +2. `/connect` 명령을 실행하고 **STACKIT**을 검색하십시오. + + ```txt + /connect + ``` + +3. STACKIT AI Model Serving 인증 토큰을 입력하십시오. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. `/models` 명령을 실행하여 _Qwen3-VL 235B_ 또는 *Llama 3.3 70B*와 같은 사용 가능한 모델을 선택하십시오. + + ```txt + /models + ``` + +--- + +### OVHcloud AI Endpoints + +1. [OVHcloud 패널](https://ovh.com/manager)로 이동합니다. `Public Cloud` 섹션으로 이동하여 `AI & Machine Learning` > `AI Endpoints`로 간 뒤 `API Keys` 탭에서 **Create a new API key**를 클릭합니다. + +2. `/connect` 명령을 실행하고 **OVHcloud AI Endpoints**를 검색하십시오. ```txt /connect @@ -1511,7 +1561,7 @@ SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40+ └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 gpt-oss-120b . +4. `/models` 명령을 실행하여 모델(예: _gpt-oss-120b_)을 선택하십시오. ```txt /models @@ -1521,9 +1571,9 @@ SAP AI Core는 OpenAI, Anthropic, Google, Amazon, Meta, Mistral 및 AI21의 40+ ### Scaleway -opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/docs/generative-apis/)를 사용하려면: +OpenCode로 [Scaleway Generative APIs](https://www.scaleway.com/en/docs/generative-apis/)를 사용하려면: -1. [Scaleway 콘솔 IAM 설정](https://console.scaleway.com/iam/api-keys)를 통해 새로운 API 키 생성. +1. [Scaleway Console IAM 설정](https://console.scaleway.com/iam/api-keys)에서 새 API 키를 생성합니다. 2. `/connect` 명령을 실행하고 **Scaleway**를 검색하십시오. @@ -1540,7 +1590,7 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오. devstral-2-123b-instruct-2512 또는 gpt-oss-120b . +4. `/models` 명령을 실행하여 모델(예: _devstral-2-123b-instruct-2512_ 또는 _gpt-oss-120b_)을 선택하십시오. ```txt /models @@ -1548,9 +1598,9 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ --- -## Together AI +### Together AI -1. [Together AI 콘솔](https://api.together.ai)에 머리, 계정을 만들고 ** 키 추가 **를 클릭합니다. +1. [Together AI 콘솔](https://api.together.ai)로 이동하여 계정을 만들고 **Add Key**를 클릭합니다. 2. `/connect` 명령을 실행하고 **Together AI**를 검색하십시오. @@ -1558,7 +1608,7 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ /connect ``` -3. 함께 AI API 키를 입력하십시오. +3. Together AI API 키를 입력하십시오. ```txt ┌ API key @@ -1567,7 +1617,7 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Kimi K2 Instruct . +4. `/models` 명령을 실행하여 모델(예: _Kimi K2 Instruct_)을 선택하십시오. ```txt /models @@ -1575,17 +1625,17 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ --- -## Venice AI +### Venice AI -1. [Venice AI 콘솔](https://venice.ai)에 머리, 계정을 만들고 API 키를 생성합니다. +1. [Venice AI 콘솔](https://venice.ai)로 이동하여 계정을 만들고 API 키를 생성합니다. -2. `/connect` 명령을 실행하고 **Venice AI **를 검색하십시오. +2. `/connect` 명령을 실행하고 **Venice AI**를 검색하십시오. ```txt /connect ``` -3. 베니스 AI API 열쇠를 입력하십시오. +3. Venice AI API 키를 입력하십시오. ```txt ┌ API key @@ -1594,7 +1644,7 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Llama 3.3 70B . +4. `/models` 명령을 실행하여 모델(예: _Llama 3.3 70B_)을 선택하십시오. ```txt /models @@ -1602,11 +1652,11 @@ opencode를 사용하여 [Scaleway Generative APIs](https://www.scaleway.com/en/ --- -## Vercel AI 게이트웨이 +### Vercel AI Gateway -Vercel AI를 게이트웨이는 OpenAI, Anthropic, Google, xAI 등에서 모델에 액세스할 수 있습니다. 모델은 Markup없이 목록 가격에서 제공됩니다. +Vercel AI Gateway는 OpenAI, Anthropic, Google, xAI 등의 모델에 액세스할 수 있으며, 통합된 엔드포인트를 통해 더 많은 기능을 제공합니다. 모델은 마크업 없이 정가로 제공됩니다. -1. [Vercel 대시보드](https://vercel.com/)에 머리, **AI Gateway** 탭으로 이동하고, **API 키**를 클릭하여 새로운 API 키 생성. +1. [Vercel 대시보드](https://vercel.com/)로 이동하여 **AI Gateway** 탭으로 간 뒤, **API keys**를 클릭하여 새 API 키를 생성합니다. 2. `/connect` 명령을 실행하고 **Vercel AI Gateway**를 검색하십시오. @@ -1614,7 +1664,7 @@ Vercel AI를 게이트웨이는 OpenAI, Anthropic, Google, xAI 등에서 모델 /connect ``` -3. Vercel AI Gateway API 키 입력. +3. Vercel AI Gateway API 키를 입력하십시오. ```txt ┌ API key @@ -1623,13 +1673,13 @@ Vercel AI를 게이트웨이는 OpenAI, Anthropic, Google, xAI 등에서 모델 └ enter ``` -4. 모델을 선택하려면 `/models` 명령을 실행하십시오. +4. `/models` 명령을 실행하여 모델을 선택하십시오. ```txt /models ``` -opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공급자 routing 순서를 지정하는 예입니다. +OpenCode 구성을 통해 모델을 사용자 정의할 수도 있습니다. 다음은 공급자 라우팅 순서를 지정하는 예입니다. ```json title="opencode.json" { @@ -1648,19 +1698,19 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 } ``` -몇몇 유용한 여정 선택권: +몇 가지 유용한 라우팅 옵션: | 옵션 | 설명 | | ------------------- | --------------------------------- | -| `order` | 공급자의 순서 | -| `only` | 특정 공급자 제한 | -| `zeroDataRetention` | 제로 데이터 보유 정책만 이용 가능 | +| `order` | 시도할 공급자 순서 | +| `only` | 특정 공급자로 제한 | +| `zeroDataRetention` | 데이터 보유 정책이 없는 곳만 사용 | --- ### xAI -1. [xAI 콘솔](https://console.x.ai/)에 머리, 계정을 만들고 API 키를 생성합니다. +1. [xAI 콘솔](https://console.x.ai/)로 이동하여 계정을 만들고 API 키를 생성합니다. 2. `/connect` 명령을 실행하고 **xAI**를 검색하십시오. @@ -1677,7 +1727,7 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 Grok Beta . +4. `/models` 명령을 실행하여 모델(예: _Grok Beta_)을 선택하십시오. ```txt /models @@ -1687,15 +1737,15 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 ### Z.AI -1. [Z.AI API 콘솔](https://z.ai/manage-apikey/apikey-list)에 머리, 계정을 만들고, **새로운 API 키**를 클릭합니다. +1. [Z.AI API 콘솔](https://z.ai/manage-apikey/apikey-list)로 이동하여 계정을 만들고 **Create a new API key**를 클릭합니다. -2. `/connect` 명령을 실행하고 ** Z.AI**를 검색하십시오. +2. `/connect` 명령을 실행하고 **Z.AI**를 검색하십시오. ```txt /connect ``` -**GLM 코딩 플랜**에 가입하면 **Z.AI 코딩 플랜**을 선택하십시오. + **GLM Coding Plan**에 가입했다면 **Z.AI Coding Plan**을 선택하십시오. 3. Z.AI API 키를 입력하십시오. @@ -1706,7 +1756,7 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 └ enter ``` -4. `/models` 명령을 실행하여 같은 모델을 선택하십시오 GLM-4.7 . +4. `/models` 명령을 실행하여 모델(예: _GLM-4.7_)을 선택하십시오. ```txt /models @@ -1714,9 +1764,9 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 --- -## ZenMux +### ZenMux -1. [ZenMux 대쉬보드](https://zenmux.ai/settings/keys)에 머리, click **Create API Key**, 키 복사. +1. [ZenMux 대시보드](https://zenmux.ai/settings/keys)로 이동하여 **Create API Key**를 클릭하고 키를 복사합니다. 2. `/connect` 명령을 실행하고 ZenMux를 검색하십시오. @@ -1724,7 +1774,7 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 /connect ``` -3. 공급자를 위한 API 열쇠를 입력하십시오. +3. API 키를 입력하십시오. ```txt ┌ API key @@ -1733,38 +1783,38 @@ opencode config를 통해 모델을 사용자 정의 할 수 있습니다. 공 └ enter ``` -4. 많은 ZenMux 모델은 기본적으로 사전 로드되며 `/models` 명령을 실행하여 원하는 것을 선택합니다. +4. 많은 ZenMux 모델은 기본적으로 미리 로드되어 있으므로 `/models` 명령을 실행하여 원하는 것을 선택하십시오. ```txt /models ``` -opencode config를 통해 추가 모델을 추가할 수 있습니다. + OpenCode 구성을 통해 모델을 추가할 수도 있습니다. -```json title="opencode.json" {6} -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "zenmux": { - "models": { - "somecoolnewmodel": {} - } - } - } -} -``` + ```json title="opencode.json" {6} + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "zenmux": { + "models": { + "somecoolnewmodel": {} + } + } + } + } + ``` --- ## 사용자 정의 공급자 -`/connect` 명령에 나열되지 않은 **OpenAI-compatible** 공급자를 추가하려면: +`/connect` 명령에 나열되지 않은 **OpenAI 호환** 공급자를 추가하려면: :::tip -opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. 가장 현대적인 AI 제공 업체는 OpenAI 호환 API를 제공합니다. +OpenCode에서 모든 OpenAI 호환 공급자를 사용할 수 있습니다. 대부분의 최신 AI 공급자는 OpenAI 호환 API를 제공합니다. ::: -1. `/connect` 명령을 실행하고 ** 다른**로 스크롤하십시오. +1. `/connect` 명령을 실행하고 **Other**로 스크롤하십시오. ```bash $ /connect @@ -1777,7 +1827,7 @@ opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. └ ``` -2. 공급자를 위한 유일한 ID를 입력하십시오. +2. 공급자를 위한 고유한 ID를 입력하십시오. ```bash $ /connect @@ -1790,10 +1840,10 @@ opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. ``` :::note - 기억에 남는 ID를 선택하면 구성 파일에서 이것을 사용할 수 있습니다. + 기억하기 쉬운 ID를 선택하십시오. 구성 파일에서 이 ID를 사용하게 됩니다. ::: -3. 공급자를 위한 당신의 API 열쇠를 입력하십시오. +3. 공급자의 API 키를 입력하십시오. ```bash $ /connect @@ -1829,23 +1879,23 @@ opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. } ``` -여기에 구성 옵션: + 구성 옵션은 다음과 같습니다: + - **npm**: 사용할 AI SDK 패키지. OpenAI 호환 공급자의 경우 `@ai-sdk/openai-compatible` + - **name**: UI에 표시될 이름 + - **models**: 사용 가능한 모델 + - **options.baseURL**: API 엔드포인트 URL + - **options.apiKey**: 인증을 사용하지 않는 경우 선택적으로 API 키 설정 + - **options.headers**: 선택적으로 사용자 정의 헤더 설정 -- **npm**: AI SDK 패키지, OpenAI 호환 공급자 `@ai-sdk/openai-compatible` -**name**: UI의 표시 이름. -- ** 모델**: 유효한 모델. -- **options.baseURL**: API 엔드포인트 URL. -- **options.apiKey**: 선택적으로 auth를 사용하지 않는 경우 API 키 설정. -- **options.headers**: 선택적으로 사용자 정의 헤더를 설정합니다. + 고급 옵션에 대한 자세한 내용은 아래 예제를 참조하십시오. -아래 예에서 고급 옵션에 더. - -5. `/models` 명령을 실행하고 사용자 정의 공급자와 모델은 선택 목록에서 나타납니다. +5. `/models` 명령을 실행하면 사용자 정의 공급자와 모델이 선택 목록에 나타납니다. --- ##### 예제 -다음은 `apiKey`, `headers` 및 모델 `limit` 옵션 설정 예입니다. +다음은 `apiKey`, `headers` 및 모델 `limit` 옵션을 설정하는 예입니다. ```json title="opencode.json" {9,11,17-20} { @@ -1877,11 +1927,12 @@ opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. 구성 세부 사항: -- **apiKey**: `env` 변수 구문을 사용하여 설정, [learn more](/docs/config#env-vars). -**headers**: 각 요청으로 전송된 사용자 정의 헤더. -- **limit.context**: 모델이 허용하는 최대 Input Tokens. -- **limit.output**: 모델이 생성할 수 있는 최대 Output Tokens. +- **apiKey**: `env` 변수 구문을 사용하여 설정, [더 알아보기](/docs/config#env-vars). +- **headers**: 각 요청과 함께 전송되는 사용자 정의 헤더. +- **limit.context**: 모델이 허용하는 최대 입력 토큰. +- **limit.output**: 모델이 생성할 수 있는 최대 출력 토큰. -`limit` 필드를 사용하면 opencode가 얼마나 많은 컨텍스트를 이해 할 수 있습니다. 표준 공급자는 model.dev에서 자동적으로 당깁니다. +`limit` 필드를 사용하면 OpenCode가 남은 컨텍스트 양을 파악할 수 있습니다. 표준 공급자는 models.dev에서 자동으로 이를 가져옵니다. --- @@ -1889,13 +1940,11 @@ opencode를 사용하여 OpenAI 호환 공급자를 사용할 수 있습니다. 공급자 구성에 문제가 있는 경우 다음을 확인하십시오. -1. **주의 설정 확인 **: `opencode auth list`를 실행하여 자격 증명을 볼 수 있습니다. - 공급자는 config에 추가됩니다. - -이것은 Amazon Bedrock과 같은 공급자에 적용되지 않습니다. 환경 변수에 의존합니다. +1. **인증 설정 확인**: `opencode auth list`를 실행하여 공급자의 자격 증명이 구성에 추가되었는지 확인하십시오. -2. 주문 공급자를 위해, opencode config를 검사하고: + Amazon Bedrock과 같이 인증을 위해 환경 변수에 의존하는 공급자에는 적용되지 않습니다. -- `/connect` 명령에 사용되는 공급자 ID가 opencode config에서 ID를 일치시킵니다. -- 오른쪽 npm 패키지는 공급자에 사용됩니다. 예를 들어 Cerebras의 `@ai-sdk/cerebras`를 사용합니다. 그리고 다른 모든 OpenAI 호환 공급자를 위해, 사용 `@ai-sdk/openai-compatible`. -- 올바른 API 엔드포인트는 `options.baseURL` 필드에 사용됩니다. +2. 사용자 정의 공급자의 경우, OpenCode 구성을 확인하고 다음을 수행하십시오: + - `/connect` 명령에 사용된 공급자 ID가 OpenCode 구성의 ID와 일치하는지 확인하십시오. + - 공급자에 올바른 npm 패키지가 사용되었는지 확인하십시오. 예를 들어 Cerebras에는 `@ai-sdk/cerebras`를 사용하고, 다른 모든 OpenAI 호환 공급자에는 `@ai-sdk/openai-compatible`을 사용하십시오. + - `options.baseURL` 필드에 올바른 API 엔드포인트가 사용되었는지 확인하십시오. diff --git a/packages/web/src/content/docs/ko/sdk.mdx b/packages/web/src/content/docs/ko/sdk.mdx index f6d43c136d6..a5d12d1ab05 100644 --- a/packages/web/src/content/docs/ko/sdk.mdx +++ b/packages/web/src/content/docs/ko/sdk.mdx @@ -117,13 +117,85 @@ try { --- +## 구조화된 출력 + +JSON 스키마와 함께 `format`을 지정하여 모델에서 구조화된 JSON 출력을 요청할 수 있습니다. 모델은 `StructuredOutput` 도구를 사용하여 스키마와 일치하는 검증된 JSON을 반환합니다. + +### 기본 사용법 + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### 출력 형식 유형 + +| 유형 | 설명 | +| ------------- | ------------------------------------------------- | +| `text` | 기본값. 표준 텍스트 응답 (구조화된 출력 없음) | +| `json_schema` | 제공된 스키마와 일치하는 검증된 JSON을 반환합니다 | + +### JSON 스키마 형식 + +`type: 'json_schema'`를 사용할 때 다음을 제공하십시오: + +| 필드 | 유형 | 설명 | +| ------------ | --------------- | ------------------------------------------- | +| `type` | `'json_schema'` | 필수. JSON 스키마 모드를 지정합니다 | +| `schema` | `object` | 필수. 출력 구조를 정의하는 JSON 스키마 객체 | +| `retryCount` | `number` | 선택 사항. 검증 재시도 횟수 (기본값: 2) | + +### 오류 처리 + +모델이 모든 재시도 후에도 유효한 구조화된 출력을 생성하지 못하면 응답에 `StructuredOutputError`가 포함됩니다: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### 모범 사례 + +1. **명확한 설명 제공**: 모델이 추출할 데이터를 이해하는 데 도움이 되도록 스키마 속성에 명확한 설명을 제공하십시오. +2. **`required` 사용**: 필수 필드를 지정하려면 `required`를 사용하십시오. +3. **스키마를 집중적으로 유지**: 복잡한 중첩 스키마는 모델이 올바르게 채우기 더 어려울 수 있습니다. +4. **적절한 `retryCount` 설정**: 복잡한 스키마의 경우 늘리고 단순한 스키마의 경우 줄이십시오. + +--- + ## API SDK는 type-safe 클라이언트를 통해 모든 서버 API를 노출합니다. --- -## 글로벌 +### 글로벌 | 메서드 | 설명 | 응답 | | ----------------- | ---------------------- | ------------------------------------ | @@ -142,10 +214,10 @@ console.log(health.data.version) ### 앱 -| 방법 | 설명 | 응답 | -| -------------- | ------------------------- | ----------------------------------------------- | -| `app.log()` | 로그 항목 작성 | `boolean` | -| `app.agents()` | 이용 가능한 모든 에이전트 | 에이전트[]| +| 방법 | 설명 | 응답 | +| -------------- | ------------------------- | ------------------------------------------- | +| `app.log()` | 로그 항목 작성 | `boolean` | +| `app.agents()` | 이용 가능한 모든 에이전트 |Agent[]| --- @@ -167,7 +239,7 @@ const agents = await client.app.agents() --- -## 프로젝트 +### 프로젝트 | 방법 | 설명 | 응답 | | ------------------- | ----------------------- | --------------------------------------------- | @@ -205,7 +277,7 @@ const pathInfo = await client.path.get() --- -#### 구성 +### 구성 | 방법 | 설명 | 응답 | | -------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------- | @@ -224,29 +296,29 @@ const { providers, default: defaults } = await client.config.providers() --- -## 세션 - -| 메서드 | 설명 | 비고 | -| ---------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | 세션 일람 |Session[]| -| `session.get({ path })` | 세션 가져 오기 |Session| -| `session.children({ path })` | 하위 세션 목록 | 반품Session| -| `session.create({ body })` | 세션 만들기 | 리턴Session| -| `session.delete({ path })` | 세션 삭제 | `boolean` 반품 | -| `session.update({ path, body })` | 업데이트 세션 속성 | 반품Session| -| `session.init({ path, body })` | 앱 초기화 및 `AGENTS.md` 분석 | `boolean`를 반환 | -| `session.abort({ path })` | 운영 중인 세션 | 반품 `boolean` | -| `session.share({ path })` | 공유 세션 | 반품Session| -| `session.unshare({ path })` | 공유 세션 | 반품Session| -| `session.summarize({ path, body })` | 세션 요약 | 반품 `boolean` | -| `session.messages({ path })` | 세션의 메시지 목록 | `{ info: `Message`, parts: `Part`}[]` | -| `session.message({ path })` | 메시지 상세정보 | 반품 `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true` 반환 UserMessage (콘텍스트 전용). 기본 반환AssistantMessage에 AI 응답 | -| `session.command({ path, body })` | 세션으로 명령을 전송 | `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | shell 명령을 실행 |AssistantMessage| -| `session.revert({ path, body })` | 메시지 다시 변환 |Session| -| `session.unrevert({ path })` | 메시지 되돌리기 취소 | 반품Session| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | 허가 요청 대응 | 반품 `boolean` | +### 세션 + +| 메서드 | 설명 | 비고 | +| ---------------------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | 세션 일람 |Session[]| +| `session.get({ path })` | 세션 가져 오기 |Session| +| `session.children({ path })` | 하위 세션 목록 | 반품Session| +| `session.create({ body })` | 세션 만들기 | 리턴Session| +| `session.delete({ path })` | 세션 삭제 | `boolean` 반품 | +| `session.update({ path, body })` | 업데이트 세션 속성 | 반품Session| +| `session.init({ path, body })` | 앱 초기화 및 `AGENTS.md` 분석 | `boolean`를 반환 | +| `session.abort({ path })` | 운영 중인 세션 | 반품 `boolean` | +| `session.share({ path })` | 공유 세션 | 반품Session| +| `session.unshare({ path })` | 공유 세션 취소 | 반품Session| +| `session.summarize({ path, body })` | 세션 요약 | 반품 `boolean` | +| `session.messages({ path })` | 세션의 메시지 목록 | `{ info: `Message`, parts: `Part`}[]` | +| `session.message({ path })` | 메시지 상세정보 | 반품 `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true`는 UserMessage(컨텍스트 전용)를 반환합니다. 기본값은 AI 응답과 함께AssistantMessage를 반환합니다. [구조화된 출력](#구조화된-출력)을 위한 `body.outputFormat`을 지원합니다 | +| `session.command({ path, body })` | 세션으로 명령을 전송 | `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | shell 명령을 실행 |AssistantMessage| +| `session.revert({ path, body })` | 메시지 다시 변환 |Session| +| `session.unrevert({ path })` | 메시지 되돌리기 취소 | 반품Session| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | 허가 요청 대응 | 반품 `boolean` | --- @@ -281,7 +353,7 @@ await client.session.prompt({ --- -## 파일 +### 파일 | 방법 | 설명 | 응답 | | ------------------------- | ---------------------------- | -------------------------------------------------------------------------------------- | @@ -322,7 +394,7 @@ const content = await client.file.read({ --- -#### TUI +### TUI | 방법 | 설명 | 응답 | | ------------------------------ | ------------------------ | --------- | @@ -353,7 +425,7 @@ await client.tui.showToast({ --- -##### 인증 +### 인증 | 방법 | 설명 | 응답 | | ------------------- | -------------- | --------- | @@ -372,7 +444,7 @@ await client.auth.set({ --- -## 이벤트 +### 이벤트 | 방법 | 설명 | 응답 | | ------------------- | ----------------------- | ----------------------- | diff --git a/packages/web/src/content/docs/ko/themes.mdx b/packages/web/src/content/docs/ko/themes.mdx index b83b6201702..af148eda10a 100644 --- a/packages/web/src/content/docs/ko/themes.mdx +++ b/packages/web/src/content/docs/ko/themes.mdx @@ -3,28 +3,27 @@ title: 테마 description: 내장 테마를 선택하거나 자신만의 테마를 정의하세요. --- -opencode를 사용하면 여러 내장 테마 중 하나에서 선택할 수 있으며 terminal 테마에 적응하는 테마를 사용하거나 사용자 정의 테마를 정의 할 수 있습니다. +OpenCode를 사용하면 여러 내장 테마 중 하나에서 선택할 수 있으며 terminal 테마에 적응하는 테마를 사용하거나 사용자 정의 테마를 정의 할 수 있습니다. -기본적으로 opencode는 자체 `opencode` 테마를 사용합니다. +기본적으로 OpenCode는 자체 `opencode` 테마를 사용합니다. --- ## 터미널 요구 사항 -자신의 풀 컬러 팔레트로 올바르게 표시하려면 terminal을 지원해야합니다 ** truecolor** (24 비트 색상). 대부분의 현대 terminal은 기본적으로 이것을 지원합니다, 그러나 당신은 그것을 가능하게 할 필요가 있을지도 모릅니다: +테마가 전체 색상 팔레트로 올바르게 표시되려면 터미널이 **truecolor** (24비트 색상)를 지원해야 합니다. 대부분의 최신 터미널은 기본적으로 이를 지원하지만, 활성화해야 할 수도 있습니다: --**체크 지원**: `echo $COLORTERM` - 그것은 `truecolor` 또는 `24bit`를 출력해야 합니다 +- **지원 확인**: `echo $COLORTERM` 실행 - `truecolor` 또는 `24bit`가 출력되어야 합니다. +- **truecolor 활성화**: 셸 프로필에서 환경 변수 `COLORTERM=truecolor`를 설정하십시오. +- **터미널 호환성**: 터미널 에뮬레이터가 24비트 색상을 지원하는지 확인하십시오 (iTerm2, Alacritty, Kitty, Windows Terminal 및 최신 버전의 GNOME Terminal 등 대부분의 최신 터미널이 지원함). -- ** truecolor 사용 가능**: shell 프로파일에서 환경 변수 `COLORTERM=truecolor`를 설정 -- **Terminal 호환성 **: terminal 에뮬레이터 지원 24 비트 색상 (iTerm2, Alacritty, Kitty, Windows Terminal 및 GNOME Terminal의 최신 버전) - -truecolor 지원 없이, 테마는 감소된 색깔 정확도로 나타날지도 모릅니다 또는 가장 가까운 256 색깔 대류로 뒤떨어질지도 모릅니다. +truecolor 지원이 없으면 테마가 감소된 색상 정확도로 표시되거나 가장 가까운 256색 근사치로 대체될 수 있습니다. --- ## 내장 테마 -opencode는 여러 내장 테마와 함께 제공됩니다. +OpenCode는 여러 내장 테마와 함께 제공됩니다. | 이름 | 설명 | | ---------------------- | ------------------------------------------------------------------- | @@ -46,27 +45,27 @@ opencode는 여러 내장 테마와 함께 제공됩니다. ## 시스템 테마 -`system` 테마는 terminal의 색깔 계획에 자동적으로 적응시키기 위하여 디자인됩니다. 고정 색상을 사용하는 전통적인 테마와 달리, system 테마: +`system` 테마는 터미널의 색상 스키마에 자동으로 적응하도록 설계되었습니다. 고정 색상을 사용하는 기존 테마와 달리, system 테마는: -- **그레이스케일**: terminal의 배경 색상을 기반으로 사용자 정의 회색 가늠자를 만들고 최적의 대조를 보장합니다. -- ** ANSI 색상 사용 ** : terminal의 색상 팔레트를 존중하는 구문 강조 및 UI 요소에 대한 표준 ANSI 색상 (0-15). -- ** terminal 기본 사항**: `none` 텍스트 및 배경 색상을 사용하여 terminal의 네이티브 외관을 유지합니다. +- **그레이스케일 생성**: 터미널의 배경 색상을 기반으로 사용자 정의 그레이스케일을 생성하여 최적의 대비를 보장합니다. +- **ANSI 색상 사용**: 구문 강조 및 UI 요소에 표준 ANSI 색상(0-15)을 활용하여 터미널의 색상 팔레트를 존중합니다. +- **터미널 기본값 유지**: 텍스트 및 배경 색상에 `none`을 사용하여 터미널의 기본 모양을 유지합니다. -시스템 테마는 사용자를위한 것입니다 : +시스템 테마는 다음과 같은 사용자에게 적합합니다: -- opencode가 terminal의 외관과 일치해야 합니다. -- 사용자 정의 terminal 색상 구성 -- 모든 terminal 응용 분야의 일관된 모습 +- OpenCode가 터미널의 모양과 일치하기를 원하는 경우 +- 사용자 정의 터미널 색상 스키마를 사용하는 경우 +- 모든 터미널 애플리케이션에서 일관된 모양을 선호하는 경우 --- ## 테마 사용 -테마를 `/theme` 명령어로 선택하여 테마를 선택할 수 있습니다. 또는 [config](/docs/config)에서 지정할 수 있습니다. +`/theme` 명령어로 테마 선택기를 불러와 테마를 선택할 수 있습니다. 또는 `tui.json`에서 지정할 수 있습니다. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` @@ -75,32 +74,35 @@ opencode는 여러 내장 테마와 함께 제공됩니다. ## 사용자 정의 테마 -opencode는 사용자가 쉽게 테마를 만들 수 있도록 유연한 JSON 기반 테마 시스템을 지원합니다. +OpenCode는 사용자가 쉽게 테마를 만들고 사용자 정의할 수 있도록 유연한 JSON 기반 테마 시스템을 지원합니다. --- -##### 계층 구조 +### 계층 구조 -테마는 다음과 같은 순서에서 여러 디렉토리에서로드됩니다. 나중에 감독은 이전 것을 무시합니다. +테마는 다음 순서대로 여러 디렉토리에서 로드되며, 나중 디렉토리가 이전 디렉토리를 덮어씁니다: -1.**Built-in themes** - 이것은 바이너리에 내장되어 있습니다. 2. **사용자 설정 디렉토리 ** - `~/.config/opencode/themes/*.json` 또는 `$XDG_CONFIG_HOME/opencode/themes/*.json`에서 정의 3. ** 루트 디렉토리 ** - `/.opencode/themes/*.json`에서 정의 4. **현재 작업 디렉토리 ** - `./.opencode/themes/*.json`에서 정의 +1. **내장 테마 (Built-in themes)** - 바이너리에 내장되어 있습니다. +2. **사용자 설정 디렉토리 (User config directory)** - `~/.config/opencode/themes/*.json` 또는 `$XDG_CONFIG_HOME/opencode/themes/*.json`에 정의됩니다. +3. **프로젝트 루트 디렉토리 (Project root directory)** - ` /.opencode/themes/*.json`에 정의됩니다. +4. **현재 작업 디렉토리 (Current working directory)** - `./.opencode/themes/*.json`에 정의됩니다. -여러 디렉토리가 같은 이름을 가진 테마를 포함한다면, 더 높은 우선 순위를 가진 디렉토리의 테마가 사용됩니다. +여러 디렉토리에 같은 이름의 테마가 있는 경우, 더 높은 우선 순위를 가진 디렉토리의 테마가 사용됩니다. --- ### 테마 만들기 -사용자 정의 테마를 만들려면 테마 디렉토리 중 하나에서 JSON 파일을 만듭니다. +사용자 정의 테마를 만들려면 테마 디렉토리 중 하나에 JSON 파일을 만듭니다. -사용자 넓은 테마: +사용자 전역 테마: ```bash no-frame mkdir -p ~/.config/opencode/themes vim ~/.config/opencode/themes/my-theme.json ``` -프로젝트 별 테마. +프로젝트별 테마: ```bash no-frame mkdir -p .opencode/themes @@ -111,35 +113,34 @@ vim .opencode/themes/my-theme.json ### JSON 형식 -테마는 유연한 JSON 형식을 사용하여 지원: - --**Hex 색상**: `"#ffffff"` +테마는 다음을 지원하는 유연한 JSON 형식을 사용합니다: -- ** ANSI 색상**: `3` (0-255) -- ** 색상 참조 ** : `"primary"` 또는 사용자 정의 정의 -- ** 어두운 / 조명 변형 ** : `{"dark": "#000", "light": "#fff"}` -- ** 색상 없음 ** : `"none"` - terminal의 기본 색상 또는 투명 사용 +- **Hex 색상**: `"#ffffff"` +- **ANSI 색상**: `3` (0-255) +- **색상 참조**: `"primary"` 또는 사용자 정의 정의 +- **다크/라이트 변형**: `{"dark": "#000", "light": "#fff"}` +- **색상 없음**: `"none"` - 터미널의 기본 색상 또는 투명 사용 --- ### 색상 정의 -`defs` 단면도는 선택적이고 당신은 주제에서 참조될 수 있는 재사용할 수 있는 색깔을 정의할 수 있습니다. +`defs` 섹션은 선택 사항이며 테마 내에서 참조할 수 있는 재사용 가능한 색상을 정의할 수 있습니다. --- -## 터미널 기본값 +### 터미널 기본값 -특별한 가치 `"none"`는 terminal의 기본 색깔을 상속하기 위하여 어떤 색깔든지를 위해 사용될 수 있습니다. 이것은 특히 당신의 terminal의 색깔 계획과 이음새가 없는 혼합 테마 창조를 위해 유용합니다: +`"none"`이라는 특별한 값은 모든 색상에 대해 터미널의 기본 색상을 상속하는 데 사용할 수 있습니다. 이는 특히 터미널의 색상 스키마와 매끄럽게 어우러지는 테마를 만들 때 유용합니다: -- `"text": "none"` - terminal의 기본 전경 색상 사용 -- `"background": "none"` - terminal의 기본 배경 색상 사용 +- `"text": "none"` - 터미널의 기본 전경색 사용 +- `"background": "none"` - 터미널의 기본 배경색 사용 --- ### 예제 -사용자 정의 테마의 예입니다 : +사용자 정의 테마의 예입니다: ```json title="my-theme.json" { diff --git a/packages/web/src/content/docs/ko/tui.mdx b/packages/web/src/content/docs/ko/tui.mdx index 8717cc785f8..669d899d0ce 100644 --- a/packages/web/src/content/docs/ko/tui.mdx +++ b/packages/web/src/content/docs/ko/tui.mdx @@ -5,9 +5,9 @@ description: OpenCode 터미널 사용자 인터페이스 사용. import { Tabs, TabItem } from "@astrojs/starlight/components" -opencode는 LLM과 함께 프로젝트를 위해 대화형 terminal 인터페이스 또는 TUI를 제공합니다. +OpenCode는 LLM과 함께 프로젝트 작업을 하기 위한 대화형 터미널 인터페이스(TUI)를 제공합니다. -opencode는 현재 디렉토리에 TUI를 시작합니다. +OpenCode를 실행하면 현재 디렉토리에서 TUI가 시작됩니다. ```bash opencode @@ -19,7 +19,7 @@ opencode opencode /path/to/project ``` -TUI에 있다면 메시지가 표시됩니다. +TUI에 들어가면 메시지를 입력하여 프롬프트할 수 있습니다. ```text Give me a quick summary of the codebase. @@ -29,10 +29,10 @@ Give me a quick summary of the codebase. ## 파일 참조 -`@`를 사용하여 메시지에 파일을 참조 할 수 있습니다. 이것은 현재 작업 디렉토리에서 fuzzy 파일 검색입니다. +`@`를 사용하여 메시지에서 파일을 참조할 수 있습니다. 이것은 현재 작업 디렉토리에서 퍼지(fuzzy) 파일 검색을 수행합니다. :::tip -`@`를 사용하여 메시지의 참조 파일을 사용할 수 있습니다. +`@`를 사용하여 메시지에서 파일을 참조할 수 있습니다. ::: ```text "@packages/functions/src/api/index.ts" @@ -45,7 +45,7 @@ How is auth handled in @packages/functions/src/api/index.ts? ## Bash 명령 -`!`를 사용하여 shell 명령을 실행합니다. +`!`로 메시지를 시작하여 셸 명령을 실행합니다. ```bash frame="none" !ls -la @@ -57,21 +57,21 @@ How is auth handled in @packages/functions/src/api/index.ts? ## 명령 -opencode TUI를 사용할 때, `/`를 입력하여 명령 이름을 따라 작업을 신속하게 실행할 수 있습니다. 예를 들면: +OpenCode TUI를 사용할 때 `/` 뒤에 명령 이름을 입력하여 작업을 빠르게 실행할 수 있습니다. 예를 들어: ```bash frame="none" /help ``` -대부분의 명령은 `ctrl+x`를 `ctrl+x`가 기본 리더 키입니다. [더 알아보기](/docs/keybinds). +대부분의 명령에는 기본 리더 키인 `ctrl+x`를 사용하는 키바인드도 있습니다. [더 알아보기](/docs/keybinds). -여기에 모든 가능한 슬래시 명령이 있습니다. +사용 가능한 모든 슬래시 명령은 다음과 같습니다: --- -### /connect +### connect -opencode에 대한 공급자를 추가합니다. 사용 가능한 공급자에서 선택하고 API 키를 추가 할 수 있습니다. +OpenCode에 공급자를 추가합니다. 사용 가능한 공급자 중에서 선택하고 API 키를 추가할 수 있습니다. ```bash frame="none" /connect @@ -79,67 +79,67 @@ opencode에 대한 공급자를 추가합니다. 사용 가능한 공급자에 --- -### /compact +### compact -현재 세션을 압축합니다. 앨리스 : `/summarize` +현재 세션을 압축합니다. _별칭_: `/summarize` ```bash frame="none" /compact ``` -** Keybind:** `ctrl+x c` +**키바인드:** `ctrl+x c` --- -### /details +### details -토글 툴 실행 세부 사항. +도구 실행 세부 정보 토글. ```bash frame="none" /details ``` -** Keybind:** `ctrl+x d` +**키바인드:** `ctrl+x d` --- -### /editor +### editor -메시지를 작성하기 위한 외부 편집기를 엽니다. `EDITOR` 환경에서 설정된 편집기를 사용합니다. [더 알아보기](#editor-setup). +메시지 작성을 위한 외부 편집기를 엽니다. `EDITOR` 환경 변수에 설정된 편집기를 사용합니다. [더 알아보기](#editor-setup). ```bash frame="none" /editor ``` -** Keybind:** `ctrl+x e` +**키바인드:** `ctrl+x e` --- -### /exit +### exit -opencode를 종료합니다. Aliases : `/quit`, `/q` +OpenCode를 종료합니다. _별칭_: `/quit`, `/q` ```bash frame="none" /exit ``` -** Keybind:** `ctrl+x q` +**키바인드:** `ctrl+x q` --- -### /export +### export -Markdown에 대한 현재 대화를 내보내고 기본 편집기에서 열립니다. `EDITOR` 환경에서 설정된 편집기를 사용합니다. [더 알아보기](#editor-setup). +현재 대화를 Markdown으로 내보내고 기본 편집기에서 엽니다. `EDITOR` 환경 변수에 설정된 편집기를 사용합니다. [더 알아보기](#editor-setup). ```bash frame="none" /export ``` -** Keybind:** `ctrl+x x` +**키바인드:** `ctrl+x x` --- -### /help +### help 도움말 대화 상자를 표시합니다. @@ -147,107 +147,106 @@ Markdown에 대한 현재 대화를 내보내고 기본 편집기에서 열립 /help ``` -** Keybind:** `ctrl+x h` +**키바인드:** `ctrl+x h` --- -###### /init +### init -`AGENTS.md` 파일을 만들거나 업데이트하십시오. [더 알아보기](/docs/rules). +`AGENTS.md` 파일을 생성하거나 업데이트합니다. [더 알아보기](/docs/rules). ```bash frame="none" /init ``` -** Keybind:** `ctrl+x i` +**키바인드:** `ctrl+x i` --- -## /models +### models -사용 가능한 모델 목록. +사용 가능한 모델 목록을 표시합니다. ```bash frame="none" /models ``` -** Keybind:** `ctrl+x m` +**키바인드:** `ctrl+x m` --- -## /new +### new -새로운 세션을 시작합니다. 앨리스 : `/clear` +새 세션을 시작합니다. _별칭_: `/clear` ```bash frame="none" /new ``` -** Keybind:** `ctrl+x n` +**키바인드:** `ctrl+x n` --- -##### /redo +### redo -이전 undone 메시지 Redo. `/undo`를 사용하는 후에만 유효한. +이전에 실행 취소한 메시지를 다시 실행합니다. `/undo`를 사용한 후에만 사용할 수 있습니다. :::tip -모든 파일 변경도 복원됩니다. +모든 파일 변경 사항도 복원됩니다. ::: -내부적으로 Git을 사용하여 파일 변경을 관리합니다. 그래서 프로젝트 ** -Git 저장소**입니다. +내부적으로 Git을 사용하여 파일 변경 사항을 관리합니다. 따라서 프로젝트가 **Git 저장소**여야 합니다. ```bash frame="none" /redo ``` -** Keybind:** `ctrl+x r` +**키바인드:** `ctrl+x r` --- -## /sessions +### sessions -세션 간 목록 및 전환. Aliases : `/resume`, `/continue` +세션 목록을 표시하고 세션 간을 전환합니다. _별칭_: `/resume`, `/continue` ```bash frame="none" /sessions ``` -** Keybind:** `ctrl+x l` +**키바인드:** `ctrl+x l` --- -## 공유 +### share -현재 세션 공유. [더 알아보기](/docs/share). +현재 세션을 공유합니다. [더 알아보기](/docs/share). ```bash frame="none" /share ``` -** Keybind:** `ctrl+x s` +**키바인드:** `ctrl+x s` --- -## /theme +### themes -사용할 수 있는 테마 목록. +사용 가능한 테마 목록을 표시합니다. ```bash frame="none" -/theme +/themes ``` -** Keybind:** `ctrl+x t` +**키바인드:** `ctrl+x t` --- -### /thinking +### thinking -대화의 사고/거주 블록의 가시성을 토합니다. 사용할 때, 확장 된 생각을 지원하는 모델의 이유 프로세스를 볼 수 있습니다. +대화에서 생각/추론 블록의 가시성을 토글합니다. 활성화하면 확장된 사고를 지원하는 모델의 추론 과정을 볼 수 있습니다. :::note -이 명령은 생각 블록이 ** 표시되었는지 여부 만 제어 ** - 모델의 소싱 기능을 활성화하거나 비활성화하지 않습니다. toggle 실제적인 reasoning 기능에, 모형 변종을 통해서 주기 위하여 `ctrl+t`를 이용합니다. +이 명령은 생각 블록이 **표시되는지 여부만 제어**하며 모델의 추론 기능을 활성화하거나 비활성화하지 않습니다. 실제 추론 기능을 토글하려면 `ctrl+t`를 사용하여 모델 변형을 순환하십시오. ::: ```bash frame="none" @@ -256,28 +255,27 @@ Git 저장소**입니다. --- -##### /undo +### undo -대화에서 마지막 메시지. 가장 최근의 사용자 메시지, 모든 후속 응답 및 모든 파일 변경 제거. +대화의 마지막 메시지를 실행 취소합니다. 가장 최근의 사용자 메시지, 모든 후속 응답 및 모든 파일 변경 사항을 제거합니다. :::tip -어떤 파일 변경도 복제됩니다. +모든 파일 변경 사항도 되돌려집니다. ::: -내부적으로 Git을 사용하여 파일 변경을 관리합니다. 그래서 프로젝트 ** -Git 저장소**입니다. +내부적으로 Git을 사용하여 파일 변경 사항을 관리합니다. 따라서 프로젝트가 **Git 저장소**여야 합니다. ```bash frame="none" /undo ``` -** Keybind:** `ctrl+x u` +**키바인드:** `ctrl+x u` --- -#### /unshare +### unshare -Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing). +현재 세션 공유를 취소합니다. [더 알아보기](/docs/share#un-sharing). ```bash frame="none" /unshare @@ -285,9 +283,9 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing). --- -## 편집기 설정 +## Editor setup -`/editor`와 `/export` 명령 모두는 `EDITOR` 환경변수에서 지정된 편집기를 사용합니다. +`/editor`와 `/export` 명령 모두 `EDITOR` 환경 변수에 지정된 편집기를 사용합니다. -인기있는 편집기 옵션은 다음과 같습니다 : +인기 있는 편집기 옵션은 다음과 같습니다: -- `code` - Visual Studio 코드 -- `cursor` - 커서 -- `windsurf` - 윈드 서핑 -- `nvim` - Neovim 편집기 -- `vim` - Vim 편집기 -- `nano` - 나노 편집기 -- `notepad` - 윈도우 노트패드 -- `subl` - 승화 텍스트 +- `code` - Visual Studio Code +- `cursor` - Cursor +- `windsurf` - Windsurf +- `nvim` - Neovim editor +- `vim` - Vim editor +- `nano` - Nano editor +- `notepad` - Windows Notepad +- `subl` - Sublime Text :::note -VS Code와 같은 일부 편집기는 `--wait` 플래그와 함께 시작해야합니다. +VS Code와 같은 일부 편집기는 `--wait` 플래그와 함께 시작해야 합니다. ::: -일부 편집기는 명령줄 인수가 차단 모드에서 실행되어야 합니다. `--wait` 플래그는 닫힐 때까지 편집기 프로세스 블록을 만듭니다. +일부 편집기는 차단 모드에서 실행하려면 명령줄 인수가 필요합니다. `--wait` 플래그는 편집기 프로세스가 닫힐 때까지 차단되도록 합니다. --- ## 구성 -opencode config 파일을 통해 TUI 동작을 사용자 정의할 수 있습니다. +`tui.json` (또는 `tui.jsonc`) 파일을 통해 TUI 동작을 사용자 정의할 수 있습니다. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +이는 서버/런타임 동작을 구성하는 `opencode.json`과는 별개입니다. + ### 옵션 -- `scroll_acceleration` - 부드러운 자연 스크롤을위한 macOS 스타일 스크롤 가속 가능. 사용할 때, 스크롤 속도는 빠른 스크롤 제스처로 증가하고 느린 움직임을 위해 정확한 유지. **이 설정은 `scroll_speed`를 통해 우선 순위를 부여하고 활성화 할 때. ** -- `scroll_speed` - 스크롤 명령 (최소 : `1`)을 사용하여 TUI 스크롤을 빠르게 제어합니다. 기본 `3`. ** 참고: `scroll_acceleration.enabled`가 `true`로 설정되면 무시됩니다.** +- `theme` - UI 테마를 설정합니다. [더 알아보기](/docs/themes). +- `keybinds` - 키보드 단축키를 사용자 정의합니다. [더 알아보기](/docs/keybinds). +- `scroll_acceleration.enabled` - 부드럽고 자연스러운 스크롤을 위해 macOS 스타일의 스크롤 가속을 활성화합니다. 활성화하면 빠른 스크롤 제스처로 스크롤 속도가 증가하고 느린 움직임에서는 정밀하게 유지됩니다. **이 설정은 `scroll_speed`보다 우선하며 활성화 시 이를 덮어씁니다.** +- `scroll_speed` - 스크롤 명령을 사용할 때 TUI 스크롤 속도를 제어합니다 (최소: `0.001`, 소수점 값 지원). 기본값은 `3`입니다. **참고: `scroll_acceleration.enabled`가 `true`로 설정되면 무시됩니다.** +- `diff_style` - diff 렌더링 방식을 제어합니다. `"auto"`는 터미널 너비에 적응하고, `"stacked"`는 항상 단일 열 레이아웃을 표시합니다. + +`OPENCODE_TUI_CONFIG`를 사용하여 사용자 정의 TUI 설정 경로를 로드할 수 있습니다. --- ## 사용자 정의 -명령 팔레트 (`ctrl+x h` 또는 `/help`)를 사용하여 TUI보기의 다양한 측면을 사용자 정의 할 수 있습니다. 재시작에 따른 설정 persist. +명령 팔레트(`ctrl+x h` 또는 `/help`)를 사용하여 TUI 보기의 다양한 측면을 사용자 정의할 수 있습니다. 설정은 다시 시작해도 유지됩니다. --- #### 사용자 이름 표시 -사용자 이름이 채팅 메시지에 나타나는지 여부를 수정합니다. 이것을 통해 접근: +채팅 메시지에 사용자 이름이 표시되는지 여부를 토글합니다. 다음을 통해 액세스: -- 명령 팔레트 : "username" 또는 "hide 사용자" 검색 -- 자동 설정은 TUI 세션을 통해 기억됩니다. +- 명령 팔레트: "username" 또는 "hide username" 검색 +- 설정은 자동으로 유지되며 TUI 세션 간에 기억됩니다. diff --git a/packages/web/src/content/docs/ko/zen.mdx b/packages/web/src/content/docs/ko/zen.mdx index 04d5c0df8e9..035f1441408 100644 --- a/packages/web/src/content/docs/ko/zen.mdx +++ b/packages/web/src/content/docs/ko/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: OpenCode가 제공하는 엄선된 모델 목록. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -55,6 +55,7 @@ OpenCode Zen은 OpenCode의 다른 제공자와 동일한 방식으로 작동합 | 모델 | 모델 ID | 엔드포인트 | AI SDK 패키지 | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -64,28 +65,30 @@ OpenCode Zen은 OpenCode의 다른 제공자와 동일한 방식으로 작동합 | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Big Pickle | big-pickle | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -OpenCode 설정 파일에서 사용하는 [모델 ID](/docs/config/#models)는 `opencode/ @@ -301,8 +299,7 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing). export EDITOR="code --wait" ``` -영원한 만들기 위하여, 당신의 shell 프로파일에 이것을 추가하십시오; -`~/.bashrc`, `~/.zshrc`, 등. + 영구적으로 설정하려면 셸 프로필(`~/.bashrc`, `~/.zshrc` 등)에 추가하십시오. @@ -315,8 +312,7 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing). set EDITOR=code --wait ``` -영구적으로, use **System Properties** > ** 환경 -변수**. + 영구적으로 설정하려면 **시스템 속성** > **환경 변수**를 사용하십시오. @@ -329,62 +325,72 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing). $env:EDITOR = "code --wait" ``` -영구적으로 만들려면 PowerShell 프로파일에 추가하십시오. + 영구적으로 설정하려면 PowerShell 프로필에 추가하십시오.` 형식을 따릅니다. +OpenCode 설정 파일에서 사용하는 [모델 ID](/docs/config/#models)는 `opencode/ ` 형식을 따릅니다. 예를 들어 GPT 5.2 Codex의 경우 설정에서 `opencode/gpt-5.2-codex`와 같이 사용합니다. --- @@ -107,29 +110,34 @@ https://opencode.ai/zen/v1/models | 모델 | 입력 | 출력 | 캐시 읽기 | 캐시 쓰기 | | --------------------------------- | ------ | ------ | --------- | --------- | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -148,8 +156,6 @@ https://opencode.ai/zen/v1/models 무료 모델: -- GLM 5 Free는 한정된 기간 동안 OpenCode에서 제공됩니다. 해당 기간 동안 팀은 사용자 피드백을 수집하고 모델을 개선할 예정입니다. -- Kimi K2.5 Free는 한정된 기간 동안 OpenCode에서 제공됩니다. 해당 기간 동안 팀은 사용자 피드백을 수집하고 모델을 개선할 예정입니다. - MiniMax M2.5 Free는 한정된 기간 동안 OpenCode에서 제공됩니다. 해당 기간 동안 팀은 사용자 피드백을 수집하고 모델을 개선할 예정입니다. - Big Pickle은 한정된 기간 동안 OpenCode에서 무료로 제공되는 스텔스 모델입니다. 해당 기간 동안 팀은 사용자 피드백을 수집하고 모델을 개선할 예정입니다. @@ -169,7 +175,7 @@ https://opencode.ai/zen/v1/models 워크스페이스 전체 및 각 팀 구성원별로 월간 사용 한도를 설정할 수 있습니다. -예를 들어 월간 사용 한도를 $20로 설정한 경우, Zen은 한 달 동안 $20을 초과하여 사용하지 않습니다. +예를 들어 월간 사용 한도를 $20로 설정한 경우, Zen은 한 달 동안 $20을 초과하여 사용하지 않습니다. 다만 자동 충전이 활성화되어 있는 경우, 잔액이 $5 미만으로 내려가면 자동으로 충전이 이루어질 수 있으므로 실제 청구 금액이 $20을 초과할 수 있습니다. --- @@ -179,8 +185,6 @@ https://opencode.ai/zen/v1/models 당사의 모든 모델은 미국에서 호스팅됩니다. 당사 제공자는 데이터 무보존(zero-retention) 정책을 따르며, 아래의 예외를 제외하고는 귀하의 데이터를 모델 학습에 사용하지 않습니다. - Big Pickle: 무료 제공 기간 동안 수집된 데이터는 모델 개선을 위해 사용될 수 있습니다. -- GLM 5 Free: 무료 제공 기간 동안 수집된 데이터는 모델 개선을 위해 사용될 수 있습니다. -- Kimi K2.5 Free: 무료 제공 기간 동안 수집된 데이터는 모델 개선을 위해 사용될 수 있습니다. - MiniMax M2.5 Free: 무료 제공 기간 동안 수집된 데이터는 모델 개선을 위해 사용될 수 있습니다. - OpenAI APIs: 요청 데이터는 [OpenAI의 데이터 정책](https://platform.openai.com/docs/guides/your-data)에 따라 30일간 보관됩니다. - Anthropic APIs: 요청 데이터는 [Anthropic의 데이터 정책](https://docs.anthropic.com/en/docs/claude-code/data-usage)에 따라 30일간 보관됩니다. diff --git a/packages/web/src/content/docs/nb/cli.mdx b/packages/web/src/content/docs/nb/cli.mdx index 2f1b3884ea0..409fdb23783 100644 --- a/packages/web/src/content/docs/nb/cli.mdx +++ b/packages/web/src/content/docs/nb/cli.mdx @@ -558,6 +558,7 @@ OpenCode kan konfigureres ved hjelp av miljøvariabler. | `OPENCODE_AUTO_SHARE` | boolsk | Del økter automatisk | | `OPENCODE_GIT_BASH_PATH` | streng | Bane til Git Bash-kjørbar på Windows | | `OPENCODE_CONFIG` | streng | Bane til konfigurasjonsfil | +| `OPENCODE_TUI_CONFIG` | streng | Bane til TUI-konfigurasjonsfil | | `OPENCODE_CONFIG_DIR` | streng | Bane til konfigurasjonskatalog | | `OPENCODE_CONFIG_CONTENT` | streng | Innebygd json-konfigurasjonsinnhold | | `OPENCODE_DISABLE_AUTOUPDATE` | boolsk | Deaktiver automatiske oppdateringskontroller | diff --git a/packages/web/src/content/docs/nb/config.mdx b/packages/web/src/content/docs/nb/config.mdx index 8f54335794c..e8b32d5a067 100644 --- a/packages/web/src/content/docs/nb/config.mdx +++ b/packages/web/src/content/docs/nb/config.mdx @@ -14,10 +14,11 @@ OpenCode støtter både **JSON** og **JSONC** (JSON med kommentarer) formater. ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -301,12 +302,12 @@ Bærer-tokens (`AWS_BEARER_TOKEN_BEDROCK` eller `/connect`) har forrang over pro ### Temaer -Du kan konfigurere temaet du vil bruke i OpenCode-konfigurasjonen gjennom alternativet `theme`. +Angi UI-temaet ditt i `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -406,11 +407,11 @@ Du kan også definere kommandoer ved å bruke markdown-filer i `~/.config/openco ### Tastebindinger -Du kan tilpasse tastebindingene dine gjennom alternativet `keybinds`. +Tilpass tastebindinger i `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -490,13 +491,15 @@ Du kan styre kontekstkomprimering gjennom alternativet `compaction`. "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Komprimer økten automatisk når konteksten er full (standard: `true`). - `prune` - Fjern gamle verktøyutdata for å spare tokens (standard: `true`). +- `reserved` - Token-buffer for komprimering. Etterlater nok vindu til å unngå overflyt under komprimering --- diff --git a/packages/web/src/content/docs/nb/custom-tools.mdx b/packages/web/src/content/docs/nb/custom-tools.mdx index 0b88f750773..505c261a0b2 100644 --- a/packages/web/src/content/docs/nb/custom-tools.mdx +++ b/packages/web/src/content/docs/nb/custom-tools.mdx @@ -79,6 +79,32 @@ Dette lager to verktøy: `math_add` og `math_multiply`. --- +#### Navnekollisjoner med innebygde verktøy + +Egendefinerte verktøy er nøklet etter verktøynavn. Hvis et egendefinert verktøy bruker samme navn som et innebygd verktøy, vil det egendefinerte verktøyet ha forrang. + +For eksempel erstatter denne filen det innebygde `bash`-verktøyet: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Foretrekk unike navn med mindre du med vilje ønsker å erstatte et innebygd verktøy. Hvis du vil deaktivere et innebygd verktøy, men ikke overstyre det, bruk [tillatelser](/docs/permissions). +::: + +--- + ### Argumenter Du kan bruke `tool.schema`, som bare er [Zod](https://zod.dev), for å definere argumenttyper. diff --git a/packages/web/src/content/docs/nb/keybinds.mdx b/packages/web/src/content/docs/nb/keybinds.mdx index d762a647f20..8314b4dd82b 100644 --- a/packages/web/src/content/docs/nb/keybinds.mdx +++ b/packages/web/src/content/docs/nb/keybinds.mdx @@ -3,11 +3,11 @@ title: Tastebindinger description: Tilpass tastebindingene dine. --- -OpenCode har en liste over tastebindinger som du kan tilpasse gjennom OpenCode-konfigurasjonen. +OpenCode har en liste over tastebindinger som du kan tilpasse gjennom `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ Du trenger ikke å bruke en ledertast for tastebindingene dine, men vi anbefaler ## Deaktivering av tastebindinger -Du kan deaktivere en tastebinding ved å legge til tasten til konfigurasjonen med verdien "none". +Du kan deaktivere en tastebinding ved å legge til tasten til `tui.json` med en verdi på "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/nb/lsp.mdx b/packages/web/src/content/docs/nb/lsp.mdx index c52b79a32d3..924b0dad1a0 100644 --- a/packages/web/src/content/docs/nb/lsp.mdx +++ b/packages/web/src/content/docs/nb/lsp.mdx @@ -27,6 +27,7 @@ OpenCode kommer med flere innebygde LSP-servere for populære språk: | gopls | .go | `go` kommando tilgjengelig | | hls | .hs, .lhs | `haskell-language-server-wrapper` kommando tilgjengelig | | jdtls | .java | `Java SDK (version 21+)` installert | +| julials | .jl | `julia` og `LanguageServer.jl` installert | | kotlin-ls | .kt, .kts | Installeres automatisk for Kotlin-prosjekter | | lua-ls | .lua | Installeres automatisk for Lua-prosjekter | | nixd | .nix | `nixd` kommando tilgjengelig | diff --git a/packages/web/src/content/docs/nb/modes.mdx b/packages/web/src/content/docs/nb/modes.mdx index 0322f069302..ccf9180e4ee 100644 --- a/packages/web/src/content/docs/nb/modes.mdx +++ b/packages/web/src/content/docs/nb/modes.mdx @@ -4,7 +4,7 @@ description: Ulike moduser for forskjellige brukstilfeller. --- :::caution -Moduser er nå konfigurert gjennom alternativet `agent` i OpenCode-konfigurasjonen. De +Moduser konfigureres nå gjennom alternativet `agent` i OpenCode-konfigurasjonen. Alternativet `mode` er nå utdatert. [Finn ut mer](/docs/agents). ::: @@ -13,6 +13,14 @@ Moduser i OpenCode lar deg tilpasse oppførselen, verktøyene og prompter for ul Den kommer med to innebygde moduser: **bygg** og **plan**. Du kan tilpasse disse eller konfigurer din egen gjennom OpenCode-konfigurasjonen. +Du kan bytte mellom moduser under en økt eller konfigurere dem i konfigurasjonsfilen din. + +--- + +## Innebygd + +OpenCode kommer med to innebygde moduser. + --- ### Bygg @@ -34,6 +42,96 @@ Denne modusen er nyttig når du vil at AI skal analysere kode, foreslå endringe --- +## Bytte + +Du kan bytte mellom moduser under en økt ved å bruke _Tab_-tasten. Eller din konfigurerte `switch_mode` hurtigtast. + +Se også: [Formatters](/docs/formatters) for informasjon om kodeformateringskonfigurasjon. + +--- + +## Konfigurer + +Du kan tilpasse de innebygde modusene eller opprette din egen gjennom konfigurasjon. Moduser kan konfigureres på to måter: + +### JSON-konfigurasjon + +Konfigurer moduser i din `opencode.json` konfigurasjonsfil: + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "mode": { + "build": { + "model": "anthropic/claude-sonnet-4-20250514", + "prompt": "{file:./prompts/build.txt}", + "tools": { + "write": true, + "edit": true, + "bash": true + } + }, + "plan": { + "model": "anthropic/claude-haiku-4-20250514", + "tools": { + "write": false, + "edit": false, + "bash": false + } + } + } +} +``` + +### Markdown-konfigurasjon + +Du kan også definere moduser ved hjelp av markdown-filer. Plasser dem i: + +- Globalt: `~/.config/opencode/modes/` +- Prosjekt: `.opencode/modes/` + +```markdown title="~/.config/opencode/modes/review.md" +--- +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.1 +tools: + write: false + edit: false + bash: false +--- + +You are in code review mode. Focus on: + +- Code quality and best practices +- Potential bugs and edge cases +- Performance implications +- Security considerations + +Provide constructive feedback without making direct changes. +``` + +Filnavnet til markdown-filen blir modusnavnet (f.eks. `review.md` oppretter en `review`-modus). + +La oss se på disse konfigurasjonsalternativene i detalj. + +--- + +### Modell + +Bruk `model`-konfigurasjonen for å overstyre standardmodellen for denne modusen. Nyttig for å bruke forskjellige modeller optimalisert for forskjellige oppgaver. For eksempel en raskere modell for planlegging, en mer kapabel modell for implementering. + +```json title="opencode.json" +{ + "mode": { + "plan": { + "model": "anthropic/claude-haiku-4-20250514" + } + } +} +``` + +--- + ### Temperatur Kontroller tilfeldigheten og kreativiteten til AI-ens svar med `temperature`-konfigurasjonen. Lavere verdier gjør svarene mer fokuserte og deterministiske, mens høyere verdier øker kreativiteten og variasjonen. @@ -54,13 +152,171 @@ Kontroller tilfeldigheten og kreativiteten til AI-ens svar med `temperature`-kon Temperaturverdier varierer vanligvis fra 0,0 til 1,0: - **0.0-0.2**: Veldig fokuserte og deterministiske svar, ideelt for kodeanalyse og planlegging -- **0,3-0,5**: Balanserte svar med litt kreativitet, bra for generelle utviklingsoppgaver +- **0.3-0.5**: Balanserte svar med litt kreativitet, bra for generelle utviklingsoppgaver - **0.6-1.0**: Mer kreative og varierte svar, nyttig for idédugnad og utforskning +```json title="opencode.json" +{ + "mode": { + "analyze": { + "temperature": 0.1, + "prompt": "{file:./prompts/analysis.txt}" + }, + "build": { + "temperature": 0.3 + }, + "brainstorm": { + "temperature": 0.7, + "prompt": "{file:./prompts/creative.txt}" + } + } +} +``` + Hvis ingen temperatur er spesifisert, bruker OpenCode modellspesifikke standardinnstillinger (vanligvis 0 for de fleste modeller, 0,55 for Qwen-modeller). --- +### Prompt + +Angi en tilpasset systemprompt-fil for denne modusen med `prompt`-konfigurasjonen. Prompt-filen skal inneholde instruksjoner som er spesifikke for modusens formål. + +```json title="opencode.json" +{ + "mode": { + "review": { + "prompt": "{file:./prompts/code-review.txt}" + } + } +} +``` + +Denne banen er relativ til der konfigurasjonsfilen er plassert. Så dette fungerer for både den globale OpenCode-konfigurasjonen og den prosjektspesifikke konfigurasjonen. + +--- + +### Verktøy + +Kontroller hvilke verktøy som er tilgjengelige i denne modusen med `tools`-konfigurasjonen. Du kan aktivere eller deaktivere spesifikke verktøy ved å sette dem til `true` eller `false`. + +```json +{ + "mode": { + "readonly": { + "tools": { + "write": false, + "edit": false, + "bash": false, + "read": true, + "grep": true, + "glob": true + } + } + } +} +``` + +Hvis ingen verktøy er spesifisert, er alle verktøy aktivert som standard. + +--- + +#### Tilgjengelige verktøy + +Her er alle verktøyene som kan kontrolleres gjennom moduskonfigurasjonen. + +| Verktøy | Beskrivelse | +| ----------- | --------------------------- | +| `bash` | Utfør shell-kommandoer | +| `edit` | Endre eksisterende filer | +| `write` | Opprett nye filer | +| `read` | Les filinnhold | +| `grep` | Søk i filinnhold | +| `glob` | Finn filer etter mønster | +| `list` | List opp kataloginnhold | +| `patch` | Bruk patcher på filer | +| `todowrite` | Administrer gjøremålslister | +| `todoread` | Les gjøremålslister | +| `webfetch` | Hent webinnhold | + +--- + +## Egendefinerte moduser + +Du kan opprette dine egne tilpassede moduser ved å legge dem til i konfigurasjonen. Her er eksempler på bruk av begge metodene: + +### Bruke JSON-konfigurasjon + +```json title="opencode.json" {4-14} +{ + "$schema": "https://opencode.ai/config.json", + "mode": { + "docs": { + "prompt": "{file:./prompts/documentation.txt}", + "tools": { + "write": true, + "edit": true, + "bash": false, + "read": true, + "grep": true, + "glob": true + } + } + } +} +``` + +### Bruke markdown-filer + +Opprett modusfiler i `.opencode/modes/` for prosjektspesifikke moduser eller `~/.config/opencode/modes/` for globale moduser: + +```markdown title=".opencode/modes/debug.md" +--- +temperature: 0.1 +tools: + bash: true + read: true + grep: true + write: false + edit: false +--- + +You are in debug mode. Your primary goal is to help investigate and diagnose issues. + +Focus on: + +- Understanding the problem through careful analysis +- Using bash commands to inspect system state +- Reading relevant files and logs +- Searching for patterns and anomalies +- Providing clear explanations of findings + +Do not make any changes to files. Only investigate and report. +``` + +```markdown title="~/.config/opencode/modes/refactor.md" +--- +model: anthropic/claude-sonnet-4-20250514 +temperature: 0.2 +tools: + edit: true + read: true + grep: true + glob: true +--- + +You are in refactoring mode. Focus on improving code quality without changing functionality. + +Priorities: + +- Improve code readability and maintainability +- Apply consistent naming conventions +- Reduce code duplication +- Optimize performance where appropriate +- Ensure all tests continue to pass +``` + +--- + ### Bruksområder Her er noen vanlige bruksområder for forskjellige moduser. diff --git a/packages/web/src/content/docs/nb/plugins.mdx b/packages/web/src/content/docs/nb/plugins.mdx index 6b6e1edf3f0..27d23ec63a8 100644 --- a/packages/web/src/content/docs/nb/plugins.mdx +++ b/packages/web/src/content/docs/nb/plugins.mdx @@ -1,6 +1,6 @@ --- title: Programtillegg -description: Skriv dine egne programtillegg for å utvide opencode. +description: Skriv dine egne programtillegg for å utvide OpenCode. --- Plugins lar deg utvide OpenCode ved å koble til ulike hendelser og tilpasse atferd. Du kan lage plugins for å legge til nye funksjoner, integrere med eksterne tjenester eller endre standardoppførselen til OpenCode. @@ -308,6 +308,10 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { Dine egendefinerte verktøy vil være tilgjengelige for OpenCode sammen med innebygde verktøy. +:::note +Hvis et plugin-verktøy bruker samme navn som et innebygd verktøy, vil plugin-verktøyet ha forrang. +::: + --- ### Logging diff --git a/packages/web/src/content/docs/nb/providers.mdx b/packages/web/src/content/docs/nb/providers.mdx index 58d325cab8c..682f923f8c4 100644 --- a/packages/web/src/content/docs/nb/providers.mdx +++ b/packages/web/src/content/docs/nb/providers.mdx @@ -57,7 +57,7 @@ testet og verifisert for å fungere godt med OpenCode. [Finn ut mer](/docs/zen). Hvis du er ny, anbefaler vi å starte med OpenCode Zen. ::: -1. Kjør kommandoen `/connect` i TUI, velg opencode og gå til [opencode.ai/auth](https://opencode.ai/auth). +1. Kjør kommandoen `/connect` i TUI, velg `OpenCode Zen` og gå til [opencode.ai/auth](https://opencode.ai/zen). ```txt /connect @@ -84,6 +84,39 @@ Det fungerer som alle andre leverandører i OpenCode og er helt valgfritt å bru --- +## OpenCode Go + +OpenCode Go er en lavpris abonnementsplan som gir pålitelig tilgang til populære åpne kodemodeller levert av OpenCode-teamet som har vært +testet og verifisert for å fungere godt med OpenCode. + +1. Kjør kommandoen `/connect` i TUI, velg `OpenCode Go`, og gå til [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Logg på, legg til faktureringsdetaljene dine og kopier API-nøkkelen. + +3. Lim inn API-nøkkelen. + + ```txt + ┌ API key + │ + │ + │ + └ enter + ``` + +4. Kjør `/models` i TUI for å se listen over modeller vi anbefaler. + + ```txt + /models + ``` + +Det fungerer som alle andre leverandører i OpenCode og er helt valgfritt å bruke. + +--- + ## Katalog La oss se på noen av leverandørene i detalj. Hvis du vil legge til en leverandør til diff --git a/packages/web/src/content/docs/nb/sdk.mdx b/packages/web/src/content/docs/nb/sdk.mdx index bbff8ebecea..56bde19d701 100644 --- a/packages/web/src/content/docs/nb/sdk.mdx +++ b/packages/web/src/content/docs/nb/sdk.mdx @@ -3,7 +3,7 @@ title: SDK description: Typesikker JS-klient for OpenCode-server. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const typesUrl = `${config.github}/blob/dev/packages/sdk/js/src/gen/types.gen.ts` OpenCode JS/TS SDK gir en typesikker klient for samhandling med serveren. @@ -117,6 +117,78 @@ try { --- +## Strukturert Utdata + +Du kan be om strukturert JSON-utdata fra modellen ved å spesifisere et `format` med et JSON-skjema. Modellen vil bruke et `StructuredOutput`-verktøy for å returnere validert JSON som samsvarer med skjemaet ditt. + +### Grunnleggende bruk + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Utdataformattyper + +| Type | Beskrivelse | +| ------------- | --------------------------------------------------------------- | +| `text` | Standard. Standard tekstrespons (ingen strukturert utdata) | +| `json_schema` | Returnerer validert JSON som samsvarer med det angitte skjemaet | + +### JSON Skjemaformat + +Når du bruker `type: 'json_schema'`, oppgi: + +| Felt | Type | Beskrivelse | +| ------------ | --------------- | ---------------------------------------------------------- | +| `type` | `'json_schema'` | Påkrevd. Spesifiserer JSON-skjemamodus | +| `schema` | `object` | Påkrevd. JSON Schema-objekt som definerer utdatastrukturen | +| `retryCount` | `number` | Valgfritt. Antall valideringsforsøk (standard: 2) | + +### Feilhåndtering + +Hvis modellen ikke klarer å produsere gyldig strukturert utdata etter alle forsøk, vil svaret inkludere en `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Beste praksis + +1. **Gi klare beskrivelser** i skjemaegenskapene dine for å hjelpe modellen med å forstå hvilke data som skal trekkes ut +2. **Bruk `required`** for å spesifisere hvilke felt som må være til stede +3. **Hold skjemaer fokuserte** - komplekse nøstede skjemaer kan være vanskeligere for modellen å fylle ut riktig +4. **Angi passende `retryCount`** - øk for komplekse skjemaer, reduser for enkle + +--- + ## API-er SDK-en eksponerer alle server-API-er gjennom en typesikker klient. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sesjoner -| Metode | Beskrivelse | Merknader | -| ---------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `session.list()` | List økter | Returnerer Session[]| -| `session.get({ path })` | Hent økt | ReturnererSession| -| `session.children({ path })` | List barneøkter | ReturnererSession[]| -| `session.create({ body })` | Opprett økt | ReturnererSession| -| `session.delete({ path })` | Slett økt | Returnerer `boolean` | -| `session.update({ path, body })` | Oppdater øktegenskaper | ReturnererSession| -| `session.init({ path, body })` | Analyser appen og lag `AGENTS.md` | Returnerer `boolean` | -| `session.abort({ path })` | Avbryt en kjørende økt | Returnerer `boolean` | -| `session.share({ path })` | Del økten | ReturnererSession| -| `session.unshare({ path })` | Slutt å dele økten | ReturnererSession| -| `session.summarize({ path, body })` | Oppsummer økten | Returnerer `boolean` | -| `session.messages({ path })` | List meldinger i en økt | Returnerer `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Hent meldingsdetaljer | Returnerer `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnererAssistantMessagemed AI svar | -| `session.command({ path, body })` | Send kommando til økt | Returnerer `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Kjør en shell-kommando | ReturnererAssistantMessage| -| `session.revert({ path, body })` | Tilbakestill en melding | ReturnererSession| -| `session.unrevert({ path })` | Gjenopprett reverserte meldinger | ReturnererSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` | +| Metode | Beskrivelse | Merknader | +| ---------------------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | List økter | ReturnererSession[]| +| `session.get({ path })` | Hent økt | ReturnererSession| +| `session.children({ path })` | List barneøkter | ReturnererSession[]| +| `session.create({ body })` | Opprett økt | ReturnererSession| +| `session.delete({ path })` | Slett økt | Returnerer `boolean` | +| `session.update({ path, body })` | Oppdater øktegenskaper | ReturnererSession| +| `session.init({ path, body })` | Analyser appen og lag `AGENTS.md` | Returnerer `boolean` | +| `session.abort({ path })` | Avbryt en kjørende økt | Returnerer `boolean` | +| `session.share({ path })` | Del økten | ReturnererSession| +| `session.unshare({ path })` | Slutt å dele økten | ReturnererSession| +| `session.summarize({ path, body })` | Oppsummer økten | Returnerer `boolean` | +| `session.messages({ path })` | List meldinger i en økt | Returnerer `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Hent meldingsdetaljer | Returnerer `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnererAssistantMessagemed AI svar. Støtter `body.outputFormat` for [strukturert utdata](#strukturert-utdata) | +| `session.command({ path, body })` | Send kommando til økt | Returnerer `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Kjør en shell-kommando | ReturnererAssistantMessage| +| `session.revert({ path, body })` | Tilbakestill en melding | ReturnererSession| +| `session.unrevert({ path })` | Gjenopprett reverserte meldinger | ReturnererSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` | --- diff --git a/packages/web/src/content/docs/nb/themes.mdx b/packages/web/src/content/docs/nb/themes.mdx index a294a6a0fa4..2284848e318 100644 --- a/packages/web/src/content/docs/nb/themes.mdx +++ b/packages/web/src/content/docs/nb/themes.mdx @@ -3,9 +3,9 @@ title: Temaer description: Velg et innebygd tema eller definer ditt eget. --- -Med opencode kan du velge fra ett av flere innebygde temaer, bruke et tema som tilpasser seg terminaltemaet ditt, eller definere ditt eget tilpassede tema. +Med OpenCode kan du velge fra ett av flere innebygde temaer, bruke et tema som tilpasser seg terminaltemaet ditt, eller definere ditt eget tilpassede tema. -Som standard bruker opencode vårt eget `opencode`-tema. +Som standard bruker OpenCode vårt eget `opencode`-tema. --- @@ -23,7 +23,7 @@ Uten truecolor-støtte kan temaer vises med redusert fargenøyaktighet eller fal ## Innebygde temaer -opencode kommer med flere innebygde temaer. +OpenCode kommer med flere innebygde temaer. | Navn | Beskrivelse | | ---------------------- | ------------------------------------------------------------------------- | @@ -53,7 +53,7 @@ Og mer, vi legger stadig til nye temaer. Systemtemaet er for brukere som: -- Vil at opencode skal matche terminalens utseende +- Vil at OpenCode skal matche terminalens utseende - Bruker tilpassede terminalfargeskjemaer - Foretrekker et konsistent utseende på tvers av alle terminalapplikasjoner @@ -61,11 +61,11 @@ Systemtemaet er for brukere som: ## Bruke et tema -Du kan velge et tema ved å åpne temavelgeren med kommandoen `/theme`. Eller du kan spesifisere det i [config](/docs/config). +Du kan velge et tema ved å åpne temavelgeren med kommandoen `/theme`. Eller du kan spesifisere det i `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` @@ -74,7 +74,7 @@ Du kan velge et tema ved å åpne temavelgeren med kommandoen `/theme`. Eller du ## Egendefinerte temaer -opencode støtter et fleksibelt JSON-basert temasystem som lar brukere enkelt lage og tilpasse temaer. +OpenCode støtter et fleksibelt JSON-basert temasystem som lar brukere enkelt lage og tilpasse temaer. --- diff --git a/packages/web/src/content/docs/nb/tui.mdx b/packages/web/src/content/docs/nb/tui.mdx index fae2a2364c1..741ba46029c 100644 --- a/packages/web/src/content/docs/nb/tui.mdx +++ b/packages/web/src/content/docs/nb/tui.mdx @@ -5,9 +5,9 @@ description: Bruke opencode-terminalbrukergrensesnittet. import { Tabs, TabItem } from "@astrojs/starlight/components" -opencode gir et interaktivt terminalgrensesnitt (TUI) for å jobbe med prosjektene dine med en LLM. +OpenCode gir et interaktivt terminalgrensesnitt (TUI) for å jobbe med prosjektene dine med en LLM. -Å kjøre opencode starter TUI for gjeldende katalog. +Å kjøre OpenCode starter TUI for gjeldende katalog. ```bash opencode @@ -57,7 +57,7 @@ Utdataene fra kommandoen legges til samtalen som et verktøyresultat. ## Kommandoer -Når du bruker opencode TUI, kan du skrive `/` etterfulgt av et kommandonavn for raskt å utføre handlinger. For eksempel: +Når du bruker OpenCode TUI, kan du skrive `/` etterfulgt av et kommandonavn for raskt å utføre handlinger. For eksempel: ```bash frame="none" /help @@ -71,7 +71,7 @@ Her er alle tilgjengelige slash-kommandoer: ### connect -Legg til en leverandør til opencode. Lar deg velge fra tilgjengelige leverandører og legge til deres API-nøkler. +Legg til en leverandør til OpenCode. Lar deg velge fra tilgjengelige leverandører og legge til deres API-nøkler. ```bash frame="none" /connect @@ -117,7 +117,7 @@ Veksle visning av verktøydetaljer. ### exit -Avslutt opencode. _Aliaser_: `/quit`, `/q` +Avslutt OpenCode. _Aliaser_: `/quit`, `/q` ```bash frame="none" /exit @@ -230,12 +230,12 @@ Del gjeldende økt. [Finn ut mer](/docs/share). --- -### theme +### themes Liste over tilgjengelige temaer. ```bash frame="none" -/theme +/themes ``` **Nøkkelbinding:** `ctrl+x t` @@ -355,24 +355,34 @@ Noen editorer trenger kommandolinjeargumenter for å kjøre i blokkeringsmodus. ## Konfigurasjon -Du kan tilpasse TUI-oppførselen gjennom opencode-konfigurasjonsfilen. +Du kan tilpasse TUI-oppførselen gjennom `tui.json` (eller `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Dette er atskilt fra `opencode.json`, som konfigurerer server-/kjøretidsoppførsel. + ### Alternativer -- `scroll_acceleration` - Aktiver rulleakselerasjon i macOS-stil for jevn, naturlig rulling. Når aktivert, øker rullehastigheten med raske rullebevegelser og forblir presis for langsommere bevegelser. **Denne innstillingen har forrang over `scroll_speed` og overstyrer den når den er aktivert.** -- `scroll_speed` - Styrer hvor raskt TUI ruller når du bruker rullekommandoer (minimum: `1`). Standard er `3`. **Merk: Dette ignoreres hvis `scroll_acceleration.enabled` er satt til `true`.** +- `theme` - Angir UI-temaet ditt. [Finn ut mer](/docs/themes). +- `keybinds` - Tilpasser hurtigtaster. [Finn ut mer](/docs/keybinds). +- `scroll_acceleration.enabled` - Aktiver rulleakselerasjon i macOS-stil for jevn, naturlig rulling. Når aktivert, øker rullehastigheten med raske rullebevegelser og forblir presis for langsommere bevegelser. **Denne innstillingen har forrang over `scroll_speed` og overstyrer den når den er aktivert.** +- `scroll_speed` - Styrer hvor raskt TUI ruller når du bruker rullekommandoer (minimum: `0.001`, støtter desimalverdier). Standard er `3`. **Merk: Dette ignoreres hvis `scroll_acceleration.enabled` er satt til `true`.** +- `diff_style` - Kontrollerer diff-gjengivelse. `"auto"` tilpasser seg terminalbredden, `"stacked"` viser alltid en enkeltkolonneoppsett. + +Bruk `OPENCODE_TUI_CONFIG` for å laste en egendefinert TUI-konfigurasjonsbane. --- diff --git a/packages/web/src/content/docs/nb/zen.mdx b/packages/web/src/content/docs/nb/zen.mdx index f8dac0f3919..d85d63e3993 100644 --- a/packages/web/src/content/docs/nb/zen.mdx +++ b/packages/web/src/content/docs/nb/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Utvalgt liste over modeller levert av OpenCode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -14,7 +14,7 @@ OpenCode Zen er for øyeblikket i beta. ::: Zen fungerer som alle andre leverandører i OpenCode. Du logger på OpenCode Zen og får -din API nøkkel. Den er **helt valgfri** og du trenger ikke bruke den for å bruke den +din API nøkkel. Den er **helt valgfri** og du trenger ikke bruke den for å bruke OpenCode. --- @@ -64,6 +64,7 @@ Du kan også få tilgang til modellene våre gjennom følgende API-endepunkter. | Modell | Modell ID | Endepunkt | AI SDK Pakke | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -73,22 +74,24 @@ Du kan også få tilgang til modellene våre gjennom følgende API-endepunkter. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -117,29 +120,34 @@ Vi støtter en pay-as-you-go-modell. Nedenfor er prisene **per 1 million tokens* | Modell | Inndata | Utdata | Bufret lesing | Bufret skriving | | --------------------------------- | ------- | ------ | ------------- | --------------- | | Big Pickle | Gratis | Gratis | Gratis | - | -| MiniMax M2.1 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 Free | Gratis | Gratis | Gratis | - | +| MiniMax M2.5 | $0,30 | $1,20 | $0,06 | - | | MiniMax M2.1 | $0,30 | $1,20 | $0,10 | - | -| GLM 4.7 Free | Gratis | Gratis | Gratis | - | +| GLM 5 | $1,00 | $3,20 | $0,20 | - | | GLM 4.7 | $0,60 | $2,20 | $0,10 | - | | GLM 4.6 | $0,60 | $2,20 | $0,10 | - | -| Kimi K2.5 Free | Gratis | Gratis | Gratis | - | | Kimi K2.5 | $0,60 | $3,00 | $0,08 | - | | Kimi K2 Thinking | $0,40 | $2,50 | - | - | | Kimi K2 | $0,40 | $2,50 | - | - | | Qwen3 Coder 480B | $0,45 | $1,50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5,00 | $25,00 | $0,50 | $6,25 | +| Claude Opus 4.6 (> 200K tokens) | $10,00 | $37,50 | $1,00 | $12,50 | +| Claude Opus 4.5 | $5,00 | $25,00 | $0,50 | $6,25 | +| Claude Opus 4.1 | $15,00 | $75,00 | $1,50 | $18,75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | | Claude Sonnet 4.5 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Sonnet 4 (≤ 200K tokens) | $3,00 | $15,00 | $0,30 | $3,75 | | Claude Sonnet 4 (> 200K tokens) | $6,00 | $22,50 | $0,60 | $7,50 | | Claude Haiku 4.5 | $1,00 | $5,00 | $0,10 | $1,25 | | Claude Haiku 3.5 | $0,80 | $4,00 | $0,08 | $1,00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5,00 | $25,00 | $0,50 | $6,25 | -| Claude Opus 4.6 (> 200K tokens) | $10,00 | $37,50 | $1,00 | $12,50 | -| Claude Opus 4.5 | $5,00 | $25,00 | $0,50 | $6,25 | -| Claude Opus 4.1 | $15,00 | $75,00 | $1,50 | $18,75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2,00 | $12,00 | $0,20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4,00 | $18,00 | $0,40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2,00 | $12,00 | $0,20 | - | | Gemini 3 Pro (> 200K tokens) | $4,00 | $18,00 | $0,40 | - | | Gemini 3 Flash | $0,50 | $3,00 | $0,05 | - | +| GPT 5.3 Codex | $1,75 | $14,00 | $0,175 | - | | GPT 5.2 | $1,75 | $14,00 | $0,175 | - | | GPT 5.2 Codex | $1,75 | $14,00 | $0,175 | - | | GPT 5.1 | $1,07 | $8,50 | $0,107 | - | @@ -158,9 +166,7 @@ Kredittkortgebyrer overføres til kostpris (4,4 % + $0,30 per transaksjon); vi b De gratis modellene: -- GLM 4.7 Free er tilgjengelig på OpenCode i en begrenset periode. Teamet bruker denne tiden til å samle tilbakemeldinger og forbedre modellen. -- Kimi K2.5 Free er tilgjengelig på OpenCode i en begrenset periode. Teamet bruker denne tiden til å samle tilbakemeldinger og forbedre modellen. -- MiniMax M2.1 Free er tilgjengelig på OpenCode i en begrenset periode. Teamet bruker denne tiden til å samle tilbakemeldinger og forbedre modellen. +- MiniMax M2.5 Free er tilgjengelig på OpenCode i en begrenset periode. Teamet bruker denne tiden til å samle tilbakemeldinger og forbedre modellen. - Big Pickle er en stealth-modell som er gratis på OpenCode i en begrenset periode. Teamet bruker denne tiden til å samle tilbakemeldinger og forbedre modellen. Kontakt oss hvis du har spørsmål. @@ -191,9 +197,7 @@ belaster deg mer enn $20 hvis saldoen din går under $5. Alle våre modeller er hostet i USA. Leverandørene våre følger retningslinjer om ingen datalagring og bruker ikke dataene dine til modellopplæring, med følgende unntak: - Big Pickle: I løpet av gratisperioden kan innsamlede data brukes til å forbedre modellen. -- GLM 4.7 Free: I løpet av gratisperioden kan innsamlede data brukes til å forbedre modellen. -- Kimi K2.5 Free: I løpet av gratisperioden kan innsamlede data brukes til å forbedre modellen. -- MiniMax M2.1 Free: I løpet av gratisperioden kan innsamlede data brukes til å forbedre modellen. +- MiniMax M2.5 Free: I løpet av gratisperioden kan innsamlede data brukes til å forbedre modellen. - OpenAI APIer: Forespørsler oppbevares i 30 dager i samsvar med [OpenAIs datapolicyer](https://platform.openai.com/docs/guides/your-data). - Anthropic APIer: Forespørsler oppbevares i 30 dager i samsvar med [Anthropics datapolicyer](https://docs.anthropic.com/en/docs/claude-code/data-usage). @@ -251,4 +255,4 @@ Vi opprettet OpenCode Zen for å: 1. **Benchmark** de beste modellene/leverandørene for kodingsagenter. 2. Ha tilgang til alternativene for **høyeste kvalitet** og ikke nedgrader ytelsen eller rute trafikk til billigere leverandører. 3. Gi videre eventuelle **prisfall** ved å selge til kostpris; så det eneste påslaget er å dekke behandlingsgebyrene våre. -4. Ha **ingen låsing** ved å la deg bruke den med en hvilken som helst annen kodeagent. Og la deg alltid bruke en hvilken som helst annen leverandør med opencode også. +4. Ha **ingen låsing** ved å la deg bruke den med en hvilken som helst annen kodeagent. Og la deg alltid bruke en hvilken som helst annen leverandør med OpenCode også. diff --git a/packages/web/src/content/docs/pl/cli.mdx b/packages/web/src/content/docs/pl/cli.mdx index 35218590181..82ff7f52b22 100644 --- a/packages/web/src/content/docs/pl/cli.mdx +++ b/packages/web/src/content/docs/pl/cli.mdx @@ -558,6 +558,7 @@ OpenCode można skonfigurować za pomocą zmiennych środowiskowych. | `OPENCODE_AUTO_SHARE` | boolean | Automatycznie udostępniaj sesje | | `OPENCODE_GIT_BASH_PATH` | string | Ścieżka do pliku wykonywalnego Git Bash w systemie Windows | | `OPENCODE_CONFIG` | string | Ścieżka do pliku konfiguracyjnego | +| `OPENCODE_TUI_CONFIG` | string | Ścieżka do pliku konfiguracyjnego TUI | | `OPENCODE_CONFIG_DIR` | string | Ścieżka do katalogu konfiguracyjnego | | `OPENCODE_CONFIG_CONTENT` | string | Treść konfiguracji JSON (inline) | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Wyłącz automatyczne sprawdzanie aktualizacji | diff --git a/packages/web/src/content/docs/pl/config.mdx b/packages/web/src/content/docs/pl/config.mdx index cde2e312eaa..a6a6fb156d7 100644 --- a/packages/web/src/content/docs/pl/config.mdx +++ b/packages/web/src/content/docs/pl/config.mdx @@ -94,7 +94,9 @@ Możesz włączyć serwer w konfiguracji projektu: ### Globalna -Umieść swoją globalną konfigurację OpenCode w `~/.config/opencode/opencode.json`. Użyj jej do ustawień ogólnych dla użytkownika, takich jak motywy, domyślny dostawca lub skróty klawiszowe. +Umieść swoją globalną konfigurację OpenCode w `~/.config/opencode/opencode.json`. Użyj jej do ustawień ogólnych dla użytkownika, takich jak dostawcy, modele i uprawnienia. + +Dla ustawień specyficznych dla TUI, użyj `~/.config/opencode/tui.json`. Konfiguracja globalna ma pierwszeństwo przed konfiguracją zdalną. @@ -104,8 +106,10 @@ Konfiguracja globalna ma pierwszeństwo przed konfiguracją zdalną. Dodaj `opencode.json` w katalogu głównym projektu. Konfiguracja projektu ma najwyższy priorytet wśród plików konfiguracyjnych — nadpisuje konfiguracje globalne i zdalne. +Dla ustawień TUI specyficznych dla projektu, dodaj plik `tui.json` obok niego. + :::tip -Dodaj ten plik do kontroli wersji, aby udostępniać konfigurację zespołowi. +Umieść konfigurację specyficzną dla projektu w katalogu głównym projektu. ::: Kiedy OpenCode się uruchamia, szuka pliku konfiguracyjnego w katalogu głównym repozytorium Git. @@ -150,28 +154,24 @@ Twój edytor powinien zapewniać walidację i autouzupełnianie na podstawie teg ### TUI -Możesz skonfigurować zachowanie TUI za pomocą opcji `tui`. +Użyj dedykowanego pliku `tui.json` (lub `tui.jsonc`) dla ustawień specyficznych dla TUI. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Dostępne opcje: +Użyj `OPENCODE_TUI_CONFIG`, aby wskazać niestandardowy plik konfiguracyjny TUI. -- `scroll_acceleration.enabled` - Włącz przyspieszenie przewijania na gładzikach macOS. **Ma pierwszeństwo przed `scroll_speed`.** -- `scroll_speed` - Niestandardowy mnożnik szybkości przewijania (domyślnie: `3`, minimalnie: `1`). Ignorowane, jeśli `scroll_acceleration.enabled` ustawiono na `true`. -- `diff_style` – Sterowanie renderowaniem różnic. `"auto"` przełącza się w zależności od szerokości terminala, `"stacked"` zawsze wymusza pojedynczą kolumnę. +Przestarzałe klucze `theme`, `keybinds` i `tui` w `opencode.json` są wycofywane i automatycznie migrowane, gdy to możliwe. -[Dowiedz się więcej o korzystaniu z TUI](/docs/tui). +[Dowiedz się więcej o konfiguracji TUI tutaj](/docs/tui#configure). --- @@ -297,16 +297,16 @@ Token okaziciela (`AWS_BEARER_TOKEN_BEDROCK` lub `/connect`) ma pierwszeństwo p ### Theme (Motyw) -Skonfiguruj motyw interfejsu OpenCode za pomocą opcji `theme`. +Ustaw motyw interfejsu użytkownika w `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` -[Dowiedz się więcej o motywach](/docs/themes). +[Dowiedz się więcej tutaj](/docs/themes). --- @@ -402,16 +402,16 @@ Możesz także definiować polecenia przy użyciu plików Markdown w `~/.config/ ### Keybinds (Skróty klawiszowe) -Możesz dostosować skróty klawiszowe za pomocą opcji `keybinds`. +Dostosuj skróty klawiszowe w `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` -[Dowiedz się więcej o skrótach klawiszowych](/docs/keybinds). +[Dowiedz się więcej tutaj](/docs/keybinds). --- diff --git a/packages/web/src/content/docs/pl/custom-tools.mdx b/packages/web/src/content/docs/pl/custom-tools.mdx index eaf403d2de8..7a38512c18c 100644 --- a/packages/web/src/content/docs/pl/custom-tools.mdx +++ b/packages/web/src/content/docs/pl/custom-tools.mdx @@ -3,7 +3,7 @@ title: Narzędzia specjalistyczne description: Twórz narzędzi, które LLM mogą być uruchamiane w otwartym kodzie. --- -Narzędzia stosowane do funkcji, z których LLM może korzystać podczas rozmów. Współpracują z [wbudowanymi narzędziami] (./tools) opencode, wtyczka jak `read`, `write` i `bash`. +Narzędzia specjalistyczne to funkcje, które tworzysz i które LLM może wywoływać podczas rozmów. Współpracują one z [wbudowanymi narzędziami](/docs/tools) opencode, takimi jak `read`, `write` i `bash`. --- @@ -75,7 +75,33 @@ export const multiply = tool({ }) ``` -Tworzy do dwóch narzędzi: `math_add` i `math_multiply`. +Tworzy to dwa narzędzia: `math_add` i `math_multiply`. + +--- + +#### Kolizje nazw z wbudowanymi narzędziami + +Niestandardowe narzędzia są identyfikowane według nazwy narzędzia. Jeśli niestandardowe narzędzie używa tej samej nazwy co wbudowane narzędzie, niestandardowe narzędzie ma pierwszeństwo. + +Na przykład ten plik zastępuje wbudowane narzędzie `bash`: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Preferuj unikalne nazwy, chyba że celowo chcesz zastąpić wbudowane narzędzie. Jeśli chcesz wyłączyć wbudowane narzędzie, ale go nie nadpisywać, użyj [uprawnień](/docs/permissions). +::: --- @@ -135,9 +161,9 @@ export default tool({ ### Napisz narzędzie w Pythonie -Napisz swoje narzędzie w języku angielskim. Oto przykład dodania dwóch liczb przy użyciu języka Python. +Możesz pisać swoje narzędzia w dowolnym języku. Oto przykład dodania dwóch liczb przy użyciu języka Python. -Fragment utworu jako skrypt w języku Python: +Najpierw utwórz narzędzie jako skrypt w języku Python: ```python title=".opencode/tools/add.py" import sys @@ -147,7 +173,7 @@ b = int(sys.argv[2]) print(a + b) ``` -Utwór instrumentalny, który jest ukryty: +Następnie utwórz definicję narzędzia, która go wywołuje: ```ts title=".opencode/tools/python-add.ts" {10} import { tool } from "@opencode-ai/plugin" @@ -167,4 +193,4 @@ export default tool({ }) ``` -Tutaj istnieje narzędzie [`Bun.$`](https://bun.com/docs/runtime/shell) uruchamiające skryptu w języku Python. +Tutaj używamy narzędzia [`Bun.$`](https://bun.com/docs/runtime/shell) do uruchomienia skryptu w języku Python. diff --git a/packages/web/src/content/docs/pl/keybinds.mdx b/packages/web/src/content/docs/pl/keybinds.mdx index f4995600dac..03b9ec9c2a2 100644 --- a/packages/web/src/content/docs/pl/keybinds.mdx +++ b/packages/web/src/content/docs/pl/keybinds.mdx @@ -3,11 +3,11 @@ title: Skróty klawiszowe description: Dostosuj swoje skróty klawiszowe. --- -opencode zawiera listę skrótów klawiszowych, które można zastosować poprzez opencode. +OpenCode zawiera listę skrótów klawiszowych, które można dostosować za pomocą `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,q", @@ -117,11 +117,11 @@ Nie musisz mieć klawisza wiodącego do skrótów klawiszowych, ale zalecamy to ## Wyłącz powiązanie klawiszy -Możesz podłączyć powiązanie klawiszy, dodając klucz do swojej konfiguracji z wartością „none”. +Możesz wyłączyć skrót klawiszowy, dodając klucz do `tui.json` z wartością "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/pl/lsp.mdx b/packages/web/src/content/docs/pl/lsp.mdx index 8430bd9ca91..ec2edec4309 100644 --- a/packages/web/src/content/docs/pl/lsp.mdx +++ b/packages/web/src/content/docs/pl/lsp.mdx @@ -27,6 +27,7 @@ OpenCode posiada kilka wbudowanych serwerów LSP dla następujących języków: | gopls | .go | Dostępne polecenie `go` | | hls | .hs, .lhs | Dostępne polecenie `haskell-language-server-wrapper` | | jdtls | .java | Zainstalowany `Java SDK (version 21+)` | +| julials | .jl | Zainstalowane `julia` i `LanguageServer.jl` | | kotlin-ls | .kt, .kts | Automatyczna instalacja dla Kotlin | | lua-ls | .lua | Automatyczna instalacja dla Lua | | nixd | .nix | Dostępne polecenie `nixd` | diff --git a/packages/web/src/content/docs/pl/plugins.mdx b/packages/web/src/content/docs/pl/plugins.mdx index e91900ad270..510c8a22e4c 100644 --- a/packages/web/src/content/docs/pl/plugins.mdx +++ b/packages/web/src/content/docs/pl/plugins.mdx @@ -9,7 +9,7 @@ Aby znaleźć się z przykładami, przejrzyj [wtyczki](/docs/ecosystem#plugins) --- -## użyj wtyczki +## Użyj wtyczki Istnieją dwa sposoby ładowania wtyczek. @@ -51,7 +51,7 @@ Przeglądaj dostępną wtyczkę w [ekosystemie](/docs/ecosystem#plugins). --- -### Załaduj zamówienie +### Kolejność ładowania Wtyczki są ładowane ze wszystkich źródeł, a wszystkie hooki napisane po kolei. Kolejność ładowania do: @@ -310,7 +310,7 @@ Twoje narzędzie będzie dostępne dla otwartego kodu wraz z narzędziami użytk --- -### Wycięcie lasu +### Logowanie użyj `client.app.log()` zamiast `console.log` do rejestracji strukturalnego: diff --git a/packages/web/src/content/docs/pl/providers.mdx b/packages/web/src/content/docs/pl/providers.mdx index 58f824764ef..fa509011031 100644 --- a/packages/web/src/content/docs/pl/providers.mdx +++ b/packages/web/src/content/docs/pl/providers.mdx @@ -57,7 +57,38 @@ przetestowane i zweryfikowane, aby dobrze współpracować z opencode. [Dowiedz Jeśli jesteś nowy, zalecamy rozpoczęcie od OpenCode Zen. ::: -1. Uruchom polecenie `/connect` w TUI, wybierz opencode i przejdź do [opencode.ai/auth](https://opencode.ai/auth). +1. Uruchom polecenie `/connect` w TUI, wybierz `OpenCode Zen` i przejdź do [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Zaloguj się, dodaj szczegóły rozliczeniowe i skopiuj klucz API. + +3. Wklej swój klucz API. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Uruchom `/models` w TUI, aby zobaczyć listę zalecanych przez nas modeli. + + ```txt + /models + ``` + +Działa jak każdy inny dostawca w opencode i jest całkowicie opcjonalny w użyciu. + +--- + +## OpenCode Go + +OpenCode Go to tani plan subskrypcji, który zapewnia niezawodny dostęp do popularnych modeli open coding dostarczanych przez zespół opencode, które zostały przetestowane i zweryfikowane pod kątem dobrej współpracy z opencode. + +1. Uruchom polecenie `/connect` w TUI, wybierz `OpenCode Go` i przejdź do [opencode.ai/auth](https://opencode.ai/zen). ```txt /connect @@ -470,7 +501,7 @@ Cloudflare AI Gateway umożliwia dostęp do modeli z OpenAI, Anthropic, Workers └ enter ``` - Or set it as an environment variable. + Lub ustaw go jako zmienną środowiskową. ```bash title="~/.bash_profile" export CLOUDFLARE_API_TOKEN=your-api-token @@ -834,11 +865,11 @@ Aby używać Google Vertex AI z opencode: 2. Ustaw wymagane zmienne środowiskowe: - `GOOGLE_CLOUD_PROJECT`: identyfikator Twojego projektu Google Cloud - `VERTEX_LOCATION` (opcjonalnie): region Vertex AI (domyślnie `global`) - - Authentication (choose one): + - Uwierzytelnianie (wybierz jedno): - `GOOGLE_APPLICATION_CREDENTIALS`: Ścieżka do pliku klucza JSON konta usługi - Uwierzytelnij się za pomocą interfejsu CLI gcloud: `gcloud auth application-default login` - Set them while running opencode. + Ustaw je podczas uruchamiania opencode. ```bash GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GOOGLE_CLOUD_PROJECT=your-project-id opencode @@ -1479,6 +1510,39 @@ SAP AI Core zapewnia dostęp do ponad 40 modeli z OpenAI, Anthropic, Google, Ama --- +### STACKIT + +STACKIT AI Model Serving zapewnia w pełni zarządzane suwerenne środowisko hostingu dla modeli AI, koncentrując się na LLM, takich jak Llama, Mistral i Qwen, z maksymalną suwerennością danych na infrastrukturze europejskiej. + +1. Przejdź do [portalu STACKIT](https://portal.stackit.cloud), przejdź do **AI Model Serving**, i utwórz token autoryzacyjny dla swojego projektu. + + :::tip + Musisz posiadać konto klienta STACKIT, konto użytkownika i projekt przed utworzeniem tokenów autoryzacyjnych. + ::: + +2. Uruchom polecenie `/connect` i wyszukaj **STACKIT**. + + ```txt + /connect + ``` + +3. Wprowadź swój token autoryzacyjny STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Uruchom polecenie `/models`, aby wybrać jeden z dostępnych modeli, np. _Qwen3-VL 235B_ lub _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Przejdź do [panelu OVHcloud](https://ovh.com/manager). Przejdź do sekcji `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` i na karcie `API Keys` kliknij **Utwórz nowy klucz API**. diff --git a/packages/web/src/content/docs/pl/sdk.mdx b/packages/web/src/content/docs/pl/sdk.mdx index 3236e38c29d..40099713eff 100644 --- a/packages/web/src/content/docs/pl/sdk.mdx +++ b/packages/web/src/content/docs/pl/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Ustrukturyzowane Dane Wyjściowe + +Możesz zażądać ustrukturyzowanych danych wyjściowych JSON od modelu, określając `format` za pomocą schematu JSON. Model użyje narzędzia `StructuredOutput`, aby zwrócić zweryfikowany kod JSON pasujący do Twojego schematu. + +### Podstawowe użycie + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Typy formatu wyjściowego + +| Typ | Opis | +| ------------- | ------------------------------------------------------------------------- | +| `text` | Domyślny. Standardowa odpowiedź tekstowa (brak ustrukturyzowanych danych) | +| `json_schema` | Zwraca zweryfikowany JSON pasujący do dostarczonego schematu | + +### Format JSON Schema + +Używając `type: 'json_schema'`, podaj: + +| Pole | Typ | Opis | +| ------------ | --------------- | ------------------------------------------------------------ | +| `type` | `'json_schema'` | Wymagane. Określa tryb schematu JSON | +| `schema` | `object` | Wymagane. Obiekt JSON Schema definiujący strukturę wyjściową | +| `retryCount` | `number` | Opcjonalne. Liczba ponownych prób walidacji (domyślnie: 2) | + +### Obsługa błędów + +Jeśli model nie wygeneruje prawidłowych ustrukturyzowanych danych wyjściowych po wszystkich próbach, odpowiedź będzie zawierać `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Najlepsze praktyki + +1. **Podawaj jasne opisy** we właściwościach schematu, aby pomóc modelowi zrozumieć, jakie dane wyodrębnić +2. **Używaj `required`**, aby określić, które pola muszą być obecne +3. **Zachowaj schematy skoncentrowane** - złożone zagnieżdżone schematy mogą być trudniejsze dla modelu do poprawnego wypełnienia +4. **Ustaw odpowiedni `retryCount`** - zwiększ dla złożonych schematów, zmniejsz dla prostych + +--- + ## API Zestaw SDK udostępnia wszystkie interfejsy API serwera za pośrednictwem klienta bezpiecznego typu. diff --git a/packages/web/src/content/docs/pl/skills.mdx b/packages/web/src/content/docs/pl/skills.mdx index 9262d87e661..8dbb7301203 100644 --- a/packages/web/src/content/docs/pl/skills.mdx +++ b/packages/web/src/content/docs/pl/skills.mdx @@ -141,8 +141,8 @@ Kontroluj, do których umiejętności agenci mogą uzyskać dostęp, używając | Permission | Behavior | | ---------- | ------------------------------------------------------ | -| `allow` | Skill loads immediately | -| `deny` | Skill hidden from agent, access rejected | +| `allow` | Umiejętność ładuje się natychmiast | +| `deny` | Umiejętność ukryta przed agentem, dostęp odrzucony | | `ask` | Użytkownik proszony o zatwierdzenie przed załadowaniem | Wzorce obsługują symbole wieloznaczne: `internal-*` odpowiada `internal-docs`, `internal-tools` itd. diff --git a/packages/web/src/content/docs/pl/themes.mdx b/packages/web/src/content/docs/pl/themes.mdx index d4272e2c9be..80a78083511 100644 --- a/packages/web/src/content/docs/pl/themes.mdx +++ b/packages/web/src/content/docs/pl/themes.mdx @@ -53,19 +53,19 @@ Motyw `system` został zaprojektowany tak, aby automatycznie dostosowywał się Motyw systemu przeznaczony jest dla użytkowników, którzy: -- Want opencode to match their terminal's appearance -- Użyj niestandardowych schematów kolorów terminali -- Prefer a consistent look across all terminal applications +- Chcą, aby OpenCode pasował do wyglądu ich terminala +- Używają niestandardowych schematów kolorów terminala +- Preferują spójny wygląd we wszystkich aplikacjach terminalowych --- ## Używanie motywu -Możesz wybrać motyw, wywołując opcję wyboru motywu za pomocą polecenia `/theme`. Możesz też określić to w [config](/docs/config). +Możesz wybrać motyw, wywołując opcję wyboru motywu za pomocą polecenia `/theme`. Możesz też określić to w `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/pl/tui.mdx b/packages/web/src/content/docs/pl/tui.mdx index 6d693eb9e65..2d983cf84b1 100644 --- a/packages/web/src/content/docs/pl/tui.mdx +++ b/packages/web/src/content/docs/pl/tui.mdx @@ -355,24 +355,34 @@ Niektórzy edytory potrzebują argumentów wiersza poleceń, aby działać w try ## Skonfiguruj -Możesz dostosować zachowanie TUI za pomocą pliku konfiguracyjnego opencode. +Możesz dostosować zachowanie TUI za pomocą pliku `tui.json` (lub `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Jest to oddzielny plik od `opencode.json`, który konfiguruje zachowanie serwera/runtime. + ### Opcje -- `scroll_acceleration` — Włącz przyspieszenie przewijania w stylu macOS, aby zapewnić płynne, naturalne przewijanie. Po włączeniu prędkość przewijania wzrasta wraz z szybkimi gestami przewijania i pozostaje precyzyjna w przypadku wolniejszych ruchów. **To ustawienie ma pierwszeństwo przed `scroll_speed` i zastępuje je, gdy jest włączone.** -- `scroll_speed` - Kontroluje szybkość przewijania TUI podczas korzystania z poleceń przewijania (minimum: `1`). Wartość domyślna to `3`. **Uwaga: jest to ignorowane, jeśli `scroll_acceleration.enabled` jest ustawione na `true`.** +- `theme` - Ustawia motyw interfejsu. [Dowiedz się więcej](/docs/themes). +- `keybinds` - Dostosowuje skróty klawiszowe. [Dowiedz się więcej](/docs/keybinds). +- `scroll_acceleration.enabled` — Włącz przyspieszenie przewijania w stylu macOS, aby zapewnić płynne, naturalne przewijanie. Po włączeniu prędkość przewijania wzrasta wraz z szybkimi gestami przewijania i pozostaje precyzyjna w przypadku wolniejszych ruchów. **To ustawienie ma pierwszeństwo przed `scroll_speed` i zastępuje je, gdy jest włączone.** +- `scroll_speed` - Kontroluje szybkość przewijania TUI podczas korzystania z poleceń przewijania (minimum: `0.001`, obsługuje wartości dziesiętne). Wartość domyślna to `3`. **Uwaga: jest to ignorowane, jeśli `scroll_acceleration.enabled` jest ustawione na `true`.** +- `diff_style` - Steruje renderowaniem różnic. `"auto"` dostosowuje się do szerokości terminala, `"stacked"` zawsze pokazuje układ jednokolumnowy. + +Użyj `OPENCODE_TUI_CONFIG`, aby załadować niestandardową ścieżkę konfiguracji TUI. --- diff --git a/packages/web/src/content/docs/pl/zen.mdx b/packages/web/src/content/docs/pl/zen.mdx index 6d5d8c0bd78..dbb75489cb6 100644 --- a/packages/web/src/content/docs/pl/zen.mdx +++ b/packages/web/src/content/docs/pl/zen.mdx @@ -62,8 +62,9 @@ Opłata jest pobierana za każde żądanie i możesz dodać kredyty do swojego k Dostęp do naszych modeli można również uzyskać za pośrednictwem następujących punktów końcowych API. -| Modelka | Identyfikator modelu | Punkt końcowy | Pakiet SDK AI | +| Model | Identyfikator modelu | Punkt końcowy | Pakiet SDK AI | | ------------------ | -------------------- | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -73,22 +74,24 @@ Dostęp do naszych modeli można również uzyskać za pośrednictwem następuj | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -114,32 +117,37 @@ https://opencode.ai/zen/v1/models Wspieramy model pay-as-you-go. Poniżej znajdują się ceny **za 1M tokenów**. -| Modelka | Wejście | Wyjście | Odczyt w pamięci podręcznej | Zapis w pamięci podręcznej | +| Model | Wejście | Wyjście | Odczyt w pamięci podręcznej | Zapis w pamięci podręcznej | | --------------------------------- | ------- | ------- | --------------------------- | -------------------------- | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -158,10 +166,8 @@ Opłaty za karty kredytowe są przenoszone na koszt (4,4% + 0,30 USD za transakc Darmowe modele: -- GLM 4.7 Free jest dostępny na platformie opencode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. -- Kimi K2.5 Free jest dostępny na opencode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. -- MiniMax M2.1 Free jest dostępny na platformie opencode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. -- Big Pickle to ukryty model, który jest bezpłatny w opencode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. +- MiniMax M2.5 Free jest dostępny w OpenCode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. +- Big Pickle to ukryty model, który jest bezpłatny w OpenCode przez ograniczony czas. Zespół wykorzystuje ten czas na zbieranie opinii i ulepszanie modelu. Skontaktuj się z nami, jeśli masz jakieś pytania. @@ -191,11 +197,9 @@ obciąży Cię kwotą wyższą niż 20 USD, jeśli saldo spadnie poniżej 5 USD. Wszystkie nasze modele są hostowane w USA. Nasi dostawcy przestrzegają polityki zerowego przechowywania i nie wykorzystują Twoich danych do szkolenia modeli, z następującymi wyjątkami: - Big Pickle: W okresie bezpłatnym zebrane dane mogą zostać wykorzystane do udoskonalenia modelu. -- GLM 4.7 Bezpłatna: W okresie bezpłatnym zebrane dane mogą zostać wykorzystane do udoskonalenia modelu. -- Kimi K2.5 Free: W okresie bezpłatnym zebrane dane mogą zostać wykorzystane do udoskonalenia modelu. -- MiniMax M2.1 Free: W okresie bezpłatnym zebrane dane mogą zostać wykorzystane do udoskonalenia modelu. +- MiniMax M2.5 Free: W okresie bezpłatnym zebrane dane mogą zostać wykorzystane do udoskonalenia modelu. - Interfejsy API OpenAI: żądania są przechowywane przez 30 dni zgodnie z [Zasadami dotyczącymi danych OpenAI](https://platform.openai.com/docs/guides/your-data). -- Interfejsy API Anthropic: żądania są przechowywane przez 30 dni zgodnie z [Zasadami dotyczącymi danych firmy Anthropic] (https://docs.anthropic.com/en/docs/claude-code/data-usage). +- Interfejsy API Anthropic: żądania są przechowywane przez 30 dni zgodnie z [Zasadami dotyczącymi danych firmy Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). --- diff --git a/packages/web/src/content/docs/pt-br/config.mdx b/packages/web/src/content/docs/pt-br/config.mdx index 405c5379456..4684bb199ec 100644 --- a/packages/web/src/content/docs/pt-br/config.mdx +++ b/packages/web/src/content/docs/pt-br/config.mdx @@ -14,10 +14,11 @@ O opencode suporta os formatos **JSON** e **JSONC** (JSON com Comentários). ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -34,7 +35,7 @@ Os arquivos de configuração são **mesclados**, não substituídos. Os arquivos de configuração são mesclados, não substituídos. As configurações das seguintes localizações de configuração são combinadas. Configurações posteriores substituem as anteriores apenas para chaves conflitantes. Configurações não conflitantes de todas as configurações são preservadas. -Por exemplo, se sua configuração global define `theme: "opencode"` e `autoupdate: true`, e sua configuração de projeto define `model: "anthropic/claude-sonnet-4-5"`, a configuração final incluirá as três configurações. +Por exemplo, se sua configuração global define `autoupdate: true` e sua configuração de projeto define `model: "anthropic/claude-sonnet-4-5"`, a configuração final incluirá as duas configurações. --- @@ -95,7 +96,9 @@ Você pode habilitar servidores específicos em sua configuração local: ### Global -Coloque sua configuração global do opencode em `~/.config/opencode/opencode.json`. Use a configuração global para preferências de usuário, como temas, provedores ou atalhos de teclado. +Coloque sua configuração global do opencode em `~/.config/opencode/opencode.json`. Use a configuração global para preferências de todo o usuário, como provedores, modelos e permissões. + +Para configurações específicas do TUI, use `~/.config/opencode/tui.json`. A configuração global substitui os padrões organizacionais remotos. @@ -105,6 +108,8 @@ A configuração global substitui os padrões organizacionais remotos. Adicione `opencode.json` na raiz do seu projeto. A configuração do projeto tem a maior precedência entre os arquivos de configuração padrão - ela substitui tanto as configurações globais quanto as remotas. +Para configurações específicas do TUI do projeto, adicione `tui.json` junto a ele. + :::tip Coloque a configuração específica do projeto na raiz do seu projeto. ::: @@ -143,7 +148,9 @@ O diretório personalizado é carregado após a configuração global e os diret ## Esquema -O arquivo de configuração tem um esquema que está definido em [**`opencode.ai/config.json`**](https://opencode.ai/config.json). +O esquema de configuração do servidor/tempo de execução é definido em [**`opencode.ai/config.json`**](https://opencode.ai/config.json). + +A configuração do TUI usa [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json). Seu editor deve ser capaz de validar e autocompletar com base no esquema. @@ -151,28 +158,24 @@ Seu editor deve ser capaz de validar e autocompletar com base no esquema. ### TUI -Você pode configurar as configurações específicas do TUI através da opção `tui`. +Use um arquivo `tui.json` (ou `tui.jsonc`) dedicado para configurações específicas do TUI. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Opções disponíveis: +Use `OPENCODE_TUI_CONFIG` para apontar para um arquivo de configuração TUI personalizado. -- `scroll_acceleration.enabled` - Habilitar aceleração de rolagem estilo macOS. **Tem precedência sobre `scroll_speed`.** -- `scroll_speed` - Multiplicador de velocidade de rolagem personalizada (padrão: `3`, mínimo: `1`). Ignorado se `scroll_acceleration.enabled` for `true`. -- `diff_style` - Controlar a renderização de diffs. `"auto"` se adapta à largura do terminal, `"stacked"` sempre mostra uma coluna única. +Chaves legadas `theme`, `keybinds` e `tui` em `opencode.json` estão obsoletas e são migradas automaticamente quando possível. -[Saiba mais sobre o uso do TUI aqui](/docs/tui). +[Saiba mais sobre a configuração do TUI aqui](/docs/tui#configure). --- @@ -298,12 +301,12 @@ Tokens Bearer (`AWS_BEARER_TOKEN_BEDROCK` ou `/connect`) têm precedência sobre ### Temas -Você pode configurar o tema que deseja usar em sua configuração do opencode através da opção `theme`. +Defina seu tema de interface em `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -403,11 +406,11 @@ Você também pode definir comandos usando arquivos markdown em `~/.config/openc ### Atalhos de teclado -Você pode personalizar seus atalhos de teclado através da opção `keybinds`. +Personalize atalhos de teclado em `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -487,13 +490,15 @@ Você pode controlar o comportamento de compactação de contexto através da op "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Compactar automaticamente a sessão quando o contexto estiver cheio (padrão: `true`). - `prune` - Remover saídas antigas de ferramentas para economizar tokens (padrão: `true`). +- `reserved` - Buffer de tokens para compactação. Deixa janela suficiente para evitar estouro durante a compactação --- @@ -673,6 +678,7 @@ Os caminhos dos arquivos podem ser: - Relativos ao diretório do arquivo de configuração - Ou caminhos absolutos começando com `/` ou `~` +- Esses são úteis para: diff --git a/packages/web/src/content/docs/pt-br/custom-tools.mdx b/packages/web/src/content/docs/pt-br/custom-tools.mdx index 43749200f86..515b8985a04 100644 --- a/packages/web/src/content/docs/pt-br/custom-tools.mdx +++ b/packages/web/src/content/docs/pt-br/custom-tools.mdx @@ -79,6 +79,32 @@ Isso cria duas ferramentas: `math_add` e `math_multiply`. --- +#### Colisões de nome com ferramentas integradas + +Ferramentas personalizadas são chaveadas pelo nome da ferramenta. Se uma ferramenta personalizada usar o mesmo nome que uma ferramenta integrada, a ferramenta personalizada tem precedência. + +Por exemplo, este arquivo substitui a ferramenta `bash` integrada: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Prefira nomes únicos, a menos que você queira intencionalmente substituir uma ferramenta integrada. Se você quiser desabilitar uma ferramenta integrada, mas não substituí-la, use [permissões](/docs/permissions). +::: + +--- + ### Argumentos Você pode usar `tool.schema`, que é apenas [Zod](https://zod.dev), para definir tipos de argumentos. @@ -126,7 +152,7 @@ export default tool({ }) ``` -Use `context.directory` para o diretório de trabalho da sessão. +Use `context.directory` para o diretório de trabalho da sessão. Use `context.worktree` para a raiz do worktree do git. --- diff --git a/packages/web/src/content/docs/pt-br/keybinds.mdx b/packages/web/src/content/docs/pt-br/keybinds.mdx index b4da4471aa5..1829763ade1 100644 --- a/packages/web/src/content/docs/pt-br/keybinds.mdx +++ b/packages/web/src/content/docs/pt-br/keybinds.mdx @@ -3,11 +3,11 @@ title: Atalhos de Teclado description: Personalize seus atalhos de teclado. --- -O opencode tem uma lista de atalhos de teclado que você pode personalizar através da configuração do opencode. +O opencode tem uma lista de atalhos de teclado que você pode personalizar através de `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -119,9 +119,9 @@ Você não precisa usar uma tecla líder para seus atalhos, mas recomendamos que Você pode desativar um atalho adicionando a tecla à sua configuração com um valor de "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/pt-br/lsp.mdx b/packages/web/src/content/docs/pt-br/lsp.mdx index 6baf1813b34..cd8937b244f 100644 --- a/packages/web/src/content/docs/pt-br/lsp.mdx +++ b/packages/web/src/content/docs/pt-br/lsp.mdx @@ -27,6 +27,7 @@ O opencode vem com vários servidores LSP integrados para linguagens populares: | gopls | .go | Comando `go` disponível | | hls | .hs, .lhs | Comando `haskell-language-server-wrapper` disponível | | jdtls | .java | `Java SDK (version 21+)` instalado | +| julials | .jl | `julia` e `LanguageServer.jl` instalados | | kotlin-ls | .kt, .kts | Instala automaticamente para projetos Kotlin | | lua-ls | .lua | Instala automaticamente para projetos Lua | | nixd | .nix | Comando `nixd` disponível | diff --git a/packages/web/src/content/docs/pt-br/plugins.mdx b/packages/web/src/content/docs/pt-br/plugins.mdx index bcf8f379bc3..54c5b1ffaca 100644 --- a/packages/web/src/content/docs/pt-br/plugins.mdx +++ b/packages/web/src/content/docs/pt-br/plugins.mdx @@ -307,6 +307,10 @@ O helper `tool` cria uma ferramenta personalizada que o opencode pode chamar. El Suas ferramentas personalizadas estarão disponíveis para o opencode junto com as ferramentas integradas. +:::note +Se uma ferramenta de plugin usar o mesmo nome que uma ferramenta integrada, a ferramenta de plugin tem precedência. +::: + --- ### Registro diff --git a/packages/web/src/content/docs/pt-br/providers.mdx b/packages/web/src/content/docs/pt-br/providers.mdx index 43f2e385f13..2ef2ebdc006 100644 --- a/packages/web/src/content/docs/pt-br/providers.mdx +++ b/packages/web/src/content/docs/pt-br/providers.mdx @@ -54,7 +54,39 @@ OpenCode Zen é uma lista de modelos fornecidos pela equipe do opencode que fora Se você é novo, recomendamos começar com o OpenCode Zen. ::: -1. Execute o comando `/connect` no TUI, selecione opencode e acesse [opencode.ai/auth](https://opencode.ai/auth). +1. Execute o comando `/connect` no TUI, selecione `OpenCode Zen` e acesse [opencode.ai/zen](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Faça login, adicione seus dados de cobrança e copie sua chave da API. + +3. Cole sua chave da API. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Execute `/models` no TUI para ver a lista de modelos que recomendamos. + + ```txt + /models + ``` + +Funciona como qualquer outro provedor no opencode e é completamente opcional. + +--- + +## OpenCode Go + +OpenCode Go é um plano de assinatura de baixo custo que fornece acesso confiável a modelos de codificação abertos populares fornecidos pela equipe do opencode que foram +testados e verificados para funcionar bem com o opencode. + +1. Execute o comando `/connect` no TUI, selecione `OpenCode Go` e acesse [opencode.ai/zen](https://opencode.ai/zen). ```txt /connect @@ -130,6 +162,8 @@ Para usar o Amazon Bedrock com o opencode: 2. **Configure a autenticação** usando um dos seguintes métodos: + *** + #### Variáveis de Ambiente (Início Rápido) Defina uma dessas variáveis de ambiente ao executar o opencode: @@ -152,6 +186,8 @@ Para usar o Amazon Bedrock com o opencode: export AWS_REGION=us-east-1 ``` + *** + #### Arquivo de Configuração (Recomendado) Para configuração específica do projeto ou persistente, use `opencode.json`: @@ -179,6 +215,8 @@ Para usar o Amazon Bedrock com o opencode: As opções do arquivo de configuração têm precedência sobre as variáveis de ambiente. ::: + *** + #### Avançado: Endpoints VPC Se você estiver usando endpoints VPC para Bedrock: @@ -202,12 +240,16 @@ Para usar o Amazon Bedrock com o opencode: A opção `endpoint` é um alias para a opção genérica `baseURL`, usando terminologia específica da AWS. Se tanto `endpoint` quanto `baseURL` forem especificados, `endpoint` tem precedência. ::: + *** + #### Métodos de Autenticação - **`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`**: Crie um usuário IAM e gere chaves de acesso no Console da AWS - **`AWS_PROFILE`**: Use perfis nomeados de `~/.aws/credentials`. Primeiro configure com `aws configure --profile my-profile` ou `aws sso login` - **`AWS_BEARER_TOKEN_BEDROCK`**: Gere chaves de API de longo prazo no console do Amazon Bedrock - **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**: Para EKS IRSA (IAM Roles for Service Accounts) ou outros ambientes Kubernetes com federação OIDC. Essas variáveis de ambiente são injetadas automaticamente pelo Kubernetes ao usar anotações de conta de serviço. + *** + #### Precedência de Autenticação O Amazon Bedrock usa a seguinte prioridade de autenticação: @@ -225,7 +267,8 @@ Para usar o Amazon Bedrock com o opencode: ``` :::note -Para perfis de inferência personalizados, use o nome do modelo e do provedor na chave e defina a propriedade `id` para o arn. Isso garante o cache correto: +Para perfis de inferência personalizados, use o nome do modelo e do provedor na chave e defina a propriedade `id` para o arn. Isso garante o cache correto. +::: ```json title="opencode.json" { @@ -243,8 +286,6 @@ Para perfis de inferência personalizados, use o nome do modelo e do provedor na } ``` -::: - --- ### Anthropic @@ -784,8 +825,6 @@ Para usar sua assinatura do GitHub Copilot com o opencode: :::note Alguns modelos podem precisar de uma [assinatura Pro+](https://github.com/features/copilot/plans) para usar. - -Alguns modelos precisam ser habilitados manualmente nas suas [configurações do GitHub Copilot](https://docs.github.com/en/copilot/how-tos/use-ai-models/configure-access-to-ai-models#setup-for-individual-use). ::: 1. Execute o comando `/connect` e procure por GitHub Copilot. @@ -803,7 +842,8 @@ Alguns modelos precisam ser habilitados manualmente nas suas [configurações do │ │ Digite o código: 8F43-6FCF │ - └ Aguardando autorização... + │ Aguardando autorização... + └ ``` 3. Agora execute o comando `/models` para selecionar o modelo que você deseja. @@ -1309,6 +1349,7 @@ Recomendamos se inscrever para [ChatGPT Plus ou Pro](https://chatgpt.com/pricing │ │ ChatGPT Plus/Pro │ Inserir manualmente a chave de API + │ └ ``` @@ -1472,6 +1513,39 @@ SAP AI Core fornece acesso a mais de 40 modelos do OpenAI, Anthropic, Google, Am --- +### STACKIT + +O STACKIT AI Model Serving fornece um ambiente de hospedagem soberano totalmente gerenciado para modelos de IA, com foco em LLMs como Llama, Mistral e Qwen, com máxima soberania de dados na infraestrutura europeia. + +1. Vá para o [Portal STACKIT](https://portal.stackit.cloud), navegue até **AI Model Serving** e crie um token de autenticação para o seu projeto. + + :::tip + Você precisa de uma conta de cliente STACKIT, conta de usuário e projeto antes de criar tokens de autenticação. + ::: + +2. Execute o comando `/connect` e procure por **STACKIT**. + + ```txt + /connect + ``` + +3. Insira seu token de autenticação do STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Execute o comando `/models` para selecionar entre os modelos disponíveis, como _Qwen3-VL 235B_ ou _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Acesse o [painel OVHcloud](https://ovh.com/manager). Navegue até a seção `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` e na aba `API Keys`, clique em **Criar uma nova chave da API**. @@ -1751,10 +1825,9 @@ Você pode usar qualquer provedor compatível com OpenAI com o opencode. A maior ┌ Adicionar credencial │ - ▲ Isso armazena apenas uma credencial para myprovider - você precisará configurá-lo no opencode.json, verifique a documentação para exemplos. - │ - ◇ Digite sua chave de API - │ sk-... + ◆ Select provider + │ ... + │ ● Other └ ``` @@ -1765,10 +1838,8 @@ Você pode usar qualquer provedor compatível com OpenAI com o opencode. A maior ┌ Adicionar credencial │ - ▲ Isso armazena apenas uma credencial para myprovider - você precisará configurá-lo no opencode.json, verifique a documentação para exemplos. - │ - ◇ Digite sua chave de API - │ sk-... + ◇ Enter provider id + │ myprovider └ ``` @@ -1808,8 +1879,6 @@ Você pode usar qualquer provedor compatível com OpenAI com o opencode. A maior } } } - } - } } } ``` @@ -1856,18 +1925,6 @@ Aqui está um exemplo definindo as opções `apiKey`, `headers` e `limit` do mod } } } - } - }, - "models": { - "my-model-name": { - "name": "Nome de Exibição do Meu Modelo", - "limit": { - "context": 200000, - "output": 65536 - } - } - } - } } } ``` diff --git a/packages/web/src/content/docs/pt-br/sdk.mdx b/packages/web/src/content/docs/pt-br/sdk.mdx index 672b852f6be..7fd765e4c14 100644 --- a/packages/web/src/content/docs/pt-br/sdk.mdx +++ b/packages/web/src/content/docs/pt-br/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Saída Estruturada + +Você pode solicitar uma saída JSON estruturada do modelo especificando um `format` com um esquema JSON. O modelo usará uma ferramenta `StructuredOutput` para retornar um JSON validado correspondente ao seu esquema. + +### Uso Básico + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Acessar a saída estruturada +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Tipos de Formato de Saída + +| Tipo | Descrição | +| ------------- | --------------------------------------------------------- | +| `text` | Padrão. Resposta de texto padrão (sem saída estruturada) | +| `json_schema` | Retorna JSON validado correspondente ao esquema fornecido | + +### Formato do Esquema JSON + +Ao usar `type: 'json_schema'`, forneça: + +| Campo | Tipo | Descrição | +| ------------ | --------------- | -------------------------------------------------------------- | +| `type` | `'json_schema'` | Obrigatório. Especifica o modo de esquema JSON | +| `schema` | `object` | Obrigatório. Objeto JSON Schema definindo a estrutura de saída | +| `retryCount` | `number` | Opcional. Número de tentativas de validação (padrão: 2) | + +### Tratamento de Erros + +Se o modelo falhar em produzir uma saída estruturada válida após todas as tentativas, a resposta incluirá um `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Melhores Práticas + +1. **Forneça descrições claras** nas propriedades do seu esquema para ajudar o modelo a entender quais dados extrair +2. **Use `required`** para especificar quais campos devem estar presentes +3. **Mantenha os esquemas focados** - esquemas aninhados complexos podem ser mais difíceis para o modelo preencher corretamente +4. **Defina um `retryCount` apropriado** - aumente para esquemas complexos, diminua para os simples + +--- + ## APIs O SDK expõe todas as APIs do servidor através de um cliente seguro em tipos. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Sessões -| Método | Descrição | Notas | -| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | Listar sessões | Retorna Session[]| -| `session.get({ path })` | Obter sessão | RetornaSession| -| `session.children({ path })` | Listar sessões filhas | RetornaSession[]| -| `session.create({ body })` | Criar sessão | RetornaSession| -| `session.delete({ path })` | Deletar sessão | Retorna `boolean` | -| `session.update({ path, body })` | Atualizar propriedades da sessão | RetornaSession| -| `session.init({ path, body })` | Analisar app e criar `AGENTS.md` | Retorna `boolean` | -| `session.abort({ path })` | Abortar uma sessão em execução | Retorna `boolean` | -| `session.share({ path })` | Compartilhar sessão | RetornaSession| -| `session.unshare({ path })` | Descompartilhar sessão | RetornaSession| -| `session.summarize({ path, body })` | Resumir sessão | Retorna `boolean` | -| `session.messages({ path })` | Listar mensagens em uma sessão | Retorna `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Obter detalhes da mensagem | Retorna `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Enviar mensagem de prompt | `body.noReply: true` retorna UserMessage (apenas contexto). O padrão retornaAssistantMessagecom resposta da AI | -| `session.command({ path, body })` | Enviar comando para a sessão | Retorna `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Executar um comando shell | RetornaAssistantMessage| -| `session.revert({ path, body })` | Reverter uma mensagem | RetornaSession| -| `session.unrevert({ path })` | Restaurar mensagens revertidas | RetornaSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a um pedido de permissão | Retorna `boolean` | +| Método | Descrição | Notas | +| ---------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `session.list()` | Listar sessões | RetornaSession[]| +| `session.get({ path })` | Obter sessão | RetornaSession| +| `session.children({ path })` | Listar sessões filhas | RetornaSession[]| +| `session.create({ body })` | Criar sessão | RetornaSession| +| `session.delete({ path })` | Deletar sessão | Retorna `boolean` | +| `session.update({ path, body })` | Atualizar propriedades da sessão | RetornaSession| +| `session.init({ path, body })` | Analisar app e criar `AGENTS.md` | Retorna `boolean` | +| `session.abort({ path })` | Abortar uma sessão em execução | Retorna `boolean` | +| `session.share({ path })` | Compartilhar sessão | RetornaSession| +| `session.unshare({ path })` | Descompartilhar sessão | RetornaSession| +| `session.summarize({ path, body })` | Resumir sessão | Retorna `boolean` | +| `session.messages({ path })` | Listar mensagens em uma sessão | Retorna `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Obter detalhes da mensagem | Retorna `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Enviar mensagem de prompt | `body.noReply: true` retorna UserMessage (apenas contexto). O padrão retornaAssistantMessagecom resposta da AI. Suporta `body.outputFormat` para [saída estruturada](#saída-estruturada) | +| `session.command({ path, body })` | Enviar comando para a sessão | Retorna `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Executar um comando shell | RetornaAssistantMessage| +| `session.revert({ path, body })` | Reverter uma mensagem | RetornaSession| +| `session.unrevert({ path })` | Restaurar mensagens revertidas | RetornaSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a um pedido de permissão | Retorna `boolean` | --- diff --git a/packages/web/src/content/docs/pt-br/themes.mdx b/packages/web/src/content/docs/pt-br/themes.mdx index a1a5083cb86..5706d6e8366 100644 --- a/packages/web/src/content/docs/pt-br/themes.mdx +++ b/packages/web/src/content/docs/pt-br/themes.mdx @@ -61,11 +61,11 @@ O tema do sistema é para usuários que: ## Usando um tema -Você pode selecionar um tema chamando a seleção de tema com o comando `/theme`. Ou você pode especificá-lo em sua [configuração](/docs/config). +Você pode selecionar um tema chamando a seleção de tema com o comando `/theme`. Ou você pode especificá-lo em `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/pt-br/tui.mdx b/packages/web/src/content/docs/pt-br/tui.mdx index 17b9c7de0b3..67de2138b6f 100644 --- a/packages/web/src/content/docs/pt-br/tui.mdx +++ b/packages/web/src/content/docs/pt-br/tui.mdx @@ -234,7 +234,7 @@ Compartilhe a sessão atual. [Saiba mais](/docs/share). Liste os temas disponíveis. ```bash frame="none" -/theme +/themes ``` **Atalho:** `ctrl+x t` @@ -352,24 +352,34 @@ Alguns editores precisam de argumentos de linha de comando para rodar em modo bl ## Configuração -Você pode personalizar o comportamento do TUI através do seu arquivo de configuração do opencode. +Você pode personalizar o comportamento do TUI através de `tui.json` (ou `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Isso é separado do `opencode.json`, que configura o comportamento do servidor/runtime. + ### Opções -- `scroll_acceleration` - Ative a aceleração de rolagem no estilo macOS para uma rolagem suave e natural. Quando ativado, a velocidade de rolagem aumenta com gestos de rolagem rápidos e permanece precisa para movimentos mais lentos. **Esta configuração tem precedência sobre `scroll_speed` e a substitui quando ativada.** -- `scroll_speed` - Controla quão rápido o TUI rola ao usar comandos de rolagem (mínimo: `1`). O padrão é `3`. **Nota: Isso é ignorado se `scroll_acceleration.enabled` estiver definido como `true`.** +- `theme` - Define o tema da sua interface. [Saiba mais](/docs/themes). +- `keybinds` - Personaliza atalhos de teclado. [Saiba mais](/docs/keybinds). +- `scroll_acceleration.enabled` - Ative a aceleração de rolagem no estilo macOS para uma rolagem suave e natural. Quando ativado, a velocidade de rolagem aumenta com gestos de rolagem rápidos e permanece precisa para movimentos mais lentos. **Esta configuração tem precedência sobre `scroll_speed` e a substitui quando ativada.** +- `scroll_speed` - Controla quão rápido o TUI rola ao usar comandos de rolagem (mínimo: `0.001`, suporta valores decimais). O padrão é `3`. **Nota: Isso é ignorado se `scroll_acceleration.enabled` estiver definido como `true`.** +- `diff_style` - Controla a renderização de diffs. `"auto"` se adapta à largura do terminal, `"stacked"` sempre mostra um layout de coluna única. + +Use `OPENCODE_TUI_CONFIG` para carregar um caminho de configuração TUI personalizado. --- diff --git a/packages/web/src/content/docs/pt-br/zen.mdx b/packages/web/src/content/docs/pt-br/zen.mdx index 203f0b3f9df..2ec969d7202 100644 --- a/packages/web/src/content/docs/pt-br/zen.mdx +++ b/packages/web/src/content/docs/pt-br/zen.mdx @@ -1,19 +1,19 @@ --- title: Zen -description: Lista selecionada de modelos fornecidos pelo opencode. +description: Lista selecionada de modelos fornecidos pelo OpenCode. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` -O OpenCode Zen é uma lista de modelos testados e verificados fornecidos pela equipe do opencode. +O OpenCode Zen é uma lista de modelos testados e verificados fornecidos pela equipe do OpenCode. :::note O OpenCode Zen está atualmente em beta. ::: -O Zen funciona como qualquer outro provedor no opencode. Você faz login no OpenCode Zen e obtém sua chave de API. É **completamente opcional** e você não precisa usá-lo para utilizar o opencode. +O Zen funciona como qualquer outro provedor no OpenCode. Você faz login no OpenCode Zen e obtém sua chave de API. É **completamente opcional** e você não precisa usá-lo para utilizar o OpenCode. --- @@ -22,7 +22,7 @@ O Zen funciona como qualquer outro provedor no opencode. Você faz login no Open Existe um grande número de modelos disponíveis, mas apenas alguns desses modelos funcionam bem como agentes de codificação. Além disso, a maioria dos provedores é configurada de maneira muito diferente; portanto, você obtém desempenhos e qualidades muito diferentes. :::tip -Testamos um grupo selecionado de modelos e provedores que funcionam bem com o opencode. +Testamos um grupo selecionado de modelos e provedores que funcionam bem com o OpenCode. ::: Portanto, se você estiver usando um modelo através de algo como OpenRouter, você nunca pode ter certeza se está obtendo a melhor versão do modelo que deseja. @@ -39,7 +39,7 @@ O OpenCode Zen é um gateway de IA que lhe dá acesso a esses modelos. ## Como funciona -O OpenCode Zen funciona como qualquer outro provedor no opencode. +O OpenCode Zen funciona como qualquer outro provedor no OpenCode. 1. Você faz login no **OpenCode Zen**, adiciona seus dados de cobrança e copia sua chave de API. 2. Você executa o comando `/connect` no TUI, seleciona OpenCode Zen e cola sua chave de API. @@ -55,6 +55,7 @@ Você também pode acessar nossos modelos através dos seguintes endpoints da AP | Modelo | ID do Modelo | Endpoint | Pacote AI SDK | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -64,28 +65,30 @@ Você também pode acessar nossos modelos através dos seguintes endpoints da AP | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Big Pickle | big-pickle | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -O [id do modelo](/docs/config/#models) na sua configuração do opencode usa o formato `opencode/`. Por exemplo, para GPT 5.2 Codex, você usaria `opencode/gpt-5.2-codex` na sua configuração. +O [id do modelo](/docs/config/#models) na sua configuração do OpenCode usa o formato `opencode/ `. Por exemplo, para GPT 5.2 Codex, você usaria `opencode/gpt-5.2-codex` na sua configuração. --- @@ -106,29 +109,34 @@ Nós suportamos um modelo de pagamento conforme o uso. Abaixo estão os preços | Modelo | Entrada | Saída | Leitura em Cache | Escrita em Cache | | --------------------------------- | ------- | ------ | ---------------- | ---------------- | | Big Pickle | Grátis | Grátis | Grátis | - | -| MiniMax M2.1 Free | Grátis | Grátis | Grátis | - | +| MiniMax M2.5 Free | Grátis | Grátis | Grátis | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Grátis | Grátis | Grátis | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Grátis | Grátis | Grátis | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -147,10 +155,8 @@ As taxas de cartão de crédito são repassadas ao custo (4,4% + $0,30 por trans Os modelos gratuitos: -- GLM 4.7 Free está disponível no opencode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. -- Kimi K2.5 Free está disponível no opencode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. -- MiniMax M2.1 Free está disponível no opencode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. -- Big Pickle é um modelo oculto que está gratuito no opencode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. +- MiniMax M2.5 Free está disponível no OpenCode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. +- Big Pickle é um modelo oculto que está gratuito no OpenCode por tempo limitado. A equipe está usando esse tempo para coletar feedback e melhorar o modelo. Entre em contato conosco se você tiver alguma dúvida. @@ -177,9 +183,7 @@ Por exemplo, digamos que você defina um limite de uso mensal de $20, o Zen não Todos os nossos modelos estão hospedados nos EUA. Nossos provedores seguem uma política de zero retenção e não usam seus dados para treinamento de modelos, com as seguintes exceções: - Big Pickle: Durante seu período gratuito, os dados coletados podem ser usados para melhorar o modelo. -- GLM 4.7 Free: Durante seu período gratuito, os dados coletados podem ser usados para melhorar o modelo. -- Kimi K2.5 Free: Durante seu período gratuito, os dados coletados podem ser usados para melhorar o modelo. -- MiniMax M2.1 Free: Durante seu período gratuito, os dados coletados podem ser usados para melhorar o modelo. +- MiniMax M2.5 Free: Durante seu período gratuito, os dados coletados podem ser usados para melhorar o modelo. - APIs da OpenAI: As solicitações são retidas por 30 dias de acordo com as [Políticas de Dados da OpenAI](https://platform.openai.com/docs/guides/your-data). - APIs da Anthropic: As solicitações são retidas por 30 dias de acordo com as [Políticas de Dados da Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). @@ -233,4 +237,4 @@ Criamos o OpenCode Zen para: 1. **Benchmark** os melhores modelos/provedores para agentes de codificação. 2. Ter acesso às opções de **mais alta qualidade** e não degradar o desempenho ou redirecionar para provedores mais baratos. 3. Repassar quaisquer **reduções de preço** vendendo ao custo; assim, a única margem é para cobrir nossas taxas de processamento. -4. Não ter **vinculação** permitindo que você o use com qualquer outro agente de codificação. E sempre permitir que você use qualquer outro provedor com o opencode também. +4. Não ter **vinculação** permitindo que você o use com qualquer outro agente de codificação. E sempre permitir que você use qualquer outro provedor com o OpenCode também. diff --git a/packages/web/src/content/docs/ru/cli.mdx b/packages/web/src/content/docs/ru/cli.mdx index 1a1003a63a1..5fa85a18fce 100644 --- a/packages/web/src/content/docs/ru/cli.mdx +++ b/packages/web/src/content/docs/ru/cli.mdx @@ -558,6 +558,7 @@ opencode можно настроить с помощью переменных с | `OPENCODE_AUTO_SHARE` | логическое значение | Автоматически делиться сеансами | | `OPENCODE_GIT_BASH_PATH` | строка | Путь к исполняемому файлу Git Bash в Windows | | `OPENCODE_CONFIG` | строка | Путь к файлу конфигурации | +| `OPENCODE_TUI_CONFIG` | строка | Путь к файлу конфигурации TUI | | `OPENCODE_CONFIG_DIR` | строка | Путь к каталогу конфигурации | | `OPENCODE_CONFIG_CONTENT` | строка | Встроенное содержимое конфигурации json | | `OPENCODE_DISABLE_AUTOUPDATE` | логическое значение | Отключить автоматическую проверку обновлений | diff --git a/packages/web/src/content/docs/ru/config.mdx b/packages/web/src/content/docs/ru/config.mdx index 14af31cfd76..5d91dc5e01b 100644 --- a/packages/web/src/content/docs/ru/config.mdx +++ b/packages/web/src/content/docs/ru/config.mdx @@ -97,6 +97,8 @@ opencode поддерживает форматы **JSON** и **JSONC** (JSON с Поместите глобальную конфигурацию opencode в `~/.config/opencode/opencode.json`. Используйте глобальную конфигурацию для общепользовательских настроек, таких как темы, поставщики или привязки клавиш. +Для настроек, специфичных для TUI, используйте `~/.config/opencode/tui.json`. + Глобальная конфигурация переопределяет настройки по умолчанию для удаленной организации. --- @@ -105,6 +107,8 @@ opencode поддерживает форматы **JSON** и **JSONC** (JSON с Добавьте `opencode.json` в корень вашего проекта. Конфигурация проекта имеет наивысший приоритет среди стандартных файлов конфигурации — она переопределяет как глобальные, так и удаленные конфигурации. +Для настроек TUI, специфичных для проекта, добавьте `tui.json` рядом с ним. + :::tip Поместите конфигурацию конкретного проекта в корень вашего проекта. ::: @@ -145,34 +149,32 @@ opencode run "Hello world" Файл конфигурации имеет схему, определенную в [**`opencode.ai/config.json`**](https://opencode.ai/config.json). +Конфигурация TUI использует [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json). + Ваш редактор должен иметь возможность проверять и автозаполнять данные на основе схемы. --- ### TUI -Вы можете настроить параметры TUI с помощью опции `tui`. +Используйте специальный файл `tui.json` (или `tui.jsonc`) для настроек, специфичных для TUI. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Доступные варианты: +Используйте `OPENCODE_TUI_CONFIG`, чтобы указать на пользовательский файл конфигурации TUI. -- `scroll_acceleration.enabled` — включить ускорение прокрутки в стиле MacOS. **Имеет приоритет над `scroll_speed`.** -- `scroll_speed` — пользовательский множитель скорости прокрутки (по умолчанию: `3`, минимум: `1`). Игнорируется, если `scroll_acceleration.enabled` равен `true`. -- `diff_style` — управление рендерингом различий. `"auto"` адаптируется к ширине terminal, `"stacked"` всегда отображает один столбец. +Устаревшие ключи `theme`, `keybinds` и `tui` в `opencode.json` устарели и автоматически переносятся, когда это возможно. -[Подробнее об использовании TUI можно узнать здесь](/docs/tui). +[Подробнее об использовании TUI можно узнать здесь](/docs/tui#configure). --- @@ -298,12 +300,12 @@ Amazon Bedrock поддерживает конфигурацию, специфи ### theme -Вы можете настроить тему, которую хотите использовать, в конфигурации opencode с помощью опции `theme`. +Установите тему пользовательского интерфейса в `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -403,11 +405,11 @@ Amazon Bedrock поддерживает конфигурацию, специфи ### Сочетания клавиш -Вы можете настроить привязки клавиш с помощью опции `keybinds`. +Настройте привязки клавиш в `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -487,13 +489,15 @@ opencode автоматически загрузит все новые обно "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` — автоматически сжимать сеанс при заполнении контекста (по умолчанию: `true`). - `prune` — удалить старые выходные данные инструмента для сохранения токенов (по умолчанию: `true`). +- `reserved` — Буфер токенов для сжатия. Оставляет достаточное окно, чтобы избежать переполнения во время сжатия. --- diff --git a/packages/web/src/content/docs/ru/keybinds.mdx b/packages/web/src/content/docs/ru/keybinds.mdx index 67d191ea2ca..8a9a14ca1ae 100644 --- a/packages/web/src/content/docs/ru/keybinds.mdx +++ b/packages/web/src/content/docs/ru/keybinds.mdx @@ -3,11 +3,11 @@ title: Сочетания клавиш description: Настройте свои сочетания клавиш. --- -opencode имеет список сочетаний клавиш, которые вы можете настроить через конфигурацию opencode. +opencode имеет список сочетаний клавиш, которые вы можете настроить через `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ opencode использует клавишу `leader` для большинст ## Отключение привязки клавиш -Вы можете отключить привязку клавиш, добавив ключ в свою конфигурацию со значением «none». +Вы можете отключить привязку клавиш, добавив ключ в `tui.json` со значением «none». -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/ru/providers.mdx b/packages/web/src/content/docs/ru/providers.mdx index 5984c89f43b..c36dfd9f78c 100644 --- a/packages/web/src/content/docs/ru/providers.mdx +++ b/packages/web/src/content/docs/ru/providers.mdx @@ -57,7 +57,39 @@ OpenCode Zen — это список моделей, предоставленн Если вы новичок, мы рекомендуем начать с OpenCode Zen. ::: -1. Запустите команду `/connect` в TUI, выберите opencode и перейдите по адресу [opencode.ai/auth](https://opencode.ai/auth). +1. Запустите команду `/connect` в TUI, выберите `OpenCode Zen` и перейдите по адресу [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Войдите в систему, добавьте свои платежные данные и скопируйте ключ API. + +3. Вставьте свой ключ API. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Запустите `/models` в TUI, чтобы просмотреть список рекомендуемых нами моделей. + + ```txt + /models + ``` + +Он работает как любой другой поставщик в opencode и его использование совершенно необязательно. + +--- + +## OpenCode Go + +OpenCode Go — это недорогой план подписки, обеспечивающий надежный доступ к популярным открытым моделям кодирования, предоставляемым командой opencode, которые были +протестированы и проверены на хорошую работу с opencode. + +1. Запустите команду `/connect` в TUI, выберите `OpenCode Go` и перейдите по адресу [opencode.ai/auth](https://opencode.ai/zen). ```txt /connect @@ -1479,6 +1511,39 @@ SAP AI Core предоставляет доступ к более чем 40 мо --- +### STACKIT + +STACKIT AI Model Serving предоставляет полностью управляемую суверенную среду хостинга для моделей ИИ, ориентированную на LLM, таких как Llama, Mistral и Qwen, с максимальным суверенитетом данных в европейской инфраструктуре. + +1. Перейдите на [портал STACKIT](https://portal.stackit.cloud), перейдите в **AI Model Serving** и создайте токен аутентификации для своего проекта. + + :::tip + Вам необходима учетная запись клиента STACKIT, учетная запись пользователя и проект перед созданием токенов аутентификации. + ::: + +2. Запустите команду `/connect` и найдите **STACKIT**. + + ```txt + /connect + ``` + +3. Введите свой токен аутентификации STACKIT AI Model Serving. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Запустите команду `/models`, чтобы выбрать одну из доступных моделей, например _Qwen3-VL 235B_ или _Llama 3.3 70B_. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. Перейдите к [OVHcloud Panel](https://ovh.com/manager). Перейдите в раздел `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` и на вкладке `API Keys` нажмите **Создать новый ключ API**. diff --git a/packages/web/src/content/docs/ru/sdk.mdx b/packages/web/src/content/docs/ru/sdk.mdx index 1269d9fc083..0afdea1b6ff 100644 --- a/packages/web/src/content/docs/ru/sdk.mdx +++ b/packages/web/src/content/docs/ru/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Структурированный вывод + +Вы можете запросить структурированный вывод JSON от модели, указав `format` со схемой JSON. Модель будет использовать инструмент `StructuredOutput` для возврата проверенного JSON, соответствующего вашей схеме. + +### Основное использование + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Типы форматов вывода + +| Тип | Описание | +| ------------- | ------------------------------------------------------------------------- | +| `text` | По умолчанию. Стандартный текстовый ответ (без структурированного вывода) | +| `json_schema` | Возвращает проверенный JSON, соответствующий предоставленной схеме | + +### Формат схемы JSON + +При использовании `type: 'json_schema'`, укажите: + +| Поле | Тип | Описание | +| ------------ | --------------- | ---------------------------------------------------------------------- | +| `type` | `'json_schema'` | Обязательно. Указывает режим схемы JSON | +| `schema` | `object` | Обязательно. Объект JSON Schema, определяющий структуру вывода | +| `retryCount` | `number` | Необязательно. Количество повторных попыток проверки (по умолчанию: 2) | + +### Обработка ошибок + +Если модель не может выдать действительный структурированный вывод после всех повторных попыток, ответ будет включать `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### Лучшие практики + +1. **Предоставляйте четкие описания** в свойствах вашей схемы, чтобы помочь модели понять, какие данные извлекать +2. **Используйте `required`**, чтобы указать, какие поля должны присутствовать +3. **Делайте схемы сфокусированными** — сложные вложенные схемы могут быть труднее для правильного заполнения моделью +4. **Устанавливайте соответствующий `retryCount`** — увеличивайте для сложных схем, уменьшайте для простых + +--- + ## API SDK предоставляет все серверные API через типобезопасный клиент. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Сессии -| Метод | Описание | Примечания | -| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | List sessions | Returns Session[]| -| `session.get({ path })` | Get session | ReturnsSession| -| `session.children({ path })` | List child sessions | ReturnsSession[]| -| `session.create({ body })` | Create session | ReturnsSession| -| `session.delete({ path })` | Delete session | Returns `boolean` | -| `session.update({ path, body })` | Update session properties | ReturnsSession| -| `session.init({ path, body })` | Analyze app and create `AGENTS.md` | Returns `boolean` | -| `session.abort({ path })` | Abort a running session | Returns `boolean` | -| `session.share({ path })` | Share session | ReturnsSession| -| `session.unshare({ path })` | Unshare session | ReturnsSession| -| `session.summarize({ path, body })` | Summarize session | Returns `boolean` | -| `session.messages({ path })` | List messages in a session | Returns `{ info: `Message`, parts: `Part[]`}[]` | -| `session.message({ path })` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` | -| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returnsAssistantMessagewith AI response | -| `session.command({ path, body })` | Send command to session | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` | -| `session.shell({ path, body })` | Run a shell command | ReturnsAssistantMessage| -| `session.revert({ path, body })` | Revert a message | ReturnsSession| -| `session.unrevert({ path })` | Restore reverted messages | ReturnsSession| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` | +| Метод | Описание | Примечания | +| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | List sessions | ReturnsSession[]| +| `session.get({ path })` | Get session | ReturnsSession| +| `session.children({ path })` | List child sessions | ReturnsSession[]| +| `session.create({ body })` | Create session | ReturnsSession| +| `session.delete({ path })` | Delete session | Returns `boolean` | +| `session.update({ path, body })` | Update session properties | ReturnsSession| +| `session.init({ path, body })` | Analyze app and create `AGENTS.md` | Returns `boolean` | +| `session.abort({ path })` | Abort a running session | Returns `boolean` | +| `session.share({ path })` | Share session | ReturnsSession| +| `session.unshare({ path })` | Unshare session | ReturnsSession| +| `session.summarize({ path, body })` | Summarize session | Returns `boolean` | +| `session.messages({ path })` | List messages in a session | Returns `{ info: `Message`, parts: `Part[]`}[]` | +| `session.message({ path })` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` | +| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` возвращает UserMessage (только контекст). По умолчанию возвращаетAssistantMessageс ответом ИИ. Поддерживает `body.outputFormat` для [структурированного вывода](#структурированный-вывод) | +| `session.command({ path, body })` | Send command to session | Returns `{ info: `AssistantMessage`, parts: `Part[]`}` | +| `session.shell({ path, body })` | Run a shell command | ReturnsAssistantMessage| +| `session.revert({ path, body })` | Revert a message | ReturnsSession| +| `session.unrevert({ path })` | Restore reverted messages | ReturnsSession| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` | --- diff --git a/packages/web/src/content/docs/ru/server.mdx b/packages/web/src/content/docs/ru/server.mdx index 898789c29ac..2356543dff2 100644 --- a/packages/web/src/content/docs/ru/server.mdx +++ b/packages/web/src/content/docs/ru/server.mdx @@ -18,13 +18,13 @@ opencode serve [--port] [--hostname ] [--cors ] #### Параметры -| Флаг | Описание | По умолчанию | -| --------------- | ----------------------------------- | ---------------- | -| `--port` | Port to listen on | `4096` | -| `--hostname` | Hostname to listen on | `127.0.0.1` | -| `--mdns` | Enable mDNS discovery | `false` | -| `--mdns-domain` | Custom domain name for mDNS service | `opencode.local` | -| `--cors` | Additional browser origins to allow | `[]` | +| Флаг | Описание | По умолчанию | +| --------------- | ------------------------------------------- | ---------------- | +| `--port` | Порт для прослушивания | `4096` | +| `--hostname` | Имя хоста для прослушивания | `127.0.0.1` | +| `--mdns` | Включить обнаружение mDNS | `false` | +| `--mdns-domain` | Пользовательское доменное имя для mDNS | `opencode.local` | +| `--cors` | Разрешенные дополнительные источники (CORS) | `[]` | `--cors` можно передать несколько раз: @@ -89,10 +89,10 @@ For example, `http://localhost:4096/doc`. Use the spec to generate clients or in ### Глобальный -| Метод | Путь | Описание | Ответ | -| ----- | ---------------- | ------------------------------ | ------------------------------------ | -| `GET` | `/global/health` | Get server health and version | `{ healthy: true, version: string }` | -| `GET` | `/global/event` | Get global events (SSE stream) | Event stream | +| Метод | Путь | Описание | Ответ | +| ----- | ---------------- | --------------------------------------- | ------------------------------------ | +| `GET` | `/global/health` | Получить состояние и версию сервера | `{ healthy: true, version: string }` | +| `GET` | `/global/event` | Получить глобальные события (поток SSE) | Поток событий | --- @@ -100,105 +100,105 @@ For example, `http://localhost:4096/doc`. Use the spec to generate clients or in | Метод | Путь | Описание | Ответ | | ----- | ------------------ | ----------------------- | --------------------------------------------- | -| `GET` | `/project` | List all projects | Project[]| -| `GET` | `/project/current` | Get the current project |Project| +| `GET` | `/project` | Список всех проектов |Project[]| +| `GET` | `/project/current` | Получить текущий проект |Project| --- ### Путь и система контроля версий -| Метод | Путь | Описание | Ответ | -| ----- | ------- | ------------------------------------ | ------------------------------------------- | -| `GET` | `/path` | Get the current path |Path| -| `GET` | `/vcs` | Get VCS info for the current project |VcsInfo| +| Метод | Путь | Описание | Ответ | +| ----- | ------- | ---------------------------------------------- | ------------------------------------------- | +| `GET` | `/path` | Получить текущий путь |Path| +| `GET` | `/vcs` | Получить информацию о VCS для текущего проекта |VcsInfo| --- ### Экземпляр -| Метод | Путь | Описание | Ответ | -| ------ | ------------------- | ---------------------------- | --------- | -| `POST` | `/instance/dispose` | Dispose the current instance | `boolean` | +| Метод | Путь | Описание | Ответ | +| ------ | ------------------- | ------------------------- | --------- | +| `POST` | `/instance/dispose` | Удалить текущий экземпляр | `boolean` | --- ### Конфигурация -| Метод | Путь | Описание | Ответ | -| ------- | ------------------- | --------------------------------- | ---------------------------------------------------------------------------------------- | -| `GET` | `/config` | Get config info |Config| -| `PATCH` | `/config` | Update config |Config| -| `GET` | `/config/providers` | List providers and default models | `{ providers: `Provider[]`, default: { [key: string]: string } }` | +| Метод | Путь | Описание | Ответ | +| ------- | ------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- | +| `GET` | `/config` | Получить информацию о конфигурации |Config| +| `PATCH` | `/config` | Обновить конфигурацию |Config| +| `GET` | `/config/providers` | Список провайдеров и моделей по умолчанию | `{ providers: `Provider[]`, default: { [key: string]: string } }` | --- ### Поставщик -| Метод | Путь | Описание | Ответ | -| ------ | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- | -| `GET` | `/provider` | List all providers | `{ all: `Provider[]`, default: {...}, connected: string[] }` | -| `GET` | `/provider/auth` | Get provider authentication methods | `{ [providerID: string]: `ProviderAuthMethod[]` }` | -| `POST` | `/provider/{id}/oauth/authorize` | Authorize a provider using OAuth |ProviderAuthAuthorization| -| `POST` | `/provider/{id}/oauth/callback` | Handle OAuth callback for a provider | `boolean` | +| Метод | Путь | Описание | Ответ | +| ------ | -------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- | +| `GET` | `/provider` | Список всех провайдеров | `{ all: `Provider[]`, default: {...}, connected: string[] }` | +| `GET` | `/provider/auth` | Получить методы аутентификации провайдера | `{ [providerID: string]: `ProviderAuthMethod[]` }` | +| `POST` | `/provider/{id}/oauth/authorize` | Авторизация провайдера через OAuth |ProviderAuthAuthorization| +| `POST` | `/provider/{id}/oauth/callback` | Обработка callback OAuth для провайдера | `boolean` | --- ### Сессии -| Метод | Путь | Описание | Примечания | -| -------- | ---------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- | -| `GET` | `/session` | List all sessions | ReturnsSession[]| -| `POST` | `/session` | Create a new session | body: `{ parentID?, title? }`, returnsSession| -| `GET` | `/session/status` | Get session status for all sessions | Returns `{ [sessionID: string]: `SessionStatus` }` | -| `GET` | `/session/:id` | Get session details | ReturnsSession| -| `DELETE` | `/session/:id` | Delete a session and all its data | Returns `boolean` | -| `PATCH` | `/session/:id` | Update session properties | body: `{ title? }`, returnsSession| -| `GET` | `/session/:id/children` | Get a session's child sessions | ReturnsSession[]| -| `GET` | `/session/:id/todo` | Get the todo list for a session | ReturnsTodo[]| -| `POST` | `/session/:id/init` | Analyze app and create `AGENTS.md` | body: `{ messageID, providerID, modelID }`, returns `boolean` | -| `POST` | `/session/:id/fork` | Fork an existing session at a message | body: `{ messageID? }`, returnsSession| -| `POST` | `/session/:id/abort` | Abort a running session | Returns `boolean` | -| `POST` | `/session/:id/share` | Share a session | ReturnsSession| -| `DELETE` | `/session/:id/share` | Unshare a session | ReturnsSession| -| `GET` | `/session/:id/diff` | Get the diff for this session | query: `messageID?`, returnsFileDiff[]| -| `POST` | `/session/:id/summarize` | Summarize the session | body: `{ providerID, modelID }`, returns `boolean` | -| `POST` | `/session/:id/revert` | Revert a message | body: `{ messageID, partID? }`, returns `boolean` | -| `POST` | `/session/:id/unrevert` | Restore all reverted messages | Returns `boolean` | -| `POST` | `/session/:id/permissions/:permissionID` | Respond to a permission request | body: `{ response, remember? }`, returns `boolean` | +| Метод | Путь | Описание | Примечания | +| -------- | ---------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------- | +| `GET` | `/session` | Список всех сессий | ВозвращаетSession[]| +| `POST` | `/session` | Создать новую сессию | body: `{ parentID?, title? }`, возвращаетSession| +| `GET` | `/session/status` | Получить статус всех сессий | Возвращает `{ [sessionID: string]: `SessionStatus` }` | +| `GET` | `/session/:id` | Получить детали сессии | ВозвращаетSession| +| `DELETE` | `/session/:id` | Удалить сессию и все её данные | Возвращает `boolean` | +| `PATCH` | `/session/:id` | Обновить свойства сессии | body: `{ title? }`, возвращаетSession| +| `GET` | `/session/:id/children` | Получить дочерние сессии | ВозвращаетSession[]| +| `GET` | `/session/:id/todo` | Получить список задач для сессии | ВозвращаетTodo[]| +| `POST` | `/session/:id/init` | Анализ приложения и создание `AGENTS.md` | body: `{ messageID, providerID, modelID }`, возвращает `boolean` | +| `POST` | `/session/:id/fork` | Ответвление сессии от сообщения | body: `{ messageID? }`, возвращаетSession| +| `POST` | `/session/:id/abort` | Прервать запущенную сессию | Возвращает `boolean` | +| `POST` | `/session/:id/share` | Поделиться сессией | ВозвращаетSession| +| `DELETE` | `/session/:id/share` | Отменить общий доступ к сессии | ВозвращаетSession| +| `GET` | `/session/:id/diff` | Получить diff для этой сессии | query: `messageID?`, возвращаетFileDiff[]| +| `POST` | `/session/:id/summarize` | Суммировать сессию | body: `{ providerID, modelID }`, возвращает `boolean` | +| `POST` | `/session/:id/revert` | Отменить сообщение | body: `{ messageID, partID? }`, возвращает `boolean` | +| `POST` | `/session/:id/unrevert` | Восстановить все отмененные сообщения | Возвращает `boolean` | +| `POST` | `/session/:id/permissions/:permissionID` | Ответить на запрос разрешения | body: `{ response, remember? }`, возвращает `boolean` | --- ### Сообщения -| Метод | Путь | Описание | Примечания | -| ------ | --------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `GET` | `/session/:id/message` | List messages in a session | query: `limit?`, returns `{ info: `Message`, parts: `Part[]`}[]` | -| `POST` | `/session/:id/message` | Send a message and wait for response | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `Message`, parts: `Part[]`}` | -| `GET` | `/session/:id/message/:messageID` | Get message details | Returns `{ info: `Message`, parts: `Part[]`}` | -| `POST` | `/session/:id/prompt_async` | Send a message asynchronously (no wait) | body: same as `/session/:id/message`, returns `204 No Content` | -| `POST` | `/session/:id/command` | Execute a slash command | body: `{ messageID?, agent?, model?, command, arguments }`, returns `{ info: `Message`, parts: `Part[]`}` | -| `POST` | `/session/:id/shell` | Run a shell command | body: `{ agent, model?, command }`, returns `{ info: `Message`, parts: `Part[]`}` | +| Метод | Путь | Описание | Примечания | +| ------ | --------------------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `GET` | `/session/:id/message` | Список сообщений в сессии | query: `limit?`, возвращает `{ info: `Message`, parts: `Part[]`}[]` | +| `POST` | `/session/:id/message` | Отправить сообщение и ждать ответа | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, возвращает `{ info: `Message`, parts: `Part[]`}` | +| `GET` | `/session/:id/message/:messageID` | Получить детали сообщения | Возвращает `{ info: `Message`, parts: `Part[]`}` | +| `POST` | `/session/:id/prompt_async` | Отправить сообщение асинхронно (без ожидания) | body: как в `/session/:id/message`, возвращает `204 No Content` | +| `POST` | `/session/:id/command` | Выполнить слэш-команду | body: `{ messageID?, agent?, model?, command, arguments }`, возвращает `{ info: `Message`, parts: `Part[]`}` | +| `POST` | `/session/:id/shell` | Запустить команду оболочки | body: `{ agent, model?, command }`, возвращает `{ info: `Message`, parts: `Part[]`}` | --- ### Команды -| Метод | Путь | Описание | Ответ | -| ----- | ---------- | ----------------- | --------------------------------------------- | -| `GET` | `/command` | List all commands |Command[]| +| Метод | Путь | Описание | Ответ | +| ----- | ---------- | ------------------ | --------------------------------------------- | +| `GET` | `/command` | Список всех команд |Command[]| --- ### Файлы -| Метод | Путь | Описание | Ответ | -| ----- | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------- | -| `GET` | `/find?pattern=` | Search for text in files | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | -| `GET` | `/find/file?query= ` | Find files and directories by name | `string[]` (paths) | -| `GET` | `/find/symbol?query=` | Find workspace symbols |Symbol[]| -| `GET` | `/file?path=` | List files and directories | FileNode[]| -| `GET` | `/file/content?path=` | Read a file |
FileContent| -| `GET` | `/file/status` | Get status for tracked files |File[]| +| Метод | Путь | Описание | Ответ | +| ----- | ------------------------ | ------------------------------------ | -------------------------------------------------------------------------------------------- | +| `GET` | `/find?pattern=` | Поиск текста в файлах | Массив объектов совпадения с `path`, `lines`, `line_number`, `absolute_offset`, `submatches` | +| `GET` | `/find/file?query= ` | Поиск файлов и директорий по имени | `string[]` (пути) | +| `GET` | `/find/symbol?query=` | Поиск символов рабочего пространства |Symbol[]| +| `GET` | `/file?path=` | Список файлов и директорий | FileNode[]| +| `GET` | `/file/content?path=` | Прочитать файл |
FileContent| +| `GET` | `/file/status` | Получить статус отслеживаемых файлов |File[]| #### `/find/file` параметры запроса @@ -212,76 +212,76 @@ For example, `http://localhost:4096/doc`. Use the spec to generate clients or in ### Инструменты (Экспериментальные) -| Метод | Путь | Описание | Ответ | -| ----- | ------------------------------------------- | ---------------------------------------- | -------------------------------------------- | -| `GET` | `/experimental/tool/ids` | List all tool IDs |ToolIDs| -| `GET` | `/experimental/tool?provider=&model=
` | List tools with JSON schemas for a model | ToolList| +| Метод | Путь | Описание | Ответ | +| ----- | ------------------------------------------- | ---------------------------------------------- | -------------------------------------------- | +| `GET` | `/experimental/tool/ids` | Список всех идентификаторов инструментов |ToolIDs| +| `GET` | `/experimental/tool?provider=&model=
` | Список инструментов со схемами JSON для модели | ToolList| --- ### LSP, форматтеры и MCP -| Метод | Путь | Описание | Ответ | -| ------ | ------------ | -------------------------- | -------------------------------------------------------- | -| `GET` | `/lsp` | Get LSP server status |LSPStatus[]| -| `GET` | `/formatter` | Get formatter status |FormatterStatus[]| -| `GET` | `/mcp` | Get MCP server status | `{ [name: string]: `MCPStatus` }` | -| `POST` | `/mcp` | Add MCP server dynamically | body: `{ name, config }`, returns MCP status object | +| Метод | Путь | Описание | Ответ | +| ------ | ------------ | ------------------------------- | -------------------------------------------------------- | +| `GET` | `/lsp` | Получить статус сервера LSP |LSPStatus[]| +| `GET` | `/formatter` | Получить статус форматера |FormatterStatus[]| +| `GET` | `/mcp` | Получить статус сервера MCP | `{ [name: string]: `MCPStatus` }` | +| `POST` | `/mcp` | Добавить сервер MCP динамически | body: `{ name, config }`, возвращает статус объекта MCP | --- ### Агенты -| Метод | Путь | Описание | Ответ | -| ----- | -------- | ------------------------- | ------------------------------------------- | -| `GET` | `/agent` | List all available agents |Agent[]| +| Метод | Путь | Описание | Ответ | +| ----- | -------- | ----------------------------- | ------------------------------------------- | +| `GET` | `/agent` | Список всех доступных агентов |Agent[]| --- ### Ведение журнала -| Метод | Путь | Описание | Ответ | -| ------ | ------ | ------------------------------------------------------------ | --------- | -| `POST` | `/log` | Write log entry. Body: `{ service, level, message, extra? }` | `boolean` | +| Метод | Путь | Описание | Ответ | +| ------ | ------ | --------------------------------------------------------------------- | --------- | +| `POST` | `/log` | Записать запись в журнал. Body: `{ service, level, message, extra? }` | `boolean` | --- ### TUI -| Метод | Путь | Описание | Ответ | -| ------ | ----------------------- | ------------------------------------------- | ---------------------- | -| `POST` | `/tui/append-prompt` | Append text to the prompt | `boolean` | -| `POST` | `/tui/open-help` | Open the help dialog | `boolean` | -| `POST` | `/tui/open-sessions` | Open the session selector | `boolean` | -| `POST` | `/tui/open-themes` | Open the theme selector | `boolean` | -| `POST` | `/tui/open-models` | Open the model selector | `boolean` | -| `POST` | `/tui/submit-prompt` | Submit the current prompt | `boolean` | -| `POST` | `/tui/clear-prompt` | Clear the prompt | `boolean` | -| `POST` | `/tui/execute-command` | Execute a command (`{ command }`) | `boolean` | -| `POST` | `/tui/show-toast` | Show toast (`{ title?, message, variant }`) | `boolean` | -| `GET` | `/tui/control/next` | Wait for the next control request | Control request object | -| `POST` | `/tui/control/response` | Respond to a control request (`{ body }`) | `boolean` | +| Метод | Путь | Описание | Ответ | +| ------ | ----------------------- | ----------------------------------------------------- | ------------------------- | +| `POST` | `/tui/append-prompt` | Добавить текст в подсказку | `boolean` | +| `POST` | `/tui/open-help` | Открыть диалог помощи | `boolean` | +| `POST` | `/tui/open-sessions` | Открыть селектор сессий | `boolean` | +| `POST` | `/tui/open-themes` | Открыть селектор тем | `boolean` | +| `POST` | `/tui/open-models` | Открыть селектор моделей | `boolean` | +| `POST` | `/tui/submit-prompt` | Отправить текущую подсказку | `boolean` | +| `POST` | `/tui/clear-prompt` | Очистить подсказку | `boolean` | +| `POST` | `/tui/execute-command` | Выполнить команду (`{ command }`) | `boolean` | +| `POST` | `/tui/show-toast` | Показать уведомление (`{ title?, message, variant }`) | `boolean` | +| `GET` | `/tui/control/next` | Ожидание следующего запроса управления | Объект запроса управления | +| `POST` | `/tui/control/response` | Ответить на запрос управления (`{ body }`) | `boolean` | --- ### Авторизация -| Метод | Путь | Описание | Ответ | -| ----- | ----------- | --------------------------------------------------------------- | --------- | -| `PUT` | `/auth/:id` | Set authentication credentials. Body must match provider schema | `boolean` | +| Метод | Путь | Описание | Ответ | +| ----- | ----------- | -------------------------------------------------------------------------------------- | --------- | +| `PUT` | `/auth/:id` | Установить учетные данные аутентификации. Body должен соответствовать схеме провайдера | `boolean` | --- ### События -| Метод | Путь | Описание | Ответ | -| ----- | -------- | ----------------------------------------------------------------------------- | ------------------------- | -| `GET` | `/event` | Server-sent events stream. First event is `server.connected`, then bus events | Server-sent events stream | +| Метод | Путь | Описание | Ответ | +| ----- | -------- | --------------------------------------------------------------------------------------------- | ------------------------------------ | +| `GET` | `/event` | Поток событий, отправляемых сервером. Первое событие — `server.connected`, затем события шины | Поток событий, отправляемых сервером | --- ### Документы -| Метод | Путь | Описание | Ответ | -| ----- | ------ | ------------------------- | --------------------------- | -| `GET` | `/doc` | OpenAPI 3.1 specification | HTML page with OpenAPI spec | +| Метод | Путь | Описание | Ответ | +| ----- | ------ | ------------------------ | -------------------------------------- | +| `GET` | `/doc` | Спецификация OpenAPI 3.1 | HTML-страница со спецификацией OpenAPI | diff --git a/packages/web/src/content/docs/ru/themes.mdx b/packages/web/src/content/docs/ru/themes.mdx index 2e5219e4c5a..05ace2c7b80 100644 --- a/packages/web/src/content/docs/ru/themes.mdx +++ b/packages/web/src/content/docs/ru/themes.mdx @@ -61,11 +61,11 @@ opencode поставляется с несколькими встроенным ## Использование темы -Вы можете выбрать тему, вызвав выбор темы с помощью команды `/theme`. Или вы можете указать это в файле [config](/docs/config). +Вы можете выбрать тему, вызвав выбор темы с помощью команды `/theme`. Или вы можете указать это в файле [tui.json](/docs/config#tui). -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/ru/tui.mdx b/packages/web/src/content/docs/ru/tui.mdx index 0134e29c482..1694908dbac 100644 --- a/packages/web/src/content/docs/ru/tui.mdx +++ b/packages/web/src/content/docs/ru/tui.mdx @@ -355,24 +355,34 @@ How is auth handled in @packages/functions/src/api/index.ts? ## Настройка -Вы можете настроить поведение TUI через файл конфигурации opencode. +Вы можете настроить поведение TUI через `tui.json` (или `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +Это отдельный файл от `opencode.json`, который настраивает поведение сервера/выполнения. + ### Параметры -- `scroll_acceleration` — включите ускорение прокрутки в стиле macOS для плавной и естественной прокрутки. Если этот параметр включен, скорость прокрутки увеличивается при быстрой прокрутке и остается точной при более медленных движениях. **Этот параметр имеет приоритет над `scroll_speed` и переопределяет его, если он включен.** -- `scroll_speed` — контролирует скорость прокрутки TUI при использовании команд прокрутки (минимум: `1`). По умолчанию `3`. **Примечание. Это игнорируется, если для `scroll_acceleration.enabled` установлено значение `true`.** +- `theme` — Устанавливает тему пользовательского интерфейса. [Подробнее](/docs/themes). +- `keybinds` — Настраивает сочетания клавиш. [Подробнее](/docs/keybinds). +- `scroll_acceleration.enabled` — включите ускорение прокрутки в стиле macOS для плавной и естественной прокрутки. Если этот параметр включен, скорость прокрутки увеличивается при быстрой прокрутке и остается точной при более медленных движениях. **Этот параметр имеет приоритет над `scroll_speed` и переопределяет его, если он включен.** +- `scroll_speed` — контролирует скорость прокрутки TUI при использовании команд прокрутки (минимум: `0.001`, поддерживает десятичные значения). По умолчанию `3`. **Примечание. Это игнорируется, если для `scroll_acceleration.enabled` установлено значение `true`.** +- `diff_style` — Управляет отображением различий. `"auto"` адаптируется к ширине терминала, `"stacked"` всегда показывает одноколоночный макет. + +Используйте `OPENCODE_TUI_CONFIG` для загрузки пользовательского пути конфигурации TUI. --- diff --git a/packages/web/src/content/docs/ru/zen.mdx b/packages/web/src/content/docs/ru/zen.mdx index 3fe03a47fac..078d1a38194 100644 --- a/packages/web/src/content/docs/ru/zen.mdx +++ b/packages/web/src/content/docs/ru/zen.mdx @@ -63,6 +63,7 @@ OpenCode Zen работает так же, как и любой другой п | Модель | Идентификатор модели | Конечная точка | Пакет AI SDK | | ------------------ | -------------------- | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -72,13 +73,15 @@ OpenCode Zen работает так же, как и любой другой п | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | | MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -86,10 +89,8 @@ OpenCode Zen работает так же, как и любой другой п | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -123,27 +124,29 @@ https://opencode.ai/zen/v1/models | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | | GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | -| GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| GLM 4.7 Free | Бесплатно | Бесплатно | Бесплатно | - | -| Kimi K2.5 Free | Бесплатно | Бесплатно | Бесплатно | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200 тыс. токенов) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200 тыс. токенов) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200 тыс. токенов) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200 тыс. токенов) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200 тыс. токенов) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200 тыс. токенов) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200 тыс. токенов) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200 тыс. токенов) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200 тыс. токенов) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200 тыс. токенов) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200 тыс. токенов) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200 тыс. токенов) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200 тыс. токенов) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200 тыс. токенов) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -162,7 +165,6 @@ https://opencode.ai/zen/v1/models Бесплатные модели: -- Kimi K2.5 Free доступен на OpenCode в течение ограниченного времени. Команда использует это время для сбора отзывов и улучшения модели. - MiniMax M2.5 Free доступен на OpenCode в течение ограниченного времени. Команда использует это время для сбора отзывов и улучшения модели. - Big Pickle — это стелс-модель, которая доступна бесплатно на OpenCode в течение ограниченного времени. Команда использует это время для сбора отзывов и улучшения модели. @@ -194,7 +196,6 @@ https://opencode.ai/zen/v1/models Все наши модели размещены в США. Наши поставщики придерживаются политики нулевого хранения и не используют ваши данные для обучения моделей, за следующими исключениями: - Big Pickle: во время бесплатного периода собранные данные могут быть использованы для улучшения модели. -- Kimi K2.5 Free: в течение бесплатного периода собранные данные могут использоваться для улучшения модели. - MiniMax M2.5 Free: в течение бесплатного периода собранные данные могут использоваться для улучшения модели. - API OpenAI: запросы хранятся в течение 30 дней в соответствии с [Политикой данных OpenAI](https://platform.openai.com/docs/guides/your-data). - API-интерфейсы Anthropic: запросы хранятся в течение 30 дней в соответствии с [Политикой данных Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage). diff --git a/packages/web/src/content/docs/th/cli.mdx b/packages/web/src/content/docs/th/cli.mdx index 60e3fac764c..875f517fc26 100644 --- a/packages/web/src/content/docs/th/cli.mdx +++ b/packages/web/src/content/docs/th/cli.mdx @@ -559,6 +559,7 @@ OpenCode สามารถกำหนดค่าโดยใช้ตัว | `OPENCODE_AUTO_SHARE` | Boolean | แชร์เซสชันอัตโนมัติเมื่อสร้าง | | `OPENCODE_GIT_BASH_PATH` | String | เส้นทางไปยัง Git Bash บน Windows | | `OPENCODE_CONFIG` | String | เส้นทางไปยังไฟล์การกำหนดค่า | +| `OPENCODE_TUI_CONFIG` | String | เส้นทางไปยังไฟล์การกำหนดค่า TUI | | `OPENCODE_CONFIG_DIR` | String | เส้นทางไปยังไดเร็กทอรีการกำหนดค่า | | `OPENCODE_CONFIG_CONTENT` | String | เนื้อหาการกำหนดค่าแบบ inline JSON | | `OPENCODE_DISABLE_AUTOUPDATE` | Boolean | ปิดใช้งานการอัปเดตอัตโนมัติ | diff --git a/packages/web/src/content/docs/th/config.mdx b/packages/web/src/content/docs/th/config.mdx index 06836aca3be..c58469c77ab 100644 --- a/packages/web/src/content/docs/th/config.mdx +++ b/packages/web/src/content/docs/th/config.mdx @@ -14,10 +14,11 @@ OpenCode รองรับทั้งรูปแบบ **JSON** และ **J ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -34,7 +35,7 @@ OpenCode รองรับทั้งรูปแบบ **JSON** และ **J ไฟล์การกำหนดค่าจะถูกรวมเข้าด้วยกัน โดยไม่มีการแทนที่ การตั้งค่าจากตำแหน่งการกำหนดค่าต่อไปนี้จะรวมกัน การกำหนดค่าในภายหลังจะแทนที่การกำหนดค่าก่อนหน้าสำหรับคีย์ที่ขัดแย้งกันเท่านั้น การตั้งค่าที่ไม่ขัดแย้งจากการกำหนดค่าทั้งหมดจะยังคงอยู่ -ตัวอย่างเช่น หากการกำหนดค่าส่วนกลางของคุณตั้งค่า `theme: "opencode"` และ `autoupdate: true` และการกำหนดค่าโปรเจ็กต์ของคุณตั้งค่า `model: "anthropic/claude-sonnet-4-5"` การกำหนดค่าสุดท้ายจะรวมการตั้งค่าทั้งสามรายการไว้ด้วย +ตัวอย่างเช่น หากการกำหนดค่าส่วนกลางของคุณตั้งค่า `autoupdate: true` และการกำหนดค่าโปรเจ็กต์ของคุณตั้งค่า `model: "anthropic/claude-sonnet-4-5"` การกำหนดค่าสุดท้ายจะรวมการตั้งค่าทั้งสองรายการไว้ด้วย --- @@ -95,7 +96,9 @@ OpenCode รองรับทั้งรูปแบบ **JSON** และ **J ### ทั่วโลก -วางการกำหนดค่า OpenCode ส่วนกลางของคุณใน `~/.config/opencode/opencode.json` ใช้การกำหนดค่าส่วนกลางสำหรับการตั้งค่าทั้งผู้ใช้ เช่น ธีม ผู้ให้บริการ หรือปุ่มลัด +วางการกำหนดค่า OpenCode ส่วนกลางของคุณใน `~/.config/opencode/opencode.json` ใช้การกำหนดค่าส่วนกลางสำหรับการตั้งค่าทั้งผู้ใช้ เช่น ผู้ให้บริการ รุ่น และสิทธิ์ + +สำหรับการตั้งค่าเฉพาะ TUI ให้ใช้ `~/.config/opencode/tui.json` การกำหนดค่าส่วนกลางจะแทนที่ค่าเริ่มต้นขององค์กรระยะไกล @@ -105,6 +108,8 @@ OpenCode รองรับทั้งรูปแบบ **JSON** และ **J เพิ่ม `opencode.json` ในรูทโปรเจ็กต์ของคุณ การกำหนดค่าโปรเจ็กต์มีความสำคัญสูงสุดในบรรดาไฟล์กำหนดค่ามาตรฐาน โดยจะแทนที่การกำหนดค่าทั้งส่วนกลางและระยะไกล +สำหรับการตั้งค่า TUI เฉพาะโครงการ ให้เพิ่ม `tui.json` ควบคู่ไปกับมัน + :::tip วางการกำหนดค่าเฉพาะโปรเจ็กต์ไว้ที่รากของโปรเจ็กต์ของคุณ ::: @@ -148,34 +153,32 @@ opencode run "Hello world" ไฟล์กำหนดค่ามีสคีมาที่กำหนดไว้ใน [**`opencode.ai/config.json`**](https://opencode.ai/config.json) +การกำหนดค่า TUI ใช้ [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json) + ผู้แก้ไขของคุณควรสามารถตรวจสอบและเติมข้อความอัตโนมัติตามสคีมาได้ --- ### TUI -คุณสามารถกำหนดการตั้งค่าเฉพาะ TUI ผ่านตัวเลือก `tui` +ใช้ไฟล์ `tui.json` (หรือ `tui.jsonc`) เฉพาะสำหรับการตั้งค่าเฉพาะ TUI -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -ตัวเลือกที่มี: +ใช้ `OPENCODE_TUI_CONFIG` เพื่อชี้ไปยังไฟล์กำหนดค่า TUI ที่กำหนดเอง -- `scroll_acceleration.enabled` - เปิดใช้งานการเร่งความเร็วการเลื่อนแบบ macOS **มีลำดับความสำคัญมากกว่า `scroll_speed`.** -- `scroll_speed` - ตัวคูณความเร็วการเลื่อนแบบกำหนดเอง (ค่าเริ่มต้น: `3` ขั้นต่ำ: `1`) ไม่สนใจหาก `scroll_acceleration.enabled` คือ `true` -- `diff_style` - ควบคุมการเรนเดอร์ต่าง `"auto"` ปรับให้เข้ากับความกว้างของ terminal `"stacked"` จะแสดงคอลัมน์เดียวเสมอ +คีย์ `theme`, `keybinds` และ `tui` แบบเดิมใน `opencode.json` เลิกใช้แล้วและจะถูกย้ายโดยอัตโนมัติเมื่อเป็นไปได้ -[เรียนรู้เพิ่มเติมเกี่ยวกับการใช้ TUI ที่นี่](/docs/tui) +[เรียนรู้เพิ่มเติมเกี่ยวกับการใช้ TUI ที่นี่](/docs/tui#configure) --- @@ -301,12 +304,12 @@ Bearer Token (`AWS_BEARER_TOKEN_BEDROCK` หรือ `/connect`) มีคว ### Themes -คุณสามารถกำหนดค่าธีมที่คุณต้องการใช้ในการกำหนดค่า OpenCode ของคุณได้ผ่านตัวเลือก `theme` +ตั้งค่าธีม UI ของคุณใน `tui.json` -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -406,11 +409,11 @@ Bearer Token (`AWS_BEARER_TOKEN_BEDROCK` หรือ `/connect`) มีคว ### คีย์ลัด -คุณสามารถปรับแต่งปุ่มลัดของคุณได้ผ่านตัวเลือก `keybinds` +ปรับแต่งปุ่มลัดใน `tui.json` -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` @@ -490,13 +493,15 @@ OpenCode จะดาวน์โหลดการอัปเดตใหม "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - กระชับเซสชันโดยอัตโนมัติเมื่อบริบทเต็ม (ค่าเริ่มต้น: `true`) - `prune` - ลบเอาท์พุตเครื่องมือเก่าเพื่อบันทึก tokens (ค่าเริ่มต้น: `true`) +- `reserved` - บัฟเฟอร์โทเค็นสำหรับการบีบอัด ให้หน้าต่างเพียงพอเพื่อหลีกเลี่ยงการล้นระหว่างการบีบอัด --- diff --git a/packages/web/src/content/docs/th/custom-tools.mdx b/packages/web/src/content/docs/th/custom-tools.mdx index 28cd229cfd8..c5e63853575 100644 --- a/packages/web/src/content/docs/th/custom-tools.mdx +++ b/packages/web/src/content/docs/th/custom-tools.mdx @@ -79,6 +79,32 @@ export const multiply = tool({ --- +#### ชื่อซ้ำกับเครื่องมือในตัว + +เครื่องมือแบบกำหนดเองจะถูกระบุด้วยชื่อเครื่องมือ หากเครื่องมือแบบกำหนดเองใช้ชื่อเดียวกับเครื่องมือในตัว เครื่องมือแบบกำหนดเองจะมีความสำคัญเหนือกว่า + +ตัวอย่างเช่น ไฟล์นี้จะแทนที่เครื่องมือ `bash` ในตัว: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +ชอบชื่อที่ไม่ซ้ำกันเว้นแต่คุณตั้งใจจะแทนที่เครื่องมือในตัว หากคุณต้องการปิดใช้งานเครื่องมือในตัวแต่ไม่ต้องการแทนที่ ให้ใช้ [permissions](/docs/permissions) +::: + +--- + ### ข้อโต้แย้ง คุณสามารถใช้ `tool.schema` ซึ่งก็คือ [Zod](https://zod.dev) เพื่อกำหนดประเภทอาร์กิวเมนต์ diff --git a/packages/web/src/content/docs/th/keybinds.mdx b/packages/web/src/content/docs/th/keybinds.mdx index 2fbcd02a6e3..8cc7586e5f1 100644 --- a/packages/web/src/content/docs/th/keybinds.mdx +++ b/packages/web/src/content/docs/th/keybinds.mdx @@ -3,11 +3,11 @@ title: ปุ่มลัด description: ปรับแต่งปุ่มลัดของคุณ --- -OpenCode มีรายการปุ่มลัดที่คุณปรับแต่งได้ผ่านการกำหนดค่า OpenCode +OpenCode มีรายการปุ่มลัดที่คุณปรับแต่งได้ผ่าน `tui.json` -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,q", @@ -117,11 +117,11 @@ OpenCode ใช้ปุ่ม `leader` สำหรับการเชื่ ## ปิดการใช้งานการผูกปุ่ม -คุณสามารถปิดการใช้งานการผูกปุ่มได้โดยการเพิ่มคีย์ลงในการกำหนดค่าของคุณด้วยค่า "none" +คุณสามารถปิดการใช้งานการผูกปุ่มได้โดยการเพิ่มคีย์ลงใน `tui.json` ด้วยค่า "none" -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/th/lsp.mdx b/packages/web/src/content/docs/th/lsp.mdx index 0e5e28c4a6f..91d3f479fb0 100644 --- a/packages/web/src/content/docs/th/lsp.mdx +++ b/packages/web/src/content/docs/th/lsp.mdx @@ -11,40 +11,41 @@ OpenCode ทำงานร่วมกับ Language Server Protocol (LSP) เ OpenCode มาพร้อมกับเซิร์ฟเวอร์ LSP ในตัวหลายตัวสำหรับภาษายอดนิยม: -| LSP เซิร์ฟเวอร์ | ส่วนขยาย | ความต้องการ | -| -------------------- | ------------------------------------------------------------------- | ------------------------------------------------------- | -| astro | .astro | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Astro | -| bash | .sh, .bash, .zsh, .ksh | ติดตั้ง bash-Language-Server โดยอัตโนมัติ | -| clang | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | ติดตั้งอัตโนมัติสำหรับโครงการ C/C++ | -| csharp | .cs | `.NET SDK` ติดตั้งแล้ว | -| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` คำสั่งใช้ได้ | -| dart | .dart | `dart` คำสั่งใช้ได้ | -| deno | .ts, .tsx, .js, .jsx, .mjs | มีคำสั่ง `deno` (ตรวจจับอัตโนมัติ deno.json/deno.jsonc) | -| elixir-ls | .ex, .exs | `elixir` คำสั่งใช้ได้ | -| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | `eslint` การพึ่งพาในโครงการ | -| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` ติดตั้งแล้ว | -| gleam | .gleam | `gleam` คำสั่งใช้ได้ | -| gopls | .go | `go` คำสั่งใช้ได้ | -| haskell | .hs, .lhs | `haskell-language-server-wrapper` คำสั่งใช้ได้ | -| jdtls | .java | `Java SDK (version 21+)` ติดตั้งแล้ว | -| kotlin-ls | .kt, .kts | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Kotlin | -| lua-ls | .lua | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Lua | -| nix | .nix | `nixd` คำสั่งใช้ได้ | -| ocaml-lsp | .ml, .mli | `ocamllsp` คำสั่งใช้ได้ | -| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | `oxlint` การพึ่งพาในโครงการ | -| php intelephense.php | .php | ติดตั้งอัตโนมัติสำหรับโครงการ PHP | -| prisma | .prisma | `prisma` คำสั่งใช้ได้ | -| pyright | .py, .pyi | `pyright` ติดตั้งการพึ่งพาแล้ว | -| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | มีคำสั่ง `ruby` และ `gem` | -| rust | .rs | `rust-analyzer` คำสั่งใช้ได้ | -| sourcekit-lsp | .swift, .objc, .objcpp | ติดตั้ง `swift` (`xcode` บน macOS) | -| svelte | .svelte | ติดตั้งอัตโนมัติสำหรับโครงการ Svelte | -| terraform | .tf, .tfvars | ติดตั้งอัตโนมัติจากรุ่น GitHub | -| tinymist | .typ, .typst | ติดตั้งอัตโนมัติจากรุ่น GitHub | -| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` การพึ่งพาในโครงการ | -| vue | .vue | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Vue | -| yaml-ls | .yaml, .yml | ติดตั้งเซิร์ฟเวอร์ภาษา Red Hat yaml โดยอัตโนมัติ | -| zls | .zig, .zon | `zig` คำสั่งใช้ได้ | +| LSP เซิร์ฟเวอร์ | ส่วนขยาย | ความต้องการ | +| ------------------ | ------------------------------------------------------------------- | ------------------------------------------------------- | +| astro | .astro | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Astro | +| bash | .sh, .bash, .zsh, .ksh | ติดตั้ง bash-Language-Server โดยอัตโนมัติ | +| clangd | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | ติดตั้งอัตโนมัติสำหรับโครงการ C/C++ | +| csharp | .cs | `.NET SDK` ติดตั้งแล้ว | +| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` คำสั่งใช้ได้ | +| dart | .dart | `dart` คำสั่งใช้ได้ | +| deno | .ts, .tsx, .js, .jsx, .mjs | มีคำสั่ง `deno` (ตรวจจับอัตโนมัติ deno.json/deno.jsonc) | +| elixir-ls | .ex, .exs | `elixir` คำสั่งใช้ได้ | +| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | `eslint` การพึ่งพาในโครงการ | +| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` ติดตั้งแล้ว | +| gleam | .gleam | `gleam` คำสั่งใช้ได้ | +| gopls | .go | `go` คำสั่งใช้ได้ | +| hls | .hs, .lhs | `haskell-language-server-wrapper` คำสั่งใช้ได้ | +| jdtls | .java | `Java SDK (version 21+)` ติดตั้งแล้ว | +| julials | .jl | ติดตั้ง `julia` และ `LanguageServer.jl` แล้ว | +| kotlin-ls | .kt, .kts | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Kotlin | +| lua-ls | .lua | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Lua | +| nixd | .nix | `nixd` คำสั่งใช้ได้ | +| ocaml-lsp | .ml, .mli | `ocamllsp` คำสั่งใช้ได้ | +| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | `oxlint` การพึ่งพาในโครงการ | +| php intelephense | .php | ติดตั้งอัตโนมัติสำหรับโครงการ PHP | +| prisma | .prisma | `prisma` คำสั่งใช้ได้ | +| pyright | .py, .pyi | `pyright` ติดตั้งการพึ่งพาแล้ว | +| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | มีคำสั่ง `ruby` และ `gem` | +| rust | .rs | `rust-analyzer` คำสั่งใช้ได้ | +| sourcekit-lsp | .swift, .objc, .objcpp | ติดตั้ง `swift` (`xcode` บน macOS) | +| svelte | .svelte | ติดตั้งอัตโนมัติสำหรับโครงการ Svelte | +| terraform | .tf, .tfvars | ติดตั้งอัตโนมัติจากรุ่น GitHub | +| tinymist | .typ, .typc | ติดตั้งอัตโนมัติจากรุ่น GitHub | +| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` การพึ่งพาในโครงการ | +| vue | .vue | ติดตั้งอัตโนมัติสำหรับโปรเจ็กต์ Vue | +| yaml-ls | .yaml, .yml | ติดตั้งเซิร์ฟเวอร์ภาษา Red Hat yaml โดยอัตโนมัติ | +| zls | .zig, .zon | `zig` คำสั่งใช้ได้ | เซิร์ฟเวอร์ LSP จะถูกเปิดใช้งานโดยอัตโนมัติเมื่อตรวจพบนามสกุลไฟล์ใดนามสกุลหนึ่งข้างต้นและเป็นไปตามข้อกำหนด diff --git a/packages/web/src/content/docs/th/plugins.mdx b/packages/web/src/content/docs/th/plugins.mdx index a2d74ceb9cb..e672715a4ef 100644 --- a/packages/web/src/content/docs/th/plugins.mdx +++ b/packages/web/src/content/docs/th/plugins.mdx @@ -308,6 +308,10 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { เครื่องมือที่คุณกำหนดเองจะพร้อมใช้งานสำหรับ opencode ควบคู่ไปกับเครื่องมือในตัว +:::note +หากเครื่องมือปลั๊กอินใช้ชื่อเดียวกับเครื่องมือในตัว เครื่องมือปลั๊กอินจะมีความสำคัญเหนือกว่า +::: + --- ### การบันทึก diff --git a/packages/web/src/content/docs/th/providers.mdx b/packages/web/src/content/docs/th/providers.mdx index e9fbb351d7d..122ade42772 100644 --- a/packages/web/src/content/docs/th/providers.mdx +++ b/packages/web/src/content/docs/th/providers.mdx @@ -84,6 +84,37 @@ OpenCode Zen คือรายชื่อโมเดลที่จัดท --- +## OpenCode Go + +OpenCode Go คือแผนการสมัครสมาชิกราคาประหยัดที่ให้การเข้าถึงโมเดลการเขียนโค้ดแบบเปิดยอดนิยมที่เชื่อถือได้ ซึ่งจัดเตรียมโดยทีมงาน OpenCode ที่ได้รับการทดสอบและตรวจสอบแล้วว่าทำงานได้ดีกับ OpenCode + +1. เรียกใช้คำสั่ง `/connect` ใน TUI เลือก `OpenCode Go` และไปที่ [opencode.ai/auth](https://opencode.ai/zen) + + ```txt + /connect + ``` + +2. ลงชื่อเข้าใช้ เพิ่มรายละเอียดการเรียกเก็บเงินของคุณ และคัดลอกรหัส API ของคุณ + +3. วางคีย์ API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. เรียกใช้ `/models` ใน TUI เพื่อดูรายการรุ่นที่เราแนะนำ + + ```txt + /models + ``` + +มันทำงานเหมือนกับผู้ให้บริการรายอื่นใน OpenCode และเป็นทางเลือกในการใช้งานโดยสมบูรณ์ + +--- + ## ไดเรกทอรี มาดูรายละเอียดผู้ให้บริการบางรายกัน หากคุณต้องการเพิ่มผู้ให้บริการให้กับ @@ -1354,6 +1385,583 @@ OpenCode Zen คือรายการโมเดลที่ได้รั └ enter ``` +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Qwen 3 Coder 480B_ + + ```txt + /models + ``` + +--- + +### OpenRouter + +1. ไปที่ [OpenRouter dashboard](https://openrouter.ai/settings/keys) คลิก **Create API Key** และคัดลอกคีย์ + +2. เรียกใช้คำสั่ง `/connect` และค้นหา OpenRouter + + ```txt + /connect + ``` + +3. ป้อนคีย์ API สำหรับผู้ให้บริการ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. โมเดล OpenRouter จำนวนมากถูกโหลดไว้ล่วงหน้าตามค่าเริ่มต้น รันคำสั่ง `/models` เพื่อเลือกโมเดลที่คุณต้องการ + + ```txt + /models + ``` + + คุณยังสามารถเพิ่มโมเดลเพิ่มเติมผ่านการกำหนดค่า opencode ของคุณได้ + + ```json title="opencode.json" {6} + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "openrouter": { + "models": { + "somecoolnewmodel": {} + } + } + } + } + ``` + +5. คุณยังสามารถปรับแต่งได้ผ่านการกำหนดค่า opencode ของคุณ นี่คือตัวอย่างการระบุผู้ให้บริการ + + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "openrouter": { + "models": { + "moonshotai/kimi-k2": { + "options": { + "provider": { + "order": ["baseten"], + "allow_fallbacks": false + } + } + } + } + } + } + } + ``` + +--- + +### SAP AI Core + +SAP AI Core ให้การเข้าถึงโมเดลมากกว่า 40 รุ่นจาก OpenAI, Anthropic, Google, Amazon, Meta, Mistral และ AI21 ผ่านแพลตฟอร์มเดียว + +1. ไปที่ [SAP BTP Cockpit](https://account.hana.ondemand.com/) ของคุณ ไปที่อินสแตนซ์บริการ SAP AI Core และสร้างคีย์บริการ + + :::tip + คีย์บริการคือวัตถุ JSON ที่มี `clientid`, `clientsecret`, `url` และ `serviceurls.AI_API_URL` คุณสามารถค้นหาอินสแตนซ์ AI Core ของคุณได้ภายใต้ **Services** > **Instances and Subscriptions** ใน BTP Cockpit + ::: + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **SAP AI Core** + + ```txt + /connect + ``` + +3. ป้อน JSON คีย์บริการของคุณ + + ```txt + ┌ Service key + │ + │ + └ enter + ``` + + หรือตั้งค่าตัวแปรสภาพแวดล้อม `AICORE_SERVICE_KEY`: + + ```bash + AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' opencode + ``` + + หรือเพิ่มลงในโปรไฟล์ทุบตีของคุณ: + + ```bash title="~/.bash_profile" + export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' + ``` + +4. เลือกตั้งค่ารหัสการปรับใช้และกลุ่มทรัพยากร: + + ```bash + AICORE_DEPLOYMENT_ID=your-deployment-id AICORE_RESOURCE_GROUP=your-resource-group opencode + ``` + + :::note + การตั้งค่าเหล่านี้เป็นทางเลือกและควรกำหนดค่าตามการตั้งค่า SAP AI Core ของคุณ + ::: + +5. รันคำสั่ง `/models` เพื่อเลือกจาก 40+ รุ่นที่มีอยู่ + + ```txt + /models + ``` + +--- + +### STACKIT + +STACKIT AI Model Serving มอบสภาพแวดล้อมการโฮสต์ที่มีการจัดการเต็มรูปแบบสำหรับโมเดล AI โดยเน้นที่ LLM เช่น Llama, Mistral และ Qwen โดยมีอธิปไตยของข้อมูลสูงสุดบนโครงสร้างพื้นฐานยุโรป + +1. ไปที่ [STACKIT Portal](https://portal.stackit.cloud) ไปที่ **AI Model Serving** และสร้างโทเค็นการตรวจสอบสิทธิ์สำหรับโครงการของคุณ + + :::tip + คุณต้องมีบัญชีลูกค้า STACKIT บัญชีผู้ใช้ และโครงการก่อนสร้างโทเค็นการตรวจสอบสิทธิ์ + ::: + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **STACKIT** + + ```txt + /connect + ``` + +3. ป้อนโทเค็นการตรวจสอบสิทธิ์ STACKIT AI Model Serving ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกจากโมเดลที่มีอยู่ เช่น _Qwen3-VL 235B_ หรือ _Llama 3.3 70B_ + + ```txt + /models + ``` + +--- + +### OVHcloud AI Endpoints + +1. ไปที่ [OVHcloud panel](https://ovh.com/manager) ไปที่ส่วน `Public Cloud`, `AI & Machine Learning` > `AI Endpoints` และในแท็บ `API Keys` ให้คลิก **Create a new API key** + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **OVHcloud AI Endpoints** + + ```txt + /connect + ``` + +3. ป้อนคีย์ API OVHcloud AI Endpoints ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _gpt-oss-120b_ + + ```txt + /models + ``` + +--- + +### Scaleway + +วิธีใช้ [Scaleway Generative APIs](https://www.scaleway.com/en/docs/generative-apis/) กับ Opencode: + +1. ไปที่ [Scaleway Console IAM settings](https://console.scaleway.com/iam/api-keys) เพื่อสร้างคีย์ API ใหม่ + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **Scaleway** + + ```txt + /connect + ``` + +3. ป้อนคีย์ Scaleway API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _devstral-2-123b-instruct-2512_ หรือ _gpt-oss-120b_ + + ```txt + /models + ``` + +--- + +### Together AI + +1. ไปที่ [Together AI console](https://api.together.ai) สร้างบัญชี และคลิก **Add Key** + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **Together AI** + + ```txt + /connect + ``` + +3. ป้อนคีย์ Together AI API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Kimi K2 Instruct_ + + ```txt + /models + ``` + +--- + +### Venice AI + +1. ไปที่ [Venice AI console](https://venice.ai) สร้างบัญชี และสร้างคีย์ API + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **Venice AI** + + ```txt + /connect + ``` + +3. ป้อนคีย์ Venice AI API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Llama 3.3 70B_ + + ```txt + /models + ``` + +--- + +### Vercel AI Gateway + +Vercel AI Gateway ช่วยให้คุณเข้าถึงโมเดลจาก OpenAI, Anthropic, Google, xAI และอื่นๆ อีกมากมายผ่านจุดสิ้นสุดแบบรวม โมเดลถูกนำเสนอในราคาปลีกโดยไม่มีการบวกเพิ่ม + +1. ไปที่ [Vercel dashboard](https://vercel.com/) ไปที่แท็บ **AI Gateway** และคลิก **API keys** เพื่อสร้างคีย์ API ใหม่ + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **Vercel AI Gateway** + + ```txt + /connect + ``` + +3. ป้อนคีย์ Vercel AI Gateway API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกรุ่น + + ```txt + /models + ``` + +คุณยังสามารถปรับแต่งโมเดลผ่านการกำหนดค่า opencode ของคุณได้ นี่คือตัวอย่างการระบุลำดับการกำหนดเส้นทางผู้ให้บริการ + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "vercel": { + "models": { + "anthropic/claude-sonnet-4": { + "options": { + "order": ["anthropic", "vertex"] + } + } + } + } + } +} +``` + +ตัวเลือกการกำหนดเส้นทางที่มีประโยชน์บางประการ: + +| ตัวเลือก | คำอธิบาย | +| ------------------- | ---------------------------------------------------------- | +| `order` | ลำดับผู้ให้บริการที่จะลอง | +| `only` | จำกัดเฉพาะผู้ให้บริการที่ระบุ | +| `zeroDataRetention` | ใช้เฉพาะผู้ให้บริการที่มีนโยบายการเก็บรักษาข้อมูลเป็นศูนย์ | + +--- + +### xAI + +1. ไปที่ [xAI console](https://console.x.ai/) สร้างบัญชี และสร้างคีย์ API + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **xAI** + + ```txt + /connect + ``` + +3. ป้อนคีย์ xAI API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Grok Beta_ + + ```txt + /models + ``` + +--- + +### Z.AI + +1. ไปที่ [Z.AI API console](https://z.ai/manage-apikey/apikey-list) สร้างบัญชี และคลิก **Create a new API key** + +2. เรียกใช้คำสั่ง `/connect` และค้นหา **Z.AI** + + ```txt + /connect + ``` + + หากคุณสมัครรับ **GLM Coding Plan** ให้เลือก **Z.AI Coding Plan** + +3. ป้อนคีย์ Z.AI API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _GLM-4.7_ + + ```txt + /models + ``` + +--- + +### ZenMux + +1. ไปที่ [ZenMux dashboard](https://zenmux.ai/settings/keys) คลิก **Create API Key** และคัดลอกคีย์ + +2. เรียกใช้คำสั่ง `/connect` และค้นหา ZenMux + + ```txt + /connect + ``` + +3. ป้อนคีย์ API สำหรับผู้ให้บริการ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. โมเดล ZenMux จำนวนมากถูกโหลดไว้ล่วงหน้าตามค่าเริ่มต้น รันคำสั่ง `/models` เพื่อเลือกโมเดลที่คุณต้องการ + + ```txt + /models + ``` + + คุณยังสามารถเพิ่มโมเดลเพิ่มเติมผ่านการกำหนดค่า opencode ของคุณได้ + + ```json title="opencode.json" {6} + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "zenmux": { + "models": { + "somecoolnewmodel": {} + } + } + } + } + ``` + +--- + +## ผู้ให้บริการที่กำหนดเอง + +หากต้องการเพิ่มผู้ให้บริการที่ **เข้ากันได้กับ OpenAI** ใดๆ ที่ไม่มีรายชื่ออยู่ในคำสั่ง `/connect`: + +:::tip +คุณสามารถใช้ผู้ให้บริการที่เข้ากันได้กับ OpenAI กับ opencode ได้ ผู้ให้บริการ AI สมัยใหม่ส่วนใหญ่เสนอ API ที่เข้ากันได้กับ OpenAI +::: + +1. เรียกใช้คำสั่ง `/connect` และเลื่อนลงไปที่ **Other** + + ```bash + $ /connect + + ┌ Add credential + │ + ◆ Select provider + │ ... + │ ● Other + └ + ``` + +2. ป้อน ID เฉพาะสำหรับผู้ให้บริการ + + ```bash + $ /connect + + ┌ Add credential + │ + ◇ Enter provider id + │ myprovider + └ + ``` + + :::note + เลือก ID ที่น่าจดจำ คุณจะใช้ ID นี้ในไฟล์กำหนดค่าของคุณ + ::: + +3. ป้อนคีย์ API สำหรับผู้ให้บริการ + + ```bash + $ /connect + + ┌ Add credential + │ + ▲ This only stores a credential for myprovider - you will need to configure it in opencode.json, check the docs for examples. + │ + ◇ Enter your API key + │ sk-... + └ + ``` + +4. สร้างหรืออัปเดตไฟล์ `opencode.json` ของคุณในไดเร็กทอรีโครงการของคุณ: + + ```json title="opencode.json" ""myprovider"" {5-15} + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "myprovider": { + "npm": "@ai-sdk/openai-compatible", + "name": "My AI ProviderDisplay Name", + "options": { + "baseURL": "https://api.myprovider.com/v1" + }, + "models": { + "my-model-name": { + "name": "My Model Display Name" + } + } + } + } + } + ``` + + นี่คือตัวเลือกการกำหนดค่า: + - **npm**: แพ็คเกจ AI SDK ที่จะใช้ `@ai-sdk/openai-compatible` สำหรับผู้ให้บริการที่เข้ากันได้กับ OpenAI + - **name**: ชื่อที่แสดงใน UI + - **models**: โมเดลที่มีจำหน่าย + - **options.baseURL**: URL จุดสิ้นสุด API + - **options.apiKey**: ตั้งค่าคีย์ API ทางเลือก หากไม่ได้ใช้การรับรองความถูกต้อง + - **options.headers**: ตั้งค่าส่วนหัวที่กำหนดเองได้ตามต้องการ + + ข้อมูลเพิ่มเติมเกี่ยวกับตัวเลือกขั้นสูงในตัวอย่างด้านล่าง + +5. รันคำสั่ง `/models` และผู้ให้บริการและโมเดลที่คุณกำหนดเองจะปรากฏในรายการตัวเลือก + +--- + +##### ตัวอย่าง + +นี่คือตัวอย่างการตั้งค่าตัวเลือก `apiKey`, `headers` และรุ่น `limit` + +```json title="opencode.json" {9,11,17-20} +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "myprovider": { + "npm": "@ai-sdk/openai-compatible", + "name": "My AI ProviderDisplay Name", + "options": { + "baseURL": "https://api.myprovider.com/v1", + "apiKey": "{env:ANTHROPIC_API_KEY}", + "headers": { + "Authorization": "Bearer custom-token" + } + }, + "models": { + "my-model-name": { + "name": "My Model Display Name", + "limit": { + "context": 200000, + "output": 65536 + } + } + } + } + } +} +``` + +รายละเอียดการกำหนดค่า: + +- **apiKey**: ตั้งค่าโดยใช้ไวยากรณ์ตัวแปร `env` [เรียนรู้เพิ่มเติม](/docs/config#env-vars) +- **headers**: ส่วนหัวที่กำหนดเองที่ส่งไปกับแต่ละคำขอ +- **limit.context**: โทเค็นอินพุตสูงสุดที่โมเดลยอมรับ +- **limit.output**: โทเค็นสูงสุดที่โมเดลสามารถสร้างได้ + +ฟิลด์ `limit` ช่วยให้ OpenCode เข้าใจว่าคุณมีบริบทเหลืออยู่เท่าใด ผู้ให้บริการมาตรฐานจะดึงข้อมูลเหล่านี้จาก models.dev โดยอัตโนมัติ + +--- + +## การแก้ไขปัญหา + +หากคุณประสบปัญหาในการกำหนดค่าผู้ให้บริการ ให้ตรวจสอบสิ่งต่อไปนี้: + +1. **ตรวจสอบการตั้งค่าการรับรองความถูกต้อง**: รัน `opencode auth list` เพื่อดูว่ามีการเพิ่มข้อมูลรับรอง + สำหรับผู้ให้บริการในการกำหนดค่าของคุณหรือไม่ + + สิ่งนี้ใช้ไม่ได้กับผู้ให้บริการเช่น Amazon Bedrock ซึ่งอาศัยตัวแปรสภาพแวดล้อมสำหรับการตรวจสอบสิทธิ์ + +2. สำหรับผู้ให้บริการที่กำหนดเอง ให้ตรวจสอบการกำหนดค่า opencode และ: + - ตรวจสอบให้แน่ใจว่า ID ผู้ให้บริการที่ใช้ในคำสั่ง `/connect` ตรงกับ ID ในการกำหนดค่า opencode ของคุณ + - ใช้แพ็คเกจ npm ที่ถูกต้องสำหรับผู้ให้บริการ ตัวอย่างเช่น ใช้ `@ai-sdk/cerebras` สำหรับ Cerebras และสำหรับผู้ให้บริการอื่นๆ ที่เข้ากันได้กับ OpenAI ให้ใช้ `@ai-sdk/openai-compatible` + - ตรวจสอบว่าใช้จุดสิ้นสุด API ที่ถูกต้องในฟิลด์ `options.baseURL` + +3. ป้อนคีย์ OpenCode API ของคุณ + + ```txt + ┌ API key + │ + │ + └ enter + ``` + 4. รันคำสั่ง `/models` เพื่อเลือกรุ่นเช่น _Qwen 3 Coder 480B_ ```txt diff --git a/packages/web/src/content/docs/th/sdk.mdx b/packages/web/src/content/docs/th/sdk.mdx index b592c1a4e4b..3454b576670 100644 --- a/packages/web/src/content/docs/th/sdk.mdx +++ b/packages/web/src/content/docs/th/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## ผลลัพธ์แบบมีโครงสร้าง + +คุณสามารถร้องขอผลลัพธ์ JSON แบบมีโครงสร้างจากโมเดลได้โดยระบุ `format` ด้วย JSON schema โมเดลจะใช้เครื่องมือ `StructuredOutput` เพื่อส่งคืน JSON ที่ผ่านการตรวจสอบความถูกต้องซึ่งตรงกับสคีมาของคุณ + +### การใช้งานพื้นฐาน + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Research Anthropic and provide company info" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Company name" }, + founded: { type: "number", description: "Year founded" }, + products: { + type: "array", + items: { type: "string" }, + description: "Main products", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Access the structured output +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### ประเภทรูปแบบผลลัพธ์ + +| ประเภท | คำอธิบาย | +| ------------- | ----------------------------------------------------------------- | +| `text` | ค่าเริ่มต้น การตอบสนองข้อความมาตรฐาน (ไม่มีผลลัพธ์แบบมีโครงสร้าง) | +| `json_schema` | ส่งคืน JSON ที่ผ่านการตรวจสอบความถูกต้องซึ่งตรงกับสคีมาที่ระบุ | + +### รูปแบบ JSON Schema + +เมื่อใช้ `type: 'json_schema'` ให้ระบุ: + +| ฟิลด์ | Type | คำอธิบาย | +| ------------ | --------------- | --------------------------------------------------------------------- | +| `type` | `'json_schema'` | จำเป็น ระบุโหมด JSON schema | +| `schema` | `object` | จำเป็น วัตถุ JSON Schema ที่กำหนดโครงสร้างผลลัพธ์ | +| `retryCount` | `number` | ไม่จำเป็น จำนวนการลองใหม่สำหรับการตรวจสอบความถูกต้อง (ค่าเริ่มต้น: 2) | + +### การจัดการข้อผิดพลาด + +หากโมเดลล้มเหลวในการสร้างผลลัพธ์แบบมีโครงสร้างที่ถูกต้องหลังจากลองใหม่ครบทุกครั้ง การตอบสนองจะรวม `StructuredOutputError`: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Failed to produce structured output:", result.data.info.error.message) + console.error("Attempts:", result.data.info.error.retries) +} +``` + +### แนวปฏิบัติที่ดีที่สุด + +1. **ระบุคำอธิบายที่ชัดเจน** ในคุณสมบัติสคีมาของคุณเพื่อช่วยให้โมเดลเข้าใจว่าข้อมูลใดที่ต้องดึงออกมา +2. **ใช้ `required`** เพื่อระบุฟิลด์ที่ต้องมี +3. **รักษาสคีมาให้โฟกัส** - สคีมาที่ซ้อนกันซับซ้อนอาจยากสำหรับโมเดลในการกรอกให้ถูกต้อง +4. **ตั้งค่า `retryCount` ที่เหมาะสม** - เพิ่มสำหรับสคีมาที่ซับซ้อน ลดลงสำหรับสคีมาที่เรียบง่าย + +--- + ## API SDK เปิดเผย API ของเซิร์ฟเวอร์ทั้งหมดผ่านไคลเอ็นต์ประเภทที่ปลอดภัย @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### เซสชัน -| Method | คำอธิบาย | หมายเหตุ | -| ---------------------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | แสดงรายการเซสชัน | ส่งคืน เซสชัน[]| -| `session.get({ path })` | รับเซสชัน | ส่งคืนเซสชัน| -| `session.children({ path })` | แสดงรายการเซสชันย่อย | ส่งคืนเซสชัน[]| -| `session.create({ body })` | สร้างเซสชัน | ส่งคืนเซสชัน| -| `session.delete({ path })` | ลบเซสชัน | ส่งคืน `boolean` | -| `session.update({ path, body })` | อัปเดตคุณสมบัติเซสชัน | ส่งคืนเซสชัน| -| `session.init({ path, body })` | วิเคราะห์แอปและสร้าง `AGENTS.md` | ส่งคืน `boolean` | -| `session.abort({ path })` | ยกเลิกเซสชันที่ทำงานอยู่ | ส่งคืน `boolean` | -| `session.share({ path })` | แบ่งปันเซสชั่น | ส่งคืนเซสชัน| -| `session.unshare({ path })` | เลิกแชร์เซสชัน | ส่งคืนเซสชัน| -| `session.summarize({ path, body })` | สรุปเซสชัน | ส่งคืน `boolean` | -| `session.messages({ path })` | แสดงรายการข้อความในเซสชัน | ส่งคืน `{ info: `ข้อความ`, parts: `ส่วน[]`}[]` | -| `session.message({ path })` | รับรายละเอียดข้อความ | ส่งคืน `{ info: `ข้อความ`, parts: `ส่วน[]`}` | -| `session.prompt({ path, body })` | ส่งข้อความแจ้ง | `body.noReply: true` ส่งคืน UserMessage (บริบทเท่านั้น) ค่าเริ่มต้นส่งคืนAssistantMessageพร้อมการตอบสนองของ AI | -| `session.command({ path, body })` | ส่งคำสั่งไปยังเซสชั่น | ส่งคืน `{ info: `AssistantMessage`, parts: `ส่วน[]`}` | -| `session.shell({ path, body })` | รันคำสั่ง shell | ส่งคืนAssistantMessage| -| `session.revert({ path, body })` | คืนค่าข้อความ | ส่งคืนเซสชัน| -| `session.unrevert({ path })` | คืนค่าข้อความที่เปลี่ยนกลับ | ส่งคืนเซสชัน| -| `postSessionByIdPermissionsByPermissionId({ path, body })` | ตอบสนองต่อการร้องขอการอนุญาต | ส่งคืน `boolean` | +| Method | คำอธิบาย | หมายเหตุ | +| ---------------------------------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | แสดงรายการเซสชัน | ส่งคืนเซสชัน[]| +| `session.get({ path })` | รับเซสชัน | ส่งคืนเซสชัน| +| `session.children({ path })` | แสดงรายการเซสชันย่อย | ส่งคืนเซสชัน[]| +| `session.create({ body })` | สร้างเซสชัน | ส่งคืนเซสชัน| +| `session.delete({ path })` | ลบเซสชัน | ส่งคืน `boolean` | +| `session.update({ path, body })` | อัปเดตคุณสมบัติเซสชัน | ส่งคืนเซสชัน| +| `session.init({ path, body })` | วิเคราะห์แอปและสร้าง `AGENTS.md` | ส่งคืน `boolean` | +| `session.abort({ path })` | ยกเลิกเซสชันที่ทำงานอยู่ | ส่งคืน `boolean` | +| `session.share({ path })` | แบ่งปันเซสชั่น | ส่งคืนเซสชัน| +| `session.unshare({ path })` | เลิกแชร์เซสชัน | ส่งคืนเซสชัน| +| `session.summarize({ path, body })` | สรุปเซสชัน | ส่งคืน `boolean` | +| `session.messages({ path })` | แสดงรายการข้อความในเซสชัน | ส่งคืน `{ info: `ข้อความ`, parts: `ส่วน[]`}[]` | +| `session.message({ path })` | รับรายละเอียดข้อความ | ส่งคืน `{ info: `ข้อความ`, parts: `ส่วน[]`}` | +| `session.prompt({ path, body })` | ส่งข้อความแจ้ง | `body.noReply: true` ส่งคืน UserMessage (บริบทเท่านั้น) ค่าเริ่มต้นส่งคืนAssistantMessageพร้อมการตอบสนองของ AI รองรับ `body.outputFormat` สำหรับ [ผลลัพธ์แบบมีโครงสร้าง](#ผลลัพธ์แบบมีโครงสร้าง) | +| `session.command({ path, body })` | ส่งคำสั่งไปยังเซสชั่น | ส่งคืน `{ info: `AssistantMessage`, parts: `ส่วน[]`}` | +| `session.shell({ path, body })` | รันคำสั่ง shell | ส่งคืนAssistantMessage| +| `session.revert({ path, body })` | คืนค่าข้อความ | ส่งคืนเซสชัน| +| `session.unrevert({ path })` | คืนค่าข้อความที่เปลี่ยนกลับ | ส่งคืนเซสชัน| +| `postSessionByIdPermissionsByPermissionId({ path, body })` | ตอบสนองต่อการร้องขอการอนุญาต | ส่งคืน `boolean` | --- diff --git a/packages/web/src/content/docs/th/themes.mdx b/packages/web/src/content/docs/th/themes.mdx index 2244c3dcf1b..44514148ea2 100644 --- a/packages/web/src/content/docs/th/themes.mdx +++ b/packages/web/src/content/docs/th/themes.mdx @@ -61,11 +61,11 @@ OpenCode มาพร้อมกับธีมในตัวหลายธ ## การใช้ธีม -คุณสามารถเลือกธีมได้โดยเปิดการเลือกธีมขึ้นมาด้วยคำสั่ง `/theme` หรือคุณสามารถระบุได้ใน [config](/docs/config) +คุณสามารถเลือกธีมได้โดยเปิดการเลือกธีมขึ้นมาด้วยคำสั่ง `/theme` หรือคุณสามารถระบุได้ใน `tui.json` -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/th/tui.mdx b/packages/web/src/content/docs/th/tui.mdx index 9151462d70d..2a5064b9d72 100644 --- a/packages/web/src/content/docs/th/tui.mdx +++ b/packages/web/src/content/docs/th/tui.mdx @@ -235,7 +235,7 @@ How is auth handled in @packages/functions/src/api/index.ts? แสดงรายการธีมที่มีอยู่ ```bash frame="none" -/theme +/themes ``` **ผูกปุ่ม:** `ctrl+x t` @@ -355,24 +355,34 @@ How is auth handled in @packages/functions/src/api/index.ts? ## กำหนดค่า -คุณสามารถปรับแต่งพฤติกรรม TUI ผ่านไฟล์กำหนดค่า OpenCode ของคุณได้ +คุณสามารถปรับแต่งพฤติกรรม TUI ได้ผ่าน `tui.json` (หรือ `tui.jsonc`) -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +สิ่งนี้แยกจาก `opencode.json` ซึ่งกำหนดค่าพฤติกรรมเซิร์ฟเวอร์/รันไทม์ + ### ตัวเลือก -- `scroll_acceleration` - เปิดใช้งานการเร่งความเร็วการเลื่อนแบบ macOS เพื่อการเลื่อนที่ราบรื่นและเป็นธรรมชาติ เมื่อเปิดใช้งาน ความเร็วในการเลื่อนจะเพิ่มขึ้นตามท่าทางการเลื่อนอย่างรวดเร็ว และคงความแม่นยำไว้สำหรับการเคลื่อนไหวที่ช้าลง **การตั้งค่านี้มีความสำคัญมากกว่า `scroll_speed` และแทนที่เมื่อเปิดใช้งาน** -- `scroll_speed` - ควบคุมความเร็วของการเลื่อน TUI เมื่อใช้คำสั่งการเลื่อน (ขั้นต่ำ: `1`) ค่าเริ่มต้นเป็น `3` **หมายเหตุ: สิ่งนี้จะถูกละเว้นหากตั้งค่า `scroll_acceleration.enabled` เป็น `true`.** +- `theme` - ตั้งค่าธีม UI ของคุณ [เรียนรู้เพิ่มเติม](/docs/themes) +- `keybinds` - ปรับแต่งแป้นพิมพ์ลัด [เรียนรู้เพิ่มเติม](/docs/keybinds) +- `scroll_acceleration.enabled` - เปิดใช้งานการเร่งความเร็วการเลื่อนแบบ macOS เพื่อการเลื่อนที่ราบรื่นและเป็นธรรมชาติ เมื่อเปิดใช้งาน ความเร็วในการเลื่อนจะเพิ่มขึ้นตามท่าทางการเลื่อนอย่างรวดเร็ว และคงความแม่นยำไว้สำหรับการเคลื่อนไหวที่ช้าลง **การตั้งค่านี้มีความสำคัญมากกว่า `scroll_speed` และแทนที่เมื่อเปิดใช้งาน** +- `scroll_speed` - ควบคุมความเร็วของการเลื่อน TUI เมื่อใช้คำสั่งการเลื่อน (ขั้นต่ำ: `0.001` รองรับค่าทศนิยม) ค่าเริ่มต้นเป็น `3` **หมายเหตุ: สิ่งนี้จะถูกละเว้นหากตั้งค่า `scroll_acceleration.enabled` เป็น `true`.** +- `diff_style` - ควบคุมการเรนเดอร์ diff `"auto"` ปรับให้เข้ากับความกว้างของ terminal `"stacked"` จะแสดงคอลัมน์เดียวเสมอ + +ใช้ `OPENCODE_TUI_CONFIG` เพื่อโหลดเส้นทางการกำหนดค่า TUI แบบกำหนดเอง --- diff --git a/packages/web/src/content/docs/th/zen.mdx b/packages/web/src/content/docs/th/zen.mdx index f0b39ceaaa0..7b9f172756c 100644 --- a/packages/web/src/content/docs/th/zen.mdx +++ b/packages/web/src/content/docs/th/zen.mdx @@ -64,31 +64,34 @@ OpenCode Zen ทำงานเหมือนกับผู้ให้บร | Model | Model ID | Endpoint | แพ็คเกจ AI SDK | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | -| GPT 5.2 | GPT-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | -| GPT 5.1 | GPT-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 Codex | gpt-5.1-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 Codex Max | gpt-5.1-codex-max | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 Codex Mini | gpt-5.1-codex-mini | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | -| GPT 5 | GPT-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | -| Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Haiku 3.5 | claude-haiku-3-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -114,41 +117,46 @@ https://opencode.ai/zen/v1/models เราสนับสนุนรูปแบบการจ่ายเงินตามการใช้งาน ด้านล่างนี้คือราคา **ต่อtokens 1M** -| Model | ป้อนข้อมูล | เอาท์พุต | แคชอ่าน | เขียนในแคช | -| --------------------------------------- | ------------ | ------------ | ------------- | ---------- | -| Big Pickle | ฟรี | ฟรี | ฟรี | - | -| MiniMax M2.1 Free | ฟรี | ฟรี | ฟรี | - | -| Miniแม็กซ์ M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | ฟรี | ฟรี | ฟรี | - | -| GLM 4.7 | $0.60 | $2.20 | $0.10 | - | -| GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | ฟรี | ฟรี | ฟรี | - | -| Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | -| Kimi K2 Thinking | $0.40 | $2.50 | - | - | -| Kimi K2 | $0.40 | $2.50 | - | - | -| Qwen3 Coder 480B | $0.45 | $1.50 | - | - | -| Claude Sonnet 4.5 (tokens ≤ 200K) | $3.00 | $15.00 | $0.30 | $3.75 | -| Claude Sonnet 4.5 (> tokens 200,000) | $6.00 | $22.50 | $0.60 | $7.50 | -| Claude Sonnet 4 (tokens 200,000 tokens) | $3.00 | $15.00 | $0.30 | $3.75 | -| Claude Sonnet 4 (> tokens 200,000) | $6.00 | $22.50 | $0.60 | $7.50 | -| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | -| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (tokens ≤ 200K) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> tokens 200,000) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | -| Gemini 3 Pro (tokens ≤ 200,000) | 2.00 ดอลลาร์ | $12.00 | $0.20 | - | -| Gemini 3 Pro (tokens> 200,000) | $4.00 | $18.00 | $0.40 | - | -| Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | -| GPT 5.2 | $1.75 | $14.00 | 0.175 ดอลลาร์ | - | -| GPT 5.2 Codex | $1.75 | $14.00 | 0.175 ดอลลาร์ | - | -| GPT 5.1 | $1.07 | 8.50 ดอลลาร์ | $0.107 | - | -| GPT 5.1 Codex | $1.07 | 8.50 ดอลลาร์ | $0.107 | - | -| GPT 5.1 CodexMax | $1.25 | $10.00 | $0.125 | - | -| GPT 5.1 CodexMini | $0.25 | 2.00 ดอลลาร์ | 0.025 ดอลลาร์ | - | -| GPT 5 | $1.07 | 8.50 ดอลลาร์ | $0.107 | - | -| GPT 5 Codex | $1.07 | 8.50 ดอลลาร์ | $0.107 | - | -| GPT 5Nano | ฟรี | ฟรี | ฟรี | - | +| Model | ป้อนข้อมูล | เอาท์พุต | แคชอ่าน | เขียนในแคช | +| --------------------------------- | ---------- | -------- | ------- | ---------- | +| Big Pickle | ฟรี | ฟรี | ฟรี | - | +| MiniMax M2.5 Free | ฟรี | ฟรี | ฟรี | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | +| MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | +| GLM 4.7 | $0.60 | $2.20 | $0.10 | - | +| GLM 4.6 | $0.60 | $2.20 | $0.10 | - | +| Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | +| Kimi K2 Thinking | $0.40 | $2.50 | - | - | +| Kimi K2 | $0.40 | $2.50 | - | - | +| Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | +| Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | +| Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | +| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | +| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | +| Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | +| Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | +| GPT 5.2 | $1.75 | $14.00 | $0.175 | - | +| GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | +| GPT 5.1 | $1.07 | $8.50 | $0.107 | - | +| GPT 5.1 Codex | $1.07 | $8.50 | $0.107 | - | +| GPT 5.1 Codex Max | $1.25 | $10.00 | $0.125 | - | +| GPT 5.1 Codex Mini | $0.25 | $2.00 | $0.025 | - | +| GPT 5 | $1.07 | $8.50 | $0.107 | - | +| GPT 5 Codex | $1.07 | $8.50 | $0.107 | - | +| GPT 5 Nano | ฟรี | ฟรี | ฟรี | - | คุณอาจสังเกตเห็น _Claude Haiku 3.5_ ในประวัติการใช้งานของคุณ นี่คือ [โมเดลราคาประหยัด](/docs/config/#models) ที่ใช้ในการสร้างชื่อเซสชันของคุณ @@ -158,9 +166,7 @@ https://opencode.ai/zen/v1/models รุ่นฟรี: -- GLM 4.7 ใช้งานได้ฟรีบน OpenCode ในระยะเวลาจำกัด ทีมงานใช้เวลานี้เพื่อรวบรวมคำติชมและปรับปรุงโมเดล -- Kimi K2.5 Free พร้อมใช้งานบน OpenCode ในระยะเวลาจำกัด ทีมงานใช้เวลานี้เพื่อรวบรวมคำติชมและปรับปรุงโมเดล -- MiniMax M2.1 Free พร้อมใช้งานบน OpenCode ในระยะเวลาจำกัด ทีมงานใช้เวลานี้เพื่อรวบรวมคำติชมและปรับปรุงโมเดล +- MiniMax M2.5 Free พร้อมใช้งานบน OpenCode ในระยะเวลาจำกัด ทีมงานใช้เวลานี้เพื่อรวบรวมคำติชมและปรับปรุงโมเดล - Big Pickle เป็นโมเดลล่องหนที่ให้บริการฟรีบน OpenCode ในระยะเวลาจำกัด ทีมงานใช้เวลานี้เพื่อรวบรวมคำติชมและปรับปรุงโมเดล Contact us if you have any questions. @@ -191,9 +197,7 @@ https://opencode.ai/zen/v1/models โมเดลทั้งหมดของเราโฮสต์ในสหรัฐอเมริกา ผู้ให้บริการของเราปฏิบัติตามนโยบายการเก็บรักษาเป็นศูนย์ และไม่ใช้ข้อมูลของคุณสำหรับการฝึกโมเดล โดยมีข้อยกเว้นต่อไปนี้: - Big Pickle: ในช่วงระยะเวลาว่าง ข้อมูลที่รวบรวมอาจนำไปใช้ในการปรับปรุงโมเดลได้ -- GLM 4.7 Free: ในช่วงระยะเวลาฟรี ข้อมูลที่รวบรวมอาจนำไปใช้ในการปรับปรุงโมเดล -- Kimi K2.5 Free: ในช่วงระยะเวลาฟรี ข้อมูลที่รวบรวมอาจนำไปใช้ในการปรับปรุงโมเดล -- MiniMax M2.1 Free: ในช่วงระยะเวลาฟรี ข้อมูลที่รวบรวมอาจนำไปใช้ในการปรับปรุงโมเดล +- MiniMax M2.5 Free: ในช่วงระยะเวลาฟรี ข้อมูลที่รวบรวมอาจนำไปใช้ในการปรับปรุงโมเดล - OpenAI API: คำขอจะถูกเก็บไว้เป็นเวลา 30 วันตาม [นโยบายข้อมูลของ OpenAI](https://platform.openai.com/docs/guides/your-data) - Anthropic API: คำขอจะถูกเก็บไว้เป็นเวลา 30 วันตาม [นโยบายข้อมูลของ Anthropic](https://docs.anthropic.com/en/docs/claude-code/data-usage) diff --git a/packages/web/src/content/docs/tr/agents.mdx b/packages/web/src/content/docs/tr/agents.mdx index 47c16abf120..1f582511be0 100644 --- a/packages/web/src/content/docs/tr/agents.mdx +++ b/packages/web/src/content/docs/tr/agents.mdx @@ -21,7 +21,7 @@ opencode'da iki tür agent vardır; birincil agent'lar ve alt agent'lar. ### Birincil agent'lar -Birincil agent'lar, doğrudan etkileşim kurduğunuz ana yardımcılardır. **Sekme** tuşunu veya yapılandırılmış `switch_agent` tuş atamanızı kullanarak bunlar arasında geçiş yapabilirsiniz. Bu agent'lar ana görüşmenizi yönetir. Araç erişimi, izinler aracılığıyla yapılandırılır; örneğin, Plan kısıtlıyken Build'de tüm araçlar etkindir. +Birincil agent'lar, doğrudan etkileşim kurduğunuz ana yardımcılardır. **Sekme** tuşunu veya yapılandırılmış `switch_agent` tuş atamanızı kullanarak bunlar arasında geçiş yapabilirsiniz. Bu agent'lar ana görüşmenizi yönetir. Araç erişimi, izinler aracılığıyla yapılandırılır; örneğin, Build'de tüm araçlar etkindir ancak Plan kısıtlıdır. :::tip Bir oturum sırasında birincil agent'lar arasında geçiş yapmak için **Sekme** tuşunu kullanabilirsiniz. @@ -83,7 +83,7 @@ Kod tabanlarını keşfetmeye yönelik hızlı, salt okunur bir agent. Dosyalar --- -### Compact Kullanımı +### Compaction Kullanımı _Mod_: `primary` @@ -181,7 +181,7 @@ Agent'ları `opencode.json` yapılandırma dosyanızda yapılandırın: Ayrıca agent'ları Markdown dosyalarını kullanarak da tanımlayabilirsiniz. Bunları şuraya yerleştirin: - Global: `~/.config/opencode/agents/` -- Per-project: `.opencode/agents/` +- Proje başına: `.opencode/agents/` ```markdown title="~/.config/opencode/agents/review.md" --- @@ -342,10 +342,10 @@ Bu yol, yapılandırma dosyasının bulunduğu yere göredir. Yani bu hem global ### Model -Bu agent'ın kodu geçersiz için `model` ayarını kullanın. Farklı bölümler için optimize edilmiş farklı modelleri kullanmak için kullanışlıdır. Örneğin planlama için daha hızlı bir model, uygulama için daha yetenekli bir model. +Bu agent'ın modelini geçersiz kılmak için `model` ayarını kullanın. Farklı bölümler için optimize edilmiş farklı modelleri kullanmak için kullanışlıdır. Örneğin planlama için daha hızlı bir model, uygulama için daha yetenekli bir model. :::tip -Bir model belirtmezseniz, birincil agent'lar [model globally configured](/docs/config#models)'yi kullanırken alt agent'lar, alt agent'ı çağıran birincil agent'ın modelini kullanır. +Bir model belirtmezseniz, birincil agent'lar [küresel olarak yapılandırılmış modeli](/docs/config#models) kullanırken alt agent'lar, alt agent'ı çağıran birincil agent'ın modelini kullanır. ::: ```json title="opencode.json" @@ -358,7 +358,7 @@ Bir model belirtmezseniz, birincil agent'lar [model globally configured](/docs/c } ``` -opencode hesabınızdaki model kimliğini `provider/model-id` biçimini kullanır. Örneğin, [OpenCode Zen](/docs/zen) kullanıyorsanız, GPT 5.1 Codex için `opencode/gpt-5.1-codex` kullanırsınız. +opencode yapılandırmanızdaki model kimliği `provider/model-id` biçimini kullanır. Örneğin, [OpenCode Zen](/docs/zen) kullanıyorsanız, GPT 5.1 Codex için `opencode/gpt-5.1-codex` kullanırsınız. --- @@ -599,7 +599,7 @@ Kullanıcılar, agent'ın görev izinleri bunu reddetse bile, her zaman herhangi Agent'ın kullanıcı arayüzündeki görsel görünümünü `color` seçeneğiyle özelleştirin. Bu, agent'ın arayüzde nasıl göründüğünü etkiler. -geçerli bir onaltılık renk (ör. `#FF5733`) veya tema rengini kullanın: `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `info`. +Geçerli bir onaltılık renk (ör. `#FF5733`) veya tema rengini kullanın: `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `info`. ```json title="opencode.json" { @@ -744,627 +744,3 @@ Look for: - Dependency vulnerabilities - Configuration security issues ``` - -3. **Oturumlar arasında gezinme**: Subagent'lar kendi alt oturumlarını oluşturduğunda, aşağıdakileri kullanarak ana oturum ile tüm alt oturumlar arasında gezinebilirsiniz: - - **\+Right** (veya yapılandırılmış `session_child_cycle` tuş atamanız) ebeveyn → çocuk1 → çocuk2 → ... → ebeveyn arasında ileri doğru geçiş yapmak için - - **\ +Left** (veya yapılandırılmış `session_child_cycle_reverse` tuş atamanız) ebeveyn ← çocuk1 ← çocuk2 ← ... ← ebeveyn arasında geriye doğru geçiş yapmak için - - Bu, ana görüşme ile özel subagent çalışması arasında sorunsuz bir şekilde geçiş yapmanıza olanak tanır. - ---- - -## Yapılandırma veya yapılandırma yoluyla kendinizinkini oluşturabilirsiniz. Agent'lar iki şekilde yapılandırılabilir: - ---- - -### JSON - -Agent'ları `opencode.json` yapılandırma dosyanızda yapılandırın: - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "agent": { - "build": { - "mode": "primary", - "model": "anthropic/claude-sonnet-4-20250514", - "prompt": "{file:./prompts/build.txt}", - "tools": { - "write": true, - "edit": true, - "bash": true - } - }, - "plan": { - "mode": "primary", - "model": "anthropic/claude-haiku-4-20250514", - "tools": { - "write": false, - "edit": false, - "bash": false - } - }, - "code-reviewer": { - "description": "Reviews code for best practices and potential issues", - "mode": "subagent", - "model": "anthropic/claude-sonnet-4-20250514", - "prompt": "You are a code reviewer. Focus on security, performance, and maintainability.", - "tools": { - "write": false, - "edit": false - } - } - } -} -``` - ---- - -### Markdown - -Ayrıca agent'ları Markdown dosyalarını kullanarak da tanımlayabilirsiniz. Bunları şuraya yerleştirin: - -- Global: `~/.config/opencode/agents/` -- Per-project: `.opencode/agents/` - -```markdown title="~/.config/opencode/agents/review.md" ---- -description: Reviews code for quality and best practices -mode: subagent -model: anthropic/claude-sonnet-4-20250514 -temperature: 0.1 -tools: - write: false - edit: false - bash: false ---- - -You are in code review mode. Focus on: - -- Code quality and best practices -- Potential bugs and edge cases -- Performance implications -- Security considerations - -Provide constructive feedback without making direct changes. -``` - -Markdown dosyasının adı agent'ın adı olur. Örneğin, `review.md` bir `review` agent'ı oluşturur. - ---- - -## Seçenekler - -Bu yapılandırma seçeneklerine ayrıntılı olarak bakalım. - ---- - -### Açıklama - -Agent'ın ne yaptığına ve ne zaman kullanılacağına ilişkin kısa bir açıklama sağlamak için `description` seçeneğini kullanın. - -```json title="opencode.json" -{ - "agent": { - "review": { - "description": "Reviews code for best practices and potential issues" - } - } -} -``` - -Bu **gerekli** bir yapılandırma seçeneğidir. - ---- - -### Sıcaklık - -LLM'nin yanıtlarının rastgeleliğini ve yaratıcılığını `temperature` yapılandırmasıyla kontrol edin. - -Düşük değerler yanıtları daha odaklı ve belirleyici hale getirirken, yüksek değerler yaratıcılığı ve değişkenliği artırır. - -```json title="opencode.json" -{ - "agent": { - "plan": { - "temperature": 0.1 - }, - "creative": { - "temperature": 0.8 - } - } -} -``` - -Sıcaklık değerleri tipik olarak 0,0 ila 1,0 arasındadır: - -- **0,0-0,2**: Çok odaklı ve belirleyici yanıtlar, kod analizi ve planlama için idealdir -- **0,3-0,5**: Biraz yaratıcılık içeren dengeli yanıtlar, genel gelişim görevleri için iyi -- **0,6-1,0**: Daha yaratıcı ve çeşitli yanıtlar, beyin fırtınası ve keşif için yararlı - -```json title="opencode.json" -{ - "agent": { - "analyze": { - "temperature": 0.1, - "prompt": "{file:./prompts/analysis.txt}" - }, - "build": { - "temperature": 0.3 - }, - "brainstorm": { - "temperature": 0.7, - "prompt": "{file:./prompts/creative.txt}" - } - } -} -``` - -Sıcaklık belirtilmezse opencode modeline özgü varsayılanları kullanır; çoğu model için genellikle 0, Qwen modelleri için 0,55. - ---- - -### Maksimum adım - -Bir agent'ın yalnızca metinle yanıt vermeye zorlanmadan önce gerçekleştirebileceği maksimum agent yineleme sayısını kontrol edin. Bu, maliyetleri kontrol etmek isteyen kullanıcıların agent eylemlerine bir sınır koymasına olanak tanır. - -Bu ayarlanmazsa, model durmayı seçene veya kullanıcı oturumu kesene kadar agent yinelemeye devam edecektir. - -```json title="opencode.json" -{ - "agent": { - "quick-thinker": { - "description": "Fast reasoning with limited iterations", - "prompt": "You are a quick thinker. Solve problems with minimal steps.", - "steps": 5 - } - } -} -``` - -Sınıra ulaşıldığında, agent, işinin özeti ve önerilen kalan görevlerin bir özetiyle yanıt vermesi talimatını veren özel bir sistem prompt'u alır. - -:::caution -Eski `maxSteps` alanı kullanımdan kaldırıldı. Bunun yerine `steps` kullanın. -::: - ---- - -### Devre dışı bırakma - -Agent'ı devre dışı bırakmak için `true` olarak ayarlayın. - -```json title="opencode.json" -{ - "agent": { - "review": { - "disable": true - } - } -} -``` - ---- - -### İstem - -Bu agent için `prompt` yapılandırmasıyla özel bir sistem prompt dosyası belirtin. Prompt dosyası, agent'ın amacına özel talimatlar içermelidir. - -```json title="opencode.json" -{ - "agent": { - "review": { - "prompt": "{file:./prompts/code-review.txt}" - } - } -} -``` - -Bu yol, yapılandırma dosyasının bulunduğu yere göredir. Yani bu hem global opencode yapılandırması hem de projeye özel yapılandırma için işe yarar. - ---- - -### Model - -Bu agent'ın varsayılan modelini geçersiz kılmak için `model` ayarını kullanın. Farklı bölümler için optimize edilmiş farklı modelleri kullanmak için kullanışlıdır. Örneğin planlama için daha hızlı bir model, uygulama için daha yetenekli bir model. - -:::tip -Bir model belirtmezseniz, primary agent'lar [model globally configured](/docs/config#models)'yi kullanırken subagent'lar, subagent'ı çağıran primary agent'ın modelini kullanır. -::: - -```json title="opencode.json" -{ - "agent": { - "plan": { - "model": "anthropic/claude-haiku-4-20250514" - } - } -} -``` - -opencode hesabınızdaki model kimliğini `provider/model-id` biçimini kullanır. Örneğin, [OpenCode Zen](/docs/zen) kullanıyorsanız, GPT 5.1 Codex için `opencode/gpt-5.1-codex` kullanırsınız. - ---- - -### Araçlar - -`tools` yapılandırmasıyla bu agent'ta hangi araçların mevcut olduğunu kontrol edin. Belirli araçları `true` veya `false` olarak ayarlayarak etkinleştirebilir veya devre dışı bırakabilirsiniz. - -```json title="opencode.json" {3-6,9-12} -{ - "$schema": "https://opencode.ai/config.json", - "tools": { - "write": true, - "bash": true - }, - "agent": { - "plan": { - "tools": { - "write": false, - "bash": false - } - } - } -} -``` - -:::note -Agent'a özgü yapılandırma, genel yapılandırmayı geçersiz kılar. -::: - -Aynı anda birden fazla aracı kontrol etmek için joker karakterleri de kullanabilirsiniz. Örneğin, bir MCP sunucusundaki tüm araçları devre dışı bırakmak için: - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "agent": { - "readonly": { - "tools": { - "mymcp_*": false, - "write": false, - "edit": false - } - } - } -} -``` - -[Araçlar hakkında daha fazla bilgi](/docs/tools). - ---- - -### İzinler - -Bir agent'ın gerçekleştirebileceği eylemleri yönetmek için izinleri yapılandırabilirsiniz. Şu anda `edit`, `bash` ve `webfetch` araçlarının izinleri şu şekilde yapılandırılabilir: - -- `"ask"` — Agent çalıştırmadan önce onay iste -- `"allow"` — Onay olmadan tüm işlemlere izin ver -- `"deny"` — Agent'ı devre dışı bırakır - -```json title="opencode.json" -{ - "$schema": "https://opencode.ai/config.json", - "permission": { - "edit": "deny" - } -} -``` - -Bu izinleri agent başına geçersiz kılabilirsiniz. - -```json title="opencode.json" {3-5,8-10} -{ - "$schema": "https://opencode.ai/config.json", - "permission": { - "edit": "deny" - }, - "agent": { - "build": { - "permission": { - "edit": "ask" - } - } - } -} -``` - -İzinleri Markdown agent'larında da ayarlayabilirsiniz. - -```markdown title="~/.config/opencode/agents/review.md" ---- -description: Code review without edits -mode: subagent -permission: - edit: deny - bash: - "*": ask - "git diff": allow - "git log*": allow - "grep *": allow - webfetch: deny ---- - -Only analyze code and suggest changes. -``` - -Belirli bash komutları için izinleri ayarlayabilirsiniz. - -```json title="opencode.json" {7} -{ - "$schema": "https://opencode.ai/config.json", - "agent": { - "build": { - "permission": { - "bash": { - "git push": "ask", - "grep *": "allow" - } - } - } - } -} -``` - -Bu küresel bir desen alabilir. - -```json title="opencode.json" {7} -{ - "$schema": "https://opencode.ai/config.json", - "agent": { - "build": { - "permission": { - "bash": { - "git *": "ask" - } - } - } - } -} -``` - -Ayrıca tüm komutların izinlerini yönetmek için `*` joker karakterini de kullanabilirsiniz. -Son eşleşen kural öncelikli olduğundan, `*` joker karakterini ilk sıraya ve belirli kuralları sonraya koyun. - -```json title="opencode.json" {8} -{ - "$schema": "https://opencode.ai/config.json", - "agent": { - "build": { - "permission": { - "bash": { - "*": "ask", - "git status *": "allow" - } - } - } - } -} -``` - -[İzinler hakkında daha fazla bilgi](/docs/permissions). - ---- - -### Mod - -Agent'ın modunu `mode` yapılandırmasıyla kontrol edin. `mode` seçeneği agent'ın nasıl kullanılabileceğini belirlemek için kullanılır. - -```json title="opencode.json" -{ - "agent": { - "review": { - "mode": "subagent" - } - } -} -``` - -`mode` seçeneği `primary`, `subagent` veya `all` olarak ayarlanabilir. `mode` belirtilmezse varsayılan olarak `all` olur. - ---- - -### Gizli - -`@` otomatik tamamlama menüsünden bir subagent'ı `hidden: true` ile gizleyin. Yalnızca diğer agent'lar tarafından Task aracı aracılığıyla programlı olarak çağrılması gereken dahili subagent'lar için kullanışlıdır. - -```json title="opencode.json" -{ - "agent": { - "internal-helper": { - "mode": "subagent", - "hidden": true - } - } -} -``` - -Bu yalnızca otomatik menüdeki kullanıcının görünümlerinin etkileri. İzinler izin vermesine, gizli agent'lar modeli tarafından Task aracı aracılığıyla çağrılmaya devam edilebilir. - -:::note -Yalnızca `mode: subagent` agent'ları için geçerlidir. -::: - ---- - -### Görev izinleri - -`permission.task` ile bir agent'ın Task aracı aracılığıyla hangi subagent'ları çağırabileceğini kontrol edin. Esnek eşleştirme için küresel desenleri kullanır. - -```json title="opencode.json" -{ - "agent": { - "orchestrator": { - "mode": "primary", - "permission": { - "task": { - "*": "deny", - "orchestrator-*": "allow", - "code-reviewer": "ask" - } - } - } - } -} -``` - -`deny` olarak ayarlandığında, subagent Task aracı açıklamasından tamamen kaldırılır, böylece model onu çağırmaya çalışmaz. - -:::tip -Kurallar sırayla değerlendirilir ve **son eşleşen kural kazanır**. Yukarıdaki örnekte `orchestrator-planner`, hem `*` (reddet) hem de `orchestrator-*` (izin ver) ile eşleşir, ancak `orchestrator-*`, `*`'den sonra geldiğinden sonuç `allow` olur. -::: - -:::tip -Kullanıcılar, agent'ın görev izinleri bunu reddetse bile, her zaman herhangi bir subagent'ı `@` otomatik tamamlama menüsü aracılığıyla doğrudan çağırabilir. -::: - ---- - -### Renk - -Agent'ın kullanıcı arayüzündeki görsel görünümünü `color` seçeneğiyle özelleştirin. Bu, agent'ın arayüzde nasıl göründüğünü etkiler. - -geçerli bir onaltılık renk (ör. `#FF5733`) veya tema rengini kullanın: `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `info`. - -```json title="opencode.json" -{ - "agent": { - "creative": { - "color": "#ff6b6b" - }, - "code-reviewer": { - "color": "accent" - } - } -} -``` - ---- - -### Top P - -`top_p` seçeneğiyle yanıt çeşitliliğini kontrol edin. Rastgeleliği kontrol etmek için sıcaklığa alternatif. - -```json title="opencode.json" -{ - "agent": { - "brainstorm": { - "top_p": 0.9 - } - } -} -``` - -Değerler 0,0 ile 1,0 arasında değişir. Düşük değerler daha odaklıdır, yüksek değerler ise daha çeşitlidir. - ---- - -### Ek - -Agent yapılandırmanızdaki diğer seçenekler, model seçenekleri olarak **doğrudan sağlayıcıya** iletilecektir. Bu, sağlayıcıya özgü özelliklerin kullanılmasını sağlar. - -Örneğin OpenAI'nin akıl yürütme modelleriyle akıl yürütme çabasını kontrol edebilirsiniz: - -```json title="opencode.json" {6,7} -{ - "agent": { - "deep-thinker": { - "description": "Agent that uses high reasoning effort for complex problems", - "model": "openai/gpt-5", - "reasoningEffort": "high", - "textVerbosity": "low" - } - } -} -``` - -Bu ek seçenekler modele ve sağlayıcıya özeldir. Kullanılabilir parametreler için sağlayıcınızın belgelerine bakın. - -:::tip -Mevcut modellerin listesini görmek için `opencode models` komutunu çalıştırın. -::: - ---- - -## Agent Oluşturma - -Aşağıdaki komutu kullanarak yeni agent'lar oluşturabilirsiniz: - -```bash -opencode agent create -``` - -Bu etkileşimli komut şunları sağlayacaktır: - -1. Agent'ı nereye kaydedeceğinizi sorun; küresel veya projeye özel. -2. Agent'ın ne yapması gerektiğinin açıklaması. -3. Uygun bir sistem istemi ve tanımlayıcı oluşturun. -4. Agent'ın hangi araçlara erişebileceğini seçmenize izin verin. -5. Son olarak agent yapılandırmasıyla bir Markdown dosyası oluşturun. - ---- - -## Kullanım Senaryoları - -Farklı agent'lara yönelik bazı yaygın kullanım senaryoları aşağıda verilmiştir. - -- **Build agent**: Tüm araçların etkinleştirildiği tam geliştirme çalışması -- **Plan agent**: Değişiklik yapmadan analiz ve planlama -- **Review agent**: Salt okunur erişim ve belgeleme araçlarıyla kod incelemesi -- **Debug agent**: Bash ve okuma araçları etkinken araştırmaya odaklanmıştır -- **Docs agent**: Dosya işlemleriyle ancak sistem komutları olmadan belge yazma - ---- - -## Örnekler - -Yararlı bulabileceğiniz bazı örnek agent'ları burada bulabilirsiniz. - -:::tip -Paylaşmak istediğiniz bir agent'ınız var mı? [Submit a PR](https://github.com/anomalyco/opencode). -::: - ---- - -### Dokümantasyon agent'ı - -```markdown title="~/.config/opencode/agents/docs-writer.md" ---- -description: Writes and maintains project documentation -mode: subagent -tools: - bash: false ---- - -You are a technical writer. Create clear, comprehensive documentation. - -Focus on: - -- Clear explanations -- Proper structure -- Code examples -- User-friendly language -``` - ---- - -### Güvenlik denetçisi - -```markdown title="~/.config/opencode/agents/security-auditor.md" ---- -description: Performs security audits and identifies vulnerabilities -mode: subagent -tools: - write: false - edit: false ---- - -You are a security expert. Focus on identifying potential security issues. - -Look for: - -- Input validation vulnerabilities -- Authentication and authorization flaws -- Data exposure risks -- Dependency vulnerabilities -- Configuration security issues -``` diff --git a/packages/web/src/content/docs/tr/cli.mdx b/packages/web/src/content/docs/tr/cli.mdx index ae151bd5c9d..5f3cd4bfcdb 100644 --- a/packages/web/src/content/docs/tr/cli.mdx +++ b/packages/web/src/content/docs/tr/cli.mdx @@ -558,6 +558,7 @@ opencode ortam değişkenleri kullanılarak yapılandırılabilir. | `OPENCODE_AUTO_SHARE` | boolean | Oturumları otomatik olarak paylaş | | `OPENCODE_GIT_BASH_PATH` | string | Windows'ta yürütülebilir Git Bash'in Yolu | | `OPENCODE_CONFIG` | string | Yapılandırma dosyasının yolu | +| `OPENCODE_TUI_CONFIG` | string | TUI yapılandırma dosyasının yolu | | `OPENCODE_CONFIG_DIR` | string | Yapılandırma dizinine giden yol | | `OPENCODE_CONFIG_CONTENT` | string | Satır içi JSON config içeriği | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Otomatik güncelleme kontrollerini devre dışı bırak | diff --git a/packages/web/src/content/docs/tr/config.mdx b/packages/web/src/content/docs/tr/config.mdx index fe60991c626..8a769ba6908 100644 --- a/packages/web/src/content/docs/tr/config.mdx +++ b/packages/web/src/content/docs/tr/config.mdx @@ -491,13 +491,15 @@ Bağlam sıkıştırma davranışını `compaction` seçeneği aracılığıyla "$schema": "https://opencode.ai/config.json", "compaction": { "auto": true, - "prune": true + "prune": true, + "reserved": 10000 } } ``` - `auto` - Bağlam dolduğunda oturumu otomatik olarak sıkıştırır (varsayılan: `true`). - `prune` - Belirteçleri kaydetmek için eski araç çıktılarını kaldırın (varsayılan: `true`). +- `reserved` - Sıkıştırma için belirteç tamponu. Sıkıştırma sırasında taşmayı önlemek için yeterli pencere bırakır. --- diff --git a/packages/web/src/content/docs/tr/custom-tools.mdx b/packages/web/src/content/docs/tr/custom-tools.mdx index cb6a12debb2..87ff66d1d6b 100644 --- a/packages/web/src/content/docs/tr/custom-tools.mdx +++ b/packages/web/src/content/docs/tr/custom-tools.mdx @@ -79,6 +79,32 @@ Bu iki araç oluşturur: `math_add` ve `math_multiply`. --- +#### Yerleşik araçlarla ad çakışmaları + +Özel araçlar, araç adına göre anahtarlanır. Özel bir araç yerleşik bir araçla aynı adı kullanıyorsa, özel araç önceliklidir. + +Örneğin, bu dosya yerleşik `bash` aracının yerini alır: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +Kasıtlı olarak yerleşik bir aracı değiştirmek istemiyorsanız benzersiz adları tercih edin. Yerleşik bir aracı devre dışı bırakmak ancak geçersiz kılmak istemiyorsanız [izinleri](/docs/permissions) kullanın. +::: + +--- + ### Argümanlar Bağımsız değişken türlerini tanımlamak için yalnızca [Zod](https://zod.dev) olan `tool.schema` öğesini kullanabilirsiniz. diff --git a/packages/web/src/content/docs/tr/keybinds.mdx b/packages/web/src/content/docs/tr/keybinds.mdx index 9a22c329cc7..bea63a35503 100644 --- a/packages/web/src/content/docs/tr/keybinds.mdx +++ b/packages/web/src/content/docs/tr/keybinds.mdx @@ -3,11 +3,11 @@ title: Tuş atamaları description: Tuş bağlantılarınızı özelleştirin. --- -opencode, opencode yapılandırması aracılığıyla özelleştirebileceğiniz bir tuş bağlantıları listesine sahiptir. +opencode, `tui.json` aracılığıyla özelleştirebileceğiniz bir tuş bağlantıları listesine sahiptir. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -119,9 +119,9 @@ Tuş atamalarınız için lider anahtar kullanmanıza gerek yoktur ancak bunu ya Anahtarı yapılandırmanıza "none" değeriyle ekleyerek bir tuş atamasını devre dışı bırakabilirsiniz. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/tr/lsp.mdx b/packages/web/src/content/docs/tr/lsp.mdx index db742113854..52a95d1c3c0 100644 --- a/packages/web/src/content/docs/tr/lsp.mdx +++ b/packages/web/src/content/docs/tr/lsp.mdx @@ -1,15 +1,15 @@ --- title: LSP Sunucuları -description: opencode, LSP sunucularınızla bütünleşir. +description: OpenCode, LSP sunucularınızla bütünleşir. --- -opencode, LLM'in kod tabanınızla etkileşime girmesine yardımcı olmak için Dil Sunucusu Protokolünüzle (LSP) bütünleşir. LLM'ye geri bildirim sağlamak için tanılamayı kullanır. +OpenCode, LLM'in kod tabanınızla etkileşime girmesine yardımcı olmak için Dil Sunucusu Protokolünüzle (LSP) bütünleşir. LLM'ye geri bildirim sağlamak için tanılamayı kullanır. --- ## Yerleşik -opencode, popüler diller için çeşitli yerleşik LSP sunucularıyla birlikte gelir: +OpenCode, popüler diller için çeşitli yerleşik LSP sunucularıyla birlikte gelir: | LSP Sunucu | Uzantılar | Gereksinimler | | ------------------ | ------------------------------------------------------------------- | --------------------------------------------------------------------- | @@ -27,6 +27,7 @@ opencode, popüler diller için çeşitli yerleşik LSP sunucularıyla birlikte | gopls | .go | `go` komutu mevcut | | hls | .hs, .lhs | `haskell-language-server-wrapper` komutu mevcut | | jdtls | .java | `Java SDK (version 21+)` kurulu | +| julials | .jl | `julia` ve `LanguageServer.jl` kurulu | | kotlin-ls | .kt, .kts | Kotlin projeleri için otomatik kurulumlar | | lua-ls | .lua | Lua projeleri için otomatik kurulumlar | | nixd | .nix | `nixd` komutu mevcut | @@ -56,7 +57,7 @@ Yukarıdaki dosya uzantılarından biri tespit edildiğinde ve gereksinimler kar ## Nasıl Çalışır? -Opencode bir dosyayı açtığında: +opencode bir dosyayı açtığında: 1. Dosya uzantısını tüm etkin LSP sunucularına göre kontrol eder. 2. Henüz çalışmıyorsa uygun LSP sunucusunu başlatır. @@ -182,7 +183,7 @@ Komutu ve dosya uzantılarını belirterek özel LSP sunucuları ekleyebilirsini PHP Intelephense, bir lisans anahtarı aracılığıyla premium özellikler sunar. Anahtarı (yalnızca) şu adresteki bir metin dosyasına yerleştirerek bir lisans anahtarı sağlayabilirsiniz: -- MacOS/Linux'ta: `$HOME/intelephense/license.txt` +- macOS/Linux'ta: `$HOME/intelephense/license.txt` - Windows'ta: `%USERPROFILE%/intelephense/license.txt` Dosya, ek içerik olmadan yalnızca lisans anahtarını içermelidir. diff --git a/packages/web/src/content/docs/tr/plugins.mdx b/packages/web/src/content/docs/tr/plugins.mdx index 0b24e48c35e..4926f5f70e5 100644 --- a/packages/web/src/content/docs/tr/plugins.mdx +++ b/packages/web/src/content/docs/tr/plugins.mdx @@ -1,9 +1,9 @@ --- title: Eklentiler -description: opencode'u genişletmek için kendi eklentilerinizi yazın. +description: OpenCode'u genişletmek için kendi eklentilerinizi yazın. --- -Eklentiler, çeşitli olaylara bağlanarak ve davranışı özelleştirerek opencode'u genişletmenize olanak tanır. Yeni özellikler eklemek, harici hizmetlerle entegrasyon sağlamak veya opencode'un varsayılan davranışını değiştirmek için eklentiler oluşturabilirsiniz. +Eklentiler, çeşitli olaylara bağlanarak ve davranışı özelleştirerek OpenCode'u genişletmenize olanak tanır. Yeni özellikler eklemek, harici hizmetlerle entegrasyon sağlamak veya OpenCode'un varsayılan davranışını değiştirmek için eklentiler oluşturabilirsiniz. Örnekler için topluluk tarafından oluşturulan [eklentilere](/docs/ecosystem#plugins) göz atın. @@ -47,7 +47,7 @@ Hem normal hem de kapsamlı npm paketleri desteklenir. **npm eklentileri** başlangıçta Bun kullanılarak otomatik olarak yüklenir. Paketler ve bağımlılıkları `~/.cache/opencode/node_modules/`'da önbelleğe alınır. -**Yerel eklentiler** doğrudan eklenti dizininden yüklenir. Harici paketleri kullanmak için, sisteminizin dizininde bir `package.json` oluşturmanız (bkz. [Bağımlılıklar](#dependencies)) veya eklentiyi npm ve [add it to your config](/docs/config#plugins)'de yayınlamanız gerekir. +**Yerel eklentiler** doğrudan eklenti dizininden yüklenir. Harici paketleri kullanmak için, sisteminizin dizininde bir `package.json` oluşturmanız (bkz. [Bağımlılıklar](#dependencies)) veya eklentiyi npm ve [yapılandırmanıza eklemeniz](/docs/config#plugins) gerekir. --- @@ -66,8 +66,7 @@ Aynı ad ve sürüme sahip yinelenen npm paketleri bir kez yüklenir. Ancak benz ## Eklenti oluşturma -Eklenti, bir veya daha fazla eklentiyi dışa aktaran bir **JavaScript/TypeScript modülüdür** -işlevler. Her işlev bir bağlam nesnesi alır ve bir kanca nesnesi döndürür. +Eklenti, bir veya daha fazla eklenti işlevini dışa aktaran bir **JavaScript/TypeScript modülüdür**. Her işlev bir bağlam nesnesi alır ve bir kanca nesnesi döndürür. --- @@ -83,7 +82,7 @@ Yerel eklentiler ve özel araçlar harici npm paketlerini kullanabilir. İhtiyac } ``` -opencode bunları yüklemek için başlangıçta `bun install` komutunu çalıştırır. Eklentileriniz ve araçlarınız daha sonra bunları içe aktarabilir. +OpenCode bunları yüklemek için başlangıçta `bun install` komutunu çalıştırır. Eklentileriniz ve araçlarınız daha sonra bunları içe aktarabilir. ```ts title=".opencode/plugins/my-plugin.ts" import { escape } from "shescape" @@ -116,9 +115,9 @@ export const MyPlugin = async ({ project, client, $, directory, worktree }) => { Eklenti işlevi şunları alır: - `project`: Mevcut proje bilgisi. -- `directory`: güncel çalışma dizini. +- `directory`: Güncel çalışma dizini. - `worktree`: Git çalışma ağacı yolu. -- `client`: Yapay zeka ile etkileşime geçmek için opencode'lu bir SDK istemcisi. +- `client`: Yapay zeka ile etkileşim kurmak için bir OpenCode SDK istemcisi. - `$`: Bun'un komutları yürütmek için kullandığı [shell API](https://bun.com/docs/runtime/shell). --- @@ -211,7 +210,7 @@ Eklentiler aşağıdaki Örnekler bölümünde görüldüğü gibi etkinliklere ## Örnekler -opencode'u genişletmek için kullanabileceğiniz bazı eklenti örneklerini burada bulabilirsiniz. +OpenCode'u genişletmek için kullanabileceğiniz bazı eklenti örneklerini burada bulabilirsiniz. --- @@ -232,17 +231,17 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr } ``` -MacOS'ta AppleScript'i çalıştırmak için `osascript` kullanıyoruz. Burada bildirim göndermek için kullanıyoruz. +macOS'ta AppleScript'i çalıştırmak için `osascript` kullanıyoruz. Burada bildirim göndermek için kullanıyoruz. :::note -opencode masaüstü uygulamasını kullanıyorsanız yanıt hazır olduğunda veya oturum hataları oluştuğunda otomatik olarak sistem bildirimleri gönderebilir. +OpenCode masaüstü uygulamasını kullanıyorsanız yanıt hazır olduğunda veya oturum hataları oluştuğunda otomatik olarak sistem bildirimleri gönderebilir. ::: --- ### .env Koruması -opencode'un `.env` dosyalarını okumasını önleyin: +OpenCode'un `.env` dosyalarını okumasını önleyin: ```javascript title=".opencode/plugins/env-protection.js" export const EnvProtection = async ({ project, client, $, directory, worktree }) => { @@ -277,7 +276,7 @@ export const InjectEnvPlugin = async () => { ### Özel araçlar -Eklentiler ayrıca opencode'a özel araçlar da ekleyebilir: +Eklentiler ayrıca OpenCode'a özel araçlar da ekleyebilir: ```ts title=".opencode/plugins/custom-tools.ts" import { type Plugin, tool } from "@opencode-ai/plugin" @@ -300,19 +299,23 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { } ``` -`tool` yardımcısı, opencode'un çağırabileceği özel bir araç oluşturur. Bir Zod şeması işlevini alır ve aşağıdakileri içeren bir araç tanımı döndürür: +`tool` yardımcısı, OpenCode'un çağırabileceği özel bir araç oluşturur. Bir Zod şeması işlevini alır ve aşağıdakileri içeren bir araç tanımı döndürür: - `description`: Araç ne yapar? - `args`: Aracın argümanları için Zod şeması - `execute`: Araç çağrıldığında çalışan fonksiyon -Özel araçlarınız, yerleşik araçların yanı sıra kod açmaya da hazır olacaktır. +Özel araçlarınız, yerleşik araçların yanı sıra OpenCode'a da hazır olacaktır. + +:::note +Eğer bir eklenti aracı yerleşik bir araçla aynı adı kullanırsa, eklenti aracı öncelik kazanır. +::: --- ### Günlüğe kaydetme -Yapılandırılmış günlük kaydı için `client.app.log()` yerine `console.log` kullanın: +Yapılandırılmış günlük kaydı için `console.log` yerine `client.app.log()` kullanın: ```ts title=".opencode/plugins/my-plugin.ts" export const MyPlugin = async ({ client }) => { @@ -327,7 +330,7 @@ export const MyPlugin = async ({ client }) => { } ``` -Seviyeler: `debug`, `info`, `warn`, `error`. Ayrıntılar için [SDK documentation](https://opencode.ai/docs/sdk)'e bakın. +Seviyeler: `debug`, `info`, `warn`, `error`. Ayrıntılar için [SDK belgelerine](https://opencode.ai/docs/sdk) bakın. --- diff --git a/packages/web/src/content/docs/tr/providers.mdx b/packages/web/src/content/docs/tr/providers.mdx index efe5ff9afa4..1ddc65131c9 100644 --- a/packages/web/src/content/docs/tr/providers.mdx +++ b/packages/web/src/content/docs/tr/providers.mdx @@ -84,6 +84,37 @@ opencode'daki diğer sağlayıcılar gibi çalışır ve kullanımı tamamen ist --- +## OpenCode Go + +OpenCode Go, opencode ile iyi çalıştığı test edilmiş ve doğrulanmış, opencode ekibi tarafından sağlanan popüler açık kodlama modellerine güvenilir erişim sağlayan düşük maliyetli bir abonelik planıdır. + +1. TUI'de `/connect` komutunu çalıştırın, `OpenCode Go`'yu seçin ve [opencode.ai/auth](https://opencode.ai/zen) adresine gidin. + + ```txt + /connect + ``` + +2. Oturum açın, fatura ayrıntılarınızı ekleyin ve API anahtarınızı kopyalayın. + +3. API anahtarınızı yapıştırın. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Önerdiğimiz modellerin listesini görmek için TUI'de `/models` komutunu çalıştırın. + + ```txt + /models + ``` + +opencode'daki diğer sağlayıcılar gibi çalışır ve kullanımı tamamen isteğe bağlıdır. + +--- + ## Dizin Sağlayıcılardan bazılarına ayrıntılı olarak bakalım. Bir sağlayıcı eklemek istiyorsanız @@ -1481,6 +1512,39 @@ SAP AI Core, birleşik bir platform aracılığıyla OpenAI, Anthropic, Google, --- +### STACKIT + +STACKIT AI Model Serving, Llama, Mistral ve Qwen gibi LLM'lere odaklanarak, Avrupa altyapısında maksimum veri egemenliğine sahip AI modelleri için tam olarak yönetilen bağımsız barındırma ortamı sağlar. + +1. [STACKIT Portal](https://portal.stackit.cloud) adresine gidin, **AI Model Serving**'e gidin ve projeniz için bir yetkilendirme belirteci oluşturun. + + :::tip + Yetkilendirme belirteçleri oluşturmadan önce bir STACKIT müşteri hesabına, kullanıcı hesabına ve projesine ihtiyacınız vardır. + ::: + +2. `/connect` komutunu çalıştırın ve **STACKIT**'i arayın. + + ```txt + /connect + ``` + +3. STACKIT AI Model Serving yetkilendirme belirtecinizi girin. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. _Qwen3-VL 235B_ veya _Llama 3.3 70B_ gibi mevcut modellerden seçim yapmak için `/models` komutunu çalıştırın. + + ```txt + /models + ``` + +--- + ### OVHcloud AI Endpoints 1. [OVHcloud panel](https://ovh.com/manager)'a gidin. `Public Cloud` bölümüne gidin, `AI & Machine Learning` > `AI Endpoints` ve `API Keys` sekmesinde **Yeni bir API anahtarı oluştur**'u tıklayın. diff --git a/packages/web/src/content/docs/tr/sdk.mdx b/packages/web/src/content/docs/tr/sdk.mdx index b5ba99f4374..44c910b1cb9 100644 --- a/packages/web/src/content/docs/tr/sdk.mdx +++ b/packages/web/src/content/docs/tr/sdk.mdx @@ -117,6 +117,78 @@ try { --- +## Yapılandırılmış Çıktı + +Bir JSON şeması ile `format` belirterek modelden yapılandırılmış JSON çıktısı isteyebilirsiniz. Model, şemanızla eşleşen doğrulanmış JSON'u döndürmek için bir `StructuredOutput` aracı kullanacaktır. + +### Temel Kullanım + +```typescript +const result = await client.session.prompt({ + path: { id: sessionId }, + body: { + parts: [{ type: "text", text: "Anthropic'i araştırın ve şirket bilgileri sağlayın" }], + format: { + type: "json_schema", + schema: { + type: "object", + properties: { + company: { type: "string", description: "Şirket adı" }, + founded: { type: "number", description: "Kuruluş yılı" }, + products: { + type: "array", + items: { type: "string" }, + description: "Ana ürünler", + }, + }, + required: ["company", "founded"], + }, + }, + }, +}) + +// Yapılandırılmış çıktıya erişin +console.log(result.data.info.structured_output) +// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] } +``` + +### Çıktı Format Türleri + +| Tür | Açıklama | +| ------------- | ------------------------------------------------------------- | +| `text` | Varsayılan. Standart metin yanıtı (yapılandırılmış çıktı yok) | +| `json_schema` | Sağlanan şema ile eşleşen doğrulanmış JSON döndürür | + +### JSON Şema Formatı + +`type: 'json_schema'` kullanırken şunları sağlayın: + +| Alan | Tür | Açıklama | +| ------------ | --------------- | ------------------------------------------------------------- | +| `type` | `'json_schema'` | Gerekli. JSON şema modunu belirtir | +| `schema` | `object` | Gerekli. Çıktı yapısını tanımlayan JSON Şema nesnesi | +| `retryCount` | `number` | İsteğe bağlı. Doğrulama yeniden deneme sayısı (varsayılan: 2) | + +### Hata Yönetimi + +Model, tüm yeniden denemelerden sonra geçerli bir yapılandırılmış çıktı üretemezse, yanıt bir `StructuredOutputError` içerecektir: + +```typescript +if (result.data.info.error?.name === "StructuredOutputError") { + console.error("Yapılandırılmış çıktı üretilemedi:", result.data.info.error.message) + console.error("Denemeler:", result.data.info.error.retries) +} +``` + +### En İyi Uygulamalar + +1. **Açık açıklamalar sağlayın**: Modelin hangi verileri çıkaracağını anlamasına yardımcı olmak için şema özelliklerinde +2. **`required` kullanın**: Hangi alanların mevcut olması gerektiğini belirtmek için +3. **Şemaları odaklı tutun**: Karmaşık iç içe geçmiş şemaların model tarafından doğru doldurulması daha zor olabilir +4. **Uygun `retryCount` ayarlayın**: Karmaşık şemalar için artırın, basit olanlar için azaltın + +--- + ## API'ler SDK, tüm sunucu API'lerini type-safe bir istemci aracılığıyla sunar. @@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers() ### Oturumlar -| Yöntem | Açıklama | Notlar | -| ---------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `session.list()` | Oturumları listele | Session[]döndürür | -| `session.get({ path })` | Oturum al |Sessiondöndürür | -| `session.children({ path })` | Alt oturumları listele |Session[]döndürür | -| `session.create({ body })` | Oturum oluştur |Sessiondöndürür | -| `session.delete({ path })` | Oturum sil | `boolean` döndürür | -| `session.update({ path, body })` | Oturum özelliklerini güncelle |Sessiondöndürür | -| `session.init({ path, body })` | Uygulamayı analiz et ve `AGENTS.md` oluştur | `boolean` döndürür | -| `session.abort({ path })` | Çalışan bir oturumu iptal et | `boolean` döndürür | -| `session.share({ path })` | Oturum paylaş |Sessiondöndürür | -| `session.unshare({ path })` | Oturum paylaşımını kaldır |Sessiondöndürür | -| `session.summarize({ path, body })` | Oturumu özetle | `boolean` döndürür | -| `session.messages({ path })` | Oturumdaki mesajları listele | `{ info: `Message`, parts: `Part[]`}[]` döndürür | -| `session.message({ path })` | Mesaj ayrıntılarını al | `{ info: `Message`, parts: `Part[]`}` döndürür | -| `session.prompt({ path, body })` | İstem mesajı gönder | `body.noReply: true` UserMessage (yalnızca bağlam) döndürür. Varsayılan olarak AI yanıtıylaAssistantMessagedöndürür | -| `session.command({ path, body })` | Oturuma komut gönder | `{ info: `AssistantMessage`, parts: `Part[]`}` döndürür | -| `session.shell({ path, body })` | Bir kabuk komutu çalıştır |AssistantMessagedöndürür | -| `session.revert({ path, body })` | Bir mesajı geri al |Sessiondöndürür | -| `session.unrevert({ path })` | Geri alınan mesajları geri yükle |Sessiondöndürür | -| `postSessionByIdPermissionsByPermissionId({ path, body })` | Bir izin isteğine yanıt ver | `boolean` döndürür | +| Yöntem | Açıklama | Notlar | +| ---------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `session.list()` | Oturumları listele |Session[]döndürür | +| `session.get({ path })` | Oturum al |Sessiondöndürür | +| `session.children({ path })` | Alt oturumları listele |Session[]döndürür | +| `session.create({ body })` | Oturum oluştur |Sessiondöndürür | +| `session.delete({ path })` | Oturum sil | `boolean` döndürür | +| `session.update({ path, body })` | Oturum özelliklerini güncelle |Sessiondöndürür | +| `session.init({ path, body })` | Uygulamayı analiz et ve `AGENTS.md` oluştur | `boolean` döndürür | +| `session.abort({ path })` | Çalışan bir oturumu iptal et | `boolean` döndürür | +| `session.share({ path })` | Oturum paylaş |Sessiondöndürür | +| `session.unshare({ path })` | Oturum paylaşımını kaldır |Sessiondöndürür | +| `session.summarize({ path, body })` | Oturumu özetle | `boolean` döndürür | +| `session.messages({ path })` | Oturumdaki mesajları listele | `{ info: `Message`, parts: `Part[]`}[]` döndürür | +| `session.message({ path })` | Mesaj ayrıntılarını al | `{ info: `Message`, parts: `Part[]`}` döndürür | +| `session.prompt({ path, body })` | İstem mesajı gönder | `body.noReply: true` UserMessage (yalnızca bağlam) döndürür. Varsayılan olarak AI yanıtıylaAssistantMessagedöndürür. [yapılandırılmış çıktı](#yapılandırılmış-çıktı) için `body.outputFormat` destekler | +| `session.command({ path, body })` | Oturuma komut gönder | `{ info: `AssistantMessage`, parts: `Part[]`}` döndürür | +| `session.shell({ path, body })` | Bir kabuk komutu çalıştır |AssistantMessagedöndürür | +| `session.revert({ path, body })` | Bir mesajı geri al |Sessiondöndürür | +| `session.unrevert({ path })` | Geri alınan mesajları geri yükle |Sessiondöndürür | +| `postSessionByIdPermissionsByPermissionId({ path, body })` | Bir izin isteğine yanıt ver | `boolean` döndürür | --- diff --git a/packages/web/src/content/docs/tr/themes.mdx b/packages/web/src/content/docs/tr/themes.mdx index 93911315f26..1511e2b9212 100644 --- a/packages/web/src/content/docs/tr/themes.mdx +++ b/packages/web/src/content/docs/tr/themes.mdx @@ -61,11 +61,11 @@ Sistem teması şu kullanıcılar için idealdir: ## Tema kullanımı -`/theme` komutuyla tema seçicisini açıp tema seçebilirsiniz. İsterseniz [config](/docs/config) dosyanızda da belirtebilirsiniz. +`/theme` komutuyla tema seçicisini açıp tema seçebilirsiniz. İsterseniz `tui.json` içinde de belirtebilirsiniz. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/tr/tui.mdx b/packages/web/src/content/docs/tr/tui.mdx index 2bd5db8f5df..55305f36727 100644 --- a/packages/web/src/content/docs/tr/tui.mdx +++ b/packages/web/src/content/docs/tr/tui.mdx @@ -1,25 +1,25 @@ --- title: TUI -description: opencode terminal arayuzunu kullanin. +description: OpenCode terminal kullanıcı arayüzünü kullanma. --- import { Tabs, TabItem } from "@astrojs/starlight/components" -opencode, projelerinizde LLM ile calismak icin etkilesimli bir terminal arayuzu (TUI) sunar. +OpenCode, projelerinizde LLM ile çalışmak için etkileşimli bir terminal arayüzü (TUI) sunar. -opencode'u calistirdiginizda mevcut dizin icin TUI baslar. +OpenCode'u çalıştırdığınızda mevcut dizin için TUI başlar. ```bash opencode ``` -Isterseniz belirli bir calisma dizini icin de baslatabilirsiniz. +İsterseniz belirli bir çalışma dizini için de başlatabilirsiniz. ```bash opencode /path/to/project ``` -TUI icinde bir mesaj yazarak istem gonderebilirsiniz. +TUI içine girdiğinizde, bir mesajla istem gönderebilirsiniz. ```text Give me a quick summary of the codebase. @@ -27,51 +27,51 @@ Give me a quick summary of the codebase. --- -## Dosya referanslari +## Dosya referansları -Mesajlarinizda `@` kullanarak dosyalara referans verebilirsiniz. Bu, mevcut calisma dizininde bulanik dosya aramasi yapar. +Mesajlarınızda `@` kullanarak dosyalara referans verebilirsiniz. Bu, mevcut çalışma dizininde bulanık dosya araması yapar. :::tip -Mesajlarinizda dosyalara referans vermek icin `@` kullanabilirsiniz. +Mesajlarınızda dosyalara referans vermek için `@` kullanabilirsiniz. ::: ```text "@packages/functions/src/api/index.ts" How is auth handled in @packages/functions/src/api/index.ts? ``` -Dosya icerigi otomatik olarak konusmaya eklenir. +Dosya içeriği otomatik olarak konuşmaya eklenir. --- -## Bash komutlari +## Bash komutları -Bir mesaji `!` ile baslatarak shell komutu calistirin. +Bir mesajı `!` ile başlatarak shell komutu çalıştırın. ```bash frame="none" !ls -la ``` -Komut ciktiisi bir arac sonucu olarak konusmaya eklenir. +Komut çıktısı bir araç sonucu olarak konuşmaya eklenir. --- ## Komutlar -opencode TUI kullanirken `/` ve komut adini yazarak hizli eylemler calistirabilirsiniz. Ornek: +OpenCode TUI kullanırken `/` ve ardından komut adını yazarak hızlı eylemler çalıştırabilirsiniz. Örneğin: ```bash frame="none" /help ``` -Komutlarin cogu, lider tusu `ctrl+x` olan bir kisayola da sahiptir. [Daha fazla bilgi](/docs/keybinds). +Komutların çoğu, lider tuşu `ctrl+x` olan bir kısayola da sahiptir. [Daha fazla bilgi](/docs/keybinds). -Mevcut slash komutlarinin tam listesi: +İşte mevcut slash komutlarının tümü: --- ### connect -opencode'a bir provider ekler. Mevcut provider'lari secip API anahtarlari eklemenizi saglar. +OpenCode'a bir sağlayıcı ekler. Mevcut sağlayıcıları seçip API anahtarları eklemenizi sağlar. ```bash frame="none" /connect @@ -81,172 +81,172 @@ opencode'a bir provider ekler. Mevcut provider'lari secip API anahtarlari ekleme ### compact -Guncel oturumu sikistirir. _Takma ad_: `/summarize` +Mevcut oturumu sıkıştırır. _Takma ad_: `/summarize` ```bash frame="none" /compact ``` -**Kisayol:** `ctrl+x c` +**Kısayol:** `ctrl+x c` --- ### details -Arac calistirma detaylarini goster/gizle yapar. +Araç çalıştırma detaylarını göster/gizle yapar. ```bash frame="none" /details ``` -**Kisayol:** `ctrl+x d` +**Kısayol:** `ctrl+x d` --- ### editor -Mesaj yazmak icin harici editor acar. `EDITOR` ortam degiskeninde ayarli editoru kullanir. [Daha fazla bilgi](#editor-setup). +Mesaj yazmak için harici editör açar. `EDITOR` ortam değişkeninde ayarlı editörü kullanır. [Daha fazla bilgi](#editor-setup). ```bash frame="none" /editor ``` -**Kisayol:** `ctrl+x e` +**Kısayol:** `ctrl+x e` --- ### exit -opencode'dan cikar. _Takma adlar_: `/quit`, `/q` +OpenCode'dan çıkar. _Takma adlar_: `/quit`, `/q` ```bash frame="none" /exit ``` -**Kisayol:** `ctrl+x q` +**Kısayol:** `ctrl+x q` --- ### export -Mevcut konusmayi Markdown olarak disa aktarir ve varsayilan editorunuzde acar. `EDITOR` ortam degiskenindeki editoru kullanir. [Daha fazla bilgi](#editor-setup). +Mevcut konuşmayı Markdown olarak dışa aktarır ve varsayılan editörünüzde açar. `EDITOR` ortam değişkeninde ayarlı editörü kullanır. [Daha fazla bilgi](#editor-setup). ```bash frame="none" /export ``` -**Kisayol:** `ctrl+x x` +**Kısayol:** `ctrl+x x` --- ### help -Yardim penceresini gosterir. +Yardım penceresini gösterir. ```bash frame="none" /help ``` -**Kisayol:** `ctrl+x h` +**Kısayol:** `ctrl+x h` --- ### init -`AGENTS.md` dosyasini olusturur veya gunceller. [Daha fazla bilgi](/docs/rules). +`AGENTS.md` dosyasını oluşturur veya günceller. [Daha fazla bilgi](/docs/rules). ```bash frame="none" /init ``` -**Kisayol:** `ctrl+x i` +**Kısayol:** `ctrl+x i` --- ### models -Kullanilabilir modelleri listeler. +Kullanılabilir modelleri listeler. ```bash frame="none" /models ``` -**Kisayol:** `ctrl+x m` +**Kısayol:** `ctrl+x m` --- ### new -Yeni bir oturum baslatir. _Takma ad_: `/clear` +Yeni bir oturum başlatır. _Takma ad_: `/clear` ```bash frame="none" /new ``` -**Kisayol:** `ctrl+x n` +**Kısayol:** `ctrl+x n` --- ### redo -Geri alinan bir mesaji tekrar uygular. Yalnizca `/undo` kullanildiktan sonra kullanilabilir. +Geri alınan bir mesajı tekrar uygular. Yalnızca `/undo` kullanıldıktan sonra kullanılabilir. :::tip -Dosya degisiklikleri de geri yuklenir. +Herhangi bir dosya değişikliği de geri yüklenir. ::: -Dahilde bu islem dosya degisikliklerini yonetmek icin Git kullanir. Bu nedenle projenizin **bir Git deposu olmasi gerekir**. +Dahili olarak bu işlem dosya değişikliklerini yönetmek için Git kullanır. Bu nedenle projenizin **bir Git deposu olması gerekir**. ```bash frame="none" /redo ``` -**Kisayol:** `ctrl+x r` +**Kısayol:** `ctrl+x r` --- ### sessions -Oturumlari listeler ve aralarinda gecis yapar. _Takma adlar_: `/resume`, `/continue` +Oturumları listeler ve aralarında geçiş yapar. _Takma adlar_: `/resume`, `/continue` ```bash frame="none" /sessions ``` -**Kisayol:** `ctrl+x l` +**Kısayol:** `ctrl+x l` --- ### share -Mevcut oturumu paylasir. [Daha fazla bilgi](/docs/share). +Mevcut oturumu paylaşır. [Daha fazla bilgi](/docs/share). ```bash frame="none" /share ``` -**Kisayol:** `ctrl+x s` +**Kısayol:** `ctrl+x s` --- ### themes -Kullanilabilir temalari listeler. +Kullanılabilir temaları listeler. ```bash frame="none" -/theme +/themes ``` -**Kisayol:** `ctrl+x t` +**Kısayol:** `ctrl+x t` --- ### thinking -Konusmadaki thinking/reasoning bloklarinin gorunurlugunu degistirir. Etkin oldugunda, genisletilmis dusunmeyi destekleyen modellerin akil yurutmelerini gorebilirsiniz. +Konuşmadaki thinking/reasoning bloklarının görünürlüğünü değiştirir. Etkin olduğunda, genişletilmiş düşünmeyi destekleyen modellerin akıl yürütme sürecini görebilirsiniz. :::note -Bu komut sadece thinking bloklarinin **gosterimini** kontrol eder, modelin gercek akil yurutmelerini acip kapatmaz. Gercek akil yurutme yetenegini degistirmek icin `ctrl+t` ile model varyantlari arasinda gecis yapin. +Bu komut sadece thinking bloklarının **gösterilip gösterilmeyeceğini** kontrol eder - modelin akıl yürütme yeteneklerini etkinleştirmez veya devre dışı bırakmaz. Gerçek akıl yürütme yeteneklerini değiştirmek için `ctrl+t` kullanarak model varyantları arasında geçiş yapın. ::: ```bash frame="none" @@ -257,25 +257,25 @@ Bu komut sadece thinking bloklarinin **gosterimini** kontrol eder, modelin gerce ### undo -Konusmadaki son mesaji geri alir. En son kullanici mesaji, sonraki tum yanitlar ve dosya degisiklikleri kaldirilir. +Konuşmadaki son mesajı geri alır. En son kullanıcı mesajını, sonraki tüm yanıtları ve dosya değişikliklerini kaldırır. :::tip -Yapilan dosya degisiklikleri de geri cevrilir. +Yapılan tüm dosya değişiklikleri de geri alınır. ::: -Dahilde bu islem dosya degisikliklerini yonetmek icin Git kullanir. Bu nedenle projenizin **bir Git deposu olmasi gerekir**. +Dahili olarak bu işlem dosya değişikliklerini yönetmek için Git kullanır. Bu nedenle projenizin **bir Git deposu olması gerekir**. ```bash frame="none" /undo ``` -**Kisayol:** `ctrl+x u` +**Kısayol:** `ctrl+x u` --- ### unshare -Mevcut oturumun paylasimini kaldirir. [Daha fazla bilgi](/docs/share#paylasimi-kaldirma). +Mevcut oturumun paylaşımını kaldırır. [Daha fazla bilgi](/docs/share#un-sharing). ```bash frame="none" /unshare @@ -283,9 +283,9 @@ Mevcut oturumun paylasimini kaldirir. [Daha fazla bilgi](/docs/share#paylasimi-k --- -## Editor kurulumu +## Editör kurulumu -`/editor` ve `/export` komutlari, `EDITOR` ortam degiskeninde tanimli editoru kullanir. +Hem `/editor` hem de `/export` komutları, `EDITOR` ortam değişkeninde belirtilen editörü kullanır.-Yaygin editor secenekleri: +Popüler editör seçenekleri şunları içerir: - `code` - Visual Studio Code - `cursor` - Cursor - `windsurf` - Windsurf -- `nvim` - Neovim editoru -- `vim` - Vim editoru -- `nano` - Nano editoru +- `nvim` - Neovim editörü +- `vim` - Vim editörü +- `nano` - Nano editörü - `notepad` - Windows Notepad - `subl` - Sublime Text :::note -VS Code gibi bazi editorlerin `--wait` parametresiyle baslatilmasi gerekir. +VS Code gibi bazı editörlerin `--wait` bayrağı ile başlatılması gerekir. ::: -Bazi editorler bloklayici modda calismak icin komut satiri argumanlari ister. `--wait` bayragi editor surecinin kapanana kadar beklemesini saglar. +Bazı editörler bloklama modunda çalışmak için komut satırı argümanlarına ihtiyaç duyar. `--wait` bayrağı, editör süreci kapanana kadar işlemin bloklanmasını sağlar. --- -## Yapilandirin +## Yapılandırma -TUI davranisini opencode config dosyanizdan ozellestirebilirsiniz. +TUI davranışını `tui.json` (veya `tui.jsonc`) aracılığıyla özelleştirebilirsiniz. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -### Secenekler +Bu, sunucu/çalışma zamanı davranışını yapılandıran `opencode.json` dosyasından ayrıdır. -- `scroll_acceleration` - Daha akici ve dogal kaydirma icin macOS tarzı hizlanmayi acar. Etkin oldugunda hizli kaydirma hareketlerinde hiz artar, yavas hareketlerde hassas kalir. **Bu ayar etkin oldugunda `scroll_speed` degerini gecersiz kilar.** -- `scroll_speed` - Kaydirma komutlariyla TUI'nin ne kadar hizli kayacagini belirler (minimum: `1`). Varsayilan `3` degeridir. **Not: `scroll_acceleration.enabled` `true` ise yok sayilir.** +### Seçenekler + +- `theme` - UI temanızı ayarlar. [Daha fazla bilgi](/docs/themes). +- `keybinds` - Klavye kısayollarını özelleştirir. [Daha fazla bilgi](/docs/keybinds). +- `scroll_acceleration.enabled` - Pürüzsüz, doğal kaydırma için macOS tarzı kaydırma ivmesini etkinleştirin. Etkinleştirildiğinde, kaydırma hızı hızlı kaydırma hareketleriyle artar ve daha yavaş hareketler için hassas kalır. **Bu ayar `scroll_speed` ayarından önceliklidir ve etkinleştirildiğinde onu geçersiz kılar.** +- `scroll_speed` - Kaydırma komutlarını kullanırken TUI'nin ne kadar hızlı kaydırılacağını kontrol eder (minimum: `0.001`, ondalık değerleri destekler). Varsayılan değer `3`'tür. **Not: `scroll_acceleration.enabled` `true` olarak ayarlanmışsa bu yok sayılır.** +- `diff_style` - Fark (diff) oluşturmayı kontrol eder. `"auto"` terminal genişliğine uyum sağlar, `"stacked"` her zaman tek sütunlu bir düzen gösterir. + +Özel bir TUI yapılandırma yolu yüklemek için `OPENCODE_TUI_CONFIG` kullanın. --- -## Ozellestirme +## Özelleştirme -TUI gorunumunun cesitli kisimlarini komut paletiyle (`ctrl+x h` veya `/help`) ozellestirebilirsiniz. Bu ayarlar yeniden baslatmalar arasinda korunur. +Komut paletini (`ctrl+x h` veya `/help`) kullanarak TUI görünümünün çeşitli yönlerini özelleştirebilirsiniz. Bu ayarlar yeniden başlatmalar arasında korunur. --- -#### Kullanici adi gorunumu +#### Kullanıcı adı görünümü -Sohbet mesajlarinda kullanici adinizin gosterilip gosterilmeyecegini degistirir. Sunlardan erisebilirsiniz: +Sohbet mesajlarında kullanıcı adınızın görünüp görünmeyeceğini değiştirin. Buna şuradan erişin: -- Komut paleti: "username" veya "hide username" aratin -- Ayar otomatik saklanir ve TUI oturumlarinda hatirlanir +- Komut paleti: "username" veya "hide username" araması yapın +- Ayar otomatik olarak kalıcı hale gelir ve TUI oturumları arasında hatırlanır diff --git a/packages/web/src/content/docs/tr/zen.mdx b/packages/web/src/content/docs/tr/zen.mdx index b9978894193..684bccb3e23 100644 --- a/packages/web/src/content/docs/tr/zen.mdx +++ b/packages/web/src/content/docs/tr/zen.mdx @@ -1,61 +1,61 @@ --- title: Zen -description: opencode ekibinin sundugu secili model listesi. +description: opencode tarafından sağlanan seçilmiş modeller listesi. --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` -OpenCode Zen, opencode ekibi tarafindan test edilip dogrulanmis modellerin listesidir. +OpenCode Zen, opencode ekibi tarafından test edilip doğrulanmış modellerin bir listesidir. :::note -OpenCode Zen su anda beta asamasindadir. +OpenCode Zen şu anda beta aşamasındadır. ::: -Zen, opencode'daki diger provider'lar gibi calisir. OpenCode Zen'e giris yapar ve API anahtarinizi alirsiniz. -Tamamen istege baglidir; opencode kullanmak icin Zen kullanmak zorunda degilsiniz. +Zen, opencode'daki diğer sağlayıcılar gibi çalışır. OpenCode Zen'e giriş yapar ve API anahtarınızı alırsınız. Tamamen isteğe bağlıdır ve opencode kullanmak için bunu kullanmanıza gerek yoktur. --- ## Arka plan -Piyasada cok sayida model var, ancak bunlarin sadece bir kismi kodlama ajani olarak iyi calisir. Ayrica provider'larin cogu birbirinden cok farkli sekilde ayarlanir; bu da performans ve kaliteyi ciddi bicimde degistirir. +Piyasada çok sayıda model var ancak bu modellerden sadece birkaçı kodlama ajanı olarak iyi çalışır. Ayrıca çoğu sağlayıcı çok farklı şekilde yapılandırılmıştır; bu nedenle çok farklı performans ve kalite elde edersiniz. :::tip -opencode ile iyi calisan belirli model/provider kombinasyonlarini test ettik. +opencode ile iyi çalışan seçkin bir grup model ve sağlayıcıyı test ettik. ::: -Bu nedenle OpenRouter benzeri bir servis uzerinden model kullaniyorsaniz, istediginiz modelin en iyi surumunu alip almadiginizdan her zaman emin olamazsiniz. +Bu nedenle, OpenRouter gibi bir şey üzerinden bir model kullanıyorsanız, istediğiniz modelin en iyi sürümünü alıp almadığınızdan asla emin olamazsınız. -Bunu cozmeye yonelik olarak sunlari yaptik: +Bunu düzeltmek için birkaç şey yaptık: -1. Secili bir model grubunu test ettik ve ekipleriyle en iyi calisma sekli uzerine gorustuk -2. Daha sonra bazi provider'larla bu modellerin dogru sekilde sunuldugunu dogruladik -3. Son olarak model/provider kombinasyonlarini benchmark ederek guvenle onerebilecegimiz bir liste olusturduk +1. Seçkin bir grup modeli test ettik ve ekipleriyle bunları en iyi nasıl çalıştıracakları hakkında konuştuk. +2. Daha sonra bunların doğru şekilde sunulduğundan emin olmak için birkaç sağlayıcıyla çalıştık. +3. Son olarak model/sağlayıcı kombinasyonunu karşılaştırdık ve önermekten memnuniyet duyduğumuz bir liste oluşturduk. -OpenCode Zen, bu modellere erisim saglayan bir AI gateway'dir. +OpenCode Zen, bu modellere erişmenizi sağlayan bir AI ağ geçididir. --- -## Nasil calisir +## Nasıl çalışır -OpenCode Zen, opencode'daki diger provider'lar gibi calisir. +OpenCode Zen, opencode'daki diğer sağlayıcılar gibi çalışır. -1. **OpenCode Zen** hesabina giris yapin, odeme bilgilerinizi ekleyin ve API anahtarinizi kopyalayin -2. TUI'da `/connect` komutunu calistirin, OpenCode Zen'i secin ve API anahtarinizi yapistirin -3. Onerdigimiz model listesini gormek icin TUI'da `/models` calistirin +1. **OpenCode Zen**'de oturum açın, fatura ayrıntılarınızı ekleyin ve API anahtarınızı kopyalayın. +2. TUI'de `/connect` komutunu çalıştırın, OpenCode Zen'i seçin ve API anahtarınızı yapıştırın. +3. Önerdiğimiz modellerin listesini görmek için TUI'de `/models` komutunu çalıştırın. -Ucretlendirme istek basina yapilir ve hesabiniza kredi yukleyebilirsiniz. +İstek başına ücretlendirilirsiniz ve hesabınıza kredi ekleyebilirsiniz. --- -## Endpoint'ler +## Uç Noktalar -Modellerimize asagidaki API endpoint'leri uzerinden de erisebilirsiniz. +Modellerimize aşağıdaki API uç noktaları aracılığıyla da erişebilirsiniz. | Model | Model ID | Endpoint | AI SDK Package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -65,35 +65,36 @@ Modellerimize asagidaki API endpoint'leri uzerinden de erisebilirsiniz. | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | +| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| MiniMax M2.1 Free | minimax-m2.1-free | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 4.7 Free | glm-4.7-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Big Pickle | big-pickle | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -opencode config'inizdeki [model id](/docs/config/#models), `opencode/ @@ -299,7 +299,7 @@ Mevcut oturumun paylasimini kaldirir. [Daha fazla bilgi](/docs/share#paylasimi-k export EDITOR="code --wait" ``` - Kalici yapmak icin bunu kabuk profilinize ekleyin: + Kalıcı yapmak için bunu kabuk profilinize ekleyin; `~/.bashrc`, `~/.zshrc` vb. @@ -313,7 +313,8 @@ Mevcut oturumun paylasimini kaldirir. [Daha fazla bilgi](/docs/share#paylasimi-k set EDITOR=code --wait ``` - Kalici yapmak icin **System Properties** > **Environment Variables** yolunu kullanin. + Kalıcı yapmak için **System Properties** > **Environment + Variables** yolunu kullanın. @@ -326,62 +327,72 @@ Mevcut oturumun paylasimini kaldirir. [Daha fazla bilgi](/docs/share#paylasimi-k $env:EDITOR = "code --wait" ``` - Kalici yapmak icin bunu PowerShell profilinize ekleyin. + Kalıcı yapmak için bunu PowerShell profilinize ekleyin.` formatini kullanir. -Ornegin GPT 5.2 Codex icin config'te `opencode/gpt-5.2-codex` kullanirsiniz. +opencode yapılandırmanızdaki [model kimliği](/docs/config/#models) `opencode/ ` biçimini kullanır. Örneğin, GPT 5.2 Codex için yapılandırmanızda `opencode/gpt-5.2-codex` kullanırsınız. --- ### Modeller -Mevcut modellerin tam listesini ve metadatasini su adresten cekebilirsiniz: +Mevcut modellerin tam listesini ve meta verilerini şuradan alabilirsiniz: ``` https://opencode.ai/zen/v1/models @@ -101,36 +102,41 @@ https://opencode.ai/zen/v1/models --- -## Fiyatlandirma +## Fiyatlandırma -Kullandikca ode modelini destekliyoruz. Asagidaki fiyatlar **1M token basina** verilmistir. +Kullandıkça öde modelini destekliyoruz. Aşağıda **1 milyon token başına** fiyatlar verilmiştir. | Model | Input | Output | Cached Read | Cached Write | | --------------------------------- | ------ | ------ | ----------- | ------------ | | Big Pickle | Free | Free | Free | - | -| MiniMax M2.1 Free | Free | Free | Free | - | +| MiniMax M2.5 Free | Free | Free | Free | - | +| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 4.7 Free | Free | Free | Free | - | +| GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K tokens) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K tokens) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -141,98 +147,94 @@ Kullandikca ode modelini destekliyoruz. Asagidaki fiyatlar **1M token basina** v | GPT 5 Codex | $1.07 | $8.50 | $0.107 | - | | GPT 5 Nano | Free | Free | Free | - | -Kullanim gecmisinizde _Claude Haiku 3.5_ gorebilirsiniz. Bu, oturum basliklarini olusturmak icin kullanilan [dusuk maliyetli bir modeldir](/docs/config/#models). +Kullanım geçmişinizde _Claude Haiku 3.5_ fark edebilirsiniz. Bu, oturumlarınızın başlıklarını oluşturmak için kullanılan [düşük maliyetli bir modeldir](/docs/config/#models). :::note -Kredi karti ucretleri maliyetine yansitilir (islem basina %4.4 + $0.30); bunun disinda ek ucret almiyoruz. +Kredi kartı ücretleri maliyetine yansıtılır (işlem başına %4,4 + 0,30$); bunun ötesinde hiçbir ücret talep etmiyoruz. ::: -Ucretsiz modeller: +Ücretsiz modeller: -- GLM 4.7 Free, sinirli bir sure icin opencode'da ucretsizdir. Ekip bu surede geri bildirim toplayip modeli iyilestiriyor -- Kimi K2.5 Free, sinirli bir sure icin opencode'da ucretsizdir. Ekip bu surede geri bildirim toplayip modeli iyilestiriyor -- MiniMax M2.1 Free, sinirli bir sure icin opencode'da ucretsizdir. Ekip bu surede geri bildirim toplayip modeli iyilestiriyor -- Big Pickle, sinirli bir sure icin opencode'da ucretsiz olan gizli bir modeldir. Ekip bu surede geri bildirim toplayip modeli iyilestiriyor +- MiniMax M2.5 Free, sınırlı bir süre için OpenCode'da ücretsizdir. Ekip bu süreyi geri bildirim toplamak ve modeli iyileştirmek için kullanıyor. +- Big Pickle, sınırlı bir süre için OpenCode'da ücretsiz olan gizli bir modeldir. Ekip bu süreyi geri bildirim toplamak ve modeli iyileştirmek için kullanıyor. -Sorunuz varsa bize ulasin. +Sorularınız varsa bizimle iletişime geçin. --- -### Otomatik yukleme +### Otomatik yükleme -Bakiyeniz $5'in altina dustugunde Zen otomatik olarak $20 yukler. +Bakiyeniz 5$'ın altına düşerse, Zen otomatik olarak 20$ yükler. -Otomatik yukleme tutarini degistirebilir veya bu ozelligi tamamen kapatabilirsiniz. +Otomatik yükleme tutarını değiştirebilirsiniz. Otomatik yüklemeyi tamamen devre dışı da bırakabilirsiniz. --- -### Aylik limitler +### Aylık limitler -Tum calisma alani ve ekip uyeleri icin aylik kullanim limiti belirleyebilirsiniz. +Ayrıca tüm çalışma alanı ve ekibinizin her üyesi için aylık kullanım limiti belirleyebilirsiniz. -Ornegin aylik limiti $20 yaptiysaniz Zen bir ayda $20'den fazla kullandirtmaz. Ancak otomatik yukleme aciksa bakiye $5 altina dustugunde toplam odemeniz $20'nin uzerine cikabilir. +Örneğin, aylık kullanım limitini 20$ olarak ayarladığınızı varsayalım, Zen bir ayda 20$'dan fazla kullanmaz. Ancak otomatik yüklemeyi etkinleştirdiyseniz, bakiyeniz 5$'ın altına düşerse Zen sizden 20$'dan fazla ücret alabilir. --- ## Gizlilik -Tum modellerimiz ABD'de barindiriliyor. Provider'larimiz sifir saklama politikasini izler ve verilerinizi model egitimi icin kullanmaz; asagidaki istisnalar haric: +Tüm modellerimiz ABD'de barındırılmaktadır. Sağlayıcılarımız sıfır saklama politikasını izler ve aşağıdaki istisnalar dışında verilerinizi model eğitimi için kullanmaz: -- Big Pickle: Ucretsiz donemde toplanan veriler modeli iyilestirmek icin kullanilabilir -- GLM 4.7 Free: Ucretsiz donemde toplanan veriler modeli iyilestirmek icin kullanilabilir -- Kimi K2.5 Free: Ucretsiz donemde toplanan veriler modeli iyilestirmek icin kullanilabilir -- MiniMax M2.1 Free: Ucretsiz donemde toplanan veriler modeli iyilestirmek icin kullanilabilir -- OpenAI API'leri: Istekler [OpenAI veri politikalari](https://platform.openai.com/docs/guides/your-data) kapsaminda 30 gun saklanir -- Anthropic API'leri: Istekler [Anthropic veri politikalari](https://docs.anthropic.com/en/docs/claude-code/data-usage) kapsaminda 30 gun saklanir +- Big Pickle: Ücretsiz döneminde toplanan veriler modeli iyileştirmek için kullanılabilir. +- MiniMax M2.5 Free: Ücretsiz döneminde toplanan veriler modeli iyileştirmek için kullanılabilir. +- OpenAI API'leri: İstekler [OpenAI'nin Veri Politikaları](https://platform.openai.com/docs/guides/your-data) uyarınca 30 gün boyunca saklanır. +- Anthropic API'leri: İstekler [Anthropic'in Veri Politikaları](https://docs.anthropic.com/en/docs/claude-code/data-usage) uyarınca 30 gün boyunca saklanır. --- -## Ekipler icin +## Ekipler İçin -Zen ekipler icin de guclu bir cozumdur. Ekip arkadaslarini davet edebilir, roller atayabilir, kullanilacak modelleri yonetebilir ve daha fazlasini yapabilirsiniz. +Zen ekipler için de harika çalışır. Ekip arkadaşlarınızı davet edebilir, roller atayabilir, ekibinizin kullandığı modelleri düzenleyebilir ve daha fazlasını yapabilirsiniz. :::note -Calisma alanlari beta kapsaminda su anda ekipler icin ucretsizdir. +Çalışma alanları şu anda beta'nın bir parçası olarak ekipler için ücretsizdir. ::: -Calisma alani yonetimi su anda beta kapsaminda ucretsizdir. Fiyatlandirma detaylarini yakinda paylasacagiz. +Çalışma alanınızı yönetmek şu anda beta'nın bir parçası olarak ekipler için ücretsizdir. Yakında fiyatlandırma hakkında daha fazla ayrıntı paylaşacağız. --- ### Roller -Calisma alaniniza ekip arkadaslarini davet edip rol atayabilirsiniz: +Ekip arkadaşlarınızı çalışma alanınıza davet edebilir ve roller atayabilirsiniz: -- **Admin**: Modelleri, uyeleri, API anahtarlarini ve faturalandirmayi yonetir -- **Member**: Yalnizca kendi API anahtarlarini yonetir +- **Admin**: Modelleri, üyeleri, API anahtarlarını ve faturalandırmayı yönetin +- **Member**: Yalnızca kendi API anahtarlarını yönetin -Admin'ler maliyet kontrolu icin uye bazinda aylik harcama limitleri de ayarlayabilir. +Yöneticiler, maliyetleri kontrol altında tutmak için her üye için aylık harcama limitleri de belirleyebilir. --- -### Model erisimi +### Model erişimi -Admin'ler calisma alani icin belirli modelleri acip kapatabilir. Devre disi bir modele yapilan istekler hata dondurur. +Yöneticiler çalışma alanı için belirli modelleri etkinleştirebilir veya devre dışı bırakabilir. Devre dışı bırakılmış bir modele yapılan istekler bir hata döndürür. -Bu, veri toplayan bir modelin kullanimini kapatmak istediginiz durumlarda kullanislidir. +Bu, veri toplayan bir modelin kullanımını devre dışı bırakmak istediğiniz durumlarda kullanışlıdır. --- -### Kendi anahtarinizi kullanin +### Kendi anahtarınızı getirin -Zen'deki diger modellere erisirken kendi OpenAI veya Anthropic API anahtarlarinizi da kullanabilirsiniz. +Zen'deki diğer modellere erişmeye devam ederken kendi OpenAI veya Anthropic API anahtarlarınızı kullanabilirsiniz. -Kendi anahtarinizi kullandiginizda token ucreti Zen yerine dogrudan provider tarafindan faturalandirilir. +Kendi anahtarlarınızı kullandığınızda, tokenler Zen tarafından değil, doğrudan sağlayıcı tarafından faturalandırılır. -Ornegin kurulusunuzun zaten OpenAI veya Anthropic anahtari varsa Zen'in sagladigi anahtar yerine onu kullanabilirsiniz. +Örneğin, kuruluşunuzun halihazırda OpenAI veya Anthropic için bir anahtarı olabilir ve Zen'in sağladığı anahtar yerine onu kullanmak isteyebilirsiniz. --- ## Hedefler -OpenCode Zen'i su amaclarla olusturduk: +OpenCode Zen'i şu amaçlarla oluşturduk: -1. Kodlama ajanlari icin en iyi model/provider kombinasyonlarini **benchmark etmek** -2. Performansi dusurmeden veya daha ucuz provider'a yonlendirmeden **en yuksek kaliteye** erismek -3. Maliyetine satarak fiyat dususlerini kullaniciya yansitmak ve yalnizca islem ucretlerini kapsayan pay birakmak -4. Herhangi bir kodlama ajaniyla kullanima izin vererek **kilitlenmeyi onlemek** ve opencode'da diger provider'lari her zaman acik tutmak +1. Kodlama ajanları için en iyi modelleri/sağlayıcıları **kıyaslamak**. +2. **En yüksek kaliteli** seçeneklere erişmek ve performansı düşürmemek veya daha ucuz sağlayıcılara yönlendirmemek. +3. Maliyetine satış yaparak herhangi bir **fiyat düşüşünü** yansıtmak; böylece tek kâr marjı işlem ücretlerimizi karşılamaktır. +4. Başka bir kodlama ajanıyla kullanmanıza izin vererek **kilitlenmeyi önlemek**. Ve her zaman OpenCode ile başka bir sağlayıcıyı kullanmanıza izin vermek. diff --git a/packages/web/src/content/docs/zh-cn/cli.mdx b/packages/web/src/content/docs/zh-cn/cli.mdx index 490d59ca0be..503207ec488 100644 --- a/packages/web/src/content/docs/zh-cn/cli.mdx +++ b/packages/web/src/content/docs/zh-cn/cli.mdx @@ -558,6 +558,7 @@ OpenCode 可以通过环境变量进行配置。 | `OPENCODE_AUTO_SHARE` | boolean | 自动分享会话 | | `OPENCODE_GIT_BASH_PATH` | string | Windows 上 Git Bash 可执行文件的路径 | | `OPENCODE_CONFIG` | string | 配置文件路径 | +| `OPENCODE_TUI_CONFIG` | string | TUI 配置文件路径 | | `OPENCODE_CONFIG_DIR` | string | 配置目录路径 | | `OPENCODE_CONFIG_CONTENT` | string | 内联 JSON 配置内容 | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | 禁用自动更新检查 | diff --git a/packages/web/src/content/docs/zh-cn/config.mdx b/packages/web/src/content/docs/zh-cn/config.mdx index 8ed3c8fbee3..c401bcf121f 100644 --- a/packages/web/src/content/docs/zh-cn/config.mdx +++ b/packages/web/src/content/docs/zh-cn/config.mdx @@ -14,10 +14,11 @@ OpenCode 支持 **JSON** 和 **JSONC**(带注释的 JSON)格式。 ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -33,7 +34,7 @@ OpenCode 支持 **JSON** 和 **JSONC**(带注释的 JSON)格式。 配置文件是合并在一起的,而不是被替换。来自以下配置位置的设置会被合并。后面的配置仅在键冲突时覆盖前面的配置。所有配置中的非冲突设置都会被保留。 -例如,如果您的全局配置设置了 `theme: "opencode"` 和 `autoupdate: true`,而您的项目配置设置了 `model: "anthropic/claude-sonnet-4-5"`,则最终配置将包含所有三个设置。 +例如,如果您的全局配置设置了 `autoupdate: true`,而您的项目配置设置了 `model: "anthropic/claude-sonnet-4-5"`,则最终配置将包含这两个设置。 --- diff --git a/packages/web/src/content/docs/zh-cn/keybinds.mdx b/packages/web/src/content/docs/zh-cn/keybinds.mdx index bb1d2c21a79..5108fdbb519 100644 --- a/packages/web/src/content/docs/zh-cn/keybinds.mdx +++ b/packages/web/src/content/docs/zh-cn/keybinds.mdx @@ -3,11 +3,11 @@ title: 快捷键 description: 自定义您的快捷键。 --- -OpenCode 提供了一系列快捷键,您可以通过 OpenCode 配置进行自定义。 +OpenCode 提供了一系列快捷键,您可以通过 `tui.json` 进行自定义。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ OpenCode 的大多数快捷键使用 `leader`(前导键)。这可以避免 ## 禁用快捷键 -您可以通过在配置中将对应的键值设置为 "none" 来禁用某个快捷键。 +您可以通过将键值添加到 `tui.json` 并设置为 "none" 来禁用某个快捷键。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/zh-cn/themes.mdx b/packages/web/src/content/docs/zh-cn/themes.mdx index d1abefed6d6..79386fbe996 100644 --- a/packages/web/src/content/docs/zh-cn/themes.mdx +++ b/packages/web/src/content/docs/zh-cn/themes.mdx @@ -61,11 +61,11 @@ OpenCode 自带多个内置主题。 ## 使用主题 -您可以通过 `/theme` 命令调出主题选择界面来选择主题,也可以在[配置](/docs/config)文件中直接指定。 +您可以通过 `/theme` 命令调出主题选择界面来选择主题,也可以在 `tui.json` 文件中直接指定。 -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/zh-cn/zen.mdx b/packages/web/src/content/docs/zh-cn/zen.mdx index e3fe35e8672..951ebe7094f 100644 --- a/packages/web/src/content/docs/zh-cn/zen.mdx +++ b/packages/web/src/content/docs/zh-cn/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: 由 OpenCode 提供的精选模型列表。 --- -import config from "../../../../config.mjs" +import config from "../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` @@ -55,6 +55,7 @@ OpenCode Zen 的工作方式与 OpenCode 中的任何其他提供商相同。 | 模型 | 模型 ID | 端点 | AI SDK 包 | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -79,11 +80,9 @@ OpenCode Zen 的工作方式与 OpenCode 中的任何其他提供商相同。 | MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 5 Free | glm-5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -113,11 +112,9 @@ https://opencode.ai/zen/v1/models | MiniMax M2.5 Free | 免费 | 免费 | 免费 | - | | MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 5 Free | Free | Free | Free | - | | GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | 免费 | 免费 | 免费 | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | @@ -139,6 +136,7 @@ https://opencode.ai/zen/v1/models | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -157,8 +155,6 @@ https://opencode.ai/zen/v1/models 免费模型说明: -- GLM 5 Free 在 OpenCode 上限时免费提供。团队正在利用这段时间收集反馈并改进模型。 -- Kimi K2.5 Free 在 OpenCode 上限时免费提供。团队正在利用这段时间收集反馈并改进模型。 - MiniMax M2.5 Free 在 OpenCode 上限时免费提供。团队正在利用这段时间收集反馈并改进模型。 - Big Pickle 是一个隐身模型,在 OpenCode 上限时免费提供。团队正在利用这段时间收集反馈并改进模型。 @@ -187,8 +183,6 @@ https://opencode.ai/zen/v1/models 我们所有的模型都托管在美国。我们的提供商遵循零保留政策,不会将你的数据用于模型训练,但以下情况除外: - Big Pickle:在免费期间,收集的数据可能会被用于改进模型。 -- GLM 5 Free:在免费期间,收集的数据可能会被用于改进模型。 -- Kimi K2.5 Free:在免费期间,收集的数据可能会被用于改进模型。 - MiniMax M2.5 Free:在免费期间,收集的数据可能会被用于改进模型。 - OpenAI API:请求会根据 [OpenAI 数据政策](https://platform.openai.com/docs/guides/your-data)保留 30 天。 - Anthropic API:请求会根据 [Anthropic 数据政策](https://docs.anthropic.com/en/docs/claude-code/data-usage)保留 30 天。 diff --git a/packages/web/src/content/docs/zh-tw/cli.mdx b/packages/web/src/content/docs/zh-tw/cli.mdx index f11066dcf56..888740f5bec 100644 --- a/packages/web/src/content/docs/zh-tw/cli.mdx +++ b/packages/web/src/content/docs/zh-tw/cli.mdx @@ -558,6 +558,7 @@ OpenCode 可以透過環境變數進行設定。 | `OPENCODE_AUTO_SHARE` | boolean | 自動分享工作階段 | | `OPENCODE_GIT_BASH_PATH` | string | Windows 上 Git Bash 可執行檔的路徑 | | `OPENCODE_CONFIG` | string | 設定檔路徑 | +| `OPENCODE_TUI_CONFIG` | string | TUI 設定檔路徑 | | `OPENCODE_CONFIG_DIR` | string | 設定目錄路徑 | | `OPENCODE_CONFIG_CONTENT` | string | 內嵌 JSON 設定內容 | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | 停用自動更新檢查 | diff --git a/packages/web/src/content/docs/zh-tw/config.mdx b/packages/web/src/content/docs/zh-tw/config.mdx index 3715dd0c9f7..a694823a65f 100644 --- a/packages/web/src/content/docs/zh-tw/config.mdx +++ b/packages/web/src/content/docs/zh-tw/config.mdx @@ -14,10 +14,11 @@ OpenCode 支援 **JSON** 和 **JSONC**(帶註解的 JSON)格式。 ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -33,7 +34,7 @@ OpenCode 支援 **JSON** 和 **JSONC**(帶註解的 JSON)格式。 設定檔是合併在一起的,而不是被替換。來自以下設定位置的設定會被合併。後面的設定僅在鍵衝突時覆寫前面的設定。所有設定中的非衝突設定都會被保留。 -例如,如果您的全域設定設定了 `theme: "opencode"` 和 `autoupdate: true`,而您的專案設定設定了 `model: "anthropic/claude-sonnet-4-5"`,則最終設定將包含所有三個設定。 +例如,如果您的全域設定設定了 `autoupdate: true`,而您的專案設定設定了 `model: "anthropic/claude-sonnet-4-5"`,則最終設定將包含這兩個設定。 --- @@ -171,6 +172,10 @@ opencode run "Hello world" - `scroll_speed` - 自訂捲動速度倍率(預設值:`3`,最小值:`1`)。如果 `scroll_acceleration.enabled` 為 `true`,則忽略此選項。 - `diff_style` - 控制差異呈現方式。`"auto"` 根據終端機寬度自適應,`"stacked"` 始終顯示單列。 +使用 `OPENCODE_TUI_CONFIG` 指向自訂 TUI 設定檔。 + +`opencode.json` 中的舊版 `theme`、`keybinds` 和 `tui` 鍵已被棄用,並將在可能的情況下自動遷移。 + [在此了解更多關於 TUI 的資訊](/docs/tui)。 --- @@ -297,12 +302,12 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)優先於基於設定 ### 主題 -您可以透過 OpenCode 設定中的 `theme` 選項設定要使用的主題。 +在 `tui.json` 中設定您的 UI 主題。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -402,11 +407,11 @@ Bearer Token(`AWS_BEARER_TOKEN_BEDROCK` 或 `/connect`)優先於基於設定 ### 快捷鍵 -您可以透過 `keybinds` 選項自訂快捷鍵。 +在 `tui.json` 中自訂快捷鍵。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` diff --git a/packages/web/src/content/docs/zh-tw/custom-tools.mdx b/packages/web/src/content/docs/zh-tw/custom-tools.mdx index 3229c6fddfa..86c2b0467f9 100644 --- a/packages/web/src/content/docs/zh-tw/custom-tools.mdx +++ b/packages/web/src/content/docs/zh-tw/custom-tools.mdx @@ -79,6 +79,32 @@ export const multiply = tool({ --- +#### 與內建工具名稱衝突 + +自訂工具以工具名稱作為鍵值。如果自訂工具使用與內建工具相同的名稱,則自訂工具具有優先權。 + +例如,此檔案將替換內建的 `bash` 工具: + +```ts title=".opencode/tools/bash.ts" +import { tool } from "@opencode-ai/plugin" + +export default tool({ + description: "Restricted bash wrapper", + args: { + command: tool.schema.string(), + }, + async execute(args) { + return `blocked: ${args.command}` + }, +}) +``` + +:::note +除非您有意替換內建工具,否則請使用唯一的名稱。如果您想停用內建工具但不覆寫它,請使用[權限](/docs/permissions)。 +::: + +--- + ### 參數 您可以使用 `tool.schema`(即 [Zod](https://zod.dev))來定義參數型別。 diff --git a/packages/web/src/content/docs/zh-tw/keybinds.mdx b/packages/web/src/content/docs/zh-tw/keybinds.mdx index d1458dfe8c0..ca085db01d8 100644 --- a/packages/web/src/content/docs/zh-tw/keybinds.mdx +++ b/packages/web/src/content/docs/zh-tw/keybinds.mdx @@ -3,11 +3,11 @@ title: 快捷鍵 description: 自訂您的快捷鍵。 --- -OpenCode 提供了一系列快捷鍵,您可以透過 OpenCode 設定進行自訂。 +OpenCode 提供了一系列快捷鍵,您可以透過 `tui.json` 進行自訂。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d, q", @@ -117,11 +117,11 @@ OpenCode 的大多數快捷鍵使用 `leader`(前導鍵)。這可以避免 ## 停用快捷鍵 -您可以透過在設定中將對應的鍵值設定為 "none" 來停用某個快捷鍵。 +您可以透過在 `tui.json` 中將對應的鍵值設定為 "none" 來停用某個快捷鍵。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/zh-tw/lsp.mdx b/packages/web/src/content/docs/zh-tw/lsp.mdx index ae419261fff..aa3af328818 100644 --- a/packages/web/src/content/docs/zh-tw/lsp.mdx +++ b/packages/web/src/content/docs/zh-tw/lsp.mdx @@ -27,6 +27,7 @@ OpenCode 內建了多種適用於主流語言的 LSP 伺服器: | gopls | .go | 需要 `go` 指令可用 | | hls | .hs, .lhs | 需要 `haskell-language-server-wrapper` 指令可用 | | jdtls | .java | 需要已安裝 `Java SDK (version 21+)` | +| julials | .jl | 需要已安裝 `julia` 和 `LanguageServer.jl` | | kotlin-ls | .kt, .kts | 為 Kotlin 專案自動安裝 | | lua-ls | .lua | 為 Lua 專案自動安裝 | | nixd | .nix | 需要 `nixd` 指令可用 | diff --git a/packages/web/src/content/docs/zh-tw/plugins.mdx b/packages/web/src/content/docs/zh-tw/plugins.mdx index 5e84f3a3530..8163c291e00 100644 --- a/packages/web/src/content/docs/zh-tw/plugins.mdx +++ b/packages/web/src/content/docs/zh-tw/plugins.mdx @@ -307,6 +307,10 @@ export const CustomToolsPlugin: Plugin = async (ctx) => { 您的自訂工具將與內建工具一起在 OpenCode 中可用。 +:::note +如果外掛工具使用與內建工具相同的名稱,則外掛工具具有優先權。 +::: + --- ### 日誌記錄 diff --git a/packages/web/src/content/docs/zh-tw/providers.mdx b/packages/web/src/content/docs/zh-tw/providers.mdx index 12c4ded4e36..b673b1ade5a 100644 --- a/packages/web/src/content/docs/zh-tw/providers.mdx +++ b/packages/web/src/content/docs/zh-tw/providers.mdx @@ -55,7 +55,7 @@ OpenCode Zen 是由 OpenCode 團隊提供的模型列表,這些模型已經過 如果您是新使用者,我們建議從 OpenCode Zen 開始。 ::: -1. 在 TUI 中執行 `/connect` 指令,選擇 opencode,然後前往 [opencode.ai/auth](https://opencode.ai/auth)。 +1. 在 TUI 中執行 `/connect` 指令,選擇 `OpenCode Zen`,然後前往 [opencode.ai/auth](https://opencode.ai/zen)。 ```txt /connect @@ -82,6 +82,37 @@ OpenCode Zen 是由 OpenCode 團隊提供的模型列表,這些模型已經過 --- +## OpenCode Go + +OpenCode Go 是一個低成本的訂閱計畫,提供對 OpenCode 團隊提供的流行開放編碼模型的可靠存取,這些模型已經過測試和驗證,能夠與 OpenCode 良好配合使用。 + +1. 在 TUI 中執行 `/connect` 指令,選擇 `OpenCode Go`,然後前往 [opencode.ai/auth](https://opencode.ai/zen)。 + + ```txt + /connect + ``` + +2. 登入後新增帳單資訊,然後複製您的 API 金鑰。 + +3. 貼上您的 API 金鑰。 + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. 在 TUI 中執行 `/models` 查看我們推薦的模型列表。 + + ```txt + /models + ``` + +它的使用方式與 OpenCode 中的任何其他提供商相同,且完全可選。 + +--- + ## 目錄 下面我們來詳細了解一些提供商。如果您想將某個提供商新增到列表中,歡迎提交 PR。 diff --git a/packages/web/src/content/docs/zh-tw/themes.mdx b/packages/web/src/content/docs/zh-tw/themes.mdx index 513f2c8a774..256b78ccb6d 100644 --- a/packages/web/src/content/docs/zh-tw/themes.mdx +++ b/packages/web/src/content/docs/zh-tw/themes.mdx @@ -61,11 +61,11 @@ OpenCode 自帶多個內建主題。 ## 使用主題 -您可以透過 `/theme` 指令調出主題選擇介面來選擇主題,也可以在[設定](/docs/config)檔案中直接指定。 +您可以透過 `/theme` 指令調出主題選擇介面來選擇主題,也可以在 `tui.json` 中直接指定。 -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/zh-tw/tui.mdx b/packages/web/src/content/docs/zh-tw/tui.mdx index 017507f20e2..8f46c4c15bc 100644 --- a/packages/web/src/content/docs/zh-tw/tui.mdx +++ b/packages/web/src/content/docs/zh-tw/tui.mdx @@ -352,24 +352,34 @@ How is auth handled in @packages/functions/src/api/index.ts? ## 設定 -您可以透過 OpenCode 設定檔自訂 TUI 行為。 +您可以透過 `tui.json`(或 `tui.jsonc`)自訂 TUI 行為。 -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +這與設定伺服器/執行時行為的 `opencode.json` 是分開的。 + ### 選項 -- `scroll_acceleration` - 啟用 macOS 風格的捲動加速,實現平滑、自然的捲動體驗。啟用後,快速捲動時速度會增加,慢速移動時保持精確。**此設定優先於 `scroll_speed`,啟用時會覆蓋它。** -- `scroll_speed` - 控制使用捲動指令時 TUI 的捲動速度(最小值:`1`)。預設為 `3`。**注意:如果 `scroll_acceleration.enabled` 設定為 `true`,則此設定會被忽略。** +- `theme` - 設定您的 UI 主題。[了解更多](/docs/themes)。 +- `keybinds` - 自訂鍵盤快速鍵。[了解更多](/docs/keybinds)。 +- `scroll_acceleration.enabled` - 啟用 macOS 風格的捲動加速,實現平滑、自然的捲動體驗。啟用後,快速捲動時速度會增加,慢速移動時保持精確。**此設定優先於 `scroll_speed`,啟用時會覆蓋它。** +- `scroll_speed` - 控制使用捲動指令時 TUI 的捲動速度(最小值:`0.001`,支援小數值)。預設為 `3`。**注意:如果 `scroll_acceleration.enabled` 設定為 `true`,則此設定會被忽略。** +- `diff_style` - 控制差異呈現方式。`"auto"` 根據終端機寬度自適應,`"stacked"` 始終顯示單列。 + +使用 `OPENCODE_TUI_CONFIG` 載入自訂 TUI 設定路徑。 --- diff --git a/packages/web/src/content/docs/zh-tw/zen.mdx b/packages/web/src/content/docs/zh-tw/zen.mdx index 5216194a938..c38188280b9 100644 --- a/packages/web/src/content/docs/zh-tw/zen.mdx +++ b/packages/web/src/content/docs/zh-tw/zen.mdx @@ -55,6 +55,7 @@ OpenCode Zen 的工作方式與 OpenCode 中的任何其他供應商相同。 | 模型 | 模型 ID | 端點 | AI SDK 套件 | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -64,13 +65,15 @@ OpenCode Zen 的工作方式與 OpenCode 中的任何其他供應商相同。 | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Nano | gpt-5-nano | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Claude Sonnet 4.6 | claude-sonnet-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 4.5 | claude-haiku-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.6 | claude-opus-4-6 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.5 | claude-opus-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | -| Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | +| Gemini 3.1 Pro | gemini-3.1-pro | `https://opencode.ai/zen/v1/models/gemini-3.1-pro` | `@ai-sdk/google` | | Gemini 3 Pro | gemini-3-pro | `https://opencode.ai/zen/v1/models/gemini-3-pro` | `@ai-sdk/google` | | Gemini 3 Flash | gemini-3-flash | `https://opencode.ai/zen/v1/models/gemini-3-flash` | `@ai-sdk/google` | | MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -80,7 +83,6 @@ OpenCode Zen 的工作方式與 OpenCode 中的任何其他供應商相同。 | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -113,24 +115,28 @@ https://opencode.ai/zen/v1/models | GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | 免費 | 免費 | 免費 | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | +| Claude Opus 4.6 (≤ 200K Token) | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.6 (> 200K Token) | $10.00 | $37.50 | $1.00 | $12.50 | +| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | +| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Claude Sonnet 4.6 (≤ 200K Token) | $3.00 | $15.00 | $0.30 | $3.75 | +| Claude Sonnet 4.6 (> 200K Token) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4.5 (≤ 200K Token) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K Token) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K Token) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4 (> 200K Token) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 | | Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 | -| Claude Opus 4.6 (≤ 200K Token) | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.6 (> 200K Token) | $10.00 | $37.50 | $1.00 | $12.50 | -| Claude Opus 4.5 | $5.00 | $25.00 | $0.50 | $6.25 | -| Claude Opus 4.1 | $15.00 | $75.00 | $1.50 | $18.75 | +| Gemini 3.1 Pro (≤ 200K Token) | $2.00 | $12.00 | $0.20 | - | +| Gemini 3.1 Pro (> 200K Token) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Pro (≤ 200K Token) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K Token) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -149,7 +155,6 @@ https://opencode.ai/zen/v1/models 免費模型說明: -- Kimi K2.5 Free 在 OpenCode 上限時免費提供。團隊正在利用這段時間收集回饋並改進模型。 - MiniMax M2.5 Free 在 OpenCode 上限時免費提供。團隊正在利用這段時間收集回饋並改進模型。 - Big Pickle 是一個隱身模型,在 OpenCode 上限時免費提供。團隊正在利用這段時間收集回饋並改進模型。 @@ -178,7 +183,6 @@ https://opencode.ai/zen/v1/models 我們所有的模型都託管在美國。我們的供應商遵循零保留政策,不會將你的資料用於模型訓練,但以下情況除外: - Big Pickle:在免費期間,收集的資料可能會被用於改進模型。 -- Kimi K2.5 Free:在免費期間,收集的資料可能會被用於改進模型。 - MiniMax M2.5 Free:在免費期間,收集的資料可能會被用於改進模型。 - OpenAI API:請求會根據 [OpenAI 資料政策](https://platform.openai.com/docs/guides/your-data)保留 30 天。 - Anthropic API:請求會根據 [Anthropic 資料政策](https://docs.anthropic.com/en/docs/claude-code/data-usage)保留 30 天。 From 114eb42444bcf347a99dec756bd2ac90c679c66c Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sat, 28 Feb 2026 18:54:18 -0500 Subject: [PATCH 003/102] docs: fix broken config imports in translated documentation Fixed incorrect relative import paths in Bosnian, French, Italian, Korean, Norwegian, Portuguese, Turkish, and Chinese docs that were referencing config.mjs from the wrong directory level. This resolves build errors when viewing translated documentation pages. --- packages/web/src/content/docs/bs/zen.mdx | 2 +- packages/web/src/content/docs/fr/zen.mdx | 2 +- packages/web/src/content/docs/it/sdk.mdx | 2 +- packages/web/src/content/docs/it/zen.mdx | 2 +- packages/web/src/content/docs/ko/providers.mdx | 2 +- packages/web/src/content/docs/ko/zen.mdx | 2 +- packages/web/src/content/docs/nb/sdk.mdx | 2 +- packages/web/src/content/docs/nb/zen.mdx | 2 +- packages/web/src/content/docs/pt-br/zen.mdx | 2 +- packages/web/src/content/docs/tr/zen.mdx | 2 +- packages/web/src/content/docs/zh-cn/zen.mdx | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/web/src/content/docs/bs/zen.mdx b/packages/web/src/content/docs/bs/zen.mdx index c7aeab0c763..ad428884d33 100644 --- a/packages/web/src/content/docs/bs/zen.mdx +++ b/packages/web/src/content/docs/bs/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Kurirana lista modela koje nudi OpenCode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/fr/zen.mdx b/packages/web/src/content/docs/fr/zen.mdx index b973c2809b1..e40b1be77ea 100644 --- a/packages/web/src/content/docs/fr/zen.mdx +++ b/packages/web/src/content/docs/fr/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Liste organisée de modèles fournis par OpenCode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/it/sdk.mdx b/packages/web/src/content/docs/it/sdk.mdx index d7cfd8489d1..2941bfb24cf 100644 --- a/packages/web/src/content/docs/it/sdk.mdx +++ b/packages/web/src/content/docs/it/sdk.mdx @@ -3,7 +3,7 @@ title: SDK description: Client JS type-safe per il server opencode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const typesUrl = `${config.github}/blob/dev/packages/sdk/js/src/gen/types.gen.ts` L'SDK JS/TS di opencode fornisce un client type-safe per interagire con il server. diff --git a/packages/web/src/content/docs/it/zen.mdx b/packages/web/src/content/docs/it/zen.mdx index 95170fc542d..db0434db502 100644 --- a/packages/web/src/content/docs/it/zen.mdx +++ b/packages/web/src/content/docs/it/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Lista curata di modelli fornita da OpenCode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/ko/providers.mdx b/packages/web/src/content/docs/ko/providers.mdx index 95b4907e242..c543c719dd2 100644 --- a/packages/web/src/content/docs/ko/providers.mdx +++ b/packages/web/src/content/docs/ko/providers.mdx @@ -3,7 +3,7 @@ title: 공급자 description: OpenCode에서 LLM 공급자를 사용합니다. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console OpenCode는 [AI SDK](https://ai-sdk.dev/) 및 [Models.dev](https://models.dev)를 사용하여 **75개 이상의 LLM 공급자**를 지원하며 로컬 모델도 실행할 수 있습니다. diff --git a/packages/web/src/content/docs/ko/zen.mdx b/packages/web/src/content/docs/ko/zen.mdx index 035f1441408..ae598cee187 100644 --- a/packages/web/src/content/docs/ko/zen.mdx +++ b/packages/web/src/content/docs/ko/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: OpenCode가 제공하는 엄선된 모델 목록. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/nb/sdk.mdx b/packages/web/src/content/docs/nb/sdk.mdx index 56bde19d701..a9470944767 100644 --- a/packages/web/src/content/docs/nb/sdk.mdx +++ b/packages/web/src/content/docs/nb/sdk.mdx @@ -3,7 +3,7 @@ title: SDK description: Typesikker JS-klient for OpenCode-server. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const typesUrl = `${config.github}/blob/dev/packages/sdk/js/src/gen/types.gen.ts` OpenCode JS/TS SDK gir en typesikker klient for samhandling med serveren. diff --git a/packages/web/src/content/docs/nb/zen.mdx b/packages/web/src/content/docs/nb/zen.mdx index d85d63e3993..51399615e56 100644 --- a/packages/web/src/content/docs/nb/zen.mdx +++ b/packages/web/src/content/docs/nb/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Utvalgt liste over modeller levert av OpenCode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/pt-br/zen.mdx b/packages/web/src/content/docs/pt-br/zen.mdx index 2ec969d7202..ba029fb7fca 100644 --- a/packages/web/src/content/docs/pt-br/zen.mdx +++ b/packages/web/src/content/docs/pt-br/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: Lista selecionada de modelos fornecidos pelo OpenCode. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/tr/zen.mdx b/packages/web/src/content/docs/tr/zen.mdx index 684bccb3e23..9582a7b7dc1 100644 --- a/packages/web/src/content/docs/tr/zen.mdx +++ b/packages/web/src/content/docs/tr/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: opencode tarafından sağlanan seçilmiş modeller listesi. --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` diff --git a/packages/web/src/content/docs/zh-cn/zen.mdx b/packages/web/src/content/docs/zh-cn/zen.mdx index 951ebe7094f..0c6c6b9d95d 100644 --- a/packages/web/src/content/docs/zh-cn/zen.mdx +++ b/packages/web/src/content/docs/zh-cn/zen.mdx @@ -3,7 +3,7 @@ title: Zen description: 由 OpenCode 提供的精选模型列表。 --- -import config from "../../../config.mjs" +import config from "../../../../config.mjs" export const console = config.console export const email = `mailto:${config.email}` From cec16dfe953a67cce9c0b6e597d323fb78600c57 Mon Sep 17 00:00:00 2001 From: James Long Date: Sat, 28 Feb 2026 20:44:54 -0500 Subject: [PATCH 004/102] feat(core): add WorkspaceContext (#15409) --- .../src/control-plane/workspace-context.ts | 23 ++++++++++++++++ packages/opencode/src/server/server.ts | 26 +++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 packages/opencode/src/control-plane/workspace-context.ts diff --git a/packages/opencode/src/control-plane/workspace-context.ts b/packages/opencode/src/control-plane/workspace-context.ts new file mode 100644 index 00000000000..f7297b3f4b4 --- /dev/null +++ b/packages/opencode/src/control-plane/workspace-context.ts @@ -0,0 +1,23 @@ +import { Context } from "../util/context" + +interface Context { + workspaceID?: string +} + +const context = Context.create ("workspace") + +export const WorkspaceContext = { + async provide (input: { workspaceID?: string; fn: () => R }): Promise { + return context.provide({ workspaceID: input.workspaceID }, async () => { + return input.fn() + }) + }, + + get workspaceID() { + try { + return context.use().workspaceID + } catch (e) { + return undefined + } + }, +} diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts index 9fba9c1fe1a..85049650c1f 100644 --- a/packages/opencode/src/server/server.ts +++ b/packages/opencode/src/server/server.ts @@ -21,6 +21,7 @@ import { Auth } from "../auth" import { Flag } from "../flag/flag" import { Command } from "../command" import { Global } from "../global" +import { WorkspaceContext } from "../control-plane/workspace-context" import { ProjectRoutes } from "./routes/project" import { SessionRoutes } from "./routes/session" import { PtyRoutes } from "./routes/pty" @@ -194,6 +195,7 @@ export namespace Server { ) .use(async (c, next) => { if (c.req.path === "/log") return next() + const workspaceID = c.req.query("workspace") || c.req.header("x-opencode-workspace") const raw = c.req.query("directory") || c.req.header("x-opencode-directory") || process.cwd() const directory = (() => { try { @@ -202,11 +204,17 @@ export namespace Server { return raw } })() - return Instance.provide({ - directory, - init: InstanceBootstrap, + + return WorkspaceContext.provide({ + workspaceID, async fn() { - return next() + return Instance.provide({ + directory, + init: InstanceBootstrap, + async fn() { + return next() + }, + }) }, }) }) @@ -223,7 +231,15 @@ export namespace Server { }, }), ) - .use(validator("query", z.object({ directory: z.string().optional() }))) + .use( + validator( + "query", + z.object({ + directory: z.string().optional(), + workspace: z.string().optional(), + }), + ), + ) .route("/project", ProjectRoutes()) .route("/pty", PtyRoutes()) .route("/config", ConfigRoutes()) From fcd733e3d6a0a2960c50adac947fc140f1934e9d Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Sun, 1 Mar 2026 01:45:44 +0000 Subject: [PATCH 005/102] chore: generate --- packages/sdk/js/src/v2/gen/sdk.gen.ts | 544 +++++++++++++++++-- packages/sdk/js/src/v2/gen/types.gen.ts | 96 ++++ packages/sdk/openapi.json | 678 +++++++++++++++++++++++- 3 files changed, 1283 insertions(+), 35 deletions(-) diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index ec8ee46857d..49ebc847345 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -373,10 +373,21 @@ export class Project extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/project", ...options, @@ -392,10 +403,21 @@ export class Project extends HeyApiClient { public current ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/project/current", ...options, @@ -412,6 +434,7 @@ export class Project extends HeyApiClient { parameters: { projectID: string directory?: string + workspace?: string name?: string icon?: { url?: string @@ -434,6 +457,7 @@ export class Project extends HeyApiClient { args: [ { in: "path", key: "projectID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "name" }, { in: "body", key: "icon" }, { in: "body", key: "commands" }, @@ -463,10 +487,21 @@ export class Pty extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/pty", ...options, @@ -482,6 +517,7 @@ export class Pty extends HeyApiClient { public create ( parameters?: { directory?: string + workspace?: string command?: string args?: Array cwd?: string @@ -498,6 +534,7 @@ export class Pty extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "command" }, { in: "body", key: "args" }, { in: "body", key: "cwd" }, @@ -528,6 +565,7 @@ export class Pty extends HeyApiClient { parameters: { ptyID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -538,6 +576,7 @@ export class Pty extends HeyApiClient { args: [ { in: "path", key: "ptyID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -558,6 +597,7 @@ export class Pty extends HeyApiClient { parameters: { ptyID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -568,6 +608,7 @@ export class Pty extends HeyApiClient { args: [ { in: "path", key: "ptyID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -588,6 +629,7 @@ export class Pty extends HeyApiClient { parameters: { ptyID: string directory?: string + workspace?: string title?: string size?: { rows: number @@ -603,6 +645,7 @@ export class Pty extends HeyApiClient { args: [ { in: "path", key: "ptyID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "title" }, { in: "body", key: "size" }, ], @@ -630,6 +673,7 @@ export class Pty extends HeyApiClient { parameters: { ptyID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -640,6 +684,7 @@ export class Pty extends HeyApiClient { args: [ { in: "path", key: "ptyID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -661,10 +706,21 @@ export class Config2 extends HeyApiClient { public get ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/config", ...options, @@ -680,6 +736,7 @@ export class Config2 extends HeyApiClient { public update ( parameters?: { directory?: string + workspace?: string config?: Config3 }, options?: Options , @@ -690,6 +747,7 @@ export class Config2 extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "config", map: "body" }, ], }, @@ -715,10 +773,21 @@ export class Config2 extends HeyApiClient { public providers ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/config/providers", ...options, @@ -736,10 +805,21 @@ export class Tool extends HeyApiClient { public ids ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/experimental/tool/ids", ...options, @@ -755,6 +835,7 @@ export class Tool extends HeyApiClient { public list ( parameters: { directory?: string + workspace?: string provider: string model: string }, @@ -766,6 +847,7 @@ export class Tool extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "provider" }, { in: "query", key: "model" }, ], @@ -789,6 +871,7 @@ export class Worktree extends HeyApiClient { public remove ( parameters?: { directory?: string + workspace?: string worktreeRemoveInput?: WorktreeRemoveInput }, options?: Options , @@ -799,6 +882,7 @@ export class Worktree extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "worktreeRemoveInput", map: "body" }, ], }, @@ -824,10 +908,21 @@ export class Worktree extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/experimental/worktree", ...options, @@ -843,6 +938,7 @@ export class Worktree extends HeyApiClient { public create ( parameters?: { directory?: string + workspace?: string worktreeCreateInput?: WorktreeCreateInput }, options?: Options , @@ -853,6 +949,7 @@ export class Worktree extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "worktreeCreateInput", map: "body" }, ], }, @@ -878,6 +975,7 @@ export class Worktree extends HeyApiClient { public reset ( parameters?: { directory?: string + workspace?: string worktreeResetInput?: WorktreeResetInput }, options?: Options , @@ -888,6 +986,7 @@ export class Worktree extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "worktreeResetInput", map: "body" }, ], }, @@ -916,6 +1015,7 @@ export class Workspace extends HeyApiClient { parameters: { id: string directory?: string + workspace?: string }, options?: Options , ) { @@ -926,6 +1026,7 @@ export class Workspace extends HeyApiClient { args: [ { in: "path", key: "id" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -950,6 +1051,7 @@ export class Workspace extends HeyApiClient { parameters: { id: string directory?: string + workspace?: string branch?: string | null config?: { directory: string @@ -965,6 +1067,7 @@ export class Workspace extends HeyApiClient { args: [ { in: "path", key: "id" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "branch" }, { in: "body", key: "config" }, ], @@ -995,10 +1098,21 @@ export class Workspace extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/experimental/workspace", ...options, @@ -1016,6 +1130,7 @@ export class Session extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string roots?: boolean start?: number cursor?: number @@ -1031,6 +1146,7 @@ export class Session extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "roots" }, { in: "query", key: "start" }, { in: "query", key: "cursor" }, @@ -1058,10 +1174,21 @@ export class Resource extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/experimental/resource", ...options, @@ -1096,6 +1223,7 @@ export class Session2 extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string roots?: boolean start?: number search?: string @@ -1109,6 +1237,7 @@ export class Session2 extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "roots" }, { in: "query", key: "start" }, { in: "query", key: "search" }, @@ -1132,6 +1261,7 @@ export class Session2 extends HeyApiClient { public create ( parameters?: { directory?: string + workspace?: string parentID?: string title?: string permission?: PermissionRuleset @@ -1144,6 +1274,7 @@ export class Session2 extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "parentID" }, { in: "body", key: "title" }, { in: "body", key: "permission" }, @@ -1171,10 +1302,21 @@ export class Session2 extends HeyApiClient { public status ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/session/status", ...options, @@ -1191,6 +1333,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1201,6 +1344,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1221,6 +1365,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1231,6 +1376,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1251,6 +1397,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string title?: string time?: { archived?: number @@ -1265,6 +1412,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "title" }, { in: "body", key: "time" }, ], @@ -1292,6 +1440,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1302,6 +1451,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1322,6 +1472,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1332,6 +1483,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1352,6 +1504,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string modelID?: string providerID?: string messageID?: string @@ -1365,6 +1518,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "modelID" }, { in: "body", key: "providerID" }, { in: "body", key: "messageID" }, @@ -1393,6 +1547,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string }, options?: Options , @@ -1404,6 +1559,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "messageID" }, ], }, @@ -1430,6 +1586,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1440,6 +1597,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1460,6 +1618,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1470,6 +1629,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1490,6 +1650,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1500,6 +1661,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1520,6 +1682,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string }, options?: Options , @@ -1531,6 +1694,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "messageID" }, ], }, @@ -1552,6 +1716,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string providerID?: string modelID?: string auto?: boolean @@ -1565,6 +1730,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "providerID" }, { in: "body", key: "modelID" }, { in: "body", key: "auto" }, @@ -1593,6 +1759,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string limit?: number }, options?: Options , @@ -1604,6 +1771,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "limit" }, ], }, @@ -1625,6 +1793,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string model?: { providerID: string @@ -1649,6 +1818,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "messageID" }, { in: "body", key: "model" }, { in: "body", key: "agent" }, @@ -1684,6 +1854,7 @@ export class Session2 extends HeyApiClient { sessionID: string messageID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1695,6 +1866,7 @@ export class Session2 extends HeyApiClient { { in: "path", key: "sessionID" }, { in: "path", key: "messageID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1720,6 +1892,7 @@ export class Session2 extends HeyApiClient { sessionID: string messageID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1731,6 +1904,7 @@ export class Session2 extends HeyApiClient { { in: "path", key: "sessionID" }, { in: "path", key: "messageID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1751,6 +1925,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string model?: { providerID: string @@ -1775,6 +1950,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "messageID" }, { in: "body", key: "model" }, { in: "body", key: "agent" }, @@ -1809,6 +1985,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string agent?: string model?: string @@ -1833,6 +2010,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "messageID" }, { in: "body", key: "agent" }, { in: "body", key: "model" }, @@ -1865,6 +2043,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string agent?: string model?: { providerID: string @@ -1881,6 +2060,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "agent" }, { in: "body", key: "model" }, { in: "body", key: "command" }, @@ -1909,6 +2089,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string messageID?: string partID?: string }, @@ -1921,6 +2102,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "messageID" }, { in: "body", key: "partID" }, ], @@ -1948,6 +2130,7 @@ export class Session2 extends HeyApiClient { parameters: { sessionID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1958,6 +2141,7 @@ export class Session2 extends HeyApiClient { args: [ { in: "path", key: "sessionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -1980,6 +2164,7 @@ export class Part extends HeyApiClient { messageID: string partID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -1992,6 +2177,7 @@ export class Part extends HeyApiClient { { in: "path", key: "messageID" }, { in: "path", key: "partID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2012,6 +2198,7 @@ export class Part extends HeyApiClient { messageID: string partID: string directory?: string + workspace?: string part?: Part2 }, options?: Options , @@ -2025,6 +2212,7 @@ export class Part extends HeyApiClient { { in: "path", key: "messageID" }, { in: "path", key: "partID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "part", map: "body" }, ], }, @@ -2056,6 +2244,7 @@ export class Permission extends HeyApiClient { sessionID: string permissionID: string directory?: string + workspace?: string response?: "once" | "always" | "reject" }, options?: Options , @@ -2068,6 +2257,7 @@ export class Permission extends HeyApiClient { { in: "path", key: "sessionID" }, { in: "path", key: "permissionID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "response" }, ], }, @@ -2094,6 +2284,7 @@ export class Permission extends HeyApiClient { parameters: { requestID: string directory?: string + workspace?: string reply?: "once" | "always" | "reject" message?: string }, @@ -2106,6 +2297,7 @@ export class Permission extends HeyApiClient { args: [ { in: "path", key: "requestID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "reply" }, { in: "body", key: "message" }, ], @@ -2132,10 +2324,21 @@ export class Permission extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/permission", ...options, @@ -2153,10 +2356,21 @@ export class Question extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/question", ...options, @@ -2173,6 +2387,7 @@ export class Question extends HeyApiClient { parameters: { requestID: string directory?: string + workspace?: string answers?: Array }, options?: Options , @@ -2184,6 +2399,7 @@ export class Question extends HeyApiClient { args: [ { in: "path", key: "requestID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "answers" }, ], }, @@ -2210,6 +2426,7 @@ export class Question extends HeyApiClient { parameters: { requestID: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2220,6 +2437,7 @@ export class Question extends HeyApiClient { args: [ { in: "path", key: "requestID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2242,6 +2460,7 @@ export class Oauth extends HeyApiClient { parameters: { providerID: string directory?: string + workspace?: string method?: number }, options?: Options , @@ -2253,6 +2472,7 @@ export class Oauth extends HeyApiClient { args: [ { in: "path", key: "providerID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "method" }, ], }, @@ -2283,6 +2503,7 @@ export class Oauth extends HeyApiClient { parameters: { providerID: string directory?: string + workspace?: string method?: number code?: string }, @@ -2295,6 +2516,7 @@ export class Oauth extends HeyApiClient { args: [ { in: "path", key: "providerID" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "method" }, { in: "body", key: "code" }, ], @@ -2327,10 +2549,21 @@ export class Provider extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/provider", ...options, @@ -2346,10 +2579,21 @@ export class Provider extends HeyApiClient { public auth ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/provider/auth", ...options, @@ -2372,6 +2616,7 @@ export class Find extends HeyApiClient { public text ( parameters: { directory?: string + workspace?: string pattern: string }, options?: Options , @@ -2382,6 +2627,7 @@ export class Find extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "pattern" }, ], }, @@ -2402,6 +2648,7 @@ export class Find extends HeyApiClient { public files ( parameters: { directory?: string + workspace?: string query: string dirs?: "true" | "false" type?: "file" | "directory" @@ -2415,6 +2662,7 @@ export class Find extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "query" }, { in: "query", key: "dirs" }, { in: "query", key: "type" }, @@ -2438,6 +2686,7 @@ export class Find extends HeyApiClient { public symbols ( parameters: { directory?: string + workspace?: string query: string }, options?: Options , @@ -2448,6 +2697,7 @@ export class Find extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "query" }, ], }, @@ -2470,6 +2720,7 @@ export class File extends HeyApiClient { public list ( parameters: { directory?: string + workspace?: string path: string }, options?: Options , @@ -2480,6 +2731,7 @@ export class File extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "path" }, ], }, @@ -2500,6 +2752,7 @@ export class File extends HeyApiClient { public read ( parameters: { directory?: string + workspace?: string path: string }, options?: Options , @@ -2510,6 +2763,7 @@ export class File extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "query", key: "path" }, ], }, @@ -2530,10 +2784,21 @@ export class File extends HeyApiClient { public status ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/file/status", ...options, @@ -2552,6 +2817,7 @@ export class Auth2 extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2562,6 +2828,7 @@ export class Auth2 extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2582,6 +2849,7 @@ export class Auth2 extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2592,6 +2860,7 @@ export class Auth2 extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2612,6 +2881,7 @@ export class Auth2 extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string code?: string }, options?: Options , @@ -2623,6 +2893,7 @@ export class Auth2 extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "code" }, ], }, @@ -2649,6 +2920,7 @@ export class Auth2 extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2659,6 +2931,7 @@ export class Auth2 extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2682,10 +2955,21 @@ export class Mcp extends HeyApiClient { public status ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/mcp", ...options, @@ -2701,6 +2985,7 @@ export class Mcp extends HeyApiClient { public add ( parameters?: { directory?: string + workspace?: string name?: string config?: McpLocalConfig | McpRemoteConfig }, @@ -2712,6 +2997,7 @@ export class Mcp extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "name" }, { in: "body", key: "config" }, ], @@ -2737,6 +3023,7 @@ export class Mcp extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2747,6 +3034,7 @@ export class Mcp extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2765,6 +3053,7 @@ export class Mcp extends HeyApiClient { parameters: { name: string directory?: string + workspace?: string }, options?: Options , ) { @@ -2775,6 +3064,7 @@ export class Mcp extends HeyApiClient { args: [ { in: "path", key: "name" }, { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, ], }, ], @@ -2801,10 +3091,21 @@ export class Control extends HeyApiClient { public next ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/tui/control/next", ...options, @@ -2820,6 +3121,7 @@ export class Control extends HeyApiClient { public response ( parameters?: { directory?: string + workspace?: string body?: unknown }, options?: Options , @@ -2830,6 +3132,7 @@ export class Control extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "body", map: "body" }, ], }, @@ -2857,6 +3160,7 @@ export class Tui extends HeyApiClient { public appendPrompt ( parameters?: { directory?: string + workspace?: string text?: string }, options?: Options , @@ -2867,6 +3171,7 @@ export class Tui extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "text" }, ], }, @@ -2892,10 +3197,21 @@ export class Tui extends HeyApiClient { public openHelp ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/open-help", ...options, @@ -2911,10 +3227,21 @@ export class Tui extends HeyApiClient { public openSessions ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/open-sessions", ...options, @@ -2930,10 +3257,21 @@ export class Tui extends HeyApiClient { public openThemes ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/open-themes", ...options, @@ -2949,10 +3287,21 @@ export class Tui extends HeyApiClient { public openModels ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/open-models", ...options, @@ -2968,10 +3317,21 @@ export class Tui extends HeyApiClient { public submitPrompt ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/submit-prompt", ...options, @@ -2987,10 +3347,21 @@ export class Tui extends HeyApiClient { public clearPrompt ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/tui/clear-prompt", ...options, @@ -3006,6 +3377,7 @@ export class Tui extends HeyApiClient { public executeCommand ( parameters?: { directory?: string + workspace?: string command?: string }, options?: Options , @@ -3016,6 +3388,7 @@ export class Tui extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "command" }, ], }, @@ -3041,6 +3414,7 @@ export class Tui extends HeyApiClient { public showToast ( parameters?: { directory?: string + workspace?: string title?: string message?: string variant?: "info" | "success" | "warning" | "error" @@ -3054,6 +3428,7 @@ export class Tui extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "title" }, { in: "body", key: "message" }, { in: "body", key: "variant" }, @@ -3082,6 +3457,7 @@ export class Tui extends HeyApiClient { public publish ( parameters?: { directory?: string + workspace?: string body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect }, options?: Options , @@ -3092,6 +3468,7 @@ export class Tui extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { key: "body", map: "body" }, ], }, @@ -3117,6 +3494,7 @@ export class Tui extends HeyApiClient { public selectSession ( parameters?: { directory?: string + workspace?: string sessionID?: string }, options?: Options , @@ -3127,6 +3505,7 @@ export class Tui extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "sessionID" }, ], }, @@ -3159,10 +3538,21 @@ export class Instance extends HeyApiClient { public dispose ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).post ({ url: "/instance/dispose", ...options, @@ -3180,10 +3570,21 @@ export class Path extends HeyApiClient { public get ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/path", ...options, @@ -3201,10 +3602,21 @@ export class Vcs extends HeyApiClient { public get ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/vcs", ...options, @@ -3222,10 +3634,21 @@ export class Command extends HeyApiClient { public list ( parameters?: { directory?: string + workspace?: string }, options?: Options , ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]) + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, + ], + }, + ], + ) return (options?.client ?? this.client).get ({ url: "/command", ...options, @@ -3243,6 +3666,7 @@ export class App extends HeyApiClient { public log ( parameters?: { directory?: string + workspace?: string service?: string level?: "debug" | "info" | "error" | "warn" message?: string @@ -3258,6 +3682,7 @@ export class App extends HeyApiClient { { args: [ { in: "query", key: "directory" }, + { in: "query", key: "workspace" }, { in: "body", key: "service" }, { in: "body", key: "level" }, { in: "body", key: "message" }, @@ -3286,10 +3711,21 @@ export class App extends HeyApiClient { public agents