Skip to content

Commit 1f3531f

Browse files
ci: lint and format with oxlint and oxfmt like workit
Keep bun test. Add the same Oxc toolchain workit uses so CI can fail on lint and format instead of only tests and types. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 16b9c52 commit 1f3531f

46 files changed

Lines changed: 3040 additions & 2609 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ jobs:
4343
- name: Typecheck
4444
run: bun run typecheck
4545

46+
lint:
47+
name: check (lint)
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v7
51+
- uses: oven-sh/setup-bun@v2
52+
with:
53+
bun-version: ${{ env.BUN_VERSION }}
54+
- name: Install dependencies
55+
run: bun install --frozen-lockfile
56+
- name: Lint
57+
run: bun run lint
58+
59+
format:
60+
name: check (format)
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v7
64+
- uses: oven-sh/setup-bun@v2
65+
with:
66+
bun-version: ${{ env.BUN_VERSION }}
67+
- name: Install dependencies
68+
run: bun install --frozen-lockfile
69+
- name: Format
70+
run: bun run format:check
71+
4672
pack:
4773
name: check (pack)
4874
runs-on: ubuntu-latest

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ dist/
44
.DS_Store
55
opencode.local.json
66
.commandcode/
7+
8+
# workit: SDD working state (never commit)
9+
docs/*/sdd/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ Maintainers only. OpenCode will scrape a local `command-code` install when `COMM
7474
git clone https://github.com/BrainerVirus/opencode-commandcode-provider.git
7575
cd opencode-commandcode-provider
7676
bun install
77-
bun test tests/unit/
77+
bun run check # oxlint + oxfmt + bun test + tsc (same stack as workit)
7878
```
7979

8080
```bash
8181
bun run sync -- --remote # refresh models.json + manifest.json from command-code@latest
8282
```
8383

84-
CI (`.github/workflows/catalog-sync.yml`) opens a PR every 6 hours when Command Code ships a new catalog. Merge after **check (test)**, **check (typecheck)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (npm publish + GitHub Release + tag). Do not push to `main`.
84+
CI (`.github/workflows/catalog-sync.yml`) opens a PR every 6 hours when Command Code ships a new catalog. Merge after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (npm publish + GitHub Release + tag). Do not push to `main`.
8585

8686
The GitHub Actions secret name is `NPMJS` (same as workit). It is mapped to both `NPM_TOKEN` and `NODE_AUTH_TOKEN`. Use an npm **Automation** token (bypasses 2FA). A login token from `~/.npmrc` fails CI with `EOTP`. Catalog PRs get a real CI run when `RELEASE_SYNC_TOKEN` (or `CATALOG_PUSH_TOKEN`) is a PAT; `GITHUB_TOKEN` can open the PR but GitHub will not start workflows from that event.
8787

bun.lock

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

index.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1-
import { resolveApiKey } from "./src/auth.js"
2-
import { CommandCodeLanguageModel } from "./src/model.js"
1+
import { resolveApiKey } from "./src/auth.js";
2+
import { CommandCodeLanguageModel } from "./src/model.js";
33

44
export interface CommandCodeProviderOptions {
5-
name?: string
6-
apiKey?: string
7-
baseURL?: string
8-
headers?: Record<string, string>
9-
authPaths?: string[]
5+
name?: string;
6+
apiKey?: string;
7+
baseURL?: string;
8+
headers?: Record<string, string>;
9+
authPaths?: string[];
1010
}
1111

1212
export function createCommandCode(options: CommandCodeProviderOptions = {}) {
13-
const apiKey = resolveApiKey({ apiKey: options.apiKey, authPaths: options.authPaths })
13+
const apiKey = resolveApiKey({ apiKey: options.apiKey, authPaths: options.authPaths });
1414
if (!apiKey) {
1515
throw new Error(
1616
"Command Code API key not found. Set COMMANDCODE_API_KEY env var, create ~/.commandcode/auth.json, or pass apiKey option.",
17-
)
17+
);
1818
}
1919

2020
return {
2121
languageModel(modelId: string): CommandCodeLanguageModel {
2222
return new CommandCodeLanguageModel(modelId, {
2323
apiKey,
2424
baseURL: typeof options.baseURL === "string" ? options.baseURL : undefined,
25-
headers: typeof options.headers === "object" && options.headers !== null ? options.headers as Record<string, string> : undefined,
26-
})
25+
headers:
26+
typeof options.headers === "object" && options.headers !== null
27+
? (options.headers as Record<string, string>)
28+
: undefined,
29+
});
2730
},
28-
}
31+
};
2932
}

package.json

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
11
{
22
"name": "@brainervirus/commandcode-go-opencode-provider",
33
"version": "0.5.0",
4+
"description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code",
5+
"keywords": [
6+
"ai",
7+
"claude",
8+
"commandcode",
9+
"deepseek",
10+
"gemini",
11+
"glm",
12+
"gpt",
13+
"kimi",
14+
"llm",
15+
"minimax",
16+
"opencode",
17+
"opencode-plugin",
18+
"opencode-provider",
19+
"qwen"
20+
],
21+
"homepage": "https://github.com/BrainerVirus/opencode-commandcode-provider#readme",
22+
"bugs": {
23+
"url": "https://github.com/BrainerVirus/opencode-commandcode-provider/issues"
24+
},
25+
"license": "MIT",
426
"author": "Brent Weatherall",
527
"repository": {
628
"type": "git",
729
"url": "git+https://github.com/BrainerVirus/opencode-commandcode-provider.git"
830
},
31+
"files": [
32+
"index.ts",
33+
"plugin.ts",
34+
"models.json",
35+
"manifest.json",
36+
"_version.txt",
37+
"README.md",
38+
"CHANGELOG.md",
39+
"src/"
40+
],
41+
"type": "module",
942
"main": "index.ts",
10-
"devDependencies": {
11-
"@semantic-release/commit-analyzer": "13.0.1",
12-
"@semantic-release/github": "12.0.9",
13-
"@semantic-release/npm": "13.1.5",
14-
"@semantic-release/release-notes-generator": "14.1.1",
15-
"@types/node": "^25.9.1",
16-
"ai": "6.0.191",
17-
"semantic-release": "25.0.9",
18-
"typescript": "^6.0.3"
19-
},
43+
"types": "index.ts",
2044
"exports": {
2145
".": {
2246
"import": "./index.ts"
@@ -25,36 +49,15 @@
2549
"import": "./plugin.ts"
2650
}
2751
},
28-
"bugs": {
29-
"url": "https://github.com/BrainerVirus/opencode-commandcode-provider/issues"
30-
},
31-
"description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code",
32-
"engines": {
33-
"bun": ">=1.0.0"
34-
},
35-
"files": ["index.ts", "plugin.ts", "models.json", "manifest.json", "_version.txt", "README.md", "CHANGELOG.md", "src/"],
36-
"homepage": "https://github.com/BrainerVirus/opencode-commandcode-provider#readme",
37-
"keywords": [
38-
"opencode",
39-
"opencode-provider",
40-
"opencode-plugin",
41-
"commandcode",
42-
"ai",
43-
"llm",
44-
"claude",
45-
"gpt",
46-
"gemini",
47-
"deepseek",
48-
"qwen",
49-
"kimi",
50-
"glm",
51-
"minimax"
52-
],
53-
"license": "MIT",
5452
"publishConfig": {
5553
"access": "public"
5654
},
5755
"scripts": {
56+
"lint": "oxlint --deny-warnings src scripts plugin.ts index.ts tests",
57+
"lint:fix": "oxlint --fix src scripts plugin.ts index.ts tests",
58+
"format": "oxfmt src scripts plugin.ts index.ts tests package.json tsconfig.json release.config.cjs",
59+
"format:check": "oxfmt --check src scripts plugin.ts index.ts tests package.json tsconfig.json release.config.cjs",
60+
"check": "bun run lint && bun run format:check && bun test tests/unit/ && bun run typecheck",
5861
"test": "bun test tests/unit/",
5962
"test:integration": "bun test tests/integration/",
6063
"test:all": "bun test",
@@ -65,9 +68,22 @@
6568
"sync:global": "bun run scripts/sync-models.ts --update-global",
6669
"catalog:ci": "bun run scripts/catalog-sync-ci.ts"
6770
},
68-
"type": "module",
69-
"types": "index.ts",
71+
"devDependencies": {
72+
"@semantic-release/commit-analyzer": "13.0.1",
73+
"@semantic-release/github": "12.0.9",
74+
"@semantic-release/npm": "13.1.5",
75+
"@semantic-release/release-notes-generator": "14.1.1",
76+
"@types/node": "^25.9.1",
77+
"ai": "6.0.191",
78+
"oxfmt": "0.63.0",
79+
"oxlint": "1.78.0",
80+
"semantic-release": "25.0.9",
81+
"typescript": "^6.0.3"
82+
},
7083
"peerDependencies": {
7184
"ai": ">=6.0.0"
85+
},
86+
"engines": {
87+
"bun": ">=1.0.0"
7288
}
7389
}

0 commit comments

Comments
 (0)