Compare commits

...

4 Commits

Author SHA1 Message Date
Adam
fbd5eff77a chore(docs): i18n sync 2026-02-27 19:18:55 -06:00
Alex Yaroshuk
2a2082233d fix(app): display skill name in skill tool call (#15413) 2026-02-27 19:18:14 -06:00
Adam
267d2c82de chore: cleanup 2026-02-27 19:12:19 -06:00
Jay
0b8c1f1f7d docs: Update OpenCode Go subscription and usage details (#15415) 2026-02-27 16:04:53 -08:00
179 changed files with 6391 additions and 5296 deletions

View File

@@ -250,6 +250,11 @@ export function getToolInfo(tool: string, input: any = {}): ToolInfo {
icon: "bubble-5",
title: i18n.t("ui.tool.questions"),
}
case "skill":
return {
icon: "brain",
title: input.name || "skill",
}
default:
return {
icon: "mcp",
@@ -1900,3 +1905,25 @@ ToolRegistry.register({
)
},
})
ToolRegistry.register({
name: "skill",
render(props) {
const title = createMemo(() => props.input.name || "skill")
const running = createMemo(() => props.status === "pending" || props.status === "running")
const titleContent = () => <TextShimmer text={title()} active={running()} />
const trigger = () => (
<div data-slot="basic-tool-tool-info-structured">
<div data-slot="basic-tool-tool-info-main">
<span data-slot="basic-tool-tool-title" class="capitalize agent-title">
{titleContent()}
</span>
</div>
</div>
)
return <BasicTool icon="brain" status={props.status} trigger={trigger()} hideDetails />
},
})

View File

@@ -496,6 +496,7 @@ opencode run "Hello world"
- `auto` - ضغط الجلسة تلقائيًا عند امتلاء السياق (الافتراضي: `true`).
- `prune` - إزالة مخرجات الأدوات القديمة لتوفير الرموز (tokens) (الافتراضي: `true`).
- `reserved` - مخزن مؤقت للرموز (tokens) من أجل الضغط. يترك نافذة كافية لتجنب الفيضان أثناء الضغط.
---

View File

@@ -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)، لتعريف أنواع الوسائط.

View File

@@ -182,7 +182,7 @@ description: يتكامل OpenCode مع خوادم LSP لديك.
يوفر PHP Intelephense ميزات مدفوعة عبر مفتاح ترخيص. يمكنك تزويده بمفتاح الترخيص عبر وضع (فقط) المفتاح داخل ملف نصي في:
- على macOS/Linux: `$HOME/intelephense/licence.txt`
- على Windows: `%USERPROFILE%/intelephense/licence.txt`
- على macOS/Linux: `$HOME/intelephense/license.txt`
- على Windows: `%USERPROFILE%/intelephense/license.txt`
يجب أن يحتوي الملف على مفتاح الترخيص فقط دون أي محتوى إضافي.

View File

@@ -83,6 +83,37 @@ OpenCode Zen هي قائمة نماذج يوفّرها فريق OpenCode وقد
---
## 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 واستخدامه اختياري بالكامل.
---
## الدليل
لنلقِ نظرة على بعض المزوّدات بالتفصيل. إذا رغبت في إضافة مزوّد إلى القائمة،
@@ -1476,6 +1507,39 @@ OpenCode Zen هي قائمة من النماذج التي تم اختبارها
---
### STACKIT
توفّر خدمة STACKIT AI Model Serving بيئة استضافة سيادية مُدارة بالكامل لنماذج الذكاء الاصطناعي، مع التركيز على نماذج LLM مثل Llama وMistral وQwen، مع أقصى درجات سيادة البيانات على بنية تحتية أوروبية.
1. توجّه إلى [STACKIT Portal](https://portal.stackit.cloud)، وانتقل إلى **AI Model Serving**، وأنشئ رمز مصادقة (auth token) لمشروعك.
:::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**.

View File

@@ -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 الذي يحدد بنية الإخراج |
| `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` مناسبا** - قم بزيادته للمخططات المعقدة، وتقليله للمخططات البسيطة
---
## APIs
توفر SDK جميع واجهات الخادم عبر عميل آمن للأنواع.
@@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers()
### الجلسات (`session`)
| الطريقة | الوصف | ملاحظات |
| ---------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | سرد الجلسات | يعيد <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | جلب جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | سرد الجلسات الفرعية | يعيد <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | إنشاء جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | حذف جلسة | يعيد `boolean` |
| `session.update({ path, body })` | تحديث خصائص الجلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | تحليل التطبيق وإنشاء `AGENTS.md` | يعيد `boolean` |
| `session.abort({ path })` | إيقاف جلسة قيد التشغيل | يعيد `boolean` |
| `session.share({ path })` | مشاركة جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | إلغاء مشاركة جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | تلخيص جلسة | يعيد `boolean` |
| `session.messages({ path })` | سرد الرسائل في جلسة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | جلب تفاصيل الرسالة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد <a href={typesUrl}><code>AssistantMessage</code></a> مع استجابة AI |
| `session.command({ path, body })` | إرسال أمر إلى الجلسة | يعيد `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | تشغيل أمر shell | يعيد <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | التراجع عن رسالة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | استعادة الرسائل المتراجع عنها | يعيد <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | الاستجابة لطلب إذن | يعيد `boolean` |
| الطريقة | الوصف | ملاحظات |
| ---------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `session.list()` | سرد الجلسات | يعيد <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | جلب جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | سرد الجلسات الفرعية | يعيد <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | إنشاء جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | حذف جلسة | يعيد `boolean` |
| `session.update({ path, body })` | تحديث خصائص الجلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | تحليل التطبيق وإنشاء `AGENTS.md` | يعيد `boolean` |
| `session.abort({ path })` | إيقاف جلسة قيد التشغيل | يعيد `boolean` |
| `session.share({ path })` | مشاركة جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | إلغاء مشاركة جلسة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | تلخيص جلسة | يعيد `boolean` |
| `session.messages({ path })` | سرد الرسائل في جلسة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | جلب تفاصيل الرسالة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد <a href={typesUrl}><code>AssistantMessage</code></a> مع استجابة AI. يدعم `body.outputFormat` من أجل [المخرجات المنظمة](#المخرجات-المنظمة) |
| `session.command({ path, body })` | إرسال أمر إلى الجلسة | يعيد `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | تشغيل أمر shell | يعيد <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | التراجع عن رسالة | يعيد <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | استعادة الرسائل المتراجع عنها | يعيد <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | الاستجابة لطلب إذن | يعيد `boolean` |
---

View File

@@ -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 مخصص.
---

View File

@@ -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 لفترة محدودة. يستخدم الفريق هذه الفترة لجمع الملاحظات وتحسين النموذج.
<a href={email}>تواصل معنا</a> إذا كانت لديك أي أسئلة.
@@ -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).

View File

@@ -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 |

View File

@@ -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.
- `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.
Stari `theme`, `keybinds`, i `tui` ključevi u `opencode.json` su zastarjeli i automatski će se migrirati kada je to moguće.
[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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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,<leader>q",
@@ -108,18 +108,20 @@ OpenCode ima listu veza tipki koje možete prilagoditi preko OpenCode konfigurac
## Leader tipka
OpenCode koristi `leader` (vodeću) tipku za većinu povezivanja tipki. Ovo izbjegava sukobe u vašem terminalu.
Prema zadanim postavkama, `ctrl+x` je vodeća tipka i većina radnji zahtijeva da prvo pritisnete vodeću tipku, a zatim i prečicu. Na primjer, da biste započeli novu sesiju, prvo pritisnite `ctrl+x`, a zatim pritisnite `n`.
Ne morate koristiti vodeću tipku za svoje veze tipki, ali preporučujemo da to učinite.
---
## Onemogućavanje prečica tipki
Možete onemogućiti spajanje tipki dodavanjem ključa u svoju konfiguraciju s vrijednošću "none".
Možete onemogućiti spajanje tipki dodavanjem ključa u `tui.json` s vrijednošću "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"
}

View File

@@ -8,40 +8,43 @@ OpenCode se integriše sa vašim Language Server Protocol (LSP) serverima kako b
## Ugrađeni
OpenCode dolazi sa nekoliko ugrađenih LSP servera za popularne jezike:
| LSP server | Ekstenzije | Zahtjevi
|------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------ |
| astro | .astro | Automatske instalacije za Astro projekte |
| bash | .sh, .bash, .zsh, .ksh | Automatski instalira bash-language-server |
| clangd | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | Automatske instalacije za C/C++ projekte |
| csharp | .cs | `.NET SDK` instaliran |
| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` komanda dostupna |
| dart | .dart | `dart` komanda dostupna |
| deno | .ts, .tsx, .js, .jsx, .mjs | `deno` komanda dostupna (automatski detektuje deno.json/deno.jsonc) |
| elixir-ls | .ex, .exs | `elixir` komanda dostupna |
| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | `eslint` ovisnost u projektu |
| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` instaliran |
| gleam | .bleam | `gleam` komanda dostupna |
| gopls | .go | `go` komanda dostupna |
| hls | .hs, .lhs | `haskell-language-server-wrapper` komanda dostupna |
| jdtls | .java | `Java SDK (version 21+)` instaliran |
| kotlin-ls | .kt, .kts | Automatske instalacije za Kotlin projekte |
| lua-ls | .lua | Automatske instalacije za Lua projekte |
| nixd | .nix | `nixd` komanda dostupna |
| ocaml-lsp | .ml, .mli | `ocamllsp` komanda dostupna |
| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | `oxlint` zavisnost u projektu |
| php intelephense | .php | Automatske instalacije za PHP projekte |
| prisma | .prisma | `prisma` komanda dostupna |
| pyright | .py, .pyi | `pyright` ovisnost instalirana |
| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | `ruby` i `gem` komande dostupne |
| rust | .rs | `rust-analyzer` komanda dostupna |
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` instaliran (`xcode` na macOS-u) |
| svelte | .svelte | Automatske instalacije za Svelte projekte |
| terraform | .tf, .tfvars | Automatske instalacije iz GitHub izdanja |
| tinymist | .typ, .typc | Automatske instalacije iz GitHub izdanja |
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` zavisnost u projektu |
| vue | .vue | Automatske instalacije za Vue projekte |
| yaml-ls | .yaml, .yml | Automatski instalira Red Hat yaml-language-server |
| zls | .zig, .zon | `zig` komanda dostupna |
| LSP server | Ekstenzije | Zahtjevi |
| ------------------ | ------------------------------------------------------------------- | -------------------------------------------------------- |
| astro | .astro | Automatske instalacije za Astro projekte |
| bash | .sh, .bash, .zsh, .ksh | Automatski instalira bash-language-server |
| clangd | .c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++ | Automatske instalacije za C/C++ projekte |
| csharp | .cs | `.NET SDK` instaliran |
| clojure-lsp | .clj, .cljs, .cljc, .edn | `clojure-lsp` komanda dostupna |
| dart | .dart | `dart` komanda dostupna |
| deno | .ts, .tsx, .js, .jsx, .mjs | `deno` komanda dostupna (automatski detektuje deno.json) |
| elixir-ls | .ex, .exs | `elixir` komanda dostupna |
| eslint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue | `eslint` ovisnost u projektu |
| fsharp | .fs, .fsi, .fsx, .fsscript | `.NET SDK` instaliran |
| gleam | .gleam | `gleam` komanda dostupna |
| gopls | .go | `go` komanda dostupna |
| hls | .hs, .lhs | `haskell-language-server-wrapper` komanda dostupna |
| jdtls | .java | `Java SDK (version 21+)` instaliran |
| julials | .jl | `julia` i `LanguageServer.jl` instalirani |
| kotlin-ls | .kt, .kts | Automatske instalacije za Kotlin projekte |
| lua-ls | .lua | Automatske instalacije za Lua projekte |
| nixd | .nix | `nixd` komanda dostupna |
| ocaml-lsp | .ml, .mli | `ocamllsp` komanda dostupna |
| oxlint | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vue, .astro, .svelte | `oxlint` zavisnost u projektu |
| php intelephense | .php | Automatske instalacije za PHP projekte |
| prisma | .prisma | `prisma` komanda dostupna |
| pyright | .py, .pyi | `pyright` ovisnost instalirana |
| ruby-lsp (rubocop) | .rb, .rake, .gemspec, .ru | `ruby` i `gem` komande dostupne |
| rust | .rs | `rust-analyzer` komanda dostupna |
| sourcekit-lsp | .swift, .objc, .objcpp | `swift` instaliran (`xcode` na macOS-u) |
| svelte | .svelte | Automatske instalacije za Svelte projekte |
| terraform | .tf, .tfvars | Automatske instalacije iz GitHub izdanja |
| tinymist | .typ, .typc | Automatske instalacije iz GitHub izdanja |
| typescript | .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts | `typescript` zavisnost u projektu |
| vue | .vue | Automatske instalacije za Vue projekte |
| yaml-ls | .yaml, .yml | Automatski instalira Red Hat yaml-language-server |
| zls | .zig, .zon | `zig` komanda dostupna |
LSP serveri su automatski omogućeni kada se otkrije jedna od gore navedenih ekstenzija datoteke i zahtjevi su ispunjeni.
:::note
Možete onemogućiti automatska preuzimanja LSP servera tako što ćete postaviti varijablu okruženja `OPENCODE_DISABLE_LSP_DOWNLOAD` na `true`.
@@ -70,13 +73,15 @@ Možete prilagoditi LSP servere kroz `lsp` odjeljak u vašoj opencode konfigurac
```
Svaki LSP server podržava sljedeće:
| Svojstvo | Vrsta | Opis
|---------------- | -------- | ------------------------------------------------- |
| `disabled` | boolean | Postavite ovo na `true` da onemogućite LSP server |
| `command` | string[] | Naredba za pokretanje LSP servera |
| `extensions` | string[] | Ekstenzije datoteka koje ovaj LSP server treba da rukuje |
| `env` | objekt | Varijable okruženja koje treba postaviti prilikom pokretanja servera |
| `initialization` | objekt | Opcije inicijalizacije za slanje na LSP server |
| Svojstvo | Vrsta | Opis |
| ---------------- | -------- | -------------------------------------------------------------------- |
| `disabled` | boolean | Postavite ovo na `true` da onemogućite LSP server |
| `command` | string[] | Naredba za pokretanje LSP servera |
| `extensions` | string[] | Ekstenzije datoteka koje ovaj LSP server treba da rukuje |
| `env` | objekt | Varijable okruženja koje treba postaviti prilikom pokretanja servera |
| `initialization` | objekt | Opcije inicijalizacije za slanje na LSP server |
Pogledajmo neke primjere.
---

View File

@@ -225,7 +225,7 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr
Koristimo `osascript` za pokretanje AppleScript-a na macOS-u. Ovdje ga koristimo za slanje obavještenja.
:::note
Ako koristite desktop aplikaciju OpenCode, ona može automatski slati sistemske obavijesti kada je odgovor spreman ili kada dođe do greške u sesiji.
Ako alat dodatka koristi isto ime kao ugrađeni alat, alat dodatka ima prednost.
:::
---

View File

@@ -84,6 +84,37 @@ Radi kao i svaki drugi provajder u OpenCode i potpuno je opcionalan za korišten
---
## OpenCode Go
OpenCode Go je jeftin plan pretplate koji pruža pouzdan pristup popularnim modelima otvorenog kodiranja koje pruža OpenCode tim i koji su testirani i verificirani da dobro rade s OpenCode-om.
1. Pokrenite naredbu `/connect` u TUI-u, odaberite `OpenCode Go` i idite na [opencode.ai/auth](https://opencode.ai/zen).
```txt
/connect
```
2. Prijavite se, dodajte svoje detalje naplate i kopirajte svoj API ključ.
3. Zalijepite svoj API ključ.
```txt
┌ API key
└ enter
```
4. Pokrenite naredbu `/models` u TUI da vidite listu modela koje preporučujemo.
```txt
/models
```
Radi kao i svaki drugi provajder u OpenCode i potpuno je opcionalan za korištenje.
---
## Direktorij
Pogledajmo neke od provajdera detaljno. Ako želite dodati provajdera na
@@ -1479,9 +1510,42 @@ Ove postavke su opcione i treba ih konfigurirati u skladu s vašim SAP AI Core p
5. Pokrenite naredbu `/models` da odaberete između 40+ dostupnih modela.
```txt
```txt
/models
```
```
---
### STACKIT
STACKIT AI Model Serving pruža potpuno upravljano suvereno hosting okruženje za AI modele, fokusirajući se na LLM-ove kao što su Llama, Mistral i Qwen, uz maksimalan suverenitet podataka na evropskoj infrastrukturi.
1. Idite na [STACKIT Portal](https://portal.stackit.cloud), idite na **AI Model Serving** i kreirajte token za autentifikaciju za svoj projekat.
:::tip
Potreban vam je STACKIT korisnički račun, korisnički nalog i projekat prije kreiranja tokena za autentifikaciju.
:::
2. Pokrenite naredbu `/connect` i potražite **STACKIT**.
```txt
/connect
```
3. Unesite svoj STACKIT AI Model Serving token za autentifikaciju.
```txt
┌ API key
└ enter
```
4. Pokrenite naredbu `/models` da odaberete dostupne modele kao što su _Qwen3-VL 235B_ ili _Llama 3.3 70B_.
```txt
/models
```
---

View File

@@ -117,6 +117,78 @@ try {
---
## Strukturirani izlaz
Možete zatražiti strukturirani JSON izlaz od modela specificiranjem `format` sa JSON šemom. Model će koristiti `StructuredOutput` alat da vrati validirani JSON koji odgovara vašoj šemi.
### Osnovna upotreba
```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"] }
```
### Tipovi formata izlaza
| Tip | Opis |
| ------------- | ------------------------------------------------------------------- |
| `text` | Default. Standardni tekstualni odgovor (nema strukturiranog izlaza) |
| `json_schema` | Vraća validirani JSON koji odgovara pruženoj šemi |
### Format JSON šeme
Kada koristite `type: 'json_schema'`, navedite:
| Polje | Tip | Opis |
| ------------ | --------------- | ----------------------------------------------------------- |
| `type` | `'json_schema'` | Obavezno. Određuje JSON schema način rada |
| `schema` | `object` | Obavezno. JSON Schema objekt koji definira strukturu izlaza |
| `retryCount` | `number` | Opcionalno. Broj ponovnih pokušaja validacije (default: 2) |
### Rukovanje greškama
Ako model ne uspije proizvesti validan strukturirani izlaz nakon svih ponovnih pokušaja, odgovor će uključivati `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)
}
```
### Najbolje prakse
1. **Navedite jasne opise** u svojstvima vaše šeme kako biste pomogli modelu da razumije koje podatke treba izdvojiti
2. **Koristite `required`** da odredite koja polja moraju biti prisutna
3. **Držite šeme fokusiranim** - složene ugniježđene šeme modelu mogu biti teže za ispravno popunjavanje
4. **Postavite odgovarajući `retryCount`** - povećajte za složene šeme, smanjite za jednostavne
---
## API-ji
SDK izlaže sve server API-je kroz type-safe klijent.
@@ -226,27 +298,27 @@ const { providers, default: defaults } = await client.config.providers()
### Sesije
| Metoda | Opis | Napomene |
| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | List sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Get session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | List child sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Create session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Delete session | Returns `boolean` |
| `session.update({ path, body })` | Update session properties | Returns <a href={typesUrl}><code>Session</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Unshare session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response |
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restore reverted messages | Returns <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` |
| Metoda | Opis | Napomene |
| ---------------------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | List sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Get session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | List child sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Create session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Delete session | Returns `boolean` |
| `session.update({ path, body })` | Update session properties | Returns <a href={typesUrl}><code>Session</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Unshare session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response. Supports `body.outputFormat` for [structured output](#strukturirani-izlaz) |
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restore reverted messages | Returns <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` |
---

View File

@@ -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 | <a href={typesUrl}><code>Project[]</code></a> |
| `GET` | `/project/current` | Get the current project | <a href={typesUrl}><code>Project</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------------------ | ------------------------ | --------------------------------------------- |
| `GET` | `/project` | Izlistaj sve projekte | <a href={typesUrl}><code>Project[]</code></a> |
| `GET` | `/project/current` | Dohvati trenutni projekt | <a href={typesUrl}><code>Project</code></a> |
---
### Putanja i VCS
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------- | ------------------------------------ | ------------------------------------------- |
| `GET` | `/path` | Get the current path | <a href={typesUrl}><code>Path</code></a> |
| `GET` | `/vcs` | Get VCS info for the current project | <a href={typesUrl}><code>VcsInfo</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------- | ------------------------------------------- | ------------------------------------------- |
| `GET` | `/path` | Dohvati trenutnu putanju | <a href={typesUrl}><code>Path</code></a> |
| `GET` | `/vcs` | Dohvati VCS informacije za trenutni projekt | <a href={typesUrl}><code>VcsInfo</code></a> |
---
### 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 | <a href={typesUrl}><code>Config</code></a> |
| `PATCH` | `/config` | Update config | <a href={typesUrl}><code>Config</code></a> |
| `GET` | `/config/providers` | List providers and default models | `{ providers: `<a href={typesUrl}>Provider[]</a>`, default: { [key: string]: string } }` |
| Metoda | Putanja | Opis | Odgovor |
| ------- | ------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- |
| `GET` | `/config` | Dohvati informacije o konfiguraciji | <a href={typesUrl}><code>Config</code></a> |
| `PATCH` | `/config` | Ažuriraj konfiguraciju | <a href={typesUrl}><code>Config</code></a> |
| `GET` | `/config/providers` | Izlistaj provajdere i zadane modele | `{ providers: `<a href={typesUrl}>Provider[]</a>`, default: { [key: string]: string } }` |
---
### Provajder
| Metoda | Putanja | Opis | Odgovor |
| ------ | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- |
| `GET` | `/provider` | List all providers | `{ all: `<a href={typesUrl}>Provider[]</a>`, default: {...}, connected: string[] }` |
| `GET` | `/provider/auth` | Get provider authentication methods | `{ [providerID: string]: `<a href={typesUrl}>ProviderAuthMethod[]</a>` }` |
| `POST` | `/provider/{id}/oauth/authorize` | Authorize a provider using OAuth | <a href={typesUrl}><code>ProviderAuthAuthorization</code></a> |
| `POST` | `/provider/{id}/oauth/callback` | Handle OAuth callback for a provider | `boolean` |
| Metoda | Putanja | Opis | Odgovor |
| ------ | -------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- |
| `GET` | `/provider` | Izlistaj sve provajdere | `{ all: `<a href={typesUrl}>Provider[]</a>`, default: {...}, connected: string[] }` |
| `GET` | `/provider/auth` | Dohvati metode autentifikacije provajdera | `{ [providerID: string]: `<a href={typesUrl}>ProviderAuthMethod[]</a>` }` |
| `POST` | `/provider/{id}/oauth/authorize` | Autoriziraj provajdera koristeći OAuth | <a href={typesUrl}><code>ProviderAuthAuthorization</code></a> |
| `POST` | `/provider/{id}/oauth/callback` | Obradi OAuth povratni poziv za provajdera | `boolean` |
---
### Sesije
| Metoda | Putanja | Opis | Napomene |
| -------- | ---------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- |
| `GET` | `/session` | List all sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `POST` | `/session` | Create a new session | body: `{ parentID?, title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/status` | Get session status for all sessions | Returns `{ [sessionID: string]: `<a href={typesUrl}>SessionStatus</a>` }` |
| `GET` | `/session/:id` | Get session details | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id` | Delete a session and all its data | Returns `boolean` |
| `PATCH` | `/session/:id` | Update session properties | body: `{ title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/children` | Get a session's child sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `GET` | `/session/:id/todo` | Get the todo list for a session | Returns <a href={typesUrl}><code>Todo[]</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `POST` | `/session/:id/abort` | Abort a running session | Returns `boolean` |
| `POST` | `/session/:id/share` | Share a session | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id/share` | Unshare a session | Returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/diff` | Get the diff for this session | query: `messageID?`, returns <a href={typesUrl}><code>FileDiff[]</code></a> |
| `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 <a href={typesUrl}><code>Session[]</code></a> |
| `POST` | `/session` | Kreiraj novu sesiju | body: `{ parentID?, title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/status` | Dohvati status sesije za sve sesije | Returns `{ [sessionID: string]: `<a href={typesUrl}>SessionStatus</a>` }` |
| `GET` | `/session/:id` | Dohvati detalje sesije | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id` | Obriši sesiju i sve njene podatke | Returns `boolean` |
| `PATCH` | `/session/:id` | Ažuriraj svojstva sesije | body: `{ title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/children` | Dohvati pod-sesije sesije | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `GET` | `/session/:id/todo` | Dohvati listu zadataka za sesiju | Returns <a href={typesUrl}><code>Todo[]</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `POST` | `/session/:id/abort` | Prekini sesiju u toku | Returns `boolean` |
| `POST` | `/session/:id/share` | Podijeli sesiju | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id/share` | Prestani dijeliti sesiju | Returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/diff` | Dohvati razlike za ovu sesiju | query: `messageID?`, returns <a href={typesUrl}><code>FileDiff[]</code></a> |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}[]` |
| `POST` | `/session/:id/message` | Send a message and wait for response | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `GET` | `/session/:id/message/:messageID` | Get message details | Returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `POST` | `/session/:id/shell` | Run a shell command | body: `{ agent, model?, command }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| Metoda | Putanja | Opis | Napomene |
| ------ | --------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET` | `/session/:id/message` | Izlistaj poruke u sesiji | query: `limit?`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}[]` |
| `POST` | `/session/:id/message` | Pošalji poruku i čekaj odgovor | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `GET` | `/session/:id/message/:messageID` | Dohvati detalje poruke | Returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `POST` | `/session/:id/shell` | Pokreni shell naredbu | body: `{ agent, model?, command }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
---
### Naredbe
| Metoda | Putanja | Opis | Odgovor |
| ------ | ---------- | ----------------- | --------------------------------------------- |
| `GET` | `/command` | List all commands | <a href={typesUrl}><code>Command[]</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | ---------- | -------------------- | --------------------------------------------- |
| `GET` | `/command` | Izlistaj sve naredbe | <a href={typesUrl}><code>Command[]</code></a> |
---
### Datoteke
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------- |
| `GET` | `/find?pattern=<pat>` | Search for text in files | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` |
| `GET` | `/find/file?query=<q>` | Find files and directories by name | `string[]` (paths) |
| `GET` | `/find/symbol?query=<q>` | Find workspace symbols | <a href={typesUrl}><code>Symbol[]</code></a> |
| `GET` | `/file?path=<path>` | List files and directories | <a href={typesUrl}><code>FileNode[]</code></a> |
| `GET` | `/file/content?path=<p>` | Read a file | <a href={typesUrl}><code>FileContent</code></a> |
| `GET` | `/file/status` | Get status for tracked files | <a href={typesUrl}><code>File[]</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------- |
| `GET` | `/find?pattern=<pat>` | Traži tekst u datotekama | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` |
| `GET` | `/find/file?query=<q>` | Pronađi datoteke i direktorije po imenu | `string[]` (paths) |
| `GET` | `/find/symbol?query=<q>` | Pronađi simbole radnog prostora | <a href={typesUrl}><code>Symbol[]</code></a> |
| `GET` | `/file?path=<path>` | Izlistaj datoteke i direktorije | <a href={typesUrl}><code>FileNode[]</code></a> |
| `GET` | `/file/content?path=<p>` | Pročitaj datoteku | <a href={typesUrl}><code>FileContent</code></a> |
| `GET` | `/file/status` | Dohvati status za praćene datoteke | <a href={typesUrl}><code>File[]</code></a> |
#### `/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 | <a href={typesUrl}><code>ToolIDs</code></a> |
| `GET` | `/experimental/tool?provider=<p>&model=<m>` | List tools with JSON schemas for a model | <a href={typesUrl}><code>ToolList</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------------------------------------------- | -------------------------------------- | -------------------------------------------- |
| `GET` | `/experimental/tool/ids` | Izlistaj sve ID-ove alata | <a href={typesUrl}><code>ToolIDs</code></a> |
| `GET` | `/experimental/tool?provider=<p>&model=<m>` | Izlistaj alate sa JSON šemama za model | <a href={typesUrl}><code>ToolList</code></a> |
---
@@ -220,65 +220,65 @@ opencode server izlaže sljedece API-je.
| Metoda | Putanja | Opis | Odgovor |
| ------ | ------------ | -------------------------- | -------------------------------------------------------- |
| `GET` | `/lsp` | Get LSP server status | <a href={typesUrl}><code>LSPStatus[]</code></a> |
| `GET` | `/formatter` | Get formatter status | <a href={typesUrl}><code>FormatterStatus[]</code></a> |
| `GET` | `/mcp` | Get MCP server status | `{ [name: string]: `<a href={typesUrl}>MCPStatus</a>` }` |
| `POST` | `/mcp` | Add MCP server dynamically | body: `{ name, config }`, returns MCP status object |
| `GET` | `/lsp` | Dohvati status LSP servera | <a href={typesUrl}><code>LSPStatus[]</code></a> |
| `GET` | `/formatter` | Dohvati status formatera | <a href={typesUrl}><code>FormatterStatus[]</code></a> |
| `GET` | `/mcp` | Dohvati status MCP servera | `{ [name: string]: `<a href={typesUrl}>MCPStatus</a>` }` |
| `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 | <a href={typesUrl}><code>Agent[]</code></a> |
| Metoda | Putanja | Opis | Odgovor |
| ------ | -------- | ---------------------------- | ------------------------------------------- |
| `GET` | `/agent` | Izlistaj sve dostupne agente | <a href={typesUrl}><code>Agent[]</code></a> |
---
### 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 |

View File

@@ -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"
}
```

View File

@@ -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.
---

View File

@@ -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, <a href={email}>kontaktirajte nas</a>.
@@ -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).
---

View File

@@ -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.

View File

@@ -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.
---

View File

@@ -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.

View File

@@ -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,<leader>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"
}

View File

@@ -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`.

View File

@@ -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

View File

@@ -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**.

View File

@@ -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 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Få session | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Liste over barnesessioner | Returnerer <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Opret session | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Slett session | Returnerer `boolean` |
| `session.update({ path, body })` | Opdater sessionegenskaper | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `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 | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Slutt at dele sessionen | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Oppsummer sessionen | Returnerer `boolean` |
| `session.messages({ path })` | Liste meldinger i en session | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Få meldingsdetaljer | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar |
| `session.command({ path, body })` | Send kommando til session | Returnerer `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Kjør en shell-kommando | Returnerer <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Tilbakestill en melding | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Gjenopret nulstillete meldinger | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` |
| Metode | Beskrivelse | Noter |
| ---------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | Liste sessioner | Returnerer <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Få session | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Liste over barnesessioner | Returnerer <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Opret session | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Slett session | Returnerer `boolean` |
| `session.update({ path, body })` | Opdater sessionegenskaper | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `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 | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Slutt at dele sessionen | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Oppsummer sessionen | Returnerer `boolean` |
| `session.messages({ path })` | Liste meldinger i en session | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Få meldingsdetaljer | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar. Understøtter `body.outputFormat` for [struktureret output](#struktureret-output) |
| `session.command({ path, body })` | Send kommando til session | Returnerer `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Kjør en shell-kommando | Returnerer <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Tilbakestill en melding | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Gjenopret nulstillete meldinger | Returnerer <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Svar på en tillatelsesforespørsel | Returnerer `boolean` |
---

View File

@@ -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"
}
```

View File

@@ -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.
---

View File

@@ -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.
<a href={email}>Kontakt os</a> 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).

View File

@@ -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**.

View File

@@ -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 | <a href={typesUrl}><code>Agent[]</code></a> |
| Method | Description | Response |
| -------------- | -------------------------------- | ------------------------------------------- |
| `app.log()` | Schreibt einen Log-Eintrag | `boolean` |
| `app.agents()` | Listet alle verfuegbaren Agenten | <a href={typesUrl}><code>Agent[]</code></a> |
---
@@ -171,10 +243,10 @@ const agents = await client.app.agents()
### Project
| Method | Description | Response |
| ------------------- | ------------------- | --------------------------------------------- |
| `project.list()` | List all projects | <a href={typesUrl}><code>Project[]</code></a> |
| `project.current()` | Get current project | <a href={typesUrl}><code>Project</code></a> |
| Method | Description | Response |
| ------------------- | ---------------------------- | --------------------------------------------- |
| `project.list()` | Listet alle Projekte | <a href={typesUrl}><code>Project[]</code></a> |
| `project.current()` | Ruft das aktuelle Projekt ab | <a href={typesUrl}><code>Project</code></a> |
---
@@ -192,9 +264,9 @@ const currentProject = await client.project.current()
### Path
| Method | Description | Response |
| ------------ | ---------------- | ---------------------------------------- |
| `path.get()` | Get current path | <a href={typesUrl}><code>Path</code></a> |
| Method | Description | Response |
| ------------ | -------------------------- | ---------------------------------------- |
| `path.get()` | Ruft den aktuellen Pfad ab | <a href={typesUrl}><code>Path</code></a> |
---
@@ -209,10 +281,10 @@ const pathInfo = await client.path.get()
### Config
| Method | Description | Response |
| -------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `config.get()` | Get config info | <a href={typesUrl}><code>Config</code></a> |
| `config.providers()` | List providers and default models | `{ providers: `<a href={typesUrl}><code>Provider[]</code></a>`, default: { [key: string]: string } }` |
| Method | Description | Response |
| -------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `config.get()` | Ruft Konfigurationsinfos ab | <a href={typesUrl}><code>Config</code></a> |
| `config.providers()` | Listet Provider und Standard-Modelle | `{ providers: `<a href={typesUrl}><code>Provider[]</code></a>`, default: { [key: string]: string } }` |
---
@@ -228,27 +300,27 @@ const { providers, default: defaults } = await client.config.providers()
### Sessions
| Method | Description | Notes |
| ---------------------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | List sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Get session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | List child sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Create session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Delete session | Returns `boolean` |
| `session.update({ path, body })` | Update session properties | Returns <a href={typesUrl}><code>Session</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Unshare session | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response |
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restore reverted messages | Returns <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Respond to a permission request | Returns `boolean` |
| Method | Description | Notes |
| ---------------------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | Listet Sessions | Gibt <a href={typesUrl}><code>Session[]</code></a> zurueck |
| `session.get({ path })` | Ruft Session ab | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `session.children({ path })` | Listet Kind-Sessions | Gibt <a href={typesUrl}><code>Session[]</code></a> zurueck |
| `session.create({ body })` | Erstellt Session | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `session.delete({ path })` | Loescht Session | Gibt `boolean` zurueck |
| `session.update({ path, body })` | Aktualisiert Session-Eigenschaften | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `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 | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `session.unshare({ path })` | Hebt Teilen der Session auf | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `session.summarize({ path, body })` | Fasst Session zusammen | Gibt `boolean` zurueck |
| `session.messages({ path })` | Listet Nachrichten einer Session | Gibt `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` zurueck |
| `session.message({ path })` | Ruft Nachrichtendetails ab | Gibt `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` zurueck |
| `session.prompt({ path, body })` | Sendet Prompt-Nachricht | `body.noReply: true` gibt UserMessage (nur Kontext) zurueck. Standard gibt <a href={typesUrl}><code>AssistantMessage</code></a> mit AI-Antwort zurueck. Unterstuetzt `body.outputFormat` fuer [strukturierte Ausgabe](#structured-output) |
| `session.command({ path, body })` | Sendet Befehl an Session | Gibt `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` zurueck |
| `session.shell({ path, body })` | Fuehrt Shell-Befehl aus | Gibt <a href={typesUrl}><code>AssistantMessage</code></a> zurueck |
| `session.revert({ path, body })` | Setzt Nachricht zurueck | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `session.unrevert({ path })` | Stellt zurueckgesetzte Nachrichten wieder her | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `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 | <a href={typesUrl}><code>Symbol[]</code></a> |
| `file.read({ query })` | Read a file | `{ type: "raw" \| "patch", content: string }` |
| `file.status({ query? })` | Get status for tracked files | <a href={typesUrl}><code>File[]</code></a> |
| 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 | <a href={typesUrl}><code>Symbol[]</code></a> |
| `file.read({ query })` | Liest eine Datei | `{ type: "raw" \| "patch", content: string }` |
| `file.status({ query? })` | Ruft Status fuer getrackte Dateien ab | <a href={typesUrl}><code>File[]</code></a> |
`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 (1200)
- `type`: `"file"` oder `"directory"`
- `directory`: Ueberschreibt das Projekt-Root fuer die Suche
- `limit`: Maximale Ergebnisse (1200)
---
@@ -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 |
---

View File

@@ -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 | <a href={typesUrl}><code>Project[]</code></a> |
| `GET` | `/project/current` | Get the current project | <a href={typesUrl}><code>Project</code></a> |
| Method | Path | Description | Response |
| ------ | ------------------ | ---------------------------- | --------------------------------------------- |
| `GET` | `/project` | Listet alle Projekte | <a href={typesUrl}><code>Project[]</code></a> |
| `GET` | `/project/current` | Ruft das aktuelle Projekt ab | <a href={typesUrl}><code>Project</code></a> |
---
### Path & VCS
| Method | Path | Description | Response |
| ------ | ------- | ------------------------------------ | ------------------------------------------- |
| `GET` | `/path` | Get the current path | <a href={typesUrl}><code>Path</code></a> |
| `GET` | `/vcs` | Get VCS info for the current project | <a href={typesUrl}><code>VcsInfo</code></a> |
| Method | Path | Description | Response |
| ------ | ------- | ------------------------------------------- | ------------------------------------------- |
| `GET` | `/path` | Ruft den aktuellen Pfad ab | <a href={typesUrl}><code>Path</code></a> |
| `GET` | `/vcs` | Ruft VCS-Infos fuer das aktuelle Projekt ab | <a href={typesUrl}><code>VcsInfo</code></a> |
---
@@ -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 | <a href={typesUrl}><code>Config</code></a> |
| `PATCH` | `/config` | Update config | <a href={typesUrl}><code>Config</code></a> |
| `GET` | `/config/providers` | List providers and default models | `{ providers: `<a href={typesUrl}>Provider[]</a>`, default: { [key: string]: string } }` |
| Method | Path | Description | Response |
| ------- | ------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------- |
| `GET` | `/config` | Ruft Konfigurationsinfos ab | <a href={typesUrl}><code>Config</code></a> |
| `PATCH` | `/config` | Aktualisiert Konfiguration | <a href={typesUrl}><code>Config</code></a> |
| `GET` | `/config/providers` | Listet Provider und Standard-Modelle | `{ providers: `<a href={typesUrl}>Provider[]</a>`, default: { [key: string]: string } }` |
---
### Anbieter
| Method | Path | Description | Response |
| ------ | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- |
| `GET` | `/provider` | List all providers | `{ all: `<a href={typesUrl}>Provider[]</a>`, default: {...}, connected: string[] }` |
| `GET` | `/provider/auth` | Get provider authentication methods | `{ [providerID: string]: `<a href={typesUrl}>ProviderAuthMethod[]</a>` }` |
| `POST` | `/provider/{id}/oauth/authorize` | Authorize a provider using OAuth | <a href={typesUrl}><code>ProviderAuthAuthorization</code></a> |
| `POST` | `/provider/{id}/oauth/callback` | Handle OAuth callback for a provider | `boolean` |
| Method | Path | Description | Response |
| ------ | -------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------- |
| `GET` | `/provider` | Listet alle Provider | `{ all: `<a href={typesUrl}>Provider[]</a>`, default: {...}, connected: string[] }` |
| `GET` | `/provider/auth` | Ruft Authentifizierungsmethoden der Provider ab | `{ [providerID: string]: `<a href={typesUrl}>ProviderAuthMethod[]</a>` }` |
| `POST` | `/provider/{id}/oauth/authorize` | Autorisiert einen Provider per OAuth | <a href={typesUrl}><code>ProviderAuthAuthorization</code></a> |
| `POST` | `/provider/{id}/oauth/callback` | Behandelt OAuth-Callback fuer einen Provider | `boolean` |
---
### Sitzungen
| Method | Path | Description | Notes |
| -------- | ---------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------- |
| `GET` | `/session` | List all sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `POST` | `/session` | Create a new session | body: `{ parentID?, title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/status` | Get session status for all sessions | Returns `{ [sessionID: string]: `<a href={typesUrl}>SessionStatus</a>` }` |
| `GET` | `/session/:id` | Get session details | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id` | Delete a session and all its data | Returns `boolean` |
| `PATCH` | `/session/:id` | Update session properties | body: `{ title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/children` | Get a session's child sessions | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `GET` | `/session/:id/todo` | Get the todo list for a session | Returns <a href={typesUrl}><code>Todo[]</code></a> |
| `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 <a href={typesUrl}><code>Session</code></a> |
| `POST` | `/session/:id/abort` | Abort a running session | Returns `boolean` |
| `POST` | `/session/:id/share` | Share a session | Returns <a href={typesUrl}><code>Session</code></a> |
| `DELETE` | `/session/:id/share` | Unshare a session | Returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/diff` | Get the diff for this session | query: `messageID?`, returns <a href={typesUrl}><code>FileDiff[]</code></a> |
| `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 | Gibt <a href={typesUrl}><code>Session[]</code></a> zurueck |
| `POST` | `/session` | Erstellt eine neue Sitzung | body: `{ parentID?, title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/status` | Ruft Status aller Sitzungen ab | Gibt `{ [sessionID: string]: `<a href={typesUrl}>SessionStatus</a>` }` zurueck |
| `GET` | `/session/:id` | Ruft Sitzungsdetails ab | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `DELETE` | `/session/:id` | Loescht eine Sitzung und alle Daten | Gibt `boolean` zurueck |
| `PATCH` | `/session/:id` | Aktualisiert Sitzungseigenschaften | body: `{ title? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `GET` | `/session/:id/children` | Ruft Kind-Sitzungen einer Sitzung ab | Gibt <a href={typesUrl}><code>Session[]</code></a> zurueck |
| `GET` | `/session/:id/todo` | Ruft die Todo-Liste einer Sitzung ab | Gibt <a href={typesUrl}><code>Todo[]</code></a> 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? }`, returns <a href={typesUrl}><code>Session</code></a> |
| `POST` | `/session/:id/abort` | Bricht eine laufende Sitzung ab | Gibt `boolean` zurueck |
| `POST` | `/session/:id/share` | Teilt eine Sitzung | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `DELETE` | `/session/:id/share` | Hebt Teilen einer Sitzung auf | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
| `GET` | `/session/:id/diff` | Ruft den Diff fuer diese Sitzung ab | query: `messageID?`, returns <a href={typesUrl}><code>FileDiff[]</code></a> |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}[]` |
| `POST` | `/session/:id/message` | Send a message and wait for response | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `GET` | `/session/:id/message/:messageID` | Get message details | Returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `POST` | `/session/:id/shell` | Run a shell command | body: `{ agent, model?, command }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| Method | Path | Description | Notes |
| ------ | --------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET` | `/session/:id/message` | Listet Nachrichten in einer Sitzung | query: `limit?`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}[]` |
| `POST` | `/session/:id/message` | Sendet eine Nachricht und wartet auf Antwort | body: `{ messageID?, model?, agent?, noReply?, system?, tools?, parts }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `GET` | `/session/:id/message/:messageID` | Ruft Nachrichtendetails ab | Returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `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: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
| `POST` | `/session/:id/shell` | Fuehrt einen Shell-Befehl aus | body: `{ agent, model?, command }`, returns `{ info: `<a href={typesUrl}>Message</a>`, parts: `<a href={typesUrl}>Part[]</a>`}` |
---
### Befehle
| Method | Path | Description | Response |
| ------ | ---------- | ----------------- | --------------------------------------------- |
| `GET` | `/command` | List all commands | <a href={typesUrl}><code>Command[]</code></a> |
| Method | Path | Description | Response |
| ------ | ---------- | ------------------- | --------------------------------------------- |
| `GET` | `/command` | Listet alle Befehle | <a href={typesUrl}><code>Command[]</code></a> |
---
### Dateien
| Method | Path | Description | Response |
| ------ | ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------- |
| `GET` | `/find?pattern=<pat>` | Search for text in files | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` |
| `GET` | `/find/file?query=<q>` | Find files and directories by name | `string[]` (paths) |
| `GET` | `/find/symbol?query=<q>` | Find workspace symbols | <a href={typesUrl}><code>Symbol[]</code></a> |
| `GET` | `/file?path=<path>` | List files and directories | <a href={typesUrl}><code>FileNode[]</code></a> |
| `GET` | `/file/content?path=<p>` | Read a file | <a href={typesUrl}><code>FileContent</code></a> |
| `GET` | `/file/status` | Get status for tracked files | <a href={typesUrl}><code>File[]</code></a> |
| Method | Path | Description | Response |
| ------ | ------------------------ | ------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `GET` | `/find?pattern=<pat>` | Sucht Text in Dateien | Array of match objects with `path`, `lines`, `line_number`, `absolute_offset`, `submatches` |
| `GET` | `/find/file?query=<q>` | Findet Dateien und Verzeichnisse nach Namen | `string[]` (paths) |
| `GET` | `/find/symbol?query=<q>` | Findet Workspace-Symbole | <a href={typesUrl}><code>Symbol[]</code></a> |
| `GET` | `/file?path=<path>` | Listet Dateien und Verzeichnisse | <a href={typesUrl}><code>FileNode[]</code></a> |
| `GET` | `/file/content?path=<p>` | Liest eine Datei | <a href={typesUrl}><code>FileContent</code></a> |
| `GET` | `/file/status` | Ruft Status fuer getrackte Dateien ab | <a href={typesUrl}><code>File[]</code></a> |
#### `/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 | <a href={typesUrl}><code>ToolIDs</code></a> |
| `GET` | `/experimental/tool?provider=<p>&model=<m>` | List tools with JSON schemas for a model | <a href={typesUrl}><code>ToolList</code></a> |
| Method | Path | Description | Response |
| ------ | ------------------------------------------- | --------------------------------------------- | -------------------------------------------- |
| `GET` | `/experimental/tool/ids` | Listet alle Tool-IDs | <a href={typesUrl}><code>ToolIDs</code></a> |
| `GET` | `/experimental/tool?provider=<p>&model=<m>` | Listet Tools mit JSON-Schemas fuer ein Modell | <a href={typesUrl}><code>ToolList</code></a> |
---
### LSP, Formatierer & MCP
| Method | Path | Description | Response |
| ------ | ------------ | -------------------------- | -------------------------------------------------------- |
| `GET` | `/lsp` | Get LSP server status | <a href={typesUrl}><code>LSPStatus[]</code></a> |
| `GET` | `/formatter` | Get formatter status | <a href={typesUrl}><code>FormatterStatus[]</code></a> |
| `GET` | `/mcp` | Get MCP server status | `{ [name: string]: `<a href={typesUrl}>MCPStatus</a>` }` |
| `POST` | `/mcp` | Add MCP server dynamically | body: `{ name, config }`, returns MCP status object |
| Method | Path | Description | Response |
| ------ | ------------ | -------------------------------- | -------------------------------------------------------- |
| `GET` | `/lsp` | Ruft LSP-Server-Status ab | <a href={typesUrl}><code>LSPStatus[]</code></a> |
| `GET` | `/formatter` | Ruft Formatter-Status ab | <a href={typesUrl}><code>FormatterStatus[]</code></a> |
| `GET` | `/mcp` | Ruft MCP-Server-Status ab | `{ [name: string]: `<a href={typesUrl}>MCPStatus</a>` }` |
| `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 | <a href={typesUrl}><code>Agent[]</code></a> |
| Method | Path | Description | Response |
| ------ | -------- | -------------------------------- | ------------------------------------------- |
| `GET` | `/agent` | Listet alle verfuegbaren Agenten | <a href={typesUrl}><code>Agent[]</code></a> |
---
### 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 |

View File

@@ -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.

View File

@@ -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 `<project-root>/.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 `<project-root>/.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"
{

View File

@@ -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.
---

View File

@@ -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)
- `<your-project>/.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: `<providerId>/<modelId>`
Wenn du `ProviderModelNotFoundError` erhaeltst, referenzierst du ein Modell wahrscheinlich falsch.
Modelle sollten so referenziert werden: `<providerId>/<modelId>`
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).

View File

@@ -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.
<Tabs>
<TabItem label="Linux/macOS">
@@ -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.
</TabItem>
@@ -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**.
</TabItem>
@@ -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.
</TabItem>
</Tabs>
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.

View File

@@ -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, <a href={email}>kontaktiere uns</a>.
@@ -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.
---

View File

@@ -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.

View File

@@ -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,<leader>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"
}

View File

@@ -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 |

View File

@@ -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

View File

@@ -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**.

View File

@@ -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 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Obtener sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Listar sesiones secundarias | Devuelve <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Crear sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Eliminar sesión | Devuelve `boolean` |
| `session.update({ path, body })` | Actualizar propiedades de sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `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 | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Dejar de compartir sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Resumir sesión | Devuelve `boolean` |
| `session.messages({ path })` | Listar mensajes en una sesión | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Obtener detalles del mensaje | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelve <a href={typesUrl}><code>AssistantMessage</code></a> con respuesta de IA |
| `session.command({ path, body })` | Enviar comando a la sesión | Devuelve `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Ejecute un comando de shell | Devuelve <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Revertir un mensaje | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restaurar mensajes revertidos | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a una solicitud de permiso | Devuelve `boolean` |
| Método | Descripción | Notas |
| ---------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | Listar sesiones | Devuelve <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Obtener sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Listar sesiones secundarias | Devuelve <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Crear sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Eliminar sesión | Devuelve `boolean` |
| `session.update({ path, body })` | Actualizar propiedades de sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `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 | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Dejar de compartir sesión | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Resumir sesión | Devuelve `boolean` |
| `session.messages({ path })` | Listar mensajes en una sesión | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Obtener detalles del mensaje | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelve <a href={typesUrl}><code>AssistantMessage</code></a> con respuesta de IA. Admite `body.outputFormat` para [salida estructurada](#salida-estructurada) |
| `session.command({ path, body })` | Enviar comando a la sesión | Devuelve `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Ejecute un comando de shell | Devuelve <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Revertir un mensaje | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restaurar mensajes revertidos | Devuelve <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Responder a una solicitud de permiso | Devuelve `boolean` |
---

View File

@@ -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"
}
```

View File

@@ -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.
---

View File

@@ -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.
<a href={email}>Contáctenos</a> 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).

View File

@@ -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 |

View File

@@ -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.
---

View File

@@ -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 |

View File

@@ -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 denvironnement.
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 <server-name>`.
---
### 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. Sil nest pas fourni, lenregistrement 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.
```

View File

@@ -84,6 +84,38 @@ Il fonctionne comme nimporte 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 nimporte 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**.

View File

@@ -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 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Obtenir une session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Liste des sessions enfants | Renvoie <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Créer une séance | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Supprimer la séance | Renvoie `boolean` |
| `session.update({ path, body })` | Mettre à jour les propriétés de la session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `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 | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Annuler le partage de la session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Résumer la séance | Renvoie `boolean` |
| `session.messages({ path })` | Liste des messages dans une session | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Obtenir les détails du message | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoie <a href={typesUrl}><code>AssistantMessage</code></a> avec réponse IA |
| `session.command({ path, body })` | Envoyer la commande à la session | Renvoie `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Exécuter une commande shell | Renvoie <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Rétablir un message | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restaurer les messages annulés | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Répondre à une demande d'autorisation | Renvoie `boolean` |
| Méthode | Descriptif | Remarques |
| ---------------------------------------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | Liste des séances | Renvoie <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Obtenir une session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Liste des sessions enfants | Renvoie <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Créer une séance | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Supprimer la séance | Renvoie `boolean` |
| `session.update({ path, body })` | Mettre à jour les propriétés de la session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `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 | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Annuler le partage de la session | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Résumer la séance | Renvoie `boolean` |
| `session.messages({ path })` | Liste des messages dans une session | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Obtenir les détails du message | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoie <a href={typesUrl}><code>AssistantMessage</code></a> avec 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: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Exécuter une commande shell | Renvoie <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Rétablir un message | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Restaurer les messages annulés | Renvoie <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Répondre à une demande d'autorisation | Renvoie `boolean` |
---

View File

@@ -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"
}
```

View File

@@ -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é.
---

View File

@@ -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 à **<a href={console}>OpenCode Zen</a>**, ajoutez votre facturation
détails et copiez votre clé API.
1. Vous vous connectez à **<a href={console}>OpenCode Zen</a>**, 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/<model-id>`. 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/<model-id>`. 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.
<a href={email}>Contactez-nous</a> 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.

View File

@@ -7,7 +7,7 @@ import config from "../../../config.mjs"
export const console = config.console
export const email = `mailto:${config.email}`
OpenCode Go is a low cost subscription that gives you reliable access to popular open coding models, with the goal of making AI coding accessible to more people.
OpenCode Go is a low cost **$10/month** subscription that gives you reliable access to popular open coding models.
:::note
OpenCode Go is currently in beta.
@@ -17,6 +17,8 @@ Go works like any other provider in OpenCode. You subscribe to OpenCode Go and
get your API key. It's **completely optional** and you don't need to use it to
use OpenCode.
It is designed primarily for international users, with models hosted in the US, EU, and Singapore for stable global access.
---
## Background
@@ -86,7 +88,7 @@ In terms of tokens, $20 of usage is roughly equivalent to:
You can view your current usage in the **<a href={console}>console</a>**.
:::tip
If you reach a usage limit, you can continue using the free models available.
If you reach the usage limit, you can continue using the free models.
:::
Usage limits may change as we learn from early usage and feedback.
@@ -95,7 +97,7 @@ Usage limits may change as we learn from early usage and feedback.
### Pricing
Below are the prices **per 1M tokens**.
OpenCode Go is a **$10/month** subscription plan. Below are the prices **per 1M tokens**.
| Model | Input | Output | Cached Read |
| ------------ | ----- | ------ | ----------- |
@@ -105,7 +107,7 @@ Below are the prices **per 1M tokens**.
---
### Use balance after limits
### Usage beyond limits
If you also have credits on your Zen balance, you can enable the **Use balance**
option in the console. When enabled, Go will fall back to your Zen balance

View File

@@ -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 |

View File

@@ -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
---

View File

@@ -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.

View File

@@ -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.

View File

@@ -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,<leader>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"
}

View File

@@ -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 |

View File

@@ -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.

View File

@@ -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**.

View File

@@ -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 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Ottieni una sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Elenca sessioni figlie | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Crea una sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Elimina una sessione | Returns `boolean` |
| `session.update({ path, body })` | Aggiorna proprieta della sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `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 | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Rimuove la condivisione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Riassume la sessione | Returns `boolean` |
| `session.messages({ path })` | Elenca i messaggi della sessione | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Ottieni dettagli di un messaggio | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritorna <a href={typesUrl}><code>AssistantMessage</code></a> con risposta AI |
| `session.command({ path, body })` | Invia un comando alla sessione | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Esegue un comando shell | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Ripristina un messaggio | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Ripristina messaggi revertiti | Returns <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Risponde a una richiesta permessi | Returns `boolean` |
| Metodo | Descrizione | Note |
| ---------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | Elenca le sessioni | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | Ottieni una sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | Elenca sessioni figlie | Returns <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | Crea una sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | Elimina una sessione | Returns `boolean` |
| `session.update({ path, body })` | Aggiorna proprieta della sessione | Returns <a href={typesUrl}><code>Session</code></a> |
| `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 | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | Rimuove la condivisione | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | Riassume la sessione | Returns `boolean` |
| `session.messages({ path })` | Elenca i messaggi della sessione | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | Ottieni dettagli di un messaggio | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritorna <a href={typesUrl}><code>AssistantMessage</code></a> con risposta AI. Supporta `body.outputFormat` per [output strutturato](#output-strutturato) |
| `session.command({ path, body })` | Invia un comando alla sessione | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | Esegue un comando shell | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | Ripristina un messaggio | Returns <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | Ripristina messaggi revertiti | Returns <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | Risponde a una richiesta permessi | Returns `boolean` |
---

View File

@@ -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 `<project-root>/.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

View File

@@ -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)

View File

@@ -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.
---

View File

@@ -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.
<a href={email}>Contattaci</a> 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).

View File

@@ -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` | | ローカルサーバーのポート (デフォルトはランダムポート) |
---

View File

@@ -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": {}
}
```

View File

@@ -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)) を使用できます。

View File

@@ -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` |
| 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 |
| biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | `biome.json(c)` config file |
| cargofmt | .rs | `cargo fmt` 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 は自動的にそれを使用します。

View File

@@ -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,<leader>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"
}

View File

@@ -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 |

View File

@@ -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 <server-name>` を使用して 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.
```

View File

@@ -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` ファイルを読み取らないようにします。

View File

@@ -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 ベースのモデルが利用可能です。

View File

@@ -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()` | セッションをリストする | 戻り値 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | セッションを取得 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | 子セッションをリストする | 戻り値 <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | セッションの作成 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | セッションを削除 | 戻り値 `boolean` |
| `session.update({ path, body })` | セッションのプロパティを更新する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | アプリを分析して `AGENTS.md` を作成する | 戻り値 `boolean` |
| `session.abort({ path })` | 実行中のセッションを中止する | 戻り値 `boolean` |
| `session.share({ path })` | セッションを共有する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | セッションの共有を解除 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | セッションを要約する | 戻り値 `boolean` |
| `session.messages({ path })` | セッション内のメッセージをリストする | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | メッセージの詳細を取得する | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含む <a href={typesUrl}><code>AssistantMessage</code></a> を返します。 |
| `session.command({ path, body })` | コマンドをセッションに送信 | 戻り値 `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | シェルコマンドを実行する | 戻り値 <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | メッセージを元に戻す | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | 元に戻したメッセージを復元する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | 許可リクエストに応答する | 戻り値 `boolean` |
| メソッド | 説明 | 詳細 |
| ---------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | セッションをリストする | 戻り値 <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | セッションを取得 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | 子セッションをリストする | 戻り値 <a href={typesUrl}><code>Session[]</code></a> |
| `session.create({ body })` | セッションの作成 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | セッションを削除 | 戻り値 `boolean` |
| `session.update({ path, body })` | セッションのプロパティを更新する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | アプリを分析して `AGENTS.md` を作成する | 戻り値 `boolean` |
| `session.abort({ path })` | 実行中のセッションを中止する | 戻り値 `boolean` |
| `session.share({ path })` | セッションを共有する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | セッションの共有を解除 | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | セッションを要約する | 戻り値 `boolean` |
| `session.messages({ path })` | セッション内のメッセージをリストする | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
| `session.message({ path })` | メッセージの詳細を取得する | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含む <a href={typesUrl}><code>AssistantMessage</code></a> を返します。[構造化出力](#構造化出力) のための `body.outputFormat` をサポートします。 |
| `session.command({ path, body })` | コマンドをセッションに送信 | 戻り値 `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | シェルコマンドを実行する | 戻り値 <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | メッセージを元に戻す | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | 元に戻したメッセージを復元する | 戻り値 <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | 許可リクエストに応答する | 戻り値 `boolean` |
---

View File

@@ -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"
}
```

View File

@@ -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` を使用します。
---

View File

@@ -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. **<a href={console}>OpenCode Zen</a>** にログインし、請求内容を追加します
詳細を確認し、API キーをコピーします。
1. **<a href={console}>OpenCode Zen</a>** にサインインし、請求情報を追加して、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 で無料で利用できるステルスモデルです。チームはこの間を利用してフィードバックを収集し、モデルを改善します。
ご質問がございましたら、<a href={email}>お問い合わせ</a>ください。
@@ -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
ワークスペースは現在、ベータ版の一部としてチームに無料で提供されています。
:::
価格の詳細については近日中にお知らせします。
ワークスペースの管理は現在、ベータ版の一部としてチームに無料で提供されています。価格の詳細については近日中にお知らせします。
---

View File

@@ -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": {}
}
```

View File

@@ -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) 기반입니다.

View File

@@ -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,<leader>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"
}

View File

@@ -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` 배열은 무시됩니다.

File diff suppressed because it is too large Load Diff

View File

@@ -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()` | 이용 가능한 모든 에이전트 | <a href={typesUrl}><code> 에이전트[]</code></a> |
| 방법 | 설명 | 응답 |
| -------------- | ------------------------- | ------------------------------------------- |
| `app.log()` | 로그 항목 작성 | `boolean` |
| `app.agents()` | 이용 가능한 모든 에이전트 | <a href={typesUrl}><code>Agent[]</code></a> |
---
@@ -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()` | 세션 일람 | <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | 세션 가져 오기 | <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | 하위 세션 목록 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.create({ body })` | 세션 만들기 | 리턴 <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | 세션 삭제 | `boolean` 반품 |
| `session.update({ path, body })` | 업데이트 세션 속성 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | 앱 초기화 및 `AGENTS.md` 분석 | `boolean`를 반환 |
| `session.abort({ path })` | 운영 중인 세션 | 반품 `boolean` |
| `session.share({ path })` | 공유 세션 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | 공유 세션 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | 세션 요약 | 반품 `boolean` |
| `session.messages({ path })` | 세션의 메시지 목록 | `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part</code></a>`}[]` |
| `session.message({ path })` | 메시지 상세정보 | 반품 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true` 반환 UserMessage (콘텍스트 전용). 기본 반환 <a href={typesUrl}><code>AssistantMessage</code></a> 에 AI 응답 |
| `session.command({ path, body })` | 세션으로 명령을 전송 | `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | shell 명령을 실행 | <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | 메시지 다시 변환 | <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | 메시지 되돌리기 취소 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `postSessionByIdPermissionsByPermissionId({ path, body })` | 허가 요청 대응 | 반품 `boolean` |
| 메서드 | 설명 | 비고 |
| ---------------------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session.list()` | 세션 일람 | <a href={typesUrl}><code>Session[]</code></a> |
| `session.get({ path })` | 세션 가져 오기 | <a href={typesUrl}><code>Session</code></a> |
| `session.children({ path })` | 하위 세션 목록 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.create({ body })` | 세션 만들기 | 리턴 <a href={typesUrl}><code>Session</code></a> |
| `session.delete({ path })` | 세션 삭제 | `boolean` 반품 |
| `session.update({ path, body })` | 업데이트 세션 속성 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.init({ path, body })` | 앱 초기화 및 `AGENTS.md` 분석 | `boolean`를 반환 |
| `session.abort({ path })` | 운영 중인 세션 | 반품 `boolean` |
| `session.share({ path })` | 공유 세션 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.unshare({ path })` | 공유 세션 취소 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `session.summarize({ path, body })` | 세션 요약 | 반품 `boolean` |
| `session.messages({ path })` | 세션의 메시지 목록 | `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part</code></a>`}[]` |
| `session.message({ path })` | 메시지 상세정보 | 반품 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true` UserMessage(컨텍스트 전용)를 반환합니다. 기본값은 AI 응답과 함께 <a href={typesUrl}><code>AssistantMessage</code></a>를 반환합니다. [구조화된 출력](#구조화된-출력)을 위한 `body.outputFormat`을 지원합니다 |
| `session.command({ path, body })` | 세션으로 명령을 전송 | `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
| `session.shell({ path, body })` | shell 명령을 실행 | <a href={typesUrl}><code>AssistantMessage</code></a> |
| `session.revert({ path, body })` | 메시지 다시 변환 | <a href={typesUrl}><code>Session</code></a> |
| `session.unrevert({ path })` | 메시지 되돌리기 취소 | 반품 <a href={typesUrl}><code>Session</code></a> |
| `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({
---
## 이벤트
### 이벤트
| 방법 | 설명 | 응답 |
| ------------------- | ----------------------- | ----------------------- |

View File

@@ -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. ** 루트 디렉토리 ** - `<project-root>/.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)** - `<project-root>/.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 형식을 사용하여 지원:
테마는 다음을 지원하는 유연한 JSON 형식을 사용합니다:
-**Hex 색상**: `"#ffffff"`
- ** 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"
{

View File

@@ -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` 환경 변수에 지정된 편집기를 사용합니다.
<Tabs>
<TabItem label="Linux/macOS">
@@ -301,8 +299,7 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing).
export EDITOR="code --wait"
```
영원한 만들기 위하여, 당신의 shell 프로파일에 이것을 추가하십시오;
`~/.bashrc`, `~/.zshrc`, 등.
영구적으로 설정하려면 셸 프로필(`~/.bashrc`, `~/.zshrc` 등)에 추가하십시오.
</TabItem>
@@ -315,8 +312,7 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing).
set EDITOR=code --wait
```
영구적으로, use **System Properties** > ** 환경
변수**.
영구적으로 설정하려면 **시스템 속성** > **환경 변수**를 사용하십시오.
</TabItem>
@@ -329,62 +325,72 @@ Unshare 현재 세션. [더 알아보기](/docs/share#un-sharing).
$env:EDITOR = "code --wait"
```
영구적으로 만들려면 PowerShell 프로파일에 추가하십시오.
영구적으로 설정하려면 PowerShell 프로에 추가하십시오.
</TabItem>
</Tabs>
인기있는 편집기 옵션은 다음과 같습니다 :
인기 있는 편집기 옵션은 다음과 같습니다:
- `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 세션 간에 기억됩니다.

View File

@@ -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/<model-id>` 형식을 따릅니다.
OpenCode 설정 파일에서 사용하는 [모델 ID](/docs/config/#models)는 `opencode/<model-id>` 형식을 따릅니다.
예를 들어 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일간 보관됩니다.

View File

@@ -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 |

View File

@@ -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
---

View File

@@ -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.

View File

@@ -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,<leader>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 "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"
}

View File

@@ -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 |

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