Skip to content

Commit 8efdb34

Browse files
committed
v1.0,2 - fix --help not working
1 parent 56087fc commit 8efdb34

4 files changed

Lines changed: 47 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ Codex model configuration; configuration is a separate, explicit command.
1212

1313
## Install on a device
1414

15-
No npm or GitHub login is required:
15+
No npm or GitHub login is required. For regular use, install the CLI globally:
1616

1717
```sh
18-
pnpm dlx @iamdevlinph/codex-kit@latest global install
19-
pnpm dlx @iamdevlinph/codex-kit@latest global configure
18+
pnpm add --global @iamdevlinph/codex-kit@latest
19+
codex-kit global install
20+
codex-kit global configure
2021
```
2122

23+
`npm install --global @iamdevlinph/codex-kit@latest` works as an alternative.
24+
For one-off use without a global installation, prefix a command with
25+
`pnpm dlx @iamdevlinph/codex-kit@latest`.
26+
2227
`global install` copies reusable agents to `${CODEX_HOME:-~/.codex}` and
2328
maintains a marked routing section in the global `AGENTS.md`.
2429

@@ -60,6 +65,8 @@ unmanaged `commit-pusher.toml` is reported but never silently deleted.
6065

6166
| Action | Command |
6267
| --- | --- |
68+
| Show command help | `codex-kit --help` |
69+
| Print the installed version | `codex-kit --version` |
6370
| Install global agents and routing | `codex-kit global install` |
6471
| Configure the orchestrator | `codex-kit global configure` |
6572
| Inspect global configuration | `codex-kit global list` |

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@iamdevlinph/codex-kit",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Portable Codex subagents and project AGENTS.md defaults.",
55
"type": "module",
66
"bin": {

‎src/codex-kit.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
existsSync,
66
mkdirSync,
77
readFileSync,
8+
realpathSync,
89
readdirSync,
910
renameSync,
1011
rmSync,
@@ -733,6 +734,7 @@ Usage:
733734
codex-kit project status [--cwd PATH]
734735
codex-kit project mark-applied [--cwd PATH]
735736
codex-kit version check
737+
codex-kit --help
736738
codex-kit --version
737739
738740
Global configure defaults to gpt-5.6-sol with high reasoning and edits only
@@ -757,7 +759,10 @@ export function main(argv: string[] = process.argv.slice(2)): void {
757759
throw new Error(`Unknown command: ${options.positionals.join(" ")}`);
758760
}
759761

760-
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
762+
if (
763+
process.argv[1] &&
764+
realpathSync(resolve(process.argv[1])) === realpathSync(fileURLToPath(import.meta.url))
765+
) {
761766
try {
762767
main();
763768
} catch (error) {

‎test/codex-kit.test.ts‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import assert from "node:assert/strict";
2-
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
2+
import {
3+
existsSync,
4+
mkdirSync,
5+
mkdtempSync,
6+
readFileSync,
7+
readdirSync,
8+
rmSync,
9+
symlinkSync,
10+
writeFileSync,
11+
} from "node:fs";
312
import { tmpdir } from "node:os";
413
import { join, resolve } from "node:path";
514
import { spawnSync } from "node:child_process";
@@ -23,6 +32,26 @@ function run(args: string[], options: RunOptions = {}) {
2332
return result;
2433
}
2534

35+
test("CLI runs through a global-style symlink", () => {
36+
const root = mkdtempSync(join(tmpdir(), "codex-kit-bin-"));
37+
const linkedCli = join(root, "codex-kit");
38+
try {
39+
symlinkSync(CLI, linkedCli);
40+
const help = spawnSync(process.execPath, [linkedCli, "--help"], { encoding: "utf8" });
41+
assert.equal(help.status, 0, help.stderr);
42+
assert.match(help.stdout, /Usage:/);
43+
44+
const version = spawnSync(process.execPath, [linkedCli, "--version"], { encoding: "utf8" });
45+
const manifest = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")) as {
46+
version: string;
47+
};
48+
assert.equal(version.status, 0, version.stderr);
49+
assert.equal(version.stdout.trim(), manifest.version);
50+
} finally {
51+
rmSync(root, { recursive: true, force: true });
52+
}
53+
});
54+
2655
test("global install and uninstall manage only package-owned files", () => {
2756
const root = mkdtempSync(join(tmpdir(), "codex-kit-global-"));
2857
const home = join(root, ".codex");

0 commit comments

Comments
 (0)