@qiaolei81/copilot-session-viewer 0.3.2 → 0.3.3

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.
@@ -0,0 +1,329 @@
1
+ # 📦 Installation Guide
2
+
3
+ Complete installation instructions for Copilot Session Viewer.
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ ### Required
10
+
11
+ - **Node.js** ≥ 18.0.0 (LTS recommended)
12
+ - **npm** ≥ 9.0.0 or **yarn** ≥ 1.22.0
13
+ - **GitHub Copilot CLI** (for session data generation)
14
+
15
+ ### Optional
16
+
17
+ - **GitHub Copilot CLI with `--yolo` mode** (for AI insights feature)
18
+
19
+ ---
20
+
21
+ ## Installation Methods
22
+
23
+ ### Method 1: NPX (Recommended for Trying)
24
+
25
+ **Best for:** First-time users, occasional use, always getting the latest version
26
+
27
+ ```bash
28
+ # Run directly without installation
29
+ npx -y @qiaolei81/copilot-session-viewer
30
+
31
+ # Then open http://localhost:3838
32
+ ```
33
+
34
+ **Pros:**
35
+ - ✅ No local installation required
36
+ - ✅ Always runs the latest version
37
+ - ✅ No disk space usage when not running
38
+
39
+ **Cons:**
40
+ - ⚠️ Slower startup (downloads on each run)
41
+ - ⚠️ Requires internet connection
42
+
43
+ ---
44
+
45
+ ### Method 2: Global Installation
46
+
47
+ **Best for:** Regular users, offline usage, faster startup times
48
+
49
+ ```bash
50
+ # Install globally
51
+ npm install -g @qiaolei81/copilot-session-viewer
52
+
53
+ # Run from anywhere
54
+ copilot-session-viewer
55
+
56
+ # Then open http://localhost:3838
57
+ ```
58
+
59
+ **Pros:**
60
+ - ✅ Fast startup time
61
+ - ✅ Works offline after installation
62
+ - ✅ Simple command `copilot-session-viewer`
63
+
64
+ **Cons:**
65
+ - ⚠️ Manual updates required
66
+ - ⚠️ Uses disk space
67
+
68
+ **Updating:**
69
+ ```bash
70
+ npm update -g @qiaolei81/copilot-session-viewer
71
+ ```
72
+
73
+ ---
74
+
75
+ ### Method 3: Local Installation (Development)
76
+
77
+ **Best for:** Developers, customization, contributing
78
+
79
+ ```bash
80
+ # Clone the repository
81
+ git clone https://github.com/qiaolei81/copilot-session-viewer.git
82
+ cd copilot-session-viewer
83
+
84
+ # Install dependencies
85
+ npm install
86
+
87
+ # Start development server
88
+ npm run dev
89
+ # OR start production server
90
+ npm start
91
+
92
+ # Then open http://localhost:3838
93
+ ```
94
+
95
+ **Pros:**
96
+ - ✅ Full source code access
97
+ - ✅ Can modify and customize
98
+ - ✅ Contributing and development
99
+
100
+ **Cons:**
101
+ - ⚠️ More setup required
102
+ - ⚠️ Manual updates via git
103
+
104
+ ---
105
+
106
+ ## Verification
107
+
108
+ ### Check Installation
109
+
110
+ ```bash
111
+ # Check Node.js version
112
+ node --version # Should be ≥ 18.0.0
113
+
114
+ # Check npm version
115
+ npm --version # Should be ≥ 9.0.0
116
+
117
+ # Check if Copilot CLI is installed
118
+ copilot --version
119
+ ```
120
+
121
+ ### Test the Installation
122
+
123
+ 1. **Start the viewer:**
124
+ ```bash
125
+ npx -y @qiaolei81/copilot-session-viewer
126
+ # OR if globally installed:
127
+ copilot-session-viewer
128
+ ```
129
+
130
+ 2. **Verify server starts:**
131
+ ```
132
+ 🚀 Copilot Session Viewer running at http://localhost:3838
133
+ 📂 Monitoring: /Users/yourname/.copilot/session-state
134
+ 🔧 Environment: production
135
+ ```
136
+
137
+ 3. **Open in browser:**
138
+ Navigate to `http://localhost:3838`
139
+
140
+ 4. **Check for sessions:**
141
+ - If you have existing Copilot CLI sessions, they should appear
142
+ - If not, generate a test session (see below)
143
+
144
+ ---
145
+
146
+ ## Generating Test Session Data
147
+
148
+ If you don't have existing session data, create some test sessions:
149
+
150
+ ```bash
151
+ # Example sessions with different models
152
+ copilot --model claude-sonnet-4.5 -p "Hello, introduce yourself"
153
+ copilot --model gpt-4o -p "Explain what you can do"
154
+ copilot --model gemini-3-pro -p "Write a simple hello world in Python"
155
+ ```
156
+
157
+ Sessions will be saved to:
158
+ - **macOS/Linux**: `~/.copilot/session-state/`
159
+ - **Windows**: `C:\Users\<username>\.copilot\session-state\`
160
+
161
+ ---
162
+
163
+ ## Configuration
164
+
165
+ ### Environment Variables
166
+
167
+ Create a `.env` file for custom configuration:
168
+
169
+ ```env
170
+ # Server Configuration
171
+ PORT=3838
172
+ NODE_ENV=development
173
+
174
+ # Session Data Directory (auto-detected if omitted)
175
+ SESSION_DIR=/path/to/custom/session-state
176
+
177
+ # Feature Flags
178
+ ENABLE_INSIGHTS=true
179
+ ENABLE_EXPORT=true
180
+ ```
181
+
182
+ ### Custom Session Directory
183
+
184
+ If your Copilot CLI sessions are in a custom location:
185
+
186
+ ```bash
187
+ # Method 1: Environment variable
188
+ SESSION_DIR=/custom/path npx @qiaolei81/copilot-session-viewer
189
+
190
+ # Method 2: Create .env file (for local installation)
191
+ echo "SESSION_DIR=/custom/path" > .env
192
+ npm start
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Docker Installation (Advanced)
198
+
199
+ For containerized deployment:
200
+
201
+ ```bash
202
+ # Clone repository
203
+ git clone https://github.com/qiaolei81/copilot-session-viewer.git
204
+ cd copilot-session-viewer
205
+
206
+ # Build Docker image
207
+ docker build -t copilot-viewer .
208
+
209
+ # Run container
210
+ docker run -p 3838:3838 \
211
+ -v ~/.copilot:/root/.copilot:ro \
212
+ copilot-viewer
213
+
214
+ # Open http://localhost:3838
215
+ ```
216
+
217
+ **Docker Compose:**
218
+
219
+ ```yaml
220
+ version: '3.8'
221
+ services:
222
+ copilot-viewer:
223
+ build: .
224
+ ports:
225
+ - "3838:3838"
226
+ volumes:
227
+ - ~/.copilot:/root/.copilot:ro
228
+ environment:
229
+ - NODE_ENV=production
230
+ - PORT=3838
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Platform-Specific Notes
236
+
237
+ ### macOS
238
+
239
+ ```bash
240
+ # Install Node.js via Homebrew (recommended)
241
+ brew install node
242
+
243
+ # Or download from nodejs.org
244
+ # Then install Copilot Session Viewer
245
+ npm install -g @qiaolei81/copilot-session-viewer
246
+ ```
247
+
248
+ ### Windows
249
+
250
+ ```powershell
251
+ # Install Node.js from nodejs.org
252
+ # Then install via npm in PowerShell/Command Prompt
253
+ npm install -g @qiaolei81/copilot-session-viewer
254
+ ```
255
+
256
+ **Windows-specific paths:**
257
+ - Sessions: `C:\Users\%USERNAME%\.copilot\session-state\`
258
+ - Global npm packages: `%APPDATA%\npm\`
259
+
260
+ ### Linux
261
+
262
+ ```bash
263
+ # Ubuntu/Debian
264
+ curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
265
+ sudo apt-get install -y nodejs
266
+
267
+ # CentOS/RHEL/Fedora
268
+ curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
269
+ sudo yum install -y nodejs
270
+
271
+ # Then install Copilot Session Viewer
272
+ npm install -g @qiaolei81/copilot-session-viewer
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Troubleshooting
278
+
279
+ ### Common Issues
280
+
281
+ **Port already in use:**
282
+ ```bash
283
+ # Use different port
284
+ PORT=3839 npx @qiaolei81/copilot-session-viewer
285
+ ```
286
+
287
+ **Permission errors (macOS/Linux):**
288
+ ```bash
289
+ # Fix npm permissions
290
+ npm config set prefix ~/.local
291
+ export PATH=~/.local/bin:$PATH
292
+ ```
293
+
294
+ **Session directory not found:**
295
+ ```bash
296
+ # Verify Copilot CLI is installed
297
+ copilot --version
298
+
299
+ # Run a test command to create the directory
300
+ copilot -p "test"
301
+ ```
302
+
303
+ **Node.js version issues:**
304
+ ```bash
305
+ # Install Node Version Manager (nvm)
306
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
307
+ nvm install --lts
308
+ nvm use --lts
309
+ ```
310
+
311
+ ### Getting Help
312
+
313
+ - **📖 Documentation**: [docs/TROUBLESHOOTING.md](TROUBLESHOOTING.md)
314
+ - **🐛 Bug Reports**: [GitHub Issues](https://github.com/qiaolei81/copilot-session-viewer/issues)
315
+ - **💬 Questions**: [GitHub Discussions](https://github.com/qiaolei81/copilot-session-viewer/discussions)
316
+
317
+ ---
318
+
319
+ ## Next Steps
320
+
321
+ After successful installation:
322
+
323
+ 1. **📖 Read the [API Documentation](API.md)** - Learn about available endpoints
324
+ 2. **🔧 Check [Development Guide](DEVELOPMENT.md)** - Set up for contributing
325
+ 3. **🚀 Start analyzing your sessions!** - Open http://localhost:3838
326
+
327
+ ---
328
+
329
+ **Installation complete!** 🎉 You're ready to explore your Copilot CLI sessions.
package/docs/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # 📖 Documentation
2
+
3
+ Complete documentation for Copilot Session Viewer.
4
+
5
+ ---
6
+
7
+ ## 🚀 Getting Started
8
+
9
+ - **[📦 Installation Guide](INSTALLATION.md)** - Complete setup instructions for all platforms
10
+ - **[🔧 Troubleshooting](TROUBLESHOOTING.md)** - Common issues and solutions
11
+
12
+ ---
13
+
14
+ ## 📚 User Guides
15
+
16
+ - **[🏠 Main README](../README.md)** - Project overview and quick start
17
+ - **[📋 Changelog](../CHANGELOG.md)** - Release history and version changes
18
+
19
+ ---
20
+
21
+ ## 🛠️ Developer Resources
22
+
23
+ - **[🔌 API Documentation](API.md)** - REST endpoints and data formats
24
+ - **[👩‍💻 Development Guide](DEVELOPMENT.md)** - Contributing and local development
25
+
26
+ ---
27
+
28
+ ## 📱 Features
29
+
30
+ ### Core Functionality
31
+ - **Session Management** - View, export, and import Copilot CLI sessions
32
+ - **Event Analysis** - Real-time parsing with filtering and search
33
+ - **Time Analysis** - Performance metrics and execution timelines
34
+ - **AI Insights** - LLM-powered session analysis
35
+
36
+ ### Technical Features
37
+ - **Virtual Scrolling** - Handle 1000+ events smoothly
38
+ - **Infinite Scroll** - Progressive loading for better performance
39
+ - **Responsive Design** - Works on desktop, tablet, and mobile
40
+ - **Dark Theme** - GitHub-inspired interface
41
+
42
+ ---
43
+
44
+ ## 🏗️ Architecture Overview
45
+
46
+ ```
47
+ Frontend (Vue 3 + EJS) ↔ Backend (Node.js + Express) ↔ File System
48
+ ```
49
+
50
+ **Data Flow:**
51
+ 1. **Sessions** stored in `~/.copilot/session-state/`
52
+ 2. **Backend** parses JSONL and YAML files
53
+ 3. **API** serves paginated session data
54
+ 4. **Frontend** renders with virtual scrolling
55
+
56
+ ---
57
+
58
+ ## 🎯 Use Cases
59
+
60
+ ### For Developers
61
+ - Debug Copilot CLI interactions
62
+ - Analyze conversation patterns
63
+ - Export sessions for collaboration
64
+ - Performance optimization insights
65
+
66
+ ### For Teams
67
+ - Share interesting sessions
68
+ - Analyze AI usage patterns
69
+ - Document problem-solving sessions
70
+ - Training and best practices
71
+
72
+ ### For Researchers
73
+ - Study human-AI interactions
74
+ - Analyze tool effectiveness
75
+ - Session data mining
76
+ - Conversation flow research
77
+
78
+ ---
79
+
80
+ ## 🔗 Quick Links
81
+
82
+ | Topic | Link | Description |
83
+ |-------|------|-------------|
84
+ | **Installation** | [INSTALLATION.md](INSTALLATION.md) | Setup for all platforms |
85
+ | **API Reference** | [API.md](API.md) | REST endpoints and examples |
86
+ | **Development** | [DEVELOPMENT.md](DEVELOPMENT.md) | Contributing guidelines |
87
+ | **Troubleshooting** | [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | Common issues and fixes |
88
+ | **Changelog** | [../CHANGELOG.md](../CHANGELOG.md) | Version history |
89
+ | **License** | [../LICENSE](../LICENSE) | MIT License terms |
90
+
91
+ ---
92
+
93
+ ## 📞 Support
94
+
95
+ - **🐛 Bug Reports**: [GitHub Issues](https://github.com/qiaolei81/copilot-session-viewer/issues)
96
+ - **💬 Questions**: [GitHub Discussions](https://github.com/qiaolei81/copilot-session-viewer/discussions)
97
+ - **📖 Documentation**: This directory
98
+ - **🚀 Quick Start**: [Main README](../README.md)
99
+
100
+ ---
101
+
102
+ **Happy exploring!** 🎉 Choose the documentation section that best fits your needs.