@code-insights/cli 1.0.1 → 1.0.2
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 +8 -127
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,16 +21,6 @@ Verify it works:
|
|
|
21
21
|
code-insights --version
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
### Development Setup
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# From the repo root
|
|
28
|
-
cd cli
|
|
29
|
-
pnpm install
|
|
30
|
-
pnpm build
|
|
31
|
-
npm link # Makes `code-insights` available globally
|
|
32
|
-
```
|
|
33
|
-
|
|
34
24
|
## Commands
|
|
35
25
|
|
|
36
26
|
### `code-insights init`
|
|
@@ -38,18 +28,18 @@ npm link # Makes `code-insights` available globally
|
|
|
38
28
|
Configure Code Insights with your Firebase credentials.
|
|
39
29
|
|
|
40
30
|
```bash
|
|
41
|
-
# Quick setup — import directly from
|
|
31
|
+
# Quick setup — import directly from files (recommended)
|
|
42
32
|
code-insights init \
|
|
43
33
|
--from-json ~/Downloads/serviceAccountKey.json \
|
|
44
|
-
--web-config ~/Downloads/firebase-web-config.
|
|
34
|
+
--web-config ~/Downloads/firebase-web-config.js
|
|
45
35
|
|
|
46
36
|
# Interactive setup — prompts for each value
|
|
47
37
|
code-insights init
|
|
48
38
|
```
|
|
49
39
|
|
|
50
40
|
**Flags:**
|
|
51
|
-
- `--from-json <path>` — Path to the Firebase service account
|
|
52
|
-
- `--web-config <path>` — Path to the Firebase web SDK config
|
|
41
|
+
- `--from-json <path>` — Path to the Firebase service account key (downloaded from Firebase Console > Project Settings > Service Accounts)
|
|
42
|
+
- `--web-config <path>` — Path to the Firebase web SDK config (saved from Firebase Console > Project Settings > General > Your Apps). Accepts both JSON and the JavaScript snippet from Firebase.
|
|
53
43
|
|
|
54
44
|
You can use one flag, both, or neither. Any values not provided via flags will be collected interactively.
|
|
55
45
|
|
|
@@ -174,119 +164,10 @@ Sessions are automatically titled based on:
|
|
|
174
164
|
3. Session character detection (deep focus, bug hunt, etc.)
|
|
175
165
|
4. Fallback to timestamp
|
|
176
166
|
|
|
177
|
-
##
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
cli/
|
|
181
|
-
├── src/
|
|
182
|
-
│ ├── commands/
|
|
183
|
-
│ │ ├── init.ts # Interactive Firebase configuration
|
|
184
|
-
│ │ ├── sync.ts # Main sync logic
|
|
185
|
-
│ │ ├── connect.ts # Generate dashboard connection URL
|
|
186
|
-
│ │ ├── status.ts # Status display
|
|
187
|
-
│ │ ├── reset.ts # Clear all data
|
|
188
|
-
│ │ └── install-hook.ts # Hook management
|
|
189
|
-
│ ├── firebase/
|
|
190
|
-
│ │ └── client.ts # Firestore operations
|
|
191
|
-
│ ├── parser/
|
|
192
|
-
│ │ ├── jsonl.ts # JSONL file parsing
|
|
193
|
-
│ │ └── titles.ts # Title generation
|
|
194
|
-
│ ├── utils/
|
|
195
|
-
│ │ ├── config.ts # Config management
|
|
196
|
-
│ │ ├── device.ts # Device identification
|
|
197
|
-
│ │ └── firebase-json.ts # Firebase JSON validation & URL generation
|
|
198
|
-
│ ├── types.ts # TypeScript types
|
|
199
|
-
│ └── index.ts # CLI entry point
|
|
200
|
-
├── dist/ # Compiled output
|
|
201
|
-
├── package.json
|
|
202
|
-
└── tsconfig.json
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Development
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
pnpm dev # Watch mode — recompiles on save
|
|
209
|
-
pnpm build # One-time compile
|
|
210
|
-
pnpm lint # Run ESLint
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
The CLI is written in TypeScript with ES Modules and compiled to `dist/`. After `npm link`, changes rebuild automatically in watch mode.
|
|
167
|
+
## Contributing
|
|
214
168
|
|
|
215
|
-
See [CONTRIBUTING.md](
|
|
169
|
+
See [CONTRIBUTING.md](https://github.com/melagiri/code-insights/blob/master/CONTRIBUTING.md) for development setup, code style, and PR guidelines.
|
|
216
170
|
|
|
217
|
-
##
|
|
171
|
+
## License
|
|
218
172
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
### `projects`
|
|
222
|
-
```typescript
|
|
223
|
-
{
|
|
224
|
-
id: string; // Hash of git remote URL or path
|
|
225
|
-
name: string; // Project directory name
|
|
226
|
-
path: string; // Full path on syncing device
|
|
227
|
-
gitRemoteUrl: string | null;
|
|
228
|
-
projectIdSource: 'git-remote' | 'path-hash';
|
|
229
|
-
sessionCount: number;
|
|
230
|
-
lastActivity: Timestamp;
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### `sessions`
|
|
235
|
-
```typescript
|
|
236
|
-
{
|
|
237
|
-
id: string; // From JSONL filename
|
|
238
|
-
projectId: string;
|
|
239
|
-
projectName: string;
|
|
240
|
-
projectPath: string;
|
|
241
|
-
gitRemoteUrl: string | null;
|
|
242
|
-
summary: string | null;
|
|
243
|
-
generatedTitle: string | null;
|
|
244
|
-
titleSource: 'claude' | 'user_message' | 'insight' | 'character' | 'fallback' | null;
|
|
245
|
-
sessionCharacter: 'deep_focus' | 'bug_hunt' | 'feature_build' | 'exploration' | 'refactor' | 'learning' | 'quick_task' | null;
|
|
246
|
-
startedAt: Timestamp;
|
|
247
|
-
endedAt: Timestamp;
|
|
248
|
-
messageCount: number;
|
|
249
|
-
userMessageCount: number;
|
|
250
|
-
assistantMessageCount: number;
|
|
251
|
-
toolCallCount: number;
|
|
252
|
-
gitBranch: string | null;
|
|
253
|
-
claudeVersion: string | null;
|
|
254
|
-
deviceId: string;
|
|
255
|
-
deviceHostname: string;
|
|
256
|
-
devicePlatform: string;
|
|
257
|
-
syncedAt: Timestamp; // Server timestamp
|
|
258
|
-
// Usage stats (present when token data is available)
|
|
259
|
-
totalInputTokens?: number;
|
|
260
|
-
totalOutputTokens?: number;
|
|
261
|
-
cacheCreationTokens?: number;
|
|
262
|
-
cacheReadTokens?: number;
|
|
263
|
-
estimatedCostUsd?: number;
|
|
264
|
-
modelsUsed?: string[];
|
|
265
|
-
primaryModel?: string;
|
|
266
|
-
usageSource?: 'jsonl';
|
|
267
|
-
}
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### `messages`
|
|
271
|
-
```typescript
|
|
272
|
-
{
|
|
273
|
-
id: string;
|
|
274
|
-
sessionId: string;
|
|
275
|
-
type: 'user' | 'assistant' | 'system';
|
|
276
|
-
content: string; // Max 10,000 chars (truncated)
|
|
277
|
-
thinking: string | null; // Extracted thinking content (max 5,000 chars)
|
|
278
|
-
toolCalls: Array<{ id: string; name: string; input: string }>; // Input max 1,000 chars
|
|
279
|
-
toolResults: Array<{ toolUseId: string; output: string }>; // Output max 2,000 chars
|
|
280
|
-
timestamp: Timestamp;
|
|
281
|
-
parentId: string | null;
|
|
282
|
-
// Per-message usage (assistant messages only)
|
|
283
|
-
usage?: {
|
|
284
|
-
inputTokens: number;
|
|
285
|
-
outputTokens: number;
|
|
286
|
-
cacheCreationTokens: number;
|
|
287
|
-
cacheReadTokens: number;
|
|
288
|
-
model: string;
|
|
289
|
-
estimatedCostUsd: number;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
```
|
|
173
|
+
MIT License — see [LICENSE](https://github.com/melagiri/code-insights/blob/master/LICENSE) for details.
|