Skip to content

Commit 0c1c074

Browse files
committed
Merge branch 'dev' into sqlite2
2 parents 105688b + 5369e96 commit 0c1c074

176 files changed

Lines changed: 5510 additions & 1726 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,20 @@ jobs:
5353
printf '%s\n' "XDG_CACHE_HOME=${{ runner.temp }}\\opencode-e2e\\cache" >> "$GITHUB_ENV"
5454
printf '%s\n' "XDG_CONFIG_HOME=${{ runner.temp }}\\opencode-e2e\\config" >> "$GITHUB_ENV"
5555
printf '%s\n' "XDG_STATE_HOME=${{ runner.temp }}\\opencode-e2e\\state" >> "$GITHUB_ENV"
56-
printf '%s\n' "MODELS_DEV_API_JSON=${{ github.workspace }}\\packages\\opencode\\test\\tool\\fixtures\\models-api.json" >> "$GITHUB_ENV"
5756
else
5857
printf '%s\n' "OPENCODE_E2E_ROOT=${{ runner.temp }}/opencode-e2e" >> "$GITHUB_ENV"
5958
printf '%s\n' "OPENCODE_TEST_HOME=${{ runner.temp }}/opencode-e2e/home" >> "$GITHUB_ENV"
6059
printf '%s\n' "XDG_DATA_HOME=${{ runner.temp }}/opencode-e2e/share" >> "$GITHUB_ENV"
6160
printf '%s\n' "XDG_CACHE_HOME=${{ runner.temp }}/opencode-e2e/cache" >> "$GITHUB_ENV"
6261
printf '%s\n' "XDG_CONFIG_HOME=${{ runner.temp }}/opencode-e2e/config" >> "$GITHUB_ENV"
6362
printf '%s\n' "XDG_STATE_HOME=${{ runner.temp }}/opencode-e2e/state" >> "$GITHUB_ENV"
64-
printf '%s\n' "MODELS_DEV_API_JSON=${{ github.workspace }}/packages/opencode/test/tool/fixtures/models-api.json" >> "$GITHUB_ENV"
6563
fi
6664
6765
- name: Seed opencode data
6866
if: matrix.settings.name != 'windows'
6967
working-directory: packages/opencode
7068
run: bun script/seed-e2e.ts
7169
env:
72-
MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }}
73-
OPENCODE_DISABLE_MODELS_FETCH: "true"
7470
OPENCODE_DISABLE_SHARE: "true"
7571
OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
7672
OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"
@@ -90,8 +86,6 @@ jobs:
9086
working-directory: packages/opencode
9187
run: bun dev -- --print-logs --log-level WARN serve --port 4096 --hostname 127.0.0.1 &
9288
env:
93-
MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }}
94-
OPENCODE_DISABLE_MODELS_FETCH: "true"
9589
OPENCODE_DISABLE_SHARE: "true"
9690
OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
9791
OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"
@@ -117,8 +111,6 @@ jobs:
117111
run: ${{ matrix.settings.command }}
118112
env:
119113
CI: true
120-
MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }}
121-
OPENCODE_DISABLE_MODELS_FETCH: "true"
122114
OPENCODE_DISABLE_SHARE: "true"
123115
OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
124116
OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"

.opencode/command/commit.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: git commit and push
3-
model: opencode/glm-4.6
3+
model: opencode/glm-4.7
44
subtask: true
55
---
66

@@ -26,3 +26,15 @@ about what user facing changes were made
2626

2727
if there are changes do a git pull --rebase
2828
if there are conflicts DO NOT FIX THEM. notify me and I will fix them
29+
30+
## GIT DIFF
31+
32+
!`git diff`
33+
34+
## GIT DIFF --cached
35+
36+
!`git diff --cached`
37+
38+
## GIT STATUS --short
39+
40+
!`git status --short`

.opencode/opencode.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// "enterprise": {
55
// "url": "https://enterprise.dev.opencode.ai",
66
// },
7-
"instructions": ["STYLE_GUIDE.md"],
87
"provider": {
98
"opencode": {
109
"options": {},

AGENTS.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,80 @@
1-
- To test opencode in `packages/opencode`, run `bun dev`.
21
- To regenerate the JavaScript SDK, run `./packages/sdk/js/script/build.ts`.
32
- ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.
43
- The default branch in this repo is `dev`.
4+
5+
## Style Guide
6+
7+
- Keep things in one function unless composable or reusable
8+
- Avoid unnecessary destructuring. Instead of `const { a, b } = obj`, use `obj.a` and `obj.b` to preserve context
9+
- Avoid `try`/`catch` where possible
10+
- Avoid using the `any` type
11+
- Prefer single word variable names where possible
12+
- Use Bun APIs when possible, like `Bun.file()`
13+
14+
### Avoid let statements
15+
16+
We don't like `let` statements, especially combined with if/else statements.
17+
Prefer `const`.
18+
19+
Good:
20+
21+
```ts
22+
const foo = condition ? 1 : 2
23+
```
24+
25+
Bad:
26+
27+
```ts
28+
let foo
29+
30+
if (condition) foo = 1
31+
else foo = 2
32+
```
33+
34+
### Avoid else statements
35+
36+
Prefer early returns or using an `iife` to avoid else statements.
37+
38+
Good:
39+
40+
```ts
41+
function foo() {
42+
if (condition) return 1
43+
return 2
44+
}
45+
```
46+
47+
Bad:
48+
49+
```ts
50+
function foo() {
51+
if (condition) return 1
52+
else return 2
53+
}
54+
```
55+
56+
### Prefer single word naming
57+
58+
Try your best to find a single word name for your variables, functions, etc.
59+
Only use multiple words if you cannot.
60+
61+
Good:
62+
63+
```ts
64+
const foo = 1
65+
const bar = 2
66+
const baz = 3
67+
```
68+
69+
Bad:
70+
71+
```ts
72+
const fooBar = 1
73+
const barBaz = 2
74+
const bazFoo = 3
75+
```
76+
77+
## Testing
78+
79+
You MUST avoid using `mocks` as much as possible.
80+
Tests MUST test actual implementation, do not duplicate logic into a test.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ This runs `bun run --cwd packages/desktop build` automatically via Tauri’s `be
148148
> [!NOTE]
149149
> If you make changes to the API or SDK (e.g. `packages/opencode/src/server/server.ts`), run `./script/generate.ts` to regenerate the SDK and related files.
150150
151-
Please try to follow the [style guide](./STYLE_GUIDE.md)
151+
Please try to follow the [style guide](./AGENTS.md)
152152

153153
### Setting up a Debugger
154154

README.ar.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<p align="center">
2+
<a href="https://opencode.ai">
3+
<picture>
4+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
5+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
6+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="شعار OpenCode">
7+
</picture>
8+
</a>
9+
</p>
10+
<p align="center">وكيل برمجة بالذكاء الاصطناعي مفتوح المصدر.</p>
11+
<p align="center">
12+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
13+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
14+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
15+
</p>
16+
17+
<p align="center">
18+
<a href="README.md">English</a> |
19+
<a href="README.zh.md">简体中文</a> |
20+
<a href="README.zht.md">繁體中文</a> |
21+
<a href="README.ko.md">한국어</a> |
22+
<a href="README.de.md">Deutsch</a> |
23+
<a href="README.es.md">Español</a> |
24+
<a href="README.fr.md">Français</a> |
25+
<a href="README.da.md">Dansk</a> |
26+
<a href="README.ja.md">日本語</a> |
27+
<a href="README.pl.md">Polski</a> |
28+
<a href="README.ru.md">Русский</a> |
29+
<a href="README.ar.md">العربية</a> |
30+
<a href="README.no.md">Norsk</a> |
31+
<a href="README.br.md">Português (Brasil)</a>
32+
</p>
33+
34+
[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai)
35+
36+
---
37+
38+
### التثبيت
39+
40+
```bash
41+
# YOLO
42+
curl -fsSL https://opencode.ai/install | bash
43+
44+
# مديري الحزم
45+
npm i -g opencode-ai@latest # او bun/pnpm/yarn
46+
scoop install opencode # Windows
47+
choco install opencode # Windows
48+
brew install anomalyco/tap/opencode # macOS و Linux (موصى به، دائما محدث)
49+
brew install opencode # macOS و Linux (صيغة brew الرسمية، تحديث اقل)
50+
paru -S opencode-bin # Arch Linux
51+
mise use -g opencode # اي نظام
52+
nix run nixpkgs#opencode # او github:anomalyco/opencode لاحدث فرع dev
53+
```
54+
55+
> [!TIP]
56+
> احذف الاصدارات الاقدم من 0.1.x قبل التثبيت.
57+
58+
### تطبيق سطح المكتب (BETA)
59+
60+
يتوفر OpenCode ايضا كتطبيق سطح مكتب. قم بالتنزيل مباشرة من [صفحة الاصدارات](https://github.com/anomalyco/opencode/releases) او من [opencode.ai/download](https://opencode.ai/download).
61+
62+
| المنصة | التنزيل |
63+
| --------------------- | ------------------------------------- |
64+
| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` |
65+
| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` |
66+
| Windows | `opencode-desktop-windows-x64.exe` |
67+
| Linux | `.deb` او `.rpm` او AppImage |
68+
69+
```bash
70+
# macOS (Homebrew)
71+
brew install --cask opencode-desktop
72+
# Windows (Scoop)
73+
scoop bucket add extras; scoop install extras/opencode-desktop
74+
```
75+
76+
#### مجلد التثبيت
77+
78+
يحترم سكربت التثبيت ترتيب الاولوية التالي لمسار التثبيت:
79+
80+
1. `$OPENCODE_INSTALL_DIR` - مجلد تثبيت مخصص
81+
2. `$XDG_BIN_DIR` - مسار متوافق مع مواصفات XDG Base Directory
82+
3. `$HOME/bin` - مجلد الثنائيات القياسي للمستخدم (ان وجد او امكن انشاؤه)
83+
4. `$HOME/.opencode/bin` - المسار الافتراضي الاحتياطي
84+
85+
```bash
86+
# امثلة
87+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
88+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
89+
```
90+
91+
### Agents
92+
93+
يتضمن OpenCode وكيليْن (Agents) مدمجين يمكنك التبديل بينهما باستخدام زر `Tab`.
94+
95+
- **build** - الافتراضي، وكيل بصلاحيات كاملة لاعمال التطوير
96+
- **plan** - وكيل للقراءة فقط للتحليل واستكشاف الكود
97+
- يرفض تعديل الملفات افتراضيا
98+
- يطلب الاذن قبل تشغيل اوامر bash
99+
- مثالي لاستكشاف قواعد كود غير مألوفة او لتخطيط التغييرات
100+
101+
بالاضافة الى ذلك يوجد وكيل فرعي **general** للبحث المعقد والمهام متعددة الخطوات.
102+
يستخدم داخليا ويمكن استدعاؤه بكتابة `@general` في الرسائل.
103+
104+
تعرف على المزيد حول [agents](https://opencode.ai/docs/agents).
105+
106+
### التوثيق
107+
108+
لمزيد من المعلومات حول كيفية ضبط OpenCode، [**راجع التوثيق**](https://opencode.ai/docs).
109+
110+
### المساهمة
111+
112+
اذا كنت مهتما بالمساهمة في OpenCode، يرجى قراءة [contributing docs](./CONTRIBUTING.md) قبل ارسال pull request.
113+
114+
### البناء فوق OpenCode
115+
116+
اذا كنت تعمل على مشروع مرتبط بـ OpenCode ويستخدم "opencode" كجزء من اسمه (مثل "opencode-dashboard" او "opencode-mobile")، يرجى اضافة ملاحظة في README توضح انه ليس مبنيا بواسطة فريق OpenCode ولا يرتبط بنا بأي شكل.
117+
118+
### FAQ
119+
120+
#### ما الفرق عن Claude Code؟
121+
122+
هو مشابه جدا لـ Claude Code من حيث القدرات. هذه هي الفروقات الاساسية:
123+
124+
- 100% مفتوح المصدر
125+
- غير مقترن بمزود معين. نوصي بالنماذج التي نوفرها عبر [OpenCode Zen](https://opencode.ai/zen)؛ لكن يمكن استخدام OpenCode مع Claude او OpenAI او Google او حتى نماذج محلية. مع تطور النماذج ستتقلص الفجوات وستنخفض الاسعار، لذا من المهم ان يكون مستقلا عن المزود.
126+
- دعم LSP جاهز للاستخدام
127+
- تركيز على TUI. تم بناء OpenCode بواسطة مستخدمي neovim ومنشئي [terminal.shop](https://terminal.shop)؛ وسندفع حدود ما هو ممكن داخل الطرفية.
128+
- معمارية عميل/خادم. على سبيل المثال، يمكن تشغيل OpenCode على جهازك بينما تقوده عن بعد من تطبيق جوال. هذا يعني ان واجهة TUI هي واحدة فقط من العملاء الممكنين.
129+
130+
---
131+
132+
**انضم الى مجتمعنا** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)

0 commit comments

Comments
 (0)