@happycastle/codex-litellm 0.7.1
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/LICENSE +21 -0
- package/README.md +37 -0
- package/bin/codex-litellm.mjs +36 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yusef Mohamadi (@yuseferi)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @happycastle/codex-litellm
|
|
2
|
+
|
|
3
|
+
Thin Codex-focused wrapper for
|
|
4
|
+
[`@happycastle/opencode-litellm`](https://github.com/happycastle114/opencode-litellm).
|
|
5
|
+
Defaults `install` to `--target codex`; everything else is forwarded to the
|
|
6
|
+
core CLI.
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# Install for Codex (interactive)
|
|
12
|
+
npx @happycastle/codex-litellm install
|
|
13
|
+
|
|
14
|
+
# Install for both Codex and OpenCode
|
|
15
|
+
npx @happycastle/codex-litellm install --target both
|
|
16
|
+
|
|
17
|
+
# Launch Codex with the installed config
|
|
18
|
+
npx @happycastle/opencode-litellm codex
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## What it does
|
|
22
|
+
|
|
23
|
+
- Prompts for LiteLLM gateway URL, auth (SSO or env key), and Codex mode
|
|
24
|
+
(`gateway`, `oauth`, or `both`)
|
|
25
|
+
- Discovers models, search tools, MCP servers, and toolsets
|
|
26
|
+
- Writes Codex config + model catalog
|
|
27
|
+
- Installs the shared research skill at `~/.agents/skills/litellm-research-router/`
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Node.js `^22.22.2 || ^24.15.0 || >=26.0.0`
|
|
32
|
+
- Codex installed
|
|
33
|
+
- A reachable LiteLLM gateway
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'node:child_process'
|
|
4
|
+
import { createRequire } from 'node:module'
|
|
5
|
+
|
|
6
|
+
const CLI_ARGUMENT = Object.freeze({
|
|
7
|
+
Install: 'install',
|
|
8
|
+
TargetOption: '--target',
|
|
9
|
+
CodexTarget: 'codex',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url)
|
|
13
|
+
const cliPath = require.resolve('@happycastle/opencode-litellm/cli')
|
|
14
|
+
const args = process.argv.slice(2)
|
|
15
|
+
const forwardedArgs = args[0] === CLI_ARGUMENT.Install && !args.includes(CLI_ARGUMENT.TargetOption)
|
|
16
|
+
? [
|
|
17
|
+
CLI_ARGUMENT.Install,
|
|
18
|
+
CLI_ARGUMENT.TargetOption,
|
|
19
|
+
CLI_ARGUMENT.CodexTarget,
|
|
20
|
+
...args.slice(1),
|
|
21
|
+
]
|
|
22
|
+
: args
|
|
23
|
+
const child = spawn(process.execPath, [cliPath, ...forwardedArgs], {
|
|
24
|
+
stdio: 'inherit',
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
child.on('error', () => {
|
|
28
|
+
process.exitCode = 1
|
|
29
|
+
})
|
|
30
|
+
child.on('exit', (code, signal) => {
|
|
31
|
+
if (signal !== null) {
|
|
32
|
+
process.kill(process.pid, signal)
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
process.exitCode = code ?? 1
|
|
36
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
+
"name": "@happycastle/codex-litellm",
|
|
4
|
+
"version": "0.7.1",
|
|
5
|
+
"description": "Codex-compatible command wrapper for the happycastle114 LiteLLM plugin",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"codex-litellm": "./bin/codex-litellm.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/happycastle114/opencode-litellm.git"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/happycastle114/opencode-litellm/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/happycastle114/opencode-litellm#readme",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@happycastle/opencode-litellm": "0.7.1"
|
|
32
|
+
}
|
|
33
|
+
}
|