@meetstream/cli 0.1.1 → 0.2.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 +8 -0
- package/bin/meetstream.js +11 -3
- package/package.json +4 -3
- package/src/telemetry.js +52 -0
package/README.md
CHANGED
|
@@ -186,3 +186,11 @@ npm test # node --test, fully mocked (no network)
|
|
|
186
186
|
Docs: [docs.meetstream.ai](https://docs.meetstream.ai) · OpenAPI: [openapi.json](https://docs.meetstream.ai/openapi.json) · MCP server for AI agents: [@meetstream/mcp](https://github.com/meetstream-ai/meetstream-mcp) · Migrating from Recall.ai: [@meetstream/migrate](https://github.com/meetstream-ai/recall-meetstream-migration-kit)
|
|
187
187
|
|
|
188
188
|
MIT © MeetStream.ai
|
|
189
|
+
|
|
190
|
+
## Telemetry
|
|
191
|
+
|
|
192
|
+
The CLI sends **anonymous** usage events (which commands you run) to help us improve MeetStream. It never sends your API key, meeting URLs, transcripts, or any content. Disable it any time:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
export MEETSTREAM_TELEMETRY=0 # or the standard DO_NOT_TRACK=1
|
|
196
|
+
```
|
package/bin/meetstream.js
CHANGED
|
@@ -9,6 +9,7 @@ import { registerBotCommands } from '../src/commands/bot.js';
|
|
|
9
9
|
import { registerTranscriptCommands } from '../src/commands/transcript.js';
|
|
10
10
|
import { registerAuthCommands, registerCalendarCommands, registerMiaCommands } from '../src/commands/misc.js';
|
|
11
11
|
import { registerListenCommand } from '../src/commands/listen.js';
|
|
12
|
+
import { track, shutdownTelemetry } from '../src/telemetry.js';
|
|
12
13
|
|
|
13
14
|
const require = createRequire(import.meta.url);
|
|
14
15
|
const { version } = require('../package.json');
|
|
@@ -32,7 +33,14 @@ registerCalendarCommands(program, getClient);
|
|
|
32
33
|
registerMiaCommands(program, getClient);
|
|
33
34
|
registerListenCommand(program);
|
|
34
35
|
|
|
35
|
-
program.
|
|
36
|
-
|
|
37
|
-
process.exit(err.exitCode || 1);
|
|
36
|
+
program.hook('preAction', (thisCmd, actionCmd) => {
|
|
37
|
+
track('cli_command_run', { command: actionCmd.name(), version });
|
|
38
38
|
});
|
|
39
|
+
|
|
40
|
+
program.parseAsync(process.argv)
|
|
41
|
+
.then(() => shutdownTelemetry())
|
|
42
|
+
.catch(async (err) => {
|
|
43
|
+
await shutdownTelemetry();
|
|
44
|
+
fail(err.message);
|
|
45
|
+
process.exit(err.exitCode || 1);
|
|
46
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetstream/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Official MeetStream CLI
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Official MeetStream CLI \u2014 create meeting bots, fetch transcripts, and stream webhook events from your terminal. Zoom, Google Meet, Microsoft Teams.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"meetstream": "bin/meetstream.js"
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"node": ">=18.17"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"commander": "^15.0.0"
|
|
22
|
+
"commander": "^15.0.0",
|
|
23
|
+
"posthog-node": "^4.0.0"
|
|
23
24
|
},
|
|
24
25
|
"keywords": [
|
|
25
26
|
"meetstream",
|
package/src/telemetry.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anonymous, opt-out usage telemetry (PostHog).
|
|
3
|
+
* Captures ONLY command names + counts — never API keys, meeting URLs, transcripts,
|
|
4
|
+
* or any content. Disable with DO_NOT_TRACK=1 or MEETSTREAM_TELEMETRY=0.
|
|
5
|
+
* The project key is a PostHog *public* key.
|
|
6
|
+
*/
|
|
7
|
+
import crypto from 'node:crypto';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
|
|
10
|
+
const KEY = 'phc_oFCXdmvQVdgxSwQoCG2GCwupkmt3UqGovj4feMp5ZuCq';
|
|
11
|
+
const HOST = 'https://us.i.posthog.com';
|
|
12
|
+
|
|
13
|
+
let _client = null;
|
|
14
|
+
let _loaded = false;
|
|
15
|
+
|
|
16
|
+
export function telemetryEnabled() {
|
|
17
|
+
const dnt = process.env.DO_NOT_TRACK;
|
|
18
|
+
const mt = process.env.MEETSTREAM_TELEMETRY;
|
|
19
|
+
if (dnt === '1' || dnt === 'true') return false;
|
|
20
|
+
if (mt === '0' || mt === 'false' || mt === 'off') return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function anonId() {
|
|
25
|
+
try {
|
|
26
|
+
const raw = `${os.hostname()}|${os.userInfo().username || ''}|${os.homedir()}`;
|
|
27
|
+
return 'anon_' + crypto.createHash('sha256').update(raw).digest('hex').slice(0, 16);
|
|
28
|
+
} catch { return 'anon_unknown'; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function client() {
|
|
32
|
+
if (!telemetryEnabled()) return null;
|
|
33
|
+
if (_loaded) return _client;
|
|
34
|
+
_loaded = true;
|
|
35
|
+
try {
|
|
36
|
+
const { PostHog } = await import('posthog-node');
|
|
37
|
+
_client = new PostHog(KEY, { host: HOST, flushAt: 1, flushInterval: 0 });
|
|
38
|
+
} catch { _client = null; }
|
|
39
|
+
return _client;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function track(event, properties = {}) {
|
|
43
|
+
try {
|
|
44
|
+
const c = await client();
|
|
45
|
+
if (!c) return;
|
|
46
|
+
c.capture({ distinctId: anonId(), event, properties: { $lib: 'meetstream-cli', ...properties } });
|
|
47
|
+
} catch { /* telemetry must never throw */ }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function shutdownTelemetry() {
|
|
51
|
+
try { if (_client) await _client.shutdown(); } catch { /* ignore */ }
|
|
52
|
+
}
|