cdx-manager 0.5.7 → 0.6.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CDX Manager
2
2
 
3
- [![License](https://img.shields.io/badge/license-MIT-4C8BF5)](LICENSE) ![Version](https://img.shields.io/badge/version-v0.5.7-4C8BF5) ![Python](https://img.shields.io/badge/python-3.9%2B-3776AB?logo=python&logoColor=white)
3
+ [![License](https://img.shields.io/badge/license-MIT-4C8BF5)](LICENSE) ![Version](https://img.shields.io/badge/version-v0.6.1-4C8BF5) ![Python](https://img.shields.io/badge/python-3.9%2B-3776AB?logo=python&logoColor=white)
4
4
 
5
5
  **Run multiple Codex and Claude sessions from one terminal. Switch between accounts instantly.**
6
6
 
@@ -34,10 +34,14 @@ One command to launch any session. Zero auth juggling.
34
34
 
35
35
  - **Multiple accounts, one tool.** Register as many Codex or Claude sessions as you need. Each one gets its own isolated auth environment — no cross-contamination between accounts.
36
36
  - **Instant launch.** `cdx work` opens your "work" session. `cdx personal` opens another. No config files to edit mid-flow.
37
+ - **Quick relaunch.** `cdx last` reopens the most recently launched assistant profile.
37
38
  - **Auth guardrails.** `cdx` checks authentication before launching. If a session is not logged in, it tells you exactly what to run — no silent failures.
38
39
  - **Usage at a glance.** `cdx status` shows token usage, 5-hour window quota, weekly quota, last-updated timestamps, priority guidance, and the last launched session in one aligned table.
40
+ - **Next-ready notification.** `cdx ready` schedules a native system notification for the next assistant that comes back from cooldown, then returns immediately.
39
41
  - **Session control.** Disable a session without deleting it when an account is temporarily out of credits; disabled sessions remain visible and sort last.
40
42
  - **Persistent launch settings.** Pin per-session power, permission, and fast-mode preferences once; `cdx` reapplies them on every launch until you unset them.
43
+ - **Launch history.** Inspect recent launches with provider, result, duration, working directory, launch settings, and transcript path.
44
+ - **Update prompts.** Periodic update checks surface `cdx update` directly in the `cdx`, `cdx status`, and launch output when a newer release is available.
41
45
  - **Shared handoff context.** Keep a per-workspace Markdown context, or build one from a source session transcript, and install it into another assistant session before switching providers or accounts.
42
46
  - **Passive status resolution.** Codex status is read from the local Codex app-server rate-limit API when available, with legacy transcript/history parsing kept as a fallback.
43
47
  - **Session transcript capture.** Every launch is recorded to a local log file via `script`, giving you a full terminal transcript for each session.
@@ -63,6 +67,7 @@ One command to launch any session. Zero auth juggling.
63
67
  - Codex live source: `codex app-server` JSON-RPC `account/rateLimits/read`, normalized into 5-hour, weekly, reset, credit, and plan fields.
64
68
  - Fallback: `status-source` scans provider JSONL history files and terminal log transcripts, strips ANSI/OSC sequences, and extracts `usage%`, `5h remaining%`, and `week remaining%` via pattern matching.
65
69
  - Claude status refreshes are cached briefly by default; pass `--refresh` to force a live rate-limit probe.
70
+ - On Linux, transcript capture uses the `util-linux` `script -c` command form.
66
71
  - If `script` is unavailable, Codex launch falls back to running without transcript capture.
67
72
  - On Windows, transcript capture is optional. If no compatible `script` wrapper is installed, Codex still launches normally without transcript capture.
68
73
  - Auth probe: synchronous subprocess call to `codex login status` or `claude auth status` before any interactive launch.
@@ -127,7 +132,7 @@ For a specific version:
127
132
 
128
133
  ```bash
129
134
  curl -fsSL https://raw.githubusercontent.com/AlexAgo83/cdx-manager/main/install.sh -o install.sh
130
- CDX_VERSION=v0.5.7 sh install.sh
135
+ CDX_VERSION=v0.6.1 sh install.sh
131
136
  ```
132
137
 
133
138
  From source:
@@ -230,6 +235,18 @@ cdx work
230
235
 
231
236
  # Check usage across all sessions
232
237
  cdx status
238
+
239
+ # Notify when the next cooling-down assistant is ready
240
+ cdx ready
241
+ ```
242
+
243
+ ### Next-Ready Notifications
244
+
245
+ Use `cdx ready` when every useful assistant is cooling down and you want your terminal back. It is shorthand for `cdx notify --schedule --next-ready`: cdx picks the next known reset, registers a native OS notification, and exits immediately.
246
+
247
+ ```bash
248
+ cdx ready
249
+ cdx ready --refresh
233
250
  ```
234
251
 
235
252
  ### Persistent Launch Settings
@@ -251,6 +268,22 @@ cdx unset work --all
251
268
 
252
269
  `--power` maps to Codex `model_reasoning_effort` and Claude `--effort`. `--permission` maps to provider-native permission flags. `--fast on` uses low effort when no explicit power is set.
253
270
 
271
+ ### Launch History
272
+
273
+ Every interactive `cdx <name>` launch is recorded under `CDX_HOME`, including success/failure, duration, cwd, launch settings, and transcript path.
274
+
275
+ ```bash
276
+ cdx history
277
+ cdx history work
278
+ cdx history work --limit 5
279
+ cdx history work --json
280
+ cdx history --summary
281
+ cdx history --summary --since 7d
282
+ cdx history --summary --from 2026-05-01 --to 2026-05-28
283
+ ```
284
+
285
+ `cdx history --summary` aggregates total time per assistant. Add `--since`, `--from`, or `--to` to focus on a period.
286
+
254
287
  ---
255
288
 
256
289
  ## All Commands
@@ -271,6 +304,8 @@ cdx unset work --all
271
304
  | `cdx config <name> [--json]` | Show persistent launch settings for a session |
272
305
  | `cdx set <name> [--power low\|medium\|high\|xhigh\|max] [--permission review\|default\|auto\|full] [--fast on\|off] [--json]` | Persist launch settings for a session |
273
306
  | `cdx unset <name> (--power\|--permission\|--fast\|--all) [--json]` | Remove persisted launch settings and fall back to provider defaults |
307
+ | `cdx history [name] [--limit N] [--summary] [--since 7d\|today\|DATE] [--from DATE] [--to DATE] [--json]` | Show recent launch history or aggregate total launch time per assistant, optionally filtered by period |
308
+ | `cdx last [--json]` | Launch the most recent existing session from launch history |
274
309
  | `cdx context show\|path\|init\|edit\|clear\|set [text...] [--json]` | Manage the shared Markdown context for the current workspace |
275
310
  | `cdx handoff <name> [--json]` | Install the current workspace context into a target session and launch it unless `--json` is used |
276
311
  | `cdx handoff <source> <target> [--json]` | Build shared context from the source session's latest launch transcript, install it into the target session, and launch the target unless `--json` is used; supports Codex and Claude targets, including cross-provider handoff |
@@ -281,6 +316,7 @@ cdx unset work --all
281
316
  | `cdx doctor [--json]` | Inspect CLI dependencies, CDX_HOME permissions, missing state, orphan profiles, and pending quarantines |
282
317
  | `cdx repair [--dry-run] [--force] [--json]` | Plan or apply safe repairs for missing state files, quarantines, and orphan profiles |
283
318
  | `cdx update [--check] [--yes] [--json] [--version TAG]` | Update cdx-manager using the installer that matches how it was installed |
319
+ | `cdx ready [--refresh] [--json]` | Schedule an OS notification for the next cooling-down assistant that becomes ready, then return immediately |
284
320
  | `cdx notify <name> --at-reset [--poll seconds] [--once] [--schedule] [--refresh] [--json]` | Wait for a session reset time or schedule an OS wake-up notification when due |
285
321
  | `cdx notify --next-ready [--poll seconds] [--once] [--schedule] [--refresh] [--json]` | Wait until the recommended session is usable, or schedule the next known reset notification |
286
322
  | `cdx status [--json] [--refresh]` | Show token usage table for all sessions; JSON returns a versioned payload with structured warnings |
@@ -313,9 +349,12 @@ Commands with machine-readable output:
313
349
  - `cdx enable ... --json`
314
350
  - `cdx context ... --json`
315
351
  - `cdx handoff ... --json`
352
+ - `cdx history ... --json`
353
+ - `cdx last --json`
316
354
  - `cdx doctor --json`
317
355
  - `cdx repair --json`
318
356
  - `cdx update --json`
357
+ - `cdx ready --json`
319
358
  - `cdx notify ... --json`
320
359
 
321
360
  Success payloads follow a shared envelope:
@@ -452,6 +491,7 @@ All session data lives under `CDX_HOME` (default: `~/.cdx/`):
452
491
  sessions.json # Session registry (versioned, all sessions)
453
492
  state/
454
493
  <encoded-name>.json # Per-session rehydration state
494
+ launch_history.jsonl # Append-only launch history
455
495
  profiles/
456
496
  <encoded-name>/ # Codex session: CODEX_HOME points here
457
497
  log/
@@ -0,0 +1,47 @@
1
+ # Changelog (`0.5.7 -> 0.6.0`)
2
+
3
+ Release date: 2026-05-28
4
+
5
+ ## Major Highlights
6
+
7
+ - Added launch history workflows for reviewing, summarizing, and relaunching assistant sessions.
8
+ - Improved `cdx status` guidance with reset-week countdowns, active-session marking, cleaner blocking quota labels, and periodic update notices.
9
+ - Added shortcut commands that reduce routine assistant switching and waiting friction.
10
+
11
+ ## Launch History and Relaunch
12
+
13
+ - Added `cdx history` to inspect recent assistant launches with provider, result, duration, working directory, launch settings, and transcript path.
14
+ - Added `cdx history --summary` to aggregate assistant time by session.
15
+ - Added period filters for history summaries with `--since`, `--from`, and `--to`.
16
+ - Added `cdx last` to relaunch the most recent existing session from launch history.
17
+ - Skips removed sessions when resolving the last launch target.
18
+
19
+ ## Status and Availability
20
+
21
+ - Added reset-week countdowns to status output.
22
+ - Hid healthy blocking quota labels so status tables stay focused on actionable quota limits.
23
+ - Marked the active launched session in status and list output.
24
+ - Added `cdx ready` as a shortcut for scheduling the next assistant reset notification.
25
+ - Added update notices to `cdx status`, matching the existing periodic update check behavior.
26
+ - Changed visual update notices to show `Run: cdx update` instead of a release URL.
27
+
28
+ ## CLI Ergonomics
29
+
30
+ - Curated the main screen next-actions list around the commands users are most likely to run next.
31
+ - Kept release URLs in JSON warning payloads for integrations while making text output directly actionable.
32
+ - Added `cdx last [--json]` to help output and README command documentation.
33
+
34
+ ## Release Metadata and Documentation
35
+
36
+ - Updated package metadata, CLI version output, README badge, and pinned installer example to `v0.6.0`.
37
+ - Documented `cdx last` and the action-oriented update notices in the README.
38
+
39
+ ## Validation and Regression Coverage
40
+
41
+ - Added regression coverage for launch history, assistant-time summaries, period filters, active session indicators, `cdx ready`, `cdx last`, and update notices in `cdx status`.
42
+ - Added coverage to ensure visual update notices show `Run: cdx update` without leaking the release URL.
43
+
44
+ ## Validation and Regression Evidence
45
+
46
+ - `npm run lint`
47
+ - `npm test`
@@ -0,0 +1,30 @@
1
+ # Changelog (`0.6.0 -> 0.6.1`)
2
+
3
+ Release date: 2026-05-28
4
+
5
+ ## Handoff Reliability
6
+
7
+ - Fixed `cdx handoff <source> <target>` when a source session has no `cdx-session*.log` launch transcript.
8
+ - Added fallback discovery for native provider histories, including Claude project JSONL files under the isolated session home.
9
+ - Converted JSONL message records into readable role-prefixed handoff context instead of requiring raw terminal logs.
10
+
11
+ ## Linux Transcript Capture
12
+
13
+ - Fixed default transcript capture on Linux and Arch Linux by using the `util-linux` `script -q -F -c "<command>" <transcript>` form.
14
+ - Kept the existing BSD/macOS `script` invocation unchanged.
15
+ - Preserved custom `CDX_SCRIPT_ARGS` behavior for users who explicitly configure their wrapper.
16
+
17
+ ## Release Metadata and Documentation
18
+
19
+ - Updated package metadata, CLI version output, README badge, and pinned installer example to `v0.6.1`.
20
+ - Documented the Linux-specific transcript capture behavior in the README.
21
+
22
+ ## Validation and Regression Coverage
23
+
24
+ - Added regression coverage for Claude-to-Claude handoff from native `.claude/projects/*.jsonl` history when no launch log exists.
25
+ - Added runtime coverage for the Linux `script` invocation shape.
26
+
27
+ ## Validation and Regression Evidence
28
+
29
+ - `npm run lint`
30
+ - `npm test`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdx-manager",
3
- "version": "0.5.7",
3
+ "version": "0.6.1",
4
4
  "description": "Terminal session manager for Codex and Claude accounts.",
5
5
  "license": "MIT",
6
6
  "author": "Alexandre Agostini",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cdx-manager"
7
- version = "0.5.7"
7
+ version = "0.6.1"
8
8
  description = "Terminal session manager for Codex and Claude accounts."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
package/src/cli.py CHANGED
@@ -18,6 +18,8 @@ from .cli_commands import (
18
18
  handle_export,
19
19
  handle_import,
20
20
  handle_handoff,
21
+ handle_history,
22
+ handle_last,
21
23
  handle_launch,
22
24
  handle_login,
23
25
  handle_logout,
@@ -52,7 +54,7 @@ from .status_view import (
52
54
  )
53
55
  from .update_check import check_for_update
54
56
 
55
- VERSION = "0.5.7"
57
+ VERSION = "0.6.1"
56
58
 
57
59
 
58
60
  # ---------------------------------------------------------------------------
@@ -73,6 +75,8 @@ def _print_help(use_color=False):
73
75
  f" {_style('cdx config <name> [--json]', '36', use_color)}",
74
76
  f" {_style('cdx set <name> [--power low|medium|high|xhigh|max] [--permission review|default|auto|full] [--fast on|off] [--json]', '36', use_color)}",
75
77
  f" {_style('cdx unset <name> (--power|--permission|--fast|--all) [--json]', '36', use_color)}",
78
+ f" {_style('cdx history [name] [--limit N] [--summary] [--since 7d|today|DATE] [--from DATE] [--to DATE] [--json]', '36', use_color)}",
79
+ f" {_style('cdx last [--json]', '36', use_color)}",
76
80
  f" {_style('cdx handoff <name> [--json]', '36', use_color)}",
77
81
  f" {_style('cdx handoff <source> <target> [--json]', '36', use_color)}",
78
82
  f" {_style('cdx add [provider] <name> [--json]', '36', use_color)}",
@@ -89,6 +93,7 @@ def _print_help(use_color=False):
89
93
  f" {_style('cdx doctor [--json]', '36', use_color)}",
90
94
  f" {_style('cdx repair [--dry-run] [--force] [--json]', '36', use_color)}",
91
95
  f" {_style('cdx update [--check] [--yes] [--json] [--version TAG]', '36', use_color)}",
96
+ f" {_style('cdx ready [--refresh] [--json]', '36', use_color)}",
92
97
  f" {_style('cdx notify <name> --at-reset [--schedule] [--refresh] [--json]', '36', use_color)}",
93
98
  f" {_style('cdx notify --next-ready [--schedule] [--refresh] [--json]', '36', use_color)}",
94
99
  f" {_style('cdx <name> [--json]', '36', use_color)}",
@@ -156,8 +161,7 @@ def _update_warning_payload(notice):
156
161
  def _update_warning_text(notice):
157
162
  if not notice:
158
163
  return None
159
- suffix = f" {notice['url']}" if notice.get("url") else ""
160
- return f"Update available: cdx-manager {notice['latest_version']} (current {VERSION}).{suffix}"
164
+ return f"Update available: cdx-manager {notice['latest_version']} (current {VERSION}). Run: cdx update"
161
165
 
162
166
 
163
167
  # ---------------------------------------------------------------------------
@@ -227,7 +231,7 @@ def main(argv, options=None):
227
231
  "version": VERSION,
228
232
  "cwd": options.get("cwd") or os.getcwd(),
229
233
  "update_notice": _get_update_notice(service, env, options) if command not in (
230
- "add", "cp", "ren", "rename", "mv", "rmv", "clean", "doctor", "repair", "update", "notify", "status", "context", "config", "set", "unset", "handoff", "login", "logout", "disable", "enable", "export", "import", "help", "version"
234
+ "add", "cp", "ren", "rename", "mv", "rmv", "clean", "doctor", "repair", "update", "ready", "notify", "context", "config", "set", "unset", "history", "handoff", "login", "logout", "disable", "enable", "export", "import", "help", "version"
231
235
  ) else None,
232
236
  "use_color": use_color,
233
237
  }
@@ -268,6 +272,11 @@ def main(argv, options=None):
268
272
  if command == "update":
269
273
  return handle_update(rest, ctx)
270
274
 
275
+ if command == "ready":
276
+ if any(arg not in ("--refresh", "--json") for arg in rest):
277
+ raise CdxError("Usage: cdx ready [--refresh] [--json]")
278
+ return handle_notify(["--next-ready", "--schedule", *rest], ctx)
279
+
271
280
  if command == "notify":
272
281
  return handle_notify(rest, ctx)
273
282
 
@@ -283,6 +292,12 @@ def main(argv, options=None):
283
292
  if command == "unset":
284
293
  return handle_unset(rest, ctx)
285
294
 
295
+ if command == "history":
296
+ return handle_history(rest, ctx)
297
+
298
+ if command == "last":
299
+ return handle_last(rest, ctx)
300
+
286
301
  if command == "handoff":
287
302
  return handle_handoff(rest, ctx)
288
303