@work-bridge/work-bridge 0.1.3 → 0.1.5

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 (2) hide show
  1. package/README.md +146 -256
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,16 @@
1
1
  # work-bridge
2
2
 
3
- > **Switching between Claude Code, Gemini CLI, OpenCode, and Codex due to LLM cost?**
4
- > Bring your session context, MCP configs, and skills with you instantly.
3
+ > **Switching between Claude Code, Gemini CLI, OpenCode, and Codex on the same project because of model cost or context limits?**
4
+ > Inspect the source session, then either apply a target-ready handoff directly into the project or export the same handoff into a separate output tree.
5
5
 
6
- `work-bridge` is a local-first portability layer for AI coding-agent workflows. It inspects your current sessions, skills, and MCP server configs across all major tools, then exports a portable bundle that any other tool can pick up from where you left off.
6
+ `work-bridge` is a local-first handoff tool for AI coding-agent workflows. It reads a source session, normalizes the useful project context, and either:
7
+
8
+ - applies a target-ready state into project-native files
9
+ - exports the same target-ready state to a separate directory
10
+
11
+ It does **not** write into another tool's home-level session database.
12
+
13
+ > **Stability:** `work-bridge` is still early and not fully stable. Project-native apply and export paths are covered by tests, but some migration paths are still under active refinement. Use `--dry-run` first when trying a new source/target pair.
7
14
 
8
15
  [![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat&logo=go)](https://golang.org)
9
16
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -13,346 +20,229 @@
13
20
 
14
21
  ## Why work-bridge?
15
22
 
16
- Modern AI coding agents store their state in incompatible formats:
23
+ Most coding-agent tools keep valuable context in incompatible formats. `work-bridge` keeps the useful project-facing parts portable:
24
+
25
+ | Preserved across tools | Notes |
26
+ |------------------------|-------|
27
+ | Task title and current goal | Normalized from the source session |
28
+ | Session summary and decisions | Added to the target-ready handoff |
29
+ | Project instruction context | Applied into `CLAUDE.md`, `GEMINI.md`, or `AGENTS.md` |
30
+ | Project-scoped skills | Materialized into `.work-bridge/<target>/skills/` |
31
+ | Effective MCP config | Materialized into `.work-bridge/<target>/mcp.json` and patched into supported target project config files |
32
+ | Portable settings context | Source secrets remain redacted |
17
33
 
18
- | What you lose when switching tools | What work-bridge preserves |
19
- |------------------------------------|---------------------------|
20
- | Current task title & goal | Task title & current goal |
21
- | Session summary & decisions | Summary, decisions, failures |
22
- | Project instruction files (AGENTS.md, CLAUDE.md, GEMINI.md…) | All instruction artifacts |
23
- | MCP server configurations | ✅ Inspected & validated MCP configs |
24
- | Portable settings (non-sensitive) | ✅ Settings snapshot (secrets stripped) |
25
- | Touched files & tool events | ✅ File touch history & event log |
34
+ The current design is intentionally simpler than the older import/export pipeline:
35
+
36
+ - `inspect` shows what can be handed off
37
+ - `switch` previews and applies directly into the project
38
+ - `export` writes the same target-ready state into a separate directory
26
39
 
27
40
  ---
28
41
 
29
42
  ## Supported Tools
30
43
 
31
- | Tool | Import | Export | MCP | Skills |
32
- |------|:------:|:------:|:---:|:------:|
33
- | **Claude Code** | ✅ | ✅ | ✅ | ✅ |
34
- | **Gemini CLI** | ✅ | ✅ | ✅ | ✅ |
35
- | **OpenCode** | ✅ | ✅ | ✅ | ✅ |
36
- | **Codex CLI** | ✅ | ✅ | ✅ | ✅ |
44
+ | Tool | Inspect source sessions | Apply to project files | Export target-ready tree |
45
+ |------|:-----------------------:|:----------------------:|:------------------------:|
46
+ | **Claude Code** | ✅ | ✅ | ✅ |
47
+ | **Gemini CLI** | ✅ | ✅ | ✅ |
48
+ | **OpenCode** | ✅ | ✅ | ✅ |
49
+ | **Codex CLI** | ✅ | ✅ | ✅ |
50
+
51
+ Project-native apply means files inside the project root only. `work-bridge` does **not** recreate native session state in `~/.codex`, `~/.gemini`, `~/.claude`, or `~/.config/opencode`.
37
52
 
38
53
  ---
39
54
 
40
- ## Quick Start
55
+ ## Install
41
56
 
42
- ### Install via npm (recommended)
57
+ ### npm
43
58
 
44
59
  ```bash
45
60
  npm install -g @work-bridge/work-bridge
46
- work-bridge
47
61
  ```
48
62
 
49
- ### Install via Go
63
+ ### Go
50
64
 
51
65
  ```bash
52
66
  go install github.com/jaeyoung0509/work-bridge/cmd/work-bridge@latest
53
67
  ```
54
68
 
55
- ### Download binary
69
+ ### Binary
56
70
 
57
- Grab the latest release binary from [GitHub Releases](https://github.com/jaeyoung0509/work-bridge/releases).
71
+ Download the latest release from [GitHub Releases](https://github.com/jaeyoung0509/work-bridge/releases).
58
72
 
59
73
  ---
60
74
 
61
- ## Usage
62
-
63
- ### TUI (Interactive Mode)
75
+ ## Quick Start
64
76
 
65
- Just run `work-bridge` in your terminal for the full interactive experience:
77
+ ### 1. Inspect available source sessions
66
78
 
67
79
  ```bash
68
- work-bridge
80
+ work-bridge inspect gemini --limit 5
69
81
  ```
70
82
 
71
- The TUI provides five panels:
72
-
73
- | Panel | What it does |
74
- |-------|-------------|
75
- | **Sessions** | Browse, inspect, import, doctor-check, and export sessions |
76
- | **Projects** | Index project roots from configured workspace roots |
77
- | **Skills** | Compare project/user/global skill coverage and sync across scopes |
78
- | **MCP** | Inspect config locations, merge effective scope, and run runtime validation |
79
- | **Logs** | View recent workspace actions and errors |
80
-
81
- **Mouse support:** pane focus · list selection · preview tab switching · scroll
82
-
83
- ### Migration Workflow
84
-
85
- ```
86
- You were using Claude Code → now switching to Gemini CLI
87
- ```
83
+ ### 2. Preview a handoff into another tool
88
84
 
89
85
  ```bash
90
- # 1. Inspect what Claude Code has
91
- work-bridge inspect claude --limit 5
92
-
93
- # 2. Import the latest session into a portable bundle
94
- work-bridge import --from claude --session latest --out ./bundle.json
95
-
96
- # 3. Check compatibility with the target tool
97
- work-bridge doctor --from claude --session latest --target gemini
98
-
99
- # 4. Export target-native artifacts
100
- work-bridge export --bundle ./bundle.json --target gemini --out ./out/
101
-
102
- # 5. Start Gemini CLI — it'll pick up GEMINI.work-bridge.md automatically
103
- cd ./out && gemini
86
+ work-bridge switch \
87
+ --from gemini \
88
+ --session latest \
89
+ --to claude \
90
+ --project /path/to/repo \
91
+ --dry-run
104
92
  ```
105
93
 
106
- The exported `./out/` directory contains:
107
-
108
- - `GEMINI.work-bridge.md` — context supplement injected into Gemini CLI
109
- - `SETTINGS_PATCH.json` — portable settings to apply
110
- - `STARTER_PROMPT.md` — copy-paste prompt to resume your task
111
- - `manifest.json` — export manifest with portability warnings
112
-
113
- ### Pack / Unpack (Portable Archives)
114
-
115
- Share your session state across machines or teammates:
94
+ ### 3. Apply the handoff into the project
116
95
 
117
96
  ```bash
118
- # Pack a session into a portable .spkg archive
119
- work-bridge pack --from claude --session latest --out ./my-session.spkg
120
-
121
- # Unpack on another machine and target a different tool
122
- work-bridge unpack --file ./my-session.spkg --target codex --out ./out/
97
+ work-bridge switch \
98
+ --from gemini \
99
+ --session latest \
100
+ --to claude \
101
+ --project /path/to/repo
123
102
  ```
124
103
 
125
- ### Detect
104
+ ### 4. Or export the same target-ready tree without touching the project
126
105
 
127
106
  ```bash
128
- # Auto-detect all installed tools and project artifacts
129
- work-bridge detect
130
- ```
131
-
132
- ### CLI Reference
133
-
134
- ```
135
- work-bridge [flags]
136
- work-bridge detect
137
- work-bridge inspect <tool> [--limit N]
138
- work-bridge import --from <tool> [--session <id|latest>] [--out <path>]
139
- work-bridge doctor --from <tool> [--session <id|latest>] --target <tool>
140
- work-bridge export --bundle <path> --target <tool> [--out <dir>]
141
- work-bridge pack --from <tool> [--session <id|latest>] --out <path>
142
- work-bridge unpack --file <path> --target <tool> [--out <dir>]
143
- work-bridge version
107
+ work-bridge export \
108
+ --from gemini \
109
+ --session latest \
110
+ --to claude \
111
+ --project /path/to/repo \
112
+ --out /tmp/claude-handoff
144
113
  ```
145
114
 
146
- **Supported tools:** `claude` · `gemini` · `codex` · `opencode`
147
-
148
115
  ---
149
116
 
150
- ## How It Works
117
+ ## What `switch` Applies
151
118
 
152
- ```
153
- ┌─────────────────────────────────────────────────────────────────┐
154
- │ work-bridge │
155
- │ │
156
- │ detect/ ──► inspect/ ──► importer/ ──► domain.SessionBundle │
157
- │ │ │
158
- │ doctor/ │
159
- │ (compatibility check) │
160
- │ │ │
161
- │ exporter/ │
162
- │ (target-native artifacts) │
163
- └─────────────────────────────────────────────────────────────────┘
164
-
165
- SessionBundle fields:
166
- source_tool · source_session_id · project_root
167
- task_title · current_goal · summary
168
- instruction_artifacts (AGENTS.md, CLAUDE.md, GEMINI.md …)
169
- settings_snapshot (sensitive keys redacted automatically)
170
- tool_events · touched_files
171
- decisions · failures · resume_hints
172
- token_stats · provenance · redactions
173
- ```
119
+ `switch` writes a managed target state into the project.
174
120
 
175
- ### Security & Redaction
121
+ Managed session output:
176
122
 
177
- `work-bridge` automatically strips sensitive values during import:
123
+ - Claude: `CLAUDE.md` + `.work-bridge/claude/*`
124
+ - Gemini: `GEMINI.md` + `.work-bridge/gemini/*`
125
+ - Codex: `AGENTS.md` + `.work-bridge/codex/*`
126
+ - OpenCode: `AGENTS.md` + `.work-bridge/opencode/*`
178
127
 
179
- - Key-based: `secret`, `token`, `password`, `auth`, `oauth`, `credential`, `api_key`, `apikey`
180
- - Value-based heuristics: `sk-*`, `ghp_*`, `github_pat_*`, `AIza*` prefixes, and long random-looking strings
181
- - Redacted fields are listed in `bundle.redactions` for transparency — nothing is silently dropped
128
+ Managed skills output:
182
129
 
183
- ---
130
+ - `.work-bridge/<target>/skills/*.md`
131
+ - `.work-bridge/<target>/skills/index.json`
184
132
 
185
- ## MCP Validation
133
+ Managed MCP output:
186
134
 
187
- The **MCP** panel (and `inspect` output) runs a real runtime handshake for supported transports:
135
+ - `.work-bridge/<target>/mcp.json`
136
+ - plus target project config patch where supported:
137
+ - Claude: `.claude/settings.local.json`
138
+ - Gemini: `.gemini/settings.json`
139
+ - OpenCode: `.opencode/opencode.jsonc`
140
+ - Codex: no separate project config patch
188
141
 
189
- 1. Spawns the server process (stdio) or connects (HTTP / SSE)
190
- 2. Sends `initialize` → waits for capability response
191
- 3. Sends `notifications/initialized`
192
- 4. Counts advertised `resources`, `resourceTemplates`, `tools`, and `prompts`
142
+ Instruction files are updated through a managed block:
193
143
 
194
- This catches config problems that a static lint pass would miss.
144
+ ```md
145
+ <!-- work-bridge:start -->
146
+ ...
147
+ <!-- work-bridge:end -->
148
+ ```
195
149
 
196
- ---
150
+ Re-running `switch` replaces that block instead of appending duplicate content.
197
151
 
198
- ## Configuration
152
+ ---
199
153
 
200
- Configuration is resolved in this priority order:
154
+ ## What `export` Writes
201
155
 
202
- 1. CLI flags
203
- 2. Environment variables (`WORK_BRIDGE_` prefix)
204
- 3. `--config <file>`
205
- 4. Auto-discovered config in CWD → then home directory
206
- 5. Built-in defaults
156
+ `export` writes the same target-ready structure into a separate output root instead of modifying the source project.
207
157
 
208
- ### Supported Config Files
158
+ Example output for `--to claude --out /tmp/claude-handoff`:
209
159
 
210
- - `.work-bridge.yaml` / `.work-bridge.yml`
211
- - `.work-bridge.toml`
212
- - `.work-bridge.json`
160
+ - `/tmp/claude-handoff/CLAUDE.md`
161
+ - `/tmp/claude-handoff/.claude/settings.local.json`
162
+ - `/tmp/claude-handoff/.work-bridge/claude/manifest.json`
163
+ - `/tmp/claude-handoff/.work-bridge/claude/mcp.json`
164
+ - `/tmp/claude-handoff/.work-bridge/claude/skills/index.json`
213
165
 
214
- ### Key Config Fields
166
+ This is useful when you want a reviewable, portable handoff tree before applying anything to a live repo.
215
167
 
216
- ```yaml
217
- # .work-bridge.yaml
218
- workspace_roots:
219
- - ~/Projects
220
- - ~/work
168
+ ---
221
169
 
222
- paths:
223
- codex: ~/.local/share/codex
224
- gemini: ~/.config/gemini
225
- claude: ~/.claude
226
- opencode: ~/.config/opencode
170
+ ## TUI
227
171
 
228
- output:
229
- export_dir: ./out/work-bridge
230
- package_path: ./session.spkg
231
- unpack_dir: ./out/unpacked
172
+ Run `work-bridge` without arguments to open the interactive migration console:
232
173
 
233
- redaction:
234
- detect_sensitive_values: true
235
- additional_sensitive_keys:
236
- - my_internal_token
174
+ ```bash
175
+ work-bridge
237
176
  ```
238
177
 
239
- ### JSON Example
240
-
241
- ```json
242
- {
243
- "format": "json",
244
- "workspace_roots": ["~/Projects", "~/work"],
245
- "paths": {
246
- "codex": "/Users/me/.local/share/codex"
247
- },
248
- "output": {
249
- "export_dir": "./out/work-bridge"
250
- }
251
- }
252
- ```
178
+ The TUI is now focused on one workflow:
253
179
 
254
- ### Environment Variables
180
+ - choose a source session from the current project
181
+ - choose a target tool
182
+ - preview the handoff
183
+ - apply or export
255
184
 
256
- | Variable | Config Key |
257
- |----------|-----------|
258
- | `WORK_BRIDGE_FORMAT` | `format` |
259
- | `WORK_BRIDGE_WORKSPACE_ROOTS` | `workspace_roots` |
260
- | `WORK_BRIDGE_PATHS_CODEX` | `paths.codex` |
261
- | `WORK_BRIDGE_PATHS_GEMINI` | `paths.gemini` |
262
- | `WORK_BRIDGE_PATHS_CLAUDE` | `paths.claude` |
263
- | `WORK_BRIDGE_PATHS_OPENCODE` | `paths.opencode` |
264
- | `WORK_BRIDGE_OUTPUT_EXPORT_DIR` | `output.export_dir` |
185
+ Key actions:
265
186
 
266
- ---
187
+ - `Enter` preview
188
+ - `a` apply into the project
189
+ - `e` export into `.work-bridge/exports/<target>/`
190
+ - `r` refresh
191
+ - `?` help
192
+ - `q` quit
267
193
 
268
- ## Repository Layout
194
+ User-facing statuses are simplified:
269
195
 
270
- ```
271
- cmd/work-bridge/ CLI entrypoint (main.go)
272
- internal/
273
- cli/ Cobra/Viper root command, TUI backend wiring
274
- app.go App struct, Run(), Config
275
- root_tui.go TUI launch logic and Backend wiring
276
- legacy_commands.go detect/inspect/import/doctor/export commands
277
- package_commands.go pack/unpack commands
278
- root_tui_backend.go All TUI backend action implementations
279
- tui/ Bubble Tea v2 interactive workspace
280
- domain/ Portable bundle types (SessionBundle, Tool, …)
281
- importer/ Tool-specific session importers
282
- claude.go / codex.go / gemini.go / opencode.go
283
- normalizer.go Signal extraction & normalization
284
- signals.go Decision/failure/hint signal detection
285
- exporter/ Target-native artifact generation
286
- detect/ Tool installation & project artifact detection
287
- inspect/ Session listing for each tool
288
- doctor/ Cross-tool compatibility analysis
289
- catalog/ Skills catalog (project/user/global scopes)
290
- capability/ MCP capability registry
291
- packagex/ .spkg pack/unpack (zip-based)
292
- platform/ FS, clock, archive, env, redact utilities
293
- testdata/ Fixtures and golden outputs
294
- scripts/
295
- install.cjs npm postinstall binary downloader
296
- ```
196
+ - `READY`
197
+ - `APPLIED`
198
+ - `PARTIAL`
199
+ - `ERROR`
297
200
 
298
201
  ---
299
202
 
300
- ## Building from Source
301
-
302
- ```bash
303
- git clone https://github.com/jaeyoung0509/work-bridge.git
304
- cd work-bridge
305
-
306
- # Build
307
- make build
308
- ./bin/work-bridge
203
+ ## CLI Reference
309
204
 
310
- # Test
311
- make test
312
-
313
- # Lint
314
- make lint
315
-
316
- # Format
317
- make fmt
205
+ ```text
206
+ work-bridge [flags]
207
+ work-bridge inspect <tool> [--limit N]
208
+ work-bridge switch --from <tool> --session <id|latest> --to <tool> --project <path> [--dry-run] [--no-skills] [--no-mcp] [--session-only]
209
+ work-bridge export --from <tool> --session <id|latest> --to <tool> --project <path> --out <dir> [--dry-run] [--no-skills] [--no-mcp] [--session-only]
210
+ work-bridge version
318
211
  ```
319
212
 
320
- **Requirements:** Go 1.21+
213
+ Supported tools:
214
+
215
+ - `claude`
216
+ - `gemini`
217
+ - `codex`
218
+ - `opencode`
321
219
 
322
220
  ---
323
221
 
324
- ## Publishing a Release
222
+ ## Limits
325
223
 
326
- Releases use [GoReleaser](https://goreleaser.com/). A GitHub Actions workflow triggers on version tags:
224
+ Current non-goals in this slice:
327
225
 
328
- ```bash
329
- git tag v0.1.0
330
- git push origin v0.1.0
331
- ```
226
+ - no home-level session-store injection
227
+ - no recreation of a target tool's private resume database
228
+ - no promise that every source-specific tool event becomes meaningful in every target
332
229
 
333
- GoReleaser builds cross-platform binaries (`darwin/amd64`, `darwin/arm64`, `linux/amd64`, `linux/arm64`, `windows/amd64`, `windows/arm64`) and uploads them as `.tar.gz` / `.zip` archives to the GitHub Release.
230
+ Current behavior to be aware of:
334
231
 
335
- The npm package wrapper then downloads the correct binary at install time via `scripts/install.cjs`.
232
+ - `switch` is project-native apply, not native session resurrection
233
+ - `export` is out-of-project handoff generation, not a bundle archive format
234
+ - `--session-only` disables skills and MCP materialization
235
+ - `--dry-run` is the safest first step for new tool pairs
336
236
 
337
237
  ---
338
238
 
339
- ## Contributing
239
+ ## Security and Redaction
340
240
 
341
- See [CONTRIBUTING.md](./CONTRIBUTING.md).
241
+ Sensitive values are stripped during source import before a handoff is built.
342
242
 
343
- **Good first areas:**
344
- - Add a new tool importer under `internal/importer/`
345
- - Extend `internal/exporter/` with a new target format
346
- - Improve MCP runtime validation for new transport types
347
- - Add fixture-backed tests for edge cases
348
-
349
- Principles:
350
- - Local-first, no network calls during normal operation
351
- - Deterministic output for fixture-backed tests
352
- - Sensitive data must never leave the machine unredacted
353
-
354
- ---
243
+ Examples include:
355
244
 
356
- ## License
245
+ - keys containing `secret`, `token`, `password`, `auth`, `credential`, `api_key`
246
+ - values matching common token-like patterns such as `sk-*`, `ghp_*`, `github_pat_*`, `AIza*`
357
247
 
358
- MIT © [jaeyoung0509](https://github.com/jaeyoung0509)
248
+ Redactions stay visible as warnings in the normalized handoff so you can see what was intentionally omitted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@work-bridge/work-bridge",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Portable session migration CLI for Claude Code, Gemini CLI, OpenCode, and Codex CLI.",
5
5
  "homepage": "https://github.com/jaeyoung0509/work-bridge",
6
6
  "repository": {