claude-plan-viewer 1.1.1 → 1.4.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
@@ -52,7 +52,7 @@ Download a pre-built binary from the [releases page](https://github.com/HelgeSve
52
52
 
53
53
  ```bash
54
54
  bun run build
55
- ./dist/plans-viewer
55
+ ./dist/claude-plan-viewer
56
56
  ```
57
57
 
58
58
  The binary is fully self-contained (~57MB) and works offline.
@@ -60,15 +60,79 @@ The binary is fully self-contained (~57MB) and works offline.
60
60
  ## Usage
61
61
 
62
62
  ```bash
63
- # Start on auto-assigned port
63
+ # Start the web viewer
64
64
  claude-plan-viewer
65
65
 
66
66
  # Start on specific port
67
67
  claude-plan-viewer --port 8080
68
+ claude-plan-viewer -p 8080
68
69
  ```
69
70
 
70
71
  The server will automatically find an available port if the requested port is in use.
71
72
 
73
+ ### CLI Options
74
+
75
+ | Flag | Short | Description |
76
+ | --------------------- | ----- | --------------------------------------------------------- |
77
+ | `--port <number>` | `-p` | Port to start the server on (default: 3000) |
78
+ | `--claude-dir <path>` | `-c` | Path to `.claude` directory (default: `~/.claude`) |
79
+ | `--json` | `-j` | Export all plans as JSON and exit |
80
+ | `--output <file>` | `-o` | Output file for JSON export (prints to stdout if omitted) |
81
+ | `--from-file <file>` | `-f` | Load plans from a JSON file instead of `~/.claude/plans` |
82
+ | `--version` | `-v` | Show version number |
83
+ | `--help` | `-h` | Show help message |
84
+
85
+ The `--claude-dir` option can also be set via the `CLAUDE_DIR` environment variable. CLI flag takes precedence over the environment variable.
86
+
87
+ ### Export plans to JSON
88
+
89
+ ```bash
90
+ # Print all plans as JSON to stdout
91
+ claude-plan-viewer --json
92
+
93
+ # Export to a file
94
+ claude-plan-viewer --json --output plans.json
95
+ claude-plan-viewer -j -o plans.json
96
+ ```
97
+
98
+ The JSON export includes all plan metadata and content, useful for backup or processing.
99
+
100
+ ### Load plans from file
101
+
102
+ ```bash
103
+ # Start viewer with plans from an exported JSON file
104
+ claude-plan-viewer --from-file plans.json
105
+ claude-plan-viewer -f plans.json
106
+ ```
107
+
108
+ This allows viewing plans offline or from a different machine. When using `--from-file`, file watching is disabled since the plans are loaded from the static JSON file.
109
+
110
+ ### Custom .claude directory
111
+
112
+ ```bash
113
+ # Use a custom .claude directory
114
+ claude-plan-viewer --claude-dir /path/to/.claude
115
+ claude-plan-viewer -c /path/to/.claude
116
+
117
+ # Or set via environment variable
118
+ CLAUDE_DIR=/path/to/.claude claude-plan-viewer
119
+ ```
120
+
121
+ This is useful when your Claude Code data is stored in a non-standard location.
122
+
123
+ ## API
124
+
125
+ The viewer exposes a REST API for programmatic access:
126
+
127
+ | Endpoint | Method | Description |
128
+ | ------------------------------- | ------ | -------------------------- |
129
+ | `/api/plans` | GET | List all plans (metadata) |
130
+ | `/api/plans/{filename}/content` | GET | Get plan markdown content |
131
+ | `/api/projects` | GET | List all project names |
132
+ | `/api/refresh` | POST | Force cache refresh |
133
+ | `/api/open` | POST | Open plan in system editor |
134
+ | `/api/openapi.json` | GET | OpenAPI 3.0 specification |
135
+
72
136
  ## Development
73
137
 
74
138
  ```bash
@@ -77,6 +141,22 @@ bun install
77
141
 
78
142
  # Run in development mode with hot reload
79
143
  bun run dev
144
+
145
+ # Or run directly with hot reload
146
+ bun --hot index.ts
147
+
148
+ # To use flags in dev mode, add them after `--`
149
+ # Example: using --from-file
150
+ bun run index.ts -- --from-file plans.json
151
+ ```
152
+
153
+ ## Running tests
154
+
155
+ ```bash
156
+ bun run test
157
+
158
+ # Note: Use `bun run test` instead of `bun test` directly,
159
+ # as the script specifies the test directory path
80
160
  ```
81
161
 
82
162
  ## Building
@@ -85,18 +165,18 @@ Build standalone binaries for different platforms:
85
165
 
86
166
  ```bash
87
167
  bun run build # Current platform
168
+ bun run build:all # All platforms
88
169
  bun run build:macos-arm64 # macOS Apple Silicon
89
170
  bun run build:macos-x64 # macOS Intel
90
171
  bun run build:linux-x64 # Linux x64
91
172
  bun run build:linux-arm64 # Linux ARM64
92
173
  bun run build:windows # Windows x64
93
- bun run build:all # All platforms
94
174
  ```
95
175
 
96
176
  ## Requirements
97
177
 
98
178
  - [Bun](https://bun.sh) runtime (for development/npx usage)
99
- - Claude Code with plan files in `~/.claude/plans`
179
+ - Claude Code with plan files in `~/.claude/plans` (or custom location via `--claude-dir`)
100
180
 
101
181
  Standalone binaries have no external dependencies.
102
182