@gengjiawen/os-init 1.21.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 CHANGED
@@ -1,5 +1,31 @@
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
+
15
+ ## [1.22.0](https://github.com/gengjiawen/os-init/compare/v1.21.0...v1.22.0) (2026-04-17)
16
+
17
+
18
+ ### Features
19
+
20
+ * **codex:** set model reasoning effort to xhigh ([41d1b75](https://github.com/gengjiawen/os-init/commit/41d1b75536646ccda8bb6b509de88cd2152be3b7))
21
+ * **set-agents:** include OpenCode only with --full ([92e01b4](https://github.com/gengjiawen/os-init/commit/92e01b4aea467bcd42cc6ae922147b383e1fc4ad))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * remove service tier from codex config ([f618abd](https://github.com/gengjiawen/os-init/commit/f618abd92a877d457006fae1765ed6f3fe323a29))
27
+ * remove unused service_tier configuration from Codex TOML template ([bfa6f1a](https://github.com/gengjiawen/os-init/commit/bfa6f1a091e9e5bb2b733dacee2247fda457918b))
28
+
3
29
  ## [1.21.0](https://github.com/gengjiawen/os-init/compare/v1.20.0...v1.21.0) (2026-03-31)
4
30
 
5
31
 
package/bin/bin.js CHANGED
@@ -128,10 +128,10 @@ program
128
128
  program
129
129
  .command('set-agents')
130
130
  .description(
131
- 'setup Claude Code, Codex, and OpenCode at once (use --full to include Gemini CLI)'
131
+ 'setup Claude Code and Codex at once (use --full to include OpenCode and Gemini CLI)'
132
132
  )
133
133
  .argument('<apiKey>', 'API key to set for agents')
134
- .option('--full', 'Also setup Gemini CLI')
134
+ .option('--full', 'Also setup OpenCode and Gemini CLI')
135
135
  .action(async (apiKey, options) => {
136
136
  if (!apiKey || String(apiKey).trim().length === 0) {
137
137
  console.error('Missing required argument: <apiKey>')
@@ -145,7 +145,7 @@ program
145
145
  console.log(
146
146
  full
147
147
  ? 'Setting up Claude Code + Codex + OpenCode + Gemini CLI...\n'
148
- : 'Setting up Claude Code + Codex + OpenCode...\n'
148
+ : 'Setting up Claude Code + Codex...\n'
149
149
  )
150
150
 
151
151
  const result = await writeAllAgentsConfig(apiKey, { full })
@@ -161,8 +161,10 @@ program
161
161
  console.log(` Auth written to: ${result.codex.authPath}`)
162
162
  console.log(` Model catalog written to: ${result.codex.catalogPath}`)
163
163
 
164
- console.log('\nOpenCode:')
165
- console.log(` Config written to: ${result.opencode.configPath}`)
164
+ if (result.opencode) {
165
+ console.log('\nOpenCode:')
166
+ console.log(` Config written to: ${result.opencode.configPath}`)
167
+ }
166
168
 
167
169
  if (result.gemini) {
168
170
  console.log('\nGemini CLI:')
@@ -180,8 +182,10 @@ program
180
182
  console.log('\nSetup complete!')
181
183
  console.log(' - Use `claude` for Claude Code')
182
184
  console.log(' - Use `codex` for Codex')
183
- console.log(' - Use `opencode` for OpenCode')
184
- if (full) console.log(' - Use `gemini` for Gemini CLI')
185
+ if (full) {
186
+ console.log(' - Use `opencode` for OpenCode')
187
+ console.log(' - Use `gemini` for Gemini CLI')
188
+ }
185
189
  })
186
190
 
187
191
  program
@@ -11,7 +11,7 @@ export interface AllAgentsResult {
11
11
  authPath: string;
12
12
  catalogPath: string;
13
13
  };
14
- opencode: {
14
+ opencode?: {
15
15
  configPath: string;
16
16
  };
17
17
  gemini?: {
@@ -6,23 +6,37 @@ 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);
12
- const opencodeResult = (0, opencode_1.writeOpencodeConfig)(apiKey);
13
14
  const result = {
14
15
  claude: claudeResult,
15
16
  codex: codexResult,
16
- opencode: opencodeResult,
17
17
  };
18
18
  if (options.full) {
19
+ result.opencode = (0, opencode_1.writeOpencodeConfig)(apiKey);
19
20
  result.gemini = (0, gemini_cli_1.writeGeminiConfig)(apiKey);
20
21
  }
21
22
  return result;
22
23
  }
23
24
  async function installAllAgentsDeps(options = {}) {
24
- const installers = [(0, claude_code_1.installDeps)(), (0, codex_1.installCodexDeps)(), (0, opencode_1.installOpencodeDeps)()];
25
- if (options.full)
26
- installers.push((0, gemini_cli_1.installGeminiDeps)());
27
- await Promise.all(installers);
25
+ const packages = ['@anthropic-ai/claude-code', '@openai/codex'];
26
+ if (options.full) {
27
+ packages.push('opencode-ai', '@google/gemini-cli');
28
+ }
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,13 +24,12 @@ function getCodexModelCatalogConfigPath() {
24
24
  }
25
25
  function getCodexConfigTomlTemplate() {
26
26
  return `model_provider = "jw"
27
- model = "gpt-5.4"
28
- model_reasoning_effort = "high"
27
+ model = "gpt-5.5"
28
+ model_reasoning_effort = "xhigh"
29
29
  plan_mode_reasoning_effort = "xhigh"
30
30
  model_auto_compact_token_limit = 131072
31
31
  disable_response_storage = true
32
32
  preferred_auth_method = "apikey"
33
- service_tier = "fast"
34
33
  model_catalog_json = ${JSON.stringify(getCodexModelCatalogConfigPath())}
35
34
 
36
35
  [model_providers.jw]
@@ -59,6 +58,7 @@ function mergeTomlTables(existingConfig, templateConfig) {
59
58
  function getMergedCodexConfig(existingContent) {
60
59
  const existingConfig = TOML.parse(existingContent);
61
60
  const templateConfig = TOML.parse(getCodexConfigTomlTemplate());
61
+ delete existingConfig.service_tier;
62
62
  return TOML.stringify(mergeTomlTables(existingConfig, templateConfig));
63
63
  }
64
64
  async function refreshCodexModelCatalog(apiKey) {
@@ -6,15 +6,18 @@ jest.mock('execa', () => ({
6
6
  execa: jest.fn(),
7
7
  }))
8
8
 
9
- import { writeAllAgentsConfig } from './all-agents'
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.4' }] }),
28
+ json: async () => ({ models: [{ id: 'gpt-5.5' }] }),
26
29
  }) as unknown as typeof global.fetch
27
30
  })
28
31
 
@@ -41,22 +44,76 @@ describe('writeAllAgentsConfig', () => {
41
44
  fs.rmSync(tempHome, { recursive: true, force: true })
42
45
  })
43
46
 
44
- test('writes Claude, Codex and OpenCode config by default', async () => {
47
+ test('writes Claude and Codex config by default', async () => {
45
48
  const result = await writeAllAgentsConfig('test-api-key')
46
49
 
47
50
  expect(fs.existsSync(result.claude.settingsPath)).toBe(true)
48
51
  expect(fs.existsSync(result.codex.configPath)).toBe(true)
49
52
  expect(fs.existsSync(result.codex.authPath)).toBe(true)
50
53
  expect(fs.existsSync(result.codex.catalogPath)).toBe(true)
51
- expect(fs.existsSync(result.opencode.configPath)).toBe(true)
54
+ expect(result.opencode).toBeUndefined()
52
55
  expect(result.gemini).toBeUndefined()
53
56
  })
54
57
 
55
- test('includes Gemini config when full option is enabled', async () => {
58
+ test('includes OpenCode and Gemini config when full option is enabled', async () => {
56
59
  const result = await writeAllAgentsConfig('test-api-key', { full: true })
57
60
 
61
+ expect(result.opencode).toBeDefined()
62
+ expect(fs.existsSync(result.opencode!.configPath)).toBe(true)
58
63
  expect(result.gemini).toBeDefined()
59
64
  expect(fs.existsSync(result.gemini!.envPath)).toBe(true)
60
65
  expect(fs.existsSync(result.gemini!.settingsPath)).toBe(true)
61
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
+ })
62
119
  })
@@ -1,47 +1,64 @@
1
- import { writeClaudeConfig, installDeps } from './claude-code'
2
- import { writeCodexConfig, installCodexDeps } from './codex'
3
- import { writeGeminiConfig, installGeminiDeps } from './gemini-cli'
4
- import { writeOpencodeConfig, installOpencodeDeps } from './opencode'
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
- /** When true, also include Gemini CLI in the combined setup. */
9
+ /** When true, also include OpenCode and Gemini CLI in the combined setup. */
8
10
  full?: boolean
9
11
  }
10
12
 
11
13
  export interface AllAgentsResult {
12
14
  claude: { settingsPath: string; vscodeSettingsPath: string }
13
15
  codex: { configPath: string; authPath: string; catalogPath: string }
14
- opencode: { configPath: string }
16
+ opencode?: { configPath: string }
15
17
  gemini?: { envPath: string; settingsPath: string }
16
18
  }
17
19
 
18
- /** Write configuration for the combined setup (Claude Code + Codex + OpenCode, optional Gemini CLI). */
20
+ /** Write configuration for the combined setup (Claude Code + Codex; optional OpenCode + Gemini CLI with --full). */
19
21
  export async function writeAllAgentsConfig(
20
22
  apiKey: string,
21
23
  options: AllAgentsOptions = {}
22
24
  ): Promise<AllAgentsResult> {
23
25
  const claudeResult = writeClaudeConfig(apiKey)
24
26
  const codexResult = await writeCodexConfig(apiKey)
25
- const opencodeResult = writeOpencodeConfig(apiKey)
26
27
 
27
28
  const result: AllAgentsResult = {
28
29
  claude: claudeResult,
29
30
  codex: codexResult,
30
- opencode: opencodeResult,
31
31
  }
32
32
 
33
33
  if (options.full) {
34
+ result.opencode = writeOpencodeConfig(apiKey)
34
35
  result.gemini = writeGeminiConfig(apiKey)
35
36
  }
36
37
 
37
38
  return result
38
39
  }
39
40
 
40
- /** Install dependencies for the combined setup (Claude Code + Codex + OpenCode, optional Gemini CLI). */
41
+ /** Install dependencies for the combined setup (Claude Code + Codex; optional OpenCode + Gemini CLI with --full). */
41
42
  export async function installAllAgentsDeps(
42
43
  options: AllAgentsOptions = {}
43
44
  ): Promise<void> {
44
- const installers = [installDeps(), installCodexDeps(), installOpencodeDeps()]
45
- if (options.full) installers.push(installGeminiDeps())
46
- await Promise.all(installers)
45
+ const packages = ['@anthropic-ai/claude-code', '@openai/codex']
46
+ if (options.full) {
47
+ packages.push('opencode-ai', '@google/gemini-cli')
48
+ }
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.')
47
64
  }
@@ -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.4' }],
25
+ models: [{ id: 'gpt-5.5' }],
26
26
  }
27
27
  ): jest.Mock {
28
28
  const fetchMock = jest.fn().mockResolvedValue({
@@ -80,7 +80,6 @@ custom_model = "keep-me"
80
80
 
81
81
  await writeCodexConfig('test-api-key')
82
82
  const config = TOML.parse(fs.readFileSync(configPath, 'utf8')) as {
83
- service_tier: string
84
83
  custom_flag: boolean
85
84
  model: string
86
85
  model_catalog_json: string
@@ -94,9 +93,9 @@ custom_model = "keep-me"
94
93
  }
95
94
  }
96
95
 
97
- expect(config.service_tier).toBe('fast')
96
+ expect(config).not.toHaveProperty('service_tier')
98
97
  expect(config.custom_flag).toBe(true)
99
- expect(config.model).toBe('gpt-5.4')
98
+ expect(config.model).toBe('gpt-5.5')
100
99
  expect(config.model_catalog_json).toBe(getExpectedModelCatalogConfigPath())
101
100
  expect(config.preferred_auth_method).toBe('apikey')
102
101
  expect(config.model_providers.jw.base_url).toBe(
@@ -125,7 +124,6 @@ base_url = "https://example.com"
125
124
  model: string
126
125
  model_catalog_json: string
127
126
  preferred_auth_method: string
128
- service_tier: string
129
127
  model_providers: {
130
128
  jw: {
131
129
  name: string
@@ -134,18 +132,18 @@ base_url = "https://example.com"
134
132
  }
135
133
  }
136
134
 
137
- expect(config.model).toBe('gpt-5.4')
135
+ expect(config.model).toBe('gpt-5.5')
138
136
  expect(config.model_catalog_json).toBe(getExpectedModelCatalogConfigPath())
139
137
  expect(config.preferred_auth_method).toBe('apikey')
140
138
  expect(config.model_providers.jw.name).toBe('jw')
141
- expect(config.service_tier).toBe('fast')
139
+ expect(config).not.toHaveProperty('service_tier')
142
140
  })
143
141
 
144
142
  test('refreshes remote model catalog after writing config', async () => {
145
143
  const fetchMock = mockCatalogFetch({
146
144
  models: [
147
- { id: 'gpt-5.4' },
148
- { id: 'gpt-5.4-mini' },
145
+ { id: 'gpt-5.5' },
146
+ { id: 'gpt-5.5-mini' },
149
147
  { id: 'gpt-5.3-codex' },
150
148
  ],
151
149
  })
@@ -169,8 +167,8 @@ base_url = "https://example.com"
169
167
 
170
168
  expect(catalog).toEqual({
171
169
  models: [
172
- { id: 'gpt-5.4' },
173
- { id: 'gpt-5.4-mini' },
170
+ { id: 'gpt-5.5' },
171
+ { id: 'gpt-5.5-mini' },
174
172
  { id: 'gpt-5.3-codex' },
175
173
  ],
176
174
  })
package/libs/codex.ts CHANGED
@@ -29,13 +29,12 @@ function getCodexModelCatalogConfigPath(): string {
29
29
 
30
30
  function getCodexConfigTomlTemplate(): string {
31
31
  return `model_provider = "jw"
32
- model = "gpt-5.4"
33
- model_reasoning_effort = "high"
32
+ model = "gpt-5.5"
33
+ model_reasoning_effort = "xhigh"
34
34
  plan_mode_reasoning_effort = "xhigh"
35
35
  model_auto_compact_token_limit = 131072
36
36
  disable_response_storage = true
37
37
  preferred_auth_method = "apikey"
38
- service_tier = "fast"
39
38
  model_catalog_json = ${JSON.stringify(getCodexModelCatalogConfigPath())}
40
39
 
41
40
  [model_providers.jw]
@@ -75,6 +74,7 @@ function mergeTomlTables(
75
74
  function getMergedCodexConfig(existingContent: string): string {
76
75
  const existingConfig = TOML.parse(existingContent) as TomlTable
77
76
  const templateConfig = TOML.parse(getCodexConfigTomlTemplate()) as TomlTable
77
+ delete existingConfig.service_tier
78
78
 
79
79
  return TOML.stringify(mergeTomlTables(existingConfig, templateConfig))
80
80
  }
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').path7za")" /usr/local/bin/7z
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.21.0",
4
+ "version": "1.23.0",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "bin": {
@@ -42,15 +42,21 @@
42
42
  "@types/node": "24.1.0",
43
43
  "cpy-cli": "^6.0.0",
44
44
  "husky": "9.1.6",
45
- "jest": "30.2.0",
45
+ "jest": "30.3.0",
46
46
  "lint-staged": "^15.2.2",
47
47
  "nodemon": "3.1.4",
48
48
  "prettier": "3.5.3",
49
- "rimraf": "6.1.2",
50
- "ts-jest": "29.4.6",
49
+ "rimraf": "6.1.3",
50
+ "ts-jest": "29.4.9",
51
51
  "ts-node": "^10.9.1",
52
52
  "typescript": "5.6.3"
53
53
  },
54
+ "pnpm": {
55
+ "overrides": {
56
+ "minimatch@3.1.2": "3.1.3",
57
+ "minimatch@9.0.5": "9.0.9"
58
+ }
59
+ },
54
60
  "husky": {
55
61
  "hooks": {
56
62
  "pre-commit": "lint-staged"