@gengjiawen/os-init 1.3.2 → 1.4.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/README.md +2 -0
- package/bin/bin.js +24 -1
- package/build/index.d.ts +3 -0
- package/build/index.js +33 -0
- package/libs/index.ts +43 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.0](https://github.com/gengjiawen/os-init/compare/v1.3.2...v1.4.0) (2025-10-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Raycast AI configuration setup and command ([b5d64d4](https://github.com/gengjiawen/os-init/commit/b5d64d4fa65dddf739b7b3b6e50ce3f94346538a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* format ([ad7cc79](https://github.com/gengjiawen/os-init/commit/ad7cc791efb1437c2eaae916fe3ba43bc545b355))
|
|
14
|
+
|
|
3
15
|
## [1.3.2](https://github.com/gengjiawen/os-init/compare/v1.3.1...v1.3.2) (2025-10-19)
|
|
4
16
|
|
|
5
17
|
|
package/README.md
CHANGED
|
@@ -4,11 +4,13 @@ What it does
|
|
|
4
4
|
|
|
5
5
|
- Configure Claude Code Router with your API key (writes `~/.claude-code-router/config.json`).
|
|
6
6
|
- Configure Codex CLI with your API key (writes `~/.codex/config.toml` and `~/.codex/auth.json`).
|
|
7
|
+
- Configure Raycast AI with your API key (writes `~/.config/raycast/ai/providers.yaml`).
|
|
7
8
|
- Install global tools: `@anthropic-ai/claude-code`, `@musistudio/claude-code-router`, `@openai/codex`.
|
|
8
9
|
|
|
9
10
|
Usage
|
|
10
11
|
|
|
11
12
|
- `pnpx @gengjiawen/os-init set-cc <API_KEY>`
|
|
12
13
|
- `pnpx @gengjiawen/os-init set-codex <API_KEY>`
|
|
14
|
+
- `pnpx @gengjiawen/os-init set-raycast-ai <API_KEY>`
|
|
13
15
|
|
|
14
16
|
Project generated by [gengjiawen/ts-scaffold](https://github.com/gengjiawen/ts-scaffold)
|
package/bin/bin.js
CHANGED
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
installDeps,
|
|
7
7
|
writeCodexConfig,
|
|
8
8
|
installCodexDeps,
|
|
9
|
+
writeRaycastConfig,
|
|
9
10
|
} = require('../build')
|
|
10
11
|
|
|
11
12
|
const program = new Command()
|
|
@@ -30,7 +31,9 @@ program
|
|
|
30
31
|
console.error('Failed to complete setup:', err.message)
|
|
31
32
|
process.exit(1)
|
|
32
33
|
}
|
|
33
|
-
console.log(
|
|
34
|
+
console.log(
|
|
35
|
+
'Claude code is ready, use `claude` in terminal to start building'
|
|
36
|
+
)
|
|
34
37
|
})
|
|
35
38
|
|
|
36
39
|
program
|
|
@@ -55,4 +58,24 @@ program
|
|
|
55
58
|
console.log('Codex is ready. use `codex` in terminal to start building')
|
|
56
59
|
})
|
|
57
60
|
|
|
61
|
+
program
|
|
62
|
+
.command('set-raycast-ai')
|
|
63
|
+
.description('setup Raycast AI providers config')
|
|
64
|
+
.argument('<apiKey>', 'API key to set for Raycast AI')
|
|
65
|
+
.action(async (apiKey) => {
|
|
66
|
+
if (!apiKey || String(apiKey).trim().length === 0) {
|
|
67
|
+
console.error('Missing required argument: <apiKey>')
|
|
68
|
+
program.help({ error: true })
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
const { configPath } = writeRaycastConfig(apiKey)
|
|
73
|
+
console.log(`Raycast AI config written to: ${configPath}`)
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.error('Failed to setup Raycast AI:', err.message)
|
|
76
|
+
process.exit(1)
|
|
77
|
+
}
|
|
78
|
+
console.log('Raycast AI is ready to use')
|
|
79
|
+
})
|
|
80
|
+
|
|
58
81
|
program.parse(process.argv)
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.writeClaudeConfig = writeClaudeConfig;
|
|
|
4
4
|
exports.installDeps = installDeps;
|
|
5
5
|
exports.writeCodexConfig = writeCodexConfig;
|
|
6
6
|
exports.installCodexDeps = installCodexDeps;
|
|
7
|
+
exports.writeRaycastConfig = writeRaycastConfig;
|
|
7
8
|
const fs = require("fs");
|
|
8
9
|
const path = require("path");
|
|
9
10
|
const os = require("os");
|
|
@@ -129,3 +130,35 @@ async function installCodexDeps() {
|
|
|
129
130
|
}
|
|
130
131
|
console.log('Codex dependency installed successfully.');
|
|
131
132
|
}
|
|
133
|
+
function getRaycastAIConfigDir() {
|
|
134
|
+
return path.join(os.homedir(), '.config', 'raycast', 'ai');
|
|
135
|
+
}
|
|
136
|
+
const RAYCAST_PROVIDERS_YAML_TEMPLATE = `providers:
|
|
137
|
+
- id: my_provider
|
|
138
|
+
name: gengjiawen AI
|
|
139
|
+
base_url: https://ai.gengjiawen.com/api/openai/v1/
|
|
140
|
+
api_keys:
|
|
141
|
+
openai: API_KEY_PLACEHOLDER
|
|
142
|
+
models:
|
|
143
|
+
- id: sota
|
|
144
|
+
name: "sota"
|
|
145
|
+
context: 200000
|
|
146
|
+
provider: openai
|
|
147
|
+
abilities:
|
|
148
|
+
temperature:
|
|
149
|
+
supported: true
|
|
150
|
+
vision:
|
|
151
|
+
supported: true
|
|
152
|
+
system_message:
|
|
153
|
+
supported: true
|
|
154
|
+
tools:
|
|
155
|
+
supported: true
|
|
156
|
+
`;
|
|
157
|
+
function writeRaycastConfig(apiKey) {
|
|
158
|
+
const configDir = getRaycastAIConfigDir();
|
|
159
|
+
ensureDir(configDir);
|
|
160
|
+
const configPath = path.join(configDir, 'providers.yaml');
|
|
161
|
+
const content = RAYCAST_PROVIDERS_YAML_TEMPLATE.replace('API_KEY_PLACEHOLDER', apiKey);
|
|
162
|
+
fs.writeFileSync(configPath, content);
|
|
163
|
+
return { configPath };
|
|
164
|
+
}
|
package/libs/index.ts
CHANGED
|
@@ -164,3 +164,46 @@ export async function installCodexDeps(): Promise<void> {
|
|
|
164
164
|
}
|
|
165
165
|
console.log('Codex dependency installed successfully.')
|
|
166
166
|
}
|
|
167
|
+
|
|
168
|
+
/** Return Raycast AI configuration directory path */
|
|
169
|
+
function getRaycastAIConfigDir(): string {
|
|
170
|
+
return path.join(os.homedir(), '.config', 'raycast', 'ai')
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Template for Raycast AI providers.yaml */
|
|
174
|
+
const RAYCAST_PROVIDERS_YAML_TEMPLATE = `providers:
|
|
175
|
+
- id: my_provider
|
|
176
|
+
name: gengjiawen AI
|
|
177
|
+
base_url: https://ai.gengjiawen.com/api/openai/v1/
|
|
178
|
+
api_keys:
|
|
179
|
+
openai: API_KEY_PLACEHOLDER
|
|
180
|
+
models:
|
|
181
|
+
- id: sota
|
|
182
|
+
name: "sota"
|
|
183
|
+
context: 200000
|
|
184
|
+
provider: openai
|
|
185
|
+
abilities:
|
|
186
|
+
temperature:
|
|
187
|
+
supported: true
|
|
188
|
+
vision:
|
|
189
|
+
supported: true
|
|
190
|
+
system_message:
|
|
191
|
+
supported: true
|
|
192
|
+
tools:
|
|
193
|
+
supported: true
|
|
194
|
+
`
|
|
195
|
+
|
|
196
|
+
/** Write Raycast AI providers.yaml */
|
|
197
|
+
export function writeRaycastConfig(apiKey: string): { configPath: string } {
|
|
198
|
+
const configDir = getRaycastAIConfigDir()
|
|
199
|
+
ensureDir(configDir)
|
|
200
|
+
|
|
201
|
+
const configPath = path.join(configDir, 'providers.yaml')
|
|
202
|
+
const content = RAYCAST_PROVIDERS_YAML_TEMPLATE.replace(
|
|
203
|
+
'API_KEY_PLACEHOLDER',
|
|
204
|
+
apiKey
|
|
205
|
+
)
|
|
206
|
+
fs.writeFileSync(configPath, content)
|
|
207
|
+
|
|
208
|
+
return { configPath }
|
|
209
|
+
}
|