@ccusage/codex 17.0.0 → 17.0.2
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/README.md +29 -9
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,11 +22,31 @@
|
|
|
22
22
|
## Quick Start
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
# Recommended
|
|
26
|
-
bunx @ccusage/codex --help
|
|
27
|
-
|
|
28
|
-
# Using npx
|
|
25
|
+
# Recommended - always include @latest
|
|
29
26
|
npx @ccusage/codex@latest --help
|
|
27
|
+
bunx @ccusage/codex@latest --help # ⚠️ MUST include @latest with bunx
|
|
28
|
+
|
|
29
|
+
# Alternative package runners
|
|
30
|
+
pnpm dlx @ccusage/codex
|
|
31
|
+
pnpx @ccusage/codex
|
|
32
|
+
|
|
33
|
+
# Using deno (with security flags)
|
|
34
|
+
deno run -E -R=$HOME/.codex/ -S=homedir -N='raw.githubusercontent.com:443' npm:@ccusage/codex@latest --help
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> ⚠️ **Critical for bunx users**: Bun 1.2.x's bunx prioritizes binaries matching the package name suffix when given a scoped package. For `@ccusage/codex`, it looks for a `codex` binary in PATH first. If you have an existing `codex` command installed (e.g., GitHub Copilot's codex), that will be executed instead. **Always use `bunx @ccusage/codex@latest` with the version tag** to force bunx to fetch and run the correct package.
|
|
38
|
+
|
|
39
|
+
### Recommended: Shell Alias
|
|
40
|
+
|
|
41
|
+
Since `npx @ccusage/codex@latest` is quite long to type repeatedly, we strongly recommend setting up a shell alias:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# bash/zsh: alias ccusage-codex='bunx @ccusage/codex@latest'
|
|
45
|
+
# fish: alias ccusage-codex 'bunx @ccusage/codex@latest'
|
|
46
|
+
|
|
47
|
+
# Then simply run:
|
|
48
|
+
ccusage-codex daily
|
|
49
|
+
ccusage-codex monthly --json
|
|
30
50
|
```
|
|
31
51
|
|
|
32
52
|
> 💡 The CLI looks for Codex session JSONL files under `CODEX_HOME` (defaults to `~/.codex`).
|
|
@@ -35,19 +55,19 @@ npx @ccusage/codex@latest --help
|
|
|
35
55
|
|
|
36
56
|
```bash
|
|
37
57
|
# Daily usage grouped by date (default command)
|
|
38
|
-
|
|
58
|
+
npx @ccusage/codex@latest daily
|
|
39
59
|
|
|
40
60
|
# Date range filtering
|
|
41
|
-
|
|
61
|
+
npx @ccusage/codex@latest daily --since 20250911 --until 20250917
|
|
42
62
|
|
|
43
63
|
# JSON output for scripting
|
|
44
|
-
|
|
64
|
+
npx @ccusage/codex@latest daily --json
|
|
45
65
|
|
|
46
66
|
# Monthly usage grouped by month
|
|
47
|
-
|
|
67
|
+
npx @ccusage/codex@latest monthly
|
|
48
68
|
|
|
49
69
|
# Monthly JSON report for integrations
|
|
50
|
-
|
|
70
|
+
npx @ccusage/codex@latest monthly --json
|
|
51
71
|
```
|
|
52
72
|
|
|
53
73
|
Useful environment variables:
|
package/dist/index.js
CHANGED
|
@@ -897,7 +897,7 @@ async function executeCommand(cmd, ctx, name$1) {
|
|
|
897
897
|
await resolved.run(ctx);
|
|
898
898
|
}
|
|
899
899
|
var name = "@ccusage/codex";
|
|
900
|
-
var version = "17.0.
|
|
900
|
+
var version = "17.0.2";
|
|
901
901
|
var description = "Usage analysis tool for OpenAI Codex sessions";
|
|
902
902
|
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
903
903
|
let messages = [];
|
|
@@ -7778,7 +7778,9 @@ const subCommands = new Map([
|
|
|
7778
7778
|
]);
|
|
7779
7779
|
const mainCommand = dailyCommand;
|
|
7780
7780
|
async function run() {
|
|
7781
|
-
|
|
7781
|
+
let args = process$1.argv.slice(2);
|
|
7782
|
+
if (args[0] === "ccusage-codex") args = args.slice(1);
|
|
7783
|
+
await cli(args, mainCommand, {
|
|
7782
7784
|
name,
|
|
7783
7785
|
version,
|
|
7784
7786
|
description,
|