Skip to content

Commit ca8165b

Browse files
committed
Merge branch 'dev' into fix/autocompletion-filtered-order
2 parents 646a87b + bee2f65 commit ca8165b

Some content is hidden

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

72 files changed

+3164
-1841
lines changed

.github/workflows/update-nix-hashes.yml

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -19,84 +19,7 @@ on:
1919
- ".github/workflows/update-nix-hashes.yml"
2020

2121
jobs:
22-
update-flake:
23-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
24-
runs-on: blacksmith-4vcpu-ubuntu-2404
25-
env:
26-
TITLE: flake.lock
27-
28-
steps:
29-
- name: Checkout repository
30-
uses: actions/checkout@v6
31-
with:
32-
token: ${{ secrets.GITHUB_TOKEN }}
33-
fetch-depth: 0
34-
ref: ${{ github.head_ref || github.ref_name }}
35-
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
36-
37-
- name: Setup Nix
38-
uses: nixbuild/nix-quick-install-action@v34
39-
40-
- name: Configure git
41-
run: |
42-
git config --global user.email "action@github.com"
43-
git config --global user.name "Github Action"
44-
45-
- name: Update ${{ env.TITLE }}
46-
run: |
47-
set -euo pipefail
48-
echo "Updating $TITLE..."
49-
nix flake update
50-
echo "$TITLE updated successfully"
51-
52-
- name: Commit ${{ env.TITLE }} changes
53-
env:
54-
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
55-
run: |
56-
set -euo pipefail
57-
58-
echo "Checking for changes in tracked files..."
59-
60-
summarize() {
61-
local status="$1"
62-
{
63-
echo "### Nix $TITLE"
64-
echo ""
65-
echo "- ref: ${GITHUB_REF_NAME}"
66-
echo "- status: ${status}"
67-
} >> "$GITHUB_STEP_SUMMARY"
68-
if [ -n "${GITHUB_SERVER_URL:-}" ] && [ -n "${GITHUB_REPOSITORY:-}" ] && [ -n "${GITHUB_RUN_ID:-}" ]; then
69-
echo "- run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> "$GITHUB_STEP_SUMMARY"
70-
fi
71-
echo "" >> "$GITHUB_STEP_SUMMARY"
72-
}
73-
FILES=(flake.lock flake.nix)
74-
STATUS="$(git status --short -- "${FILES[@]}" || true)"
75-
if [ -z "$STATUS" ]; then
76-
echo "No changes detected."
77-
summarize "no changes"
78-
exit 0
79-
fi
80-
81-
echo "Changes detected:"
82-
echo "$STATUS"
83-
echo "Staging files..."
84-
git add "${FILES[@]}"
85-
echo "Committing changes..."
86-
git commit -m "Update $TITLE"
87-
echo "Changes committed"
88-
89-
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
90-
echo "Pulling latest from branch: $BRANCH"
91-
git pull --rebase --autostash origin "$BRANCH"
92-
echo "Pushing changes to branch: $BRANCH"
93-
git push origin HEAD:"$BRANCH"
94-
echo "Changes pushed successfully"
95-
96-
summarize "committed $(git rev-parse --short HEAD)"
97-
9822
compute-node-modules-hash:
99-
needs: update-flake
10023
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
10124
strategy:
10225
fail-fast: false

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# Package managers
2828
npm i -g opencode-ai@latest # or bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
3232
brew install opencode # macOS and Linux (official brew formula, updated less)
@@ -52,6 +52,8 @@ OpenCode is also available as a desktop application. Download directly from the
5252
```bash
5353
# macOS (Homebrew)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### Installation Directory

README.zh-CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# 软件包管理器
2828
npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS 和 Linux(推荐,始终保持最新)
3232
brew install opencode # macOS 和 Linux(官方 brew formula,更新频率较低)
@@ -52,6 +52,8 @@ OpenCode 也提供桌面版应用。可直接从 [发布页 (releases page)](htt
5252
```bash
5353
# macOS (Homebrew Cask)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### 安装目录

README.zh-TW.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# 套件管理員
2828
npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS 與 Linux(推薦,始終保持最新)
3232
brew install opencode # macOS 與 Linux(官方 brew formula,更新頻率較低)
@@ -52,6 +52,8 @@ OpenCode 也提供桌面版應用程式。您可以直接從 [發佈頁面 (rele
5252
```bash
5353
# macOS (Homebrew Cask)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### 安裝目錄

STATS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,4 @@
203203
| 2026-01-14 | 3,568,928 (+271,850) | 1,645,362 (+50,300) | 5,214,290 (+322,150) |
204204
| 2026-01-16 | 4,121,550 (+552,622) | 1,754,418 (+109,056) | 5,875,968 (+661,678) |
205205
| 2026-01-17 | 4,389,558 (+268,008) | 1,805,315 (+50,897) | 6,194,873 (+318,905) |
206+
| 2026-01-18 | 4,627,623 (+238,065) | 1,839,171 (+33,856) | 6,466,794 (+271,921) |

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -6,111 +6,43 @@
66
};
77

88
outputs =
9-
{
10-
self,
11-
nixpkgs,
12-
...
13-
}:
9+
{ self, nixpkgs, ... }:
1410
let
1511
systems = [
1612
"aarch64-linux"
1713
"x86_64-linux"
1814
"aarch64-darwin"
1915
"x86_64-darwin"
2016
];
21-
inherit (nixpkgs) lib;
22-
forEachSystem = lib.genAttrs systems;
23-
pkgsFor = system: nixpkgs.legacyPackages.${system};
24-
packageJson = builtins.fromJSON (builtins.readFile ./packages/opencode/package.json);
25-
bunTarget = {
26-
"aarch64-linux" = "bun-linux-arm64";
27-
"x86_64-linux" = "bun-linux-x64";
28-
"aarch64-darwin" = "bun-darwin-arm64";
29-
"x86_64-darwin" = "bun-darwin-x64";
30-
};
31-
32-
# Parse "bun-{os}-{cpu}" to {os, cpu}
33-
parseBunTarget =
34-
target:
35-
let
36-
parts = lib.splitString "-" target;
37-
in
38-
{
39-
os = builtins.elemAt parts 1;
40-
cpu = builtins.elemAt parts 2;
41-
};
42-
43-
hashesFile = "${./nix}/hashes.json";
44-
hashesData =
45-
if builtins.pathExists hashesFile then builtins.fromJSON (builtins.readFile hashesFile) else { };
46-
# Lookup hash: supports per-system ({system: hash}) or legacy single hash
47-
nodeModulesHashFor =
48-
system:
49-
if builtins.isAttrs hashesData.nodeModules then
50-
hashesData.nodeModules.${system}
51-
else
52-
hashesData.nodeModules;
53-
modelsDev = forEachSystem (
54-
system:
55-
let
56-
pkgs = pkgsFor system;
57-
in
58-
pkgs."models-dev"
59-
);
17+
forEachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
18+
rev = self.shortRev or self.dirtyShortRev or "dirty";
6019
in
6120
{
62-
devShells = forEachSystem (
63-
system:
64-
let
65-
pkgs = pkgsFor system;
66-
in
67-
{
68-
default = pkgs.mkShell {
69-
packages = with pkgs; [
70-
bun
71-
nodejs_20
72-
pkg-config
73-
openssl
74-
git
75-
];
76-
};
77-
}
78-
);
21+
devShells = forEachSystem (pkgs: {
22+
default = pkgs.mkShell {
23+
packages = with pkgs; [
24+
bun
25+
nodejs_20
26+
pkg-config
27+
openssl
28+
git
29+
];
30+
};
31+
});
7932

8033
packages = forEachSystem (
81-
system:
34+
pkgs:
8235
let
83-
pkgs = pkgsFor system;
84-
bunPlatform = parseBunTarget bunTarget.${system};
85-
mkNodeModules = pkgs.callPackage ./nix/node-modules.nix {
86-
hash = nodeModulesHashFor system;
87-
bunCpu = bunPlatform.cpu;
88-
bunOs = bunPlatform.os;
36+
opencode = pkgs.callPackage ./nix/opencode.nix {
37+
inherit rev;
8938
};
90-
mkOpencode = pkgs.callPackage ./nix/opencode.nix { };
91-
mkDesktop = pkgs.callPackage ./nix/desktop.nix { };
92-
93-
opencodePkg = mkOpencode {
94-
inherit (packageJson) version;
95-
src = ./.;
96-
scripts = ./nix/scripts;
97-
target = bunTarget.${system};
98-
modelsDev = "${modelsDev.${system}}/dist/_api.json";
99-
inherit mkNodeModules;
100-
};
101-
102-
desktopPkg = mkDesktop {
103-
inherit (packageJson) version;
104-
src = ./.;
105-
scripts = ./nix/scripts;
106-
mkNodeModules = mkNodeModules;
107-
opencode = opencodePkg;
39+
desktop = pkgs.callPackage ./nix/desktop.nix {
40+
inherit opencode;
10841
};
10942
in
11043
{
111-
default = self.packages.${system}.opencode;
112-
opencode = opencodePkg;
113-
desktop = desktopPkg;
44+
default = opencode;
45+
inherit opencode desktop;
11446
}
11547
);
11648
};

nix/bundle.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)