@filipc77/cowrite 0.4.22 → 0.4.23
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 +26 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,25 +32,37 @@ A single Node.js process runs both the HTTP/WebSocket preview server and the MCP
|
|
|
32
32
|
|
|
33
33
|
## Quick Start
|
|
34
34
|
|
|
35
|
-
### 1.
|
|
35
|
+
### 1. Install Cowrite
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g @filipc77/cowrite
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This gives you the `cowrite` command globally.
|
|
42
|
+
|
|
43
|
+
### 2. Add Cowrite as an MCP server in Claude Code
|
|
38
44
|
|
|
39
45
|
```bash
|
|
40
|
-
claude mcp add -s user cowrite -- npx -y @filipc77/cowrite serve
|
|
46
|
+
claude mcp add -s user cowrite -- npx -y @filipc77/cowrite@latest serve
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
###
|
|
49
|
+
### 3. Open the preview
|
|
50
|
+
|
|
51
|
+
The browser opens automatically when a new Claude Code session starts. The default port is `3377`, but if it's in use (e.g. running cowrite in multiple repos), it automatically picks the next available port.
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
If you need to reopen the browser later (e.g. you closed the tab), run from any terminal:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cowrite open
|
|
57
|
+
```
|
|
46
58
|
|
|
47
59
|
Pick a file and you'll see a live preview.
|
|
48
60
|
|
|
49
|
-
###
|
|
61
|
+
### 4. Select text and comment
|
|
50
62
|
|
|
51
63
|
Select any text in the preview. A **Comment** button appears — click it to open the comment form. Your text selection stays intact, so you can still copy-paste normally.
|
|
52
64
|
|
|
53
|
-
###
|
|
65
|
+
### 5. Start the background watcher (recommended)
|
|
54
66
|
|
|
55
67
|
In your Claude Code session, type:
|
|
56
68
|
|
|
@@ -60,14 +72,14 @@ In your Claude Code session, type:
|
|
|
60
72
|
|
|
61
73
|
This starts a background watcher that handles comments as they arrive — without blocking your main conversation. You only need to do this once per session.
|
|
62
74
|
|
|
63
|
-
###
|
|
75
|
+
### 6. The agent handles your comments
|
|
64
76
|
|
|
65
77
|
Even without `/watch`, comments reach the agent through auto-installed hooks:
|
|
66
78
|
|
|
67
79
|
- **`UserPromptSubmit` hook** — Whenever you send any message, pending comments are injected into the agent's context. The agent makes the change, replies in the browser preview, and resolves the comment.
|
|
68
80
|
- **`Stop` hook** — When the agent finishes any task, it checks for pending comments before going idle. Catches comments that arrive while the agent is busy.
|
|
69
81
|
|
|
70
|
-
###
|
|
82
|
+
### 7. Auto-installed integration
|
|
71
83
|
|
|
72
84
|
On first run, `cowrite serve` installs into your project's `.claude/` directory:
|
|
73
85
|
- **Hooks** (`UserPromptSubmit` + `Stop`) — surface pending comments to the agent automatically
|
|
@@ -77,16 +89,18 @@ On first run, `cowrite serve` installs into your project's `.claude/` directory:
|
|
|
77
89
|
## CLI Reference
|
|
78
90
|
|
|
79
91
|
```
|
|
80
|
-
cowrite preview <file> [--port N] Open browser preview for a specific file + start MCP server
|
|
81
92
|
cowrite serve [--port N] Start MCP server + preview server (browse any file)
|
|
82
|
-
cowrite
|
|
93
|
+
cowrite preview <file> [--port N] Open browser preview for a specific file + start MCP server
|
|
94
|
+
cowrite open [--port N] Open the browser to an already-running preview server
|
|
83
95
|
|
|
84
96
|
Options:
|
|
85
97
|
--port, -p Port for preview server (default: 3377)
|
|
86
|
-
--no-open Don't auto-open the browser
|
|
98
|
+
--no-open Don't auto-open the browser on serve/preview startup
|
|
87
99
|
--help, -h Show help
|
|
88
100
|
```
|
|
89
101
|
|
|
102
|
+
`serve` and `preview` auto-open the browser on startup. Use `--no-open` to disable this. To reopen the browser later (e.g. after closing a tab), run `cowrite open` from any terminal.
|
|
103
|
+
|
|
90
104
|
## MCP Tools
|
|
91
105
|
|
|
92
106
|
### `get_preview_url`
|