agentlytics 0.0.10 → 0.0.11

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 (3) hide show
  1. package/README.md +6 -0
  2. package/index.js +12 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -32,6 +32,12 @@ npx agentlytics
32
32
 
33
33
  Opens at **http://localhost:4637**. Requires Node.js ≥ 18, macOS.
34
34
 
35
+ To only build the cache database without starting the server:
36
+
37
+ ```bash
38
+ npx agentlytics --collect
39
+ ```
40
+
35
41
  For local development, run `npm run dev` from the repo root. That starts both the backend on `http://localhost:4637` and the Vite frontend on `http://localhost:5173`.
36
42
 
37
43
  ## Features
package/index.js CHANGED
@@ -9,17 +9,19 @@ const { execSync } = require('child_process');
9
9
  const HOME = os.homedir();
10
10
  const PORT = process.env.PORT || 4637;
11
11
  const noCache = process.argv.includes('--no-cache');
12
+ const collectOnly = process.argv.includes('--collect');
12
13
 
13
14
  console.log('');
14
15
  console.log(chalk.bold(' ⚡ Agentlytics'));
15
16
  console.log(chalk.dim(' Comprehensive analytics for your AI coding agents'));
17
+ if (collectOnly) console.log(chalk.cyan(' ⟳ Collect-only mode (no server)'));
16
18
  console.log('');
17
19
 
18
20
  // ── Build UI if not already built ──────────────────────────
19
21
  const publicIndex = path.join(__dirname, 'public', 'index.html');
20
22
  const uiDir = path.join(__dirname, 'ui');
21
23
 
22
- if (!fs.existsSync(publicIndex) && fs.existsSync(uiDir)) {
24
+ if (!collectOnly && !fs.existsSync(publicIndex) && fs.existsSync(uiDir)) {
23
25
  console.log(chalk.cyan(' ⟳ Building dashboard UI (first run)...'));
24
26
  try {
25
27
  const uiModules = path.join(uiDir, 'node_modules');
@@ -37,7 +39,7 @@ if (!fs.existsSync(publicIndex) && fs.existsSync(uiDir)) {
37
39
  console.log('');
38
40
  }
39
41
 
40
- if (!fs.existsSync(publicIndex)) {
42
+ if (!collectOnly && !fs.existsSync(publicIndex)) {
41
43
  console.error(chalk.red(' ✗ No built UI found at public/index.html'));
42
44
  console.error(chalk.dim(' Run: cd ui && npm install && npm run build'));
43
45
  process.exit(1);
@@ -104,6 +106,14 @@ console.log('');
104
106
  console.log(chalk.green(` ✓ Cache ready: ${result.total} chats, ${result.analyzed} analyzed, ${result.skipped} cached (${elapsed}s)`));
105
107
  console.log('');
106
108
 
109
+ // In collect-only mode, exit after cache is built
110
+ if (collectOnly) {
111
+ const cacheDbPath = path.join(os.homedir(), '.agentlytics', 'cache.db');
112
+ console.log(chalk.dim(` Cache file: ${cacheDbPath}`));
113
+ console.log('');
114
+ process.exit(0);
115
+ }
116
+
107
117
  // Start server
108
118
  const app = require('./server');
109
119
  app.listen(PORT, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentlytics",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Comprehensive analytics dashboard for AI coding agents — Cursor, Windsurf, Claude Code, VS Code Copilot, Zed, Antigravity, OpenCode, Command Code",
5
5
  "main": "index.js",
6
6
  "bin": {