@gengjiawen/os-init 1.22.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/all-agents.js +17 -3
- package/build/codex.js +1 -1
- package/libs/all-agents.test.ts +57 -2
- package/libs/all-agents.ts +23 -7
- package/libs/codex.test.ts +7 -7
- package/libs/codex.ts +1 -1
- package/macOS-init.md +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.23.0](https://github.com/gengjiawen/os-init/compare/v1.22.0...v1.23.0) (2026-04-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* bump default Codex model to gpt-5.5 ([7104f50](https://github.com/gengjiawen/os-init/commit/7104f50d2e3af71e48aa0e88306b36d686fffb42))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* combine set-agents dependency installs ([5edbad1](https://github.com/gengjiawen/os-init/commit/5edbad1689d834cb8ead4cfc8e05a15e015c2c2f))
|
|
14
|
+
|
|
3
15
|
## [1.22.0](https://github.com/gengjiawen/os-init/compare/v1.21.0...v1.22.0) (2026-04-17)
|
|
4
16
|
|
|
5
17
|
|
package/build/all-agents.js
CHANGED
|
@@ -6,6 +6,8 @@ const claude_code_1 = require("./claude-code");
|
|
|
6
6
|
const codex_1 = require("./codex");
|
|
7
7
|
const gemini_cli_1 = require("./gemini-cli");
|
|
8
8
|
const opencode_1 = require("./opencode");
|
|
9
|
+
const execa_1 = require("execa");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
9
11
|
async function writeAllAgentsConfig(apiKey, options = {}) {
|
|
10
12
|
const claudeResult = (0, claude_code_1.writeClaudeConfig)(apiKey);
|
|
11
13
|
const codexResult = await (0, codex_1.writeCodexConfig)(apiKey);
|
|
@@ -20,9 +22,21 @@ async function writeAllAgentsConfig(apiKey, options = {}) {
|
|
|
20
22
|
return result;
|
|
21
23
|
}
|
|
22
24
|
async function installAllAgentsDeps(options = {}) {
|
|
23
|
-
const
|
|
25
|
+
const packages = ['@anthropic-ai/claude-code', '@openai/codex'];
|
|
24
26
|
if (options.full) {
|
|
25
|
-
|
|
27
|
+
packages.push('opencode-ai', '@google/gemini-cli');
|
|
26
28
|
}
|
|
27
|
-
await
|
|
29
|
+
const usePnpm = await (0, utils_1.commandExists)('pnpm');
|
|
30
|
+
if (usePnpm) {
|
|
31
|
+
console.log('pnpm detected. Installing agent dependencies with pnpm...');
|
|
32
|
+
await (0, execa_1.execa)('pnpm', ['add', '-g', ...packages], {
|
|
33
|
+
stdio: 'inherit',
|
|
34
|
+
env: utils_1.PNPM_INSTALL_ENV,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log('pnpm not found. Falling back to npm...');
|
|
39
|
+
await (0, execa_1.execa)('npm', ['install', '-g', ...packages], { stdio: 'inherit' });
|
|
40
|
+
}
|
|
41
|
+
console.log('Agent dependencies installed successfully.');
|
|
28
42
|
}
|
package/build/codex.js
CHANGED
|
@@ -24,7 +24,7 @@ function getCodexModelCatalogConfigPath() {
|
|
|
24
24
|
}
|
|
25
25
|
function getCodexConfigTomlTemplate() {
|
|
26
26
|
return `model_provider = "jw"
|
|
27
|
-
model = "gpt-5.
|
|
27
|
+
model = "gpt-5.5"
|
|
28
28
|
model_reasoning_effort = "xhigh"
|
|
29
29
|
plan_mode_reasoning_effort = "xhigh"
|
|
30
30
|
model_auto_compact_token_limit = 131072
|
package/libs/all-agents.test.ts
CHANGED
|
@@ -6,15 +6,18 @@ jest.mock('execa', () => ({
|
|
|
6
6
|
execa: jest.fn(),
|
|
7
7
|
}))
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { execa } from 'execa'
|
|
10
|
+
import { installAllAgentsDeps, writeAllAgentsConfig } from './all-agents'
|
|
10
11
|
|
|
11
12
|
describe('writeAllAgentsConfig', () => {
|
|
12
13
|
let tempHome: string
|
|
13
14
|
let homedirSpy: jest.SpiedFunction<typeof os.homedir>
|
|
14
15
|
let originalAppData: string | undefined
|
|
15
16
|
let originalFetch: typeof global.fetch | undefined
|
|
17
|
+
const execaMock = jest.mocked(execa)
|
|
16
18
|
|
|
17
19
|
beforeEach(() => {
|
|
20
|
+
jest.clearAllMocks()
|
|
18
21
|
tempHome = fs.mkdtempSync(path.join(os.tmpdir(), 'os-init-all-agents-'))
|
|
19
22
|
homedirSpy = jest.spyOn(os, 'homedir').mockReturnValue(tempHome)
|
|
20
23
|
originalAppData = process.env.APPDATA
|
|
@@ -22,7 +25,7 @@ describe('writeAllAgentsConfig', () => {
|
|
|
22
25
|
process.env.APPDATA = path.join(tempHome, 'AppData', 'Roaming')
|
|
23
26
|
global.fetch = jest.fn().mockResolvedValue({
|
|
24
27
|
ok: true,
|
|
25
|
-
json: async () => ({ models: [{ id: 'gpt-5.
|
|
28
|
+
json: async () => ({ models: [{ id: 'gpt-5.5' }] }),
|
|
26
29
|
}) as unknown as typeof global.fetch
|
|
27
30
|
})
|
|
28
31
|
|
|
@@ -61,4 +64,56 @@ describe('writeAllAgentsConfig', () => {
|
|
|
61
64
|
expect(fs.existsSync(result.gemini!.envPath)).toBe(true)
|
|
62
65
|
expect(fs.existsSync(result.gemini!.settingsPath)).toBe(true)
|
|
63
66
|
})
|
|
67
|
+
|
|
68
|
+
test('installs Claude and Codex in one pnpm command', async () => {
|
|
69
|
+
execaMock
|
|
70
|
+
.mockResolvedValueOnce({ failed: false } as never)
|
|
71
|
+
.mockResolvedValueOnce({} as never)
|
|
72
|
+
|
|
73
|
+
await installAllAgentsDeps()
|
|
74
|
+
|
|
75
|
+
expect(execaMock).toHaveBeenNthCalledWith(1, 'pnpm', ['--version'], {
|
|
76
|
+
stdio: 'ignore',
|
|
77
|
+
reject: false,
|
|
78
|
+
})
|
|
79
|
+
expect(execaMock).toHaveBeenNthCalledWith(
|
|
80
|
+
2,
|
|
81
|
+
'pnpm',
|
|
82
|
+
['add', '-g', '@anthropic-ai/claude-code', '@openai/codex'],
|
|
83
|
+
{
|
|
84
|
+
stdio: 'inherit',
|
|
85
|
+
env: {
|
|
86
|
+
PNPM_CONFIG_ENABLE_PRE_POST_SCRIPTS: 'true',
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
expect(execaMock).toHaveBeenCalledTimes(2)
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
test('installs all requested agents in one npm command when pnpm is unavailable', async () => {
|
|
94
|
+
execaMock
|
|
95
|
+
.mockRejectedValueOnce(new Error('pnpm not found'))
|
|
96
|
+
.mockResolvedValueOnce({} as never)
|
|
97
|
+
|
|
98
|
+
await installAllAgentsDeps({ full: true })
|
|
99
|
+
|
|
100
|
+
expect(execaMock).toHaveBeenNthCalledWith(1, 'pnpm', ['--version'], {
|
|
101
|
+
stdio: 'ignore',
|
|
102
|
+
reject: false,
|
|
103
|
+
})
|
|
104
|
+
expect(execaMock).toHaveBeenNthCalledWith(
|
|
105
|
+
2,
|
|
106
|
+
'npm',
|
|
107
|
+
[
|
|
108
|
+
'install',
|
|
109
|
+
'-g',
|
|
110
|
+
'@anthropic-ai/claude-code',
|
|
111
|
+
'@openai/codex',
|
|
112
|
+
'opencode-ai',
|
|
113
|
+
'@google/gemini-cli',
|
|
114
|
+
],
|
|
115
|
+
{ stdio: 'inherit' }
|
|
116
|
+
)
|
|
117
|
+
expect(execaMock).toHaveBeenCalledTimes(2)
|
|
118
|
+
})
|
|
64
119
|
})
|
package/libs/all-agents.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { writeClaudeConfig
|
|
2
|
-
import { writeCodexConfig
|
|
3
|
-
import { writeGeminiConfig
|
|
4
|
-
import { writeOpencodeConfig
|
|
1
|
+
import { writeClaudeConfig } from './claude-code'
|
|
2
|
+
import { writeCodexConfig } from './codex'
|
|
3
|
+
import { writeGeminiConfig } from './gemini-cli'
|
|
4
|
+
import { writeOpencodeConfig } from './opencode'
|
|
5
|
+
import { execa } from 'execa'
|
|
6
|
+
import { commandExists, PNPM_INSTALL_ENV } from './utils'
|
|
5
7
|
|
|
6
8
|
export interface AllAgentsOptions {
|
|
7
9
|
/** When true, also include OpenCode and Gemini CLI in the combined setup. */
|
|
@@ -40,9 +42,23 @@ export async function writeAllAgentsConfig(
|
|
|
40
42
|
export async function installAllAgentsDeps(
|
|
41
43
|
options: AllAgentsOptions = {}
|
|
42
44
|
): Promise<void> {
|
|
43
|
-
const
|
|
45
|
+
const packages = ['@anthropic-ai/claude-code', '@openai/codex']
|
|
44
46
|
if (options.full) {
|
|
45
|
-
|
|
47
|
+
packages.push('opencode-ai', '@google/gemini-cli')
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
|
|
50
|
+
const usePnpm = await commandExists('pnpm')
|
|
51
|
+
|
|
52
|
+
if (usePnpm) {
|
|
53
|
+
console.log('pnpm detected. Installing agent dependencies with pnpm...')
|
|
54
|
+
await execa('pnpm', ['add', '-g', ...packages], {
|
|
55
|
+
stdio: 'inherit',
|
|
56
|
+
env: PNPM_INSTALL_ENV,
|
|
57
|
+
})
|
|
58
|
+
} else {
|
|
59
|
+
console.log('pnpm not found. Falling back to npm...')
|
|
60
|
+
await execa('npm', ['install', '-g', ...packages], { stdio: 'inherit' })
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.log('Agent dependencies installed successfully.')
|
|
48
64
|
}
|
package/libs/codex.test.ts
CHANGED
|
@@ -22,7 +22,7 @@ describe('writeCodexConfig', () => {
|
|
|
22
22
|
|
|
23
23
|
function mockCatalogFetch(
|
|
24
24
|
catalog: { models: Array<Record<string, unknown>> } = {
|
|
25
|
-
models: [{ id: 'gpt-5.
|
|
25
|
+
models: [{ id: 'gpt-5.5' }],
|
|
26
26
|
}
|
|
27
27
|
): jest.Mock {
|
|
28
28
|
const fetchMock = jest.fn().mockResolvedValue({
|
|
@@ -95,7 +95,7 @@ custom_model = "keep-me"
|
|
|
95
95
|
|
|
96
96
|
expect(config).not.toHaveProperty('service_tier')
|
|
97
97
|
expect(config.custom_flag).toBe(true)
|
|
98
|
-
expect(config.model).toBe('gpt-5.
|
|
98
|
+
expect(config.model).toBe('gpt-5.5')
|
|
99
99
|
expect(config.model_catalog_json).toBe(getExpectedModelCatalogConfigPath())
|
|
100
100
|
expect(config.preferred_auth_method).toBe('apikey')
|
|
101
101
|
expect(config.model_providers.jw.base_url).toBe(
|
|
@@ -132,7 +132,7 @@ base_url = "https://example.com"
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
expect(config.model).toBe('gpt-5.
|
|
135
|
+
expect(config.model).toBe('gpt-5.5')
|
|
136
136
|
expect(config.model_catalog_json).toBe(getExpectedModelCatalogConfigPath())
|
|
137
137
|
expect(config.preferred_auth_method).toBe('apikey')
|
|
138
138
|
expect(config.model_providers.jw.name).toBe('jw')
|
|
@@ -142,8 +142,8 @@ base_url = "https://example.com"
|
|
|
142
142
|
test('refreshes remote model catalog after writing config', async () => {
|
|
143
143
|
const fetchMock = mockCatalogFetch({
|
|
144
144
|
models: [
|
|
145
|
-
{ id: 'gpt-5.
|
|
146
|
-
{ id: 'gpt-5.
|
|
145
|
+
{ id: 'gpt-5.5' },
|
|
146
|
+
{ id: 'gpt-5.5-mini' },
|
|
147
147
|
{ id: 'gpt-5.3-codex' },
|
|
148
148
|
],
|
|
149
149
|
})
|
|
@@ -167,8 +167,8 @@ base_url = "https://example.com"
|
|
|
167
167
|
|
|
168
168
|
expect(catalog).toEqual({
|
|
169
169
|
models: [
|
|
170
|
-
{ id: 'gpt-5.
|
|
171
|
-
{ id: 'gpt-5.
|
|
170
|
+
{ id: 'gpt-5.5' },
|
|
171
|
+
{ id: 'gpt-5.5-mini' },
|
|
172
172
|
{ id: 'gpt-5.3-codex' },
|
|
173
173
|
],
|
|
174
174
|
})
|
package/libs/codex.ts
CHANGED
|
@@ -29,7 +29,7 @@ function getCodexModelCatalogConfigPath(): string {
|
|
|
29
29
|
|
|
30
30
|
function getCodexConfigTomlTemplate(): string {
|
|
31
31
|
return `model_provider = "jw"
|
|
32
|
-
model = "gpt-5.
|
|
32
|
+
model = "gpt-5.5"
|
|
33
33
|
model_reasoning_effort = "xhigh"
|
|
34
34
|
plan_mode_reasoning_effort = "xhigh"
|
|
35
35
|
model_auto_compact_token_limit = 131072
|
package/macOS-init.md
CHANGED
|
@@ -25,7 +25,7 @@ brew install jordanbaird-ice
|
|
|
25
25
|
sudo git lfs install --system
|
|
26
26
|
npm i -g pnpm yarn && pnpm setup
|
|
27
27
|
pnpm i -g vite 7zip-bin-full
|
|
28
|
-
sudo ln -s "$(NODE_PATH="$(pnpm root -g)" node -p "require('7zip-bin-full').
|
|
28
|
+
sudo ln -s "$(NODE_PATH="$(pnpm root -g)" node -p "require('7zip-bin-full').path7z")" /usr/local/bin/7z
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gengjiawen/os-init",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.23.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"lint-staged": "^15.2.2",
|
|
47
47
|
"nodemon": "3.1.4",
|
|
48
48
|
"prettier": "3.5.3",
|
|
49
|
-
"rimraf": "6.1.
|
|
49
|
+
"rimraf": "6.1.3",
|
|
50
50
|
"ts-jest": "29.4.9",
|
|
51
51
|
"ts-node": "^10.9.1",
|
|
52
52
|
"typescript": "5.6.3"
|