@bramblex/codex-workbench 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/package.json +3 -2
  3. package/src/cli.js +17 -5
package/README.md CHANGED
@@ -48,6 +48,8 @@ codex-workbench resume <session> [prompt...]
48
48
  codex-workbench fork <session>
49
49
  codex-workbench archive <session>
50
50
  codex-workbench unarchive <session>
51
+ codex-workbench hide <session>
52
+ codex-workbench unhide <session>
51
53
  codex-workbench delete <session> [--force]
52
54
  ```
53
55
 
@@ -57,6 +59,12 @@ Run without arguments to open the interactive UI:
57
59
  codex-workbench
58
60
  ```
59
61
 
62
+ The package also installs the short alias:
63
+
64
+ ```sh
65
+ cwb
66
+ ```
67
+
60
68
  Use `list` to find sessions:
61
69
 
62
70
  ```sh
@@ -66,6 +74,14 @@ codex-workbench list --cwd /path/to/project
66
74
  codex-workbench list --all
67
75
  ```
68
76
 
77
+ Use `hide` for sessions that Codex itself can no longer resume, archive, or delete. Hidden sessions are removed from the default list but remain visible with `--all`:
78
+
79
+ ```sh
80
+ codex-workbench hide <session>
81
+ codex-workbench unhide <session>
82
+ codex-workbench list --all
83
+ ```
84
+
69
85
  Use `doctor` to check which Codex executable the CLI will launch:
70
86
 
71
87
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bramblex/codex-workbench",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Terminal workbench for browsing and managing local Codex sessions.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -19,7 +19,8 @@
19
19
  "tui"
20
20
  ],
21
21
  "bin": {
22
- "codex-workbench": "bin/codex-workbench"
22
+ "codex-workbench": "bin/codex-workbench",
23
+ "cwb": "bin/codex-workbench"
23
24
  },
24
25
  "publishConfig": {
25
26
  "access": "public"
package/src/cli.js CHANGED
@@ -27,6 +27,8 @@ Usage:
27
27
  codex-workbench fork <session>
28
28
  codex-workbench archive <session>
29
29
  codex-workbench unarchive <session>
30
+ codex-workbench hide <session>
31
+ codex-workbench unhide <session>
30
32
  codex-workbench delete <session> [--force]
31
33
 
32
34
  Environment:
@@ -175,7 +177,7 @@ function truncate(text, width) {
175
177
 
176
178
  function printList(sessions, opts = {}) {
177
179
  const filtered = sessions.filter((session) => {
178
- if (!opts.all && session.archived) return false;
180
+ if (!opts.all && (session.archived || session.hidden)) return false;
179
181
  if (opts.cwd) return path.resolve(session.cwd) === path.resolve(opts.cwd);
180
182
  return true;
181
183
  });
@@ -192,7 +194,7 @@ function printList(sessions, opts = {}) {
192
194
  console.log(`\n${cwd}`);
193
195
  for (const session of group) {
194
196
  const label = session.name || truncate(session.first || session.last || '(no prompt)', 56);
195
- const flags = [session.archived ? 'archived' : '', session.note ? 'note' : ''].filter(Boolean).join(',');
197
+ const flags = [session.archived ? 'archived' : '', session.hidden ? 'hidden' : '', session.note ? 'note' : ''].filter(Boolean).join(',');
196
198
  console.log(` ${shortId(session.id)} ${localTime(session.updatedAt)} ${String(session.turns).padStart(2)} turns ${flags ? `[${flags}] ` : ''}${label}`);
197
199
  }
198
200
  }
@@ -200,7 +202,7 @@ function printList(sessions, opts = {}) {
200
202
  }
201
203
 
202
204
  function printShow(session) {
203
- console.log(`${session.name || '(unnamed)'} ${session.archived ? '[archived]' : ''}`);
205
+ console.log(`${session.name || '(unnamed)'} ${session.archived ? '[archived]' : ''}${session.hidden ? '[hidden]' : ''}`);
204
206
  console.log(`id: ${session.id}`);
205
207
  console.log(`cwd: ${session.cwd}`);
206
208
  console.log(`started: ${localTime(session.startedAt)}`);
@@ -524,7 +526,7 @@ async function ui() {
524
526
  const promptOpen = () => prompt.visible || question.visible;
525
527
 
526
528
  const reload = () => {
527
- sessions = listSessions().filter((s) => !s.archived);
529
+ sessions = listSessions().filter((s) => !s.archived && !s.hidden);
528
530
  groups = ['All', ...new Set(sessions.map((s) => s.cwd))];
529
531
  if (groupIndex >= groups.length) groupIndex = Math.max(0, groups.length - 1);
530
532
  const visible = currentSessions();
@@ -594,6 +596,7 @@ async function ui() {
594
596
  }
595
597
  if (status === 0) refreshAfterAction(doneText);
596
598
  else refreshAfterAction(`${command} exited with code ${status}.`, true);
599
+ return status;
597
600
  };
598
601
 
599
602
  const runAction = async (action) => {
@@ -712,7 +715,14 @@ async function ui() {
712
715
  setMessage('Delete cancelled.');
713
716
  return render();
714
717
  }
715
- runCodexAndReturn('delete', session, ['--force'], `Deleted ${shortId(session.id)}.`);
718
+ const status = runCodexAndReturn('delete', session, ['--force'], `Deleted ${shortId(session.id)}.`);
719
+ if (status !== 0) {
720
+ const hide = await askConfirm(`Codex could not delete ${shortId(session.id)}. Hide it from workbench?`);
721
+ if (hide) {
722
+ updateMetadata(session, { hidden: true });
723
+ refreshAfterAction(`Hidden ${shortId(session.id)}.`);
724
+ }
725
+ }
716
726
  }));
717
727
 
718
728
  sessionsList.focus();
@@ -739,6 +749,8 @@ async function main() {
739
749
  if (cmd === 'fork') return codexCommand('fork', resolveSession(flags._[0], sessions), [], true);
740
750
  if (cmd === 'archive') return codexCommand('archive', resolveSession(flags._[0], sessions));
741
751
  if (cmd === 'unarchive') return codexCommand('unarchive', resolveSession(flags._[0], sessions));
752
+ if (cmd === 'hide') return updateMetadata(resolveSession(flags._[0], sessions), { hidden: true });
753
+ if (cmd === 'unhide') return updateMetadata(resolveSession(flags._[0], sessions), { hidden: false });
742
754
  if (cmd === 'delete') return codexCommand('delete', resolveSession(flags._[0], sessions), flags.force ? ['--force'] : []);
743
755
 
744
756
  usage();