xedoc-cli 0.1.10 → 0.1.11

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
@@ -6,7 +6,7 @@ xedoc is a single React Router Framework Mode app, built with Vite, for managing
6
6
 
7
7
  - Stores shared Codex accounts, chat metadata, runs, and live message projections in a local SQLite database through Prisma.
8
8
  - Starts browser or device-code Codex account authentication through the local `codex app-server` JSON-RPC flow.
9
- - Isolates each Codex account with a separate `CODEX_HOME`.
9
+ - Isolates each Codex account with a separate `CODEX_HOME` while sharing Codex chat sessions through the system Codex chat store.
10
10
  - Stores a working directory on each chat so different chats can target different local projects.
11
11
  - Executes chat prompts against the selected Codex account and reads settled transcripts back from Codex runtime/session data.
12
12
  - Serves the ChatGPT-style web UI and `/api/*` resource routes from one same-origin app.
@@ -17,7 +17,7 @@ xedoc is a single React Router Framework Mode app, built with Vite, for managing
17
17
  The easiest local install is the npm CLI:
18
18
 
19
19
  ```bash
20
- npx xedoc
20
+ npx xedoc-cli
21
21
  ```
22
22
 
23
23
  By default the CLI creates a SQLite database under the workspace root at
@@ -30,6 +30,7 @@ Common CLI options:
30
30
  - `--port <port>` changes the web server port.
31
31
  - `--workspace-root <path>` changes the directory tree visible to the app.
32
32
  - `--accounts-home <path>` changes where Codex account state is stored.
33
+ - `--shared-chat-home <path>` changes where shared Codex chat sessions are stored.
33
34
  - `--skip-setup` skips SQLite schema setup.
34
35
 
35
36
  For repository development:
@@ -69,12 +70,25 @@ npmjs.com with this GitHub repository and the workflow file
69
70
 
70
71
  ## Codex Account Isolation
71
72
 
72
- Each Codex account runs as its own local `codex app-server` process. The server sets `CODEX_HOME` per account so auth files, config, sessions, cache, and other Codex state stay under:
73
+ Each Codex account runs as its own local `codex app-server` process. The server sets `CODEX_HOME` per account so auth files, config, cache, and other account-specific Codex state stay under:
73
74
 
74
75
  ```text
75
76
  ~/.xedoc/accounts/<accountId>
76
77
  ```
77
78
 
79
+ Codex chat data is centralized separately. By default, each account home gets symlinks for `sessions/` and `session_index.jsonl` pointing at the system Codex chat store:
80
+
81
+ ```text
82
+ ~/.codex
83
+ ```
84
+
85
+ Set `CODEX_SHARED_CHAT_HOME` to change the shared chat store. Existing per-account `sessions/` and `session_index.jsonl` paths are copied into the shared store when an account runtime starts, then kept as timestamped `.pre-shared-*` backups before the symlinks are created.
86
+
87
+ For existing installations, saved account homes are prepared when the app lists
88
+ accounts after upgrade. This migrates old per-account chat storage into the
89
+ shared store without changing each account's `auth.json` or other
90
+ account-specific files.
91
+
78
92
  Set `CODEX_ACCOUNTS_HOME` to change the base directory. This isolates Codex account state only; Codex still runs as the same host user and can access whatever that user can access.
79
93
 
80
94
  Set `CODEX_WORKSPACE_ROOT` to the directory the web app can browse for chat
package/bin/xedoc.mjs CHANGED
@@ -34,6 +34,12 @@ const accountsHome = resolveHomePath(
34
34
  process.env.CODEX_ACCOUNTS_HOME ??
35
35
  join(appHome, "accounts"),
36
36
  )
37
+ const sharedChatHome = resolveHomePath(
38
+ options.sharedChatHome ??
39
+ process.env.CODEX_SHARED_CHAT_HOME ??
40
+ process.env.CODEX_HOME ??
41
+ "~/.codex",
42
+ )
37
43
  const workspaceRoot = resolveHomePath(
38
44
  options.workspaceRoot ?? process.env.CODEX_WORKSPACE_ROOT ?? homedir(),
39
45
  )
@@ -47,6 +53,7 @@ const env = {
47
53
  CODEX_ACCOUNTS_HOME: accountsHome,
48
54
  CODEX_ARGS: options.codexArgs ?? process.env.CODEX_ARGS ?? `${codexBin} app-server`,
49
55
  CODEX_COMMAND: options.codexCommand ?? process.env.CODEX_COMMAND ?? process.execPath,
56
+ CODEX_SHARED_CHAT_HOME: sharedChatHome,
50
57
  CODEX_WORKSPACE_ROOT: workspaceRoot,
51
58
  DATABASE_URL: databaseUrl,
52
59
  HOST: host,
@@ -66,6 +73,7 @@ const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`
66
73
  console.log(`xedoc: ${url}`)
67
74
  console.log("Set the server password in your browser on first visit.")
68
75
  console.log(`Workspace root: ${workspaceRoot}`)
76
+ console.log(`Shared chat store: ${sharedChatHome}`)
69
77
  console.log("Press Ctrl+C to stop.")
70
78
 
71
79
  await runServer(env)
@@ -116,6 +124,9 @@ function assignOption(parsed, name, value) {
116
124
  case "--port":
117
125
  parsed.port = value
118
126
  return
127
+ case "--shared-chat-home":
128
+ parsed.sharedChatHome = value
129
+ return
119
130
  case "--workspace-root":
120
131
  parsed.workspaceRoot = value
121
132
  return
@@ -220,6 +231,7 @@ Options:
220
231
  --host <host> Web server host. Defaults to 127.0.0.1.
221
232
  --workspace-root <path> Directory tree visible in the app. Defaults to your home directory.
222
233
  --accounts-home <path> Codex account state directory. Defaults to ~/.xedoc/accounts.
234
+ --shared-chat-home <path> Shared Codex chat store. Defaults to ~/.codex.
223
235
  --skip-setup Do not create the SQLite database schema.
224
236
  --codex-command <command> Codex command used for new accounts.
225
237
  --codex-args <args> Codex command arguments used for new accounts.
@@ -0,0 +1 @@
1
+ import{j as t,t as r}from"./jsx-runtime-Cal6WBdn.js";import{t as s}from"./app-shell-iKMZyGQn.js";var a=r(),o=t(function(){return(0,a.jsx)(s,{})});export{o as default};