@gengjiawen/os-init 1.12.0 → 1.13.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/AGENTS.md +42 -0
- package/CHANGELOG.md +7 -0
- package/bin/bin.js +24 -11
- package/build/all-agents.d.ts +6 -3
- package/build/all-agents.js +11 -6
- package/libs/all-agents.ts +25 -9
- package/package.json +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure
|
|
4
|
+
|
|
5
|
+
- `bin/`: Node CLI entrypoint (`bin/bin.js`) and command definitions (e.g., `set-codex`, `set-gemini`).
|
|
6
|
+
- `libs/`: TypeScript source for config writers/installers and setup utilities (main exports in `libs/index.ts`).
|
|
7
|
+
- `build/`: Compiled JS + `.d.ts` output from `tsc` (`outDir`), consumed by the CLI and published to npm.
|
|
8
|
+
- `dev-setup/`: Optional Docker-based dev environment (sshd + compose) for remote/portable workflows.
|
|
9
|
+
- `.github/workflows/`: CI (`nodejs.yml`) and automated releases via Release Please (`release-please.yml`).
|
|
10
|
+
|
|
11
|
+
## Build, Test, and Development Commands
|
|
12
|
+
|
|
13
|
+
Use `pnpm` (CI uses it).
|
|
14
|
+
|
|
15
|
+
- `pnpm install`: install dependencies.
|
|
16
|
+
- `pnpm dev`: run TypeScript compiler in watch mode.
|
|
17
|
+
- `pnpm build`: clean and compile to `build/` (then copies non-TS assets from `libs/`).
|
|
18
|
+
- `pnpm test`: run Jest (TypeScript via `ts-jest`).
|
|
19
|
+
- `pnpm format` / `pnpm format:check`: format or verify formatting with Prettier.
|
|
20
|
+
|
|
21
|
+
## Coding Style & Naming Conventions
|
|
22
|
+
|
|
23
|
+
- Formatting: Prettier (no semicolons, single quotes). Run `pnpm format` before pushing.
|
|
24
|
+
- TypeScript: strict options are enabled; prefer explicit, typed helpers over `any`.
|
|
25
|
+
- Naming: files are kebab-case in `libs/` (e.g., `gemini-cli.ts`); exported functions are `camelCase`.
|
|
26
|
+
|
|
27
|
+
## Testing Guidelines
|
|
28
|
+
|
|
29
|
+
- Framework: Jest + `ts-jest`.
|
|
30
|
+
- Naming: place tests next to code as `*.test.ts` (example: `libs/index.test.ts`).
|
|
31
|
+
- Keep tests hermetic: avoid writing to real user paths; prefer temp dirs/mocks when testing config output.
|
|
32
|
+
|
|
33
|
+
## Commit & Pull Request Guidelines
|
|
34
|
+
|
|
35
|
+
- Commits follow Conventional Commits (observed history): `feat: ...`, `fix: ...`, `refactor: ...`, `chore: ...`.
|
|
36
|
+
- Releases are automated on `master` via Release Please; don’t manually bump versions in PRs.
|
|
37
|
+
- PRs should include: a clear description, validation steps (`pnpm build && pnpm test && pnpm format:check`), and any relevant config/output examples.
|
|
38
|
+
|
|
39
|
+
## Security & Configuration Tips
|
|
40
|
+
|
|
41
|
+
- This repo generates local agent config files and may handle API keys. Never commit secrets or generated config files.
|
|
42
|
+
- When adding new setup commands, document where files are written and keep defaults safe/least-privilege.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.13.0](https://github.com/gengjiawen/os-init/compare/v1.12.0...v1.13.0) (2026-01-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add --full to include gemini in set-agents ([defdaca](https://github.com/gengjiawen/os-init/commit/defdaca67c0cea3d2d449a68b69080f68cf6f771))
|
|
9
|
+
|
|
3
10
|
## [1.12.0](https://github.com/gengjiawen/os-init/compare/v1.11.0...v1.12.0) (2026-01-05)
|
|
4
11
|
|
|
5
12
|
|
package/bin/bin.js
CHANGED
|
@@ -90,18 +90,28 @@ program
|
|
|
90
90
|
|
|
91
91
|
program
|
|
92
92
|
.command('set-agents')
|
|
93
|
-
.description(
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
.description(
|
|
94
|
+
'setup Claude Code and Codex at once (use --full to include Gemini CLI)'
|
|
95
|
+
)
|
|
96
|
+
.argument('<apiKey>', 'API key to set for agents')
|
|
97
|
+
.option('--full', 'Also setup Gemini CLI')
|
|
98
|
+
.action(async (apiKey, options) => {
|
|
96
99
|
if (!apiKey || String(apiKey).trim().length === 0) {
|
|
97
100
|
console.error('Missing required argument: <apiKey>')
|
|
98
101
|
program.help({ error: true })
|
|
99
102
|
return
|
|
100
103
|
}
|
|
104
|
+
|
|
105
|
+
const full = Boolean(options.full)
|
|
106
|
+
|
|
101
107
|
try {
|
|
102
|
-
console.log(
|
|
108
|
+
console.log(
|
|
109
|
+
full
|
|
110
|
+
? 'Setting up Claude Code + Codex + Gemini CLI...\n'
|
|
111
|
+
: 'Setting up Claude Code + Codex...\n'
|
|
112
|
+
)
|
|
103
113
|
|
|
104
|
-
const result = writeAllAgentsConfig(apiKey)
|
|
114
|
+
const result = writeAllAgentsConfig(apiKey, { full })
|
|
105
115
|
|
|
106
116
|
console.log('Claude Code:')
|
|
107
117
|
console.log(` Settings written to: ${result.claude.settingsPath}`)
|
|
@@ -110,20 +120,23 @@ program
|
|
|
110
120
|
console.log(` Config written to: ${result.codex.configPath}`)
|
|
111
121
|
console.log(` Auth written to: ${result.codex.authPath}`)
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
if (result.gemini) {
|
|
124
|
+
console.log('\nGemini CLI:')
|
|
125
|
+
console.log(` Env written to: ${result.gemini.envPath}`)
|
|
126
|
+
console.log(` Settings written to: ${result.gemini.settingsPath}`)
|
|
127
|
+
}
|
|
116
128
|
|
|
117
129
|
console.log('\nInstalling dependencies...')
|
|
118
|
-
await installAllAgentsDeps()
|
|
130
|
+
await installAllAgentsDeps({ full })
|
|
119
131
|
} catch (err) {
|
|
120
132
|
console.error('Failed to setup agents:', err.message)
|
|
121
133
|
process.exit(1)
|
|
122
134
|
}
|
|
123
|
-
|
|
135
|
+
|
|
136
|
+
console.log('\nSetup complete!')
|
|
124
137
|
console.log(' - Use `claude` for Claude Code')
|
|
125
138
|
console.log(' - Use `codex` for Codex')
|
|
126
|
-
console.log(' - Use `gemini` for Gemini CLI')
|
|
139
|
+
if (full) console.log(' - Use `gemini` for Gemini CLI')
|
|
127
140
|
})
|
|
128
141
|
|
|
129
142
|
program
|
package/build/all-agents.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export interface AllAgentsOptions {
|
|
2
|
+
full?: boolean;
|
|
3
|
+
}
|
|
1
4
|
export interface AllAgentsResult {
|
|
2
5
|
claude: {
|
|
3
6
|
settingsPath: string;
|
|
@@ -6,10 +9,10 @@ export interface AllAgentsResult {
|
|
|
6
9
|
configPath: string;
|
|
7
10
|
authPath: string;
|
|
8
11
|
};
|
|
9
|
-
gemini
|
|
12
|
+
gemini?: {
|
|
10
13
|
envPath: string;
|
|
11
14
|
settingsPath: string;
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
|
-
export declare function writeAllAgentsConfig(apiKey: string): AllAgentsResult;
|
|
15
|
-
export declare function installAllAgentsDeps(): Promise<void>;
|
|
17
|
+
export declare function writeAllAgentsConfig(apiKey: string, options?: AllAgentsOptions): AllAgentsResult;
|
|
18
|
+
export declare function installAllAgentsDeps(options?: AllAgentsOptions): Promise<void>;
|
package/build/all-agents.js
CHANGED
|
@@ -5,16 +5,21 @@ exports.installAllAgentsDeps = installAllAgentsDeps;
|
|
|
5
5
|
const claude_code_1 = require("./claude-code");
|
|
6
6
|
const codex_1 = require("./codex");
|
|
7
7
|
const gemini_cli_1 = require("./gemini-cli");
|
|
8
|
-
function writeAllAgentsConfig(apiKey) {
|
|
8
|
+
function writeAllAgentsConfig(apiKey, options = {}) {
|
|
9
9
|
const claudeResult = (0, claude_code_1.writeClaudeConfig)(apiKey);
|
|
10
10
|
const codexResult = (0, codex_1.writeCodexConfig)(apiKey);
|
|
11
|
-
const
|
|
12
|
-
return {
|
|
11
|
+
const result = {
|
|
13
12
|
claude: claudeResult,
|
|
14
13
|
codex: codexResult,
|
|
15
|
-
gemini: geminiResult,
|
|
16
14
|
};
|
|
15
|
+
if (options.full) {
|
|
16
|
+
result.gemini = (0, gemini_cli_1.writeGeminiConfig)(apiKey);
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
17
19
|
}
|
|
18
|
-
async function installAllAgentsDeps() {
|
|
19
|
-
|
|
20
|
+
async function installAllAgentsDeps(options = {}) {
|
|
21
|
+
const installers = [(0, claude_code_1.installDeps)(), (0, codex_1.installCodexDeps)()];
|
|
22
|
+
if (options.full)
|
|
23
|
+
installers.push((0, gemini_cli_1.installGeminiDeps)());
|
|
24
|
+
await Promise.all(installers);
|
|
20
25
|
}
|
package/libs/all-agents.ts
CHANGED
|
@@ -2,26 +2,42 @@ import { writeClaudeConfig, installDeps } from './claude-code'
|
|
|
2
2
|
import { writeCodexConfig, installCodexDeps } from './codex'
|
|
3
3
|
import { writeGeminiConfig, installGeminiDeps } from './gemini-cli'
|
|
4
4
|
|
|
5
|
+
export interface AllAgentsOptions {
|
|
6
|
+
/** When true, also include Gemini CLI in the combined setup. */
|
|
7
|
+
full?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
export interface AllAgentsResult {
|
|
6
11
|
claude: { settingsPath: string }
|
|
7
12
|
codex: { configPath: string; authPath: string }
|
|
8
|
-
gemini
|
|
13
|
+
gemini?: { envPath: string; settingsPath: string }
|
|
9
14
|
}
|
|
10
15
|
|
|
11
|
-
/** Write configuration for
|
|
12
|
-
export function writeAllAgentsConfig(
|
|
16
|
+
/** Write configuration for the combined setup (Claude Code + Codex, optional Gemini CLI). */
|
|
17
|
+
export function writeAllAgentsConfig(
|
|
18
|
+
apiKey: string,
|
|
19
|
+
options: AllAgentsOptions = {}
|
|
20
|
+
): AllAgentsResult {
|
|
13
21
|
const claudeResult = writeClaudeConfig(apiKey)
|
|
14
22
|
const codexResult = writeCodexConfig(apiKey)
|
|
15
|
-
const geminiResult = writeGeminiConfig(apiKey)
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
const result: AllAgentsResult = {
|
|
18
25
|
claude: claudeResult,
|
|
19
26
|
codex: codexResult,
|
|
20
|
-
gemini: geminiResult,
|
|
21
27
|
}
|
|
28
|
+
|
|
29
|
+
if (options.full) {
|
|
30
|
+
result.gemini = writeGeminiConfig(apiKey)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return result
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
/** Install dependencies for
|
|
25
|
-
export async function installAllAgentsDeps(
|
|
26
|
-
|
|
36
|
+
/** Install dependencies for the combined setup (Claude Code + Codex, optional Gemini CLI). */
|
|
37
|
+
export async function installAllAgentsDeps(
|
|
38
|
+
options: AllAgentsOptions = {}
|
|
39
|
+
): Promise<void> {
|
|
40
|
+
const installers = [installDeps(), installCodexDeps()]
|
|
41
|
+
if (options.full) installers.push(installGeminiDeps())
|
|
42
|
+
await Promise.all(installers)
|
|
27
43
|
}
|