session-steward 0.1.0 → 0.2.0

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,36 +1,48 @@
1
1
  # Session Steward
2
2
 
3
- Safely review, back up, and remove local Codex sessions with a browser UI or terminal CLI.
3
+ A local Codex session manager for safely reviewing, backing up, and deleting old sessions from a browser UI or terminal CLI.
4
4
 
5
- Session Steward is a local-first Codex session manager for macOS and Linux. It shows what will be removed before cleanup, creates a local backup, and verifies the result afterward. Your session data stays on your computer.
5
+ Codex can accumulate hundreds of local sessions over time. A single session may leave behind a transcript, history and index entries, logs, and linked subagent records, so manual cleanup can easily miss related data.
6
6
 
7
- Use it to clear old Codex session history, reclaim the space used by session artifacts, or remove local session traces without resetting the rest of your Codex setup.
7
+ Session Steward makes session cleanup safer by finding those records, showing what cleanup will affect, creating a local backup, removing supported data, and verifying the result afterward. Everything runs locally, and your session data stays on your computer.
8
8
 
9
- ![UI of sessions, filters, and session details](https://raw.githubusercontent.com/mallikcheripally/session-steward/main/docs/session-steward-overview.jpg)
9
+ ![Session Steward cleanup demo](https://raw.githubusercontent.com/mallikcheripally/session-steward/main/docs/session-steward-demo.gif)
10
10
 
11
- ## Why Session Steward
11
+ ## Manage and clean up local Codex sessions
12
12
 
13
- - Review local Codex sessions in a clear browser interface.
14
- - See linked subagents and affected local records before deletion.
15
- - Choose between focused session removal and a deeper local cleanup.
16
- - Keep an automatic backup of every cleanup operation.
17
- - Pause thorough cleanup when an unfamiliar storage format is found.
18
- - Verify that selected session artifacts were removed.
19
- - Use the same saved Codex folder in the browser and terminal interfaces.
13
+ - Review sessions in a browser UI or terminal CLI.
14
+ - See total sessions, subagents, supporting sessions, and transcript storage.
15
+ - Find sessions inactive for 30, 60, or 90 days.
16
+ - Filter active or archived sessions by workspace, name, or session ID.
17
+ - Inspect linked sessions and affected records before deletion.
18
+ - Choose standard or thorough cleanup.
19
+ - Use a custom Codex folder across browser and terminal sessions.
20
20
 
21
- Session Steward does not delete conversations stored in your ChatGPT account.
21
+ ## Safe by default
22
22
 
23
- ## Requirements
23
+ - Cleanup happens entirely on your computer.
24
+ - Only records included in the reviewed cleanup plan are removed.
25
+ - A local recovery backup is created before anything changes.
26
+ - Cleanup is verified before the backup is removed.
27
+ - Unrecognized storage is reported and left untouched.
28
+ - Thorough cleanup is unavailable when the detected storage format is not supported.
29
+ - Session contents and other Codex data are never sent over the network.
24
30
 
25
- - macOS or Linux
26
- - [Node.js](https://nodejs.org/) 24.15 or newer
27
- - Local sessions created by Codex
31
+ At startup, Session Steward may contact the public npm registry to check for a newer version.
28
32
 
29
- Git and a separate SQLite installation are not required. Session Steward uses the SQLite support included with Node.js.
33
+ ### Session Steward does not remove
30
34
 
31
- ## Install
35
+ - Codex sign-in data or saved API credentials
36
+ - Configuration, plugins, caches, or custom prompt files
37
+ - Project files, Git repositories, or worktrees
38
+ - Sessions outside the reviewed cleanup plan
39
+ - Conversations stored in your ChatGPT account
32
40
 
33
- Install Session Steward globally with npm:
41
+ ## Install and get started
42
+
43
+ Session Steward supports macOS and Linux and requires Node.js 24.15 or newer.
44
+
45
+ Install it globally:
34
46
 
35
47
  ```bash
36
48
  npm install --global session-steward
@@ -42,173 +54,159 @@ Then launch it:
42
54
  session-steward
43
55
  ```
44
56
 
45
- Session Steward opens its browser interface and listens only on `127.0.0.1`. It uses `~/.codex` by default.
46
-
47
- Keep the terminal open while using Session Steward. Press `Ctrl+C` when you want to stop it.
48
-
49
- To try it without a global installation:
57
+ Or try it without installing:
50
58
 
51
59
  ```bash
52
60
  npx session-steward@latest
53
61
  ```
54
62
 
55
- ## Quick start
63
+ Session Steward opens in your browser, listens only on `127.0.0.1`, and uses `~/.codex` by default.
64
+
65
+ To clean up sessions:
56
66
 
57
- 1. Run `session-steward`.
58
- 2. Review the detected Codex sessions.
59
- 3. Select one or more sessions.
60
- 4. Choose a cleanup option and review the deletion preview.
67
+ 1. Review the detected sessions.
68
+ 2. Select one or more sessions.
69
+ 3. Choose a cleanup option.
70
+ 4. Review exactly what will be removed.
61
71
  5. Close any selected sessions that may still be active.
62
72
  6. Confirm the cleanup.
63
73
 
64
- Each cleanup creates a backup inside your Codex folder under `session-steward-backups/`.
74
+ Keep the terminal open while using Session Steward. Press `Ctrl+C` to stop it.
65
75
 
66
- ## What you can adjust
76
+ ## Cleanup and recovery
67
77
 
68
- - Search by session name, workspace, or session ID.
69
- - Sort by recent activity, creation time, name, or workspace.
70
- - Show subagent and supporting sessions when you need the additional detail.
71
- - Choose standard or thorough cleanup for each deletion.
72
- - Change the Codex session folder and save that choice for later runs.
78
+ ### Standard cleanup
73
79
 
74
- ## Safety model
80
+ Recommended for routine session removal. It removes supported registry entries, transcripts, history and index entries, logs, and linked subagents belonging to the selected sessions.
75
81
 
76
- Session Steward is intentionally conservative:
82
+ ### Thorough cleanup
77
83
 
78
- - All session inspection and cleanup happens on your computer.
79
- - Only recognized Codex storage is changed.
80
- - Unrecognized databases and changed storage layouts are reported but left untouched.
81
- - Thorough cleanup is paused when the local storage layout is not supported.
82
- - A backup is created before session data is changed.
83
- - Cleanup is checked afterward for remaining selected artifacts.
84
- - Authentication, plugins, caches, project files, worktrees, and unrelated sessions are not removed.
84
+ Includes standard cleanup and also removes supported local references and generated records, including recognized ChatGPT Desktop references, memory outputs, and goal records.
85
85
 
86
- At startup, Session Steward may contact the public npm registry to check for a newer release. It does not send session contents or other Codex data.
86
+ Thorough cleanup is unavailable when Session Steward finds storage it does not recognize. Standard cleanup remains available for supported records that can be identified safely.
87
87
 
88
- Close selected Codex sessions before deleting them. Session Steward cannot currently determine whether a session is still being written to.
88
+ ### Recovery backups
89
89
 
90
- ## Cleanup options
90
+ A temporary backup is created inside your Codex folder under `session-steward-backups/`.
91
91
 
92
- ### Standard cleanup
92
+ After cleanup is successfully verified, the backup is removed automatically. If cleanup fails, Session Steward keeps the backup and lets you restore the sessions, keep the backup, or delete it.
93
93
 
94
- Recommended for routine session removal. It removes the selected session registry entries, transcripts, history entries, session-index entries, logs, and linked subagents.
94
+ Before restoring, the current versions of affected files are saved separately to provide another recovery point.
95
95
 
96
- ### Thorough cleanup
96
+ ## Terminal CLI
97
97
 
98
- Choose this when you also want supported local references and generated records removed. It includes everything in standard cleanup, plus recognized ChatGPT Desktop references, memory outputs, and goal records.
98
+ Start the interactive terminal interface:
99
99
 
100
- Thorough cleanup remains unavailable when Session Steward finds storage it does not recognize. Standard cleanup stays available for the supported records it can identify safely.
100
+ ```bash
101
+ session-steward-cli
102
+ ```
103
+
104
+ List sessions as JSON:
101
105
 
102
- ## Backups and recovery
106
+ ```bash
107
+ session-steward-cli --json --limit 10
108
+ ```
103
109
 
104
- Completed cleanups keep their recovery backup on disk. If cleanup encounters a problem after creating its backup, Session Steward offers a guided restore from the cleanup progress screen.
110
+ Find sessions inactive for at least 60 days:
105
111
 
106
- Before restoring, Session Steward saves the current versions of the affected files in a separate safety folder. This gives you a second recovery point if the restore itself is interrupted.
112
+ ```bash
113
+ session-steward-cli --inactive-days 60
114
+ ```
107
115
 
108
- ## Use a custom Codex home folder
116
+ Show only archived sessions:
109
117
 
110
- The browser interface shows the active Codex session folder. Choose **Change folder** to select another existing Codex folder and remember it for future browser and terminal sessions.
118
+ ```bash
119
+ session-steward-cli --archive-status archived
120
+ ```
111
121
 
112
- For a one-time folder override:
122
+ Show sessions from one exact workspace:
113
123
 
114
124
  ```bash
115
- session-steward --codex-home /path/to/.codex
125
+ session-steward-cli --workspace /path/to/project
116
126
  ```
117
127
 
118
- The command-line override applies only to that run and does not replace the saved folder.
128
+ The interactive terminal accepts the same filters:
119
129
 
120
- Saved settings are stored at:
130
+ ```text
131
+ inactive 30
132
+ inactive 60
133
+ inactive 90
134
+ archive active
135
+ archive archived
136
+ workspace /path/to/project
137
+ ```
121
138
 
122
- - macOS: `~/Library/Application Support/session-steward/config.json`
123
- - Linux: `$XDG_CONFIG_HOME/session-steward/config.json`, or `~/.config/session-steward/config.json` when `XDG_CONFIG_HOME` is not set
139
+ Run `inactive`, `archive`, or `workspace` without a value to clear that filter.
124
140
 
125
- ## Terminal interface
141
+ Use `session-steward-cli --help` to see all available options.
126
142
 
127
- For an interactive terminal workflow:
143
+ ## Use a custom Codex folder
128
144
 
129
- ```bash
130
- session-steward-cli
131
- ```
145
+ The browser interface displays the active Codex session folder. Select **Change folder** to choose another existing Codex folder and remember it for later browser and terminal sessions.
132
146
 
133
- To inspect a small JSON result without opening the browser:
147
+ For a one-time override:
134
148
 
135
149
  ```bash
136
- session-steward-cli --json --limit 10
150
+ session-steward --codex-home /path/to/.codex
137
151
  ```
138
152
 
139
- Run `session-steward-cli --help` for all available options. The terminal interface uses the same saved Codex folder as the browser interface.
153
+ The command-line override applies only to that run and does not replace your saved folder.
140
154
 
141
- ## Common commands
155
+ ## Other commands
142
156
 
143
- Start without opening a browser:
157
+ Start without automatically opening the browser:
144
158
 
145
159
  ```bash
146
160
  session-steward --no-open
147
161
  ```
148
162
 
149
- Update to the latest release:
163
+ Update Session Steward:
150
164
 
151
165
  ```bash
152
166
  npm install --global session-steward@latest
153
167
  ```
154
168
 
155
- Uninstall Session Steward:
169
+ Uninstall it:
156
170
 
157
171
  ```bash
158
172
  npm uninstall --global session-steward
159
173
  ```
160
174
 
161
- Uninstalling the package does not remove your Codex sessions, Session Steward backups, or saved folder preference.
175
+ Uninstalling Session Steward does not remove Codex sessions, recovery backups, or your saved folder preference.
162
176
 
163
177
  ## Troubleshooting
164
178
 
165
- ### The browser did not open
166
-
167
- Run `session-steward --no-open`, then open the local address printed in the terminal.
168
-
169
- ### No sessions were found
170
-
171
- Confirm that the displayed Codex folder contains your local session data. Use **Change folder** or pass `--codex-home` for a one-time override.
172
-
173
- ### Thorough cleanup is unavailable
174
-
175
- Open the compatibility details in Session Steward. New or changed local storage is left untouched until that format is supported. You can still use standard cleanup when its recognized records are supported.
176
-
177
- ### Node.js is too old
178
-
179
- Install Node.js 24.15 or newer, then run `session-steward` again.
179
+ - **The browser did not open:** Run `session-steward --no-open`, then open the local address shown in the terminal.
180
+ - **No sessions were found:** Check the displayed Codex folder. Use **Change folder** or pass `--codex-home` for a one-time override.
181
+ - **Thorough cleanup is unavailable:** Review the compatibility details. Unrecognized storage is left untouched, but standard cleanup may still be available.
182
+ - **Your Node.js version is too old:** Install Node.js 24.15 or newer and run Session Steward again.
180
183
 
181
184
  ## Development
182
185
 
183
- Clone the repository and install its dependencies:
184
-
185
186
  ```bash
186
187
  git clone https://github.com/mallikcheripally/session-steward.git
187
188
  cd session-steward
188
189
  npm install
190
+ npm test
191
+ npm run build
189
192
  ```
190
193
 
191
- Useful commands:
194
+ Scale benchmarks are also available:
192
195
 
193
196
  ```bash
194
- npm start
195
- npm test
196
197
  npm run benchmark:scale
198
+ npm run benchmark:overview
197
199
  npm run benchmark:discovery
198
200
  npm run benchmark:transcripts
199
- npm run build
200
- npm pack --dry-run --cache .npm-cache
201
201
  ```
202
202
 
203
- Tests use temporary synthetic Codex data. They do not read or change your local Codex sessions.
204
-
205
- ## Roadmap
206
-
207
- Codex is supported today. Claude Code is planned as the next provider integration.
203
+ Tests and benchmarks use temporary synthetic Codex data. They do not read or modify your local sessions.
208
204
 
209
205
  ## Support
210
206
 
211
- Use [GitHub Issues](https://github.com/mallikcheripally/session-steward/issues) to report a bug, request a provider, or share a storage format that Session Steward does not yet recognize.
207
+ Codex is supported today. Claude Code support is planned.
208
+
209
+ Use [GitHub Issues](https://github.com/mallikcheripally/session-steward/issues) to report a bug, request a provider, or share a storage format that Session Steward does not recognize.
212
210
 
213
211
  Session Steward is an independent project and is not affiliated with or endorsed by OpenAI.
214
212
 
@@ -11,6 +11,9 @@ const { runCli } = await import("../lib/cli.mjs");
11
11
  const { values } = parseArgs({
12
12
  allowPositionals: false,
13
13
  options: {
14
+ "archive-status": {
15
+ type: "string",
16
+ },
14
17
  "codex-home": {
15
18
  type: "string",
16
19
  },
@@ -18,6 +21,9 @@ const { values } = parseArgs({
18
21
  short: "h",
19
22
  type: "boolean",
20
23
  },
24
+ "inactive-days": {
25
+ type: "string",
26
+ },
21
27
  "include-internals": {
22
28
  type: "boolean",
23
29
  },
@@ -33,6 +39,9 @@ const { values } = parseArgs({
33
39
  sort: {
34
40
  type: "string",
35
41
  },
42
+ workspace: {
43
+ type: "string",
44
+ },
36
45
  },
37
46
  });
38
47
 
@@ -54,13 +63,16 @@ async function main() {
54
63
  }
55
64
 
56
65
  await runCli({
66
+ archiveStatus: values["archive-status"],
57
67
  codexHome,
58
68
  help,
69
+ inactiveDays: values["inactive-days"],
59
70
  includeInternals: values["include-internals"] ?? false,
60
71
  json: values.json ?? false,
61
72
  limit: numericLimit,
62
73
  search: values.search ?? "",
63
74
  sort: values.sort ?? "updated",
75
+ workspace: values.workspace,
64
76
  });
65
77
  }
66
78
 
@@ -9,15 +9,36 @@ import { findAvailableUpdate, formatUpdateNotice } from "../lib/update-check.mjs
9
9
 
10
10
  assertSupportedNode();
11
11
 
12
- const { startLocalServer } = await import("../lib/server.mjs");
13
-
14
12
  const { values } = parseArgs({
13
+ allowPositionals: false,
15
14
  options: {
16
15
  "codex-home": { type: "string" },
16
+ help: { short: "h", type: "boolean" },
17
17
  "no-open": { type: "boolean", default: false },
18
18
  port: { type: "string" },
19
+ version: { short: "v", type: "boolean" },
19
20
  },
20
21
  });
22
+
23
+ if (values.help) {
24
+ process.stdout.write(`Usage: session-steward [options]
25
+
26
+ Options:
27
+ --codex-home <path> Use a custom Codex session folder
28
+ --port <number> Use a specific local port
29
+ --no-open Start without opening a browser
30
+ -h, --help Show this help
31
+ -v, --version Show the installed version
32
+ `);
33
+ process.exit(0);
34
+ }
35
+
36
+ if (values.version) {
37
+ process.stdout.write(`${packageMetadata.version}\n`);
38
+ process.exit(0);
39
+ }
40
+
41
+ const { startLocalServer } = await import("../lib/server.mjs");
21
42
  const port = values.port === undefined ? 0 : Number.parseInt(values.port, 10);
22
43
  const availableUpdate = await findAvailableUpdate({ packageMetadata });
23
44