@mahe_pkm/buzl-capi 0.1.2 → 0.1.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,842 @@
1
+ # 📖 Buzl Tracker & Conversions API (CAPI) — User Handbook & Cross-Platform Command Reference
2
+
3
+ Welcome to the official **Buzl Tracker & Conversions API (`@mahe_pkm/buzl-capi`) User Handbook**. This document provides an exhaustive, copy-ready guide for deploying, managing, testing, and rolling back conversion tracking across landing pages and websites.
4
+
5
+ Every command in this handbook is provided in **isolated, blocked command snippets** tailored specifically for:
6
+ - 🪟 **Windows (PowerShell)**
7
+ - 🪟 **Windows (Command Prompt / CMD)**
8
+ - 🍎 **macOS (Terminal / zsh / bash)**
9
+ - 🐧 **Linux (bash / sh)**
10
+
11
+ ---
12
+
13
+ ## 📑 Table of Contents
14
+
15
+ 1. [Architectural Overview](#1-architectural-overview)
16
+ 2. [Prerequisites & Environment Setup](#2-prerequisites--environment-setup)
17
+ - [Windows Setup](#windows-setup)
18
+ - [macOS Setup](#macos-setup)
19
+ - [Linux Setup](#linux-setup)
20
+ 3. [NPM Package Installation, Updating & Version Management](#3-npm-package-installation-updating--version-management)
21
+ - [Zero-Install Execution via npx](#31-zero-install-execution-via-npx-recommended)
22
+ - [Global CLI Installation & Updating](#32-global-cli-installation--updating)
23
+ - [Updating as Local Project Dependency](#33-updating-as-a-local-project-dependency)
24
+ - [Author Publishing & Release Workflow (with 2FA / OTP)](#34-author-publishing--release-workflow-with-2fa--otp)
25
+ 4. [CLI Reference Matrix & Syntax Standards](#4-cli-reference-matrix--syntax-standards)
26
+ 5. [OS-Specific Command Execution Handbook](#5-os-specific-command-execution-handbook)
27
+ - [Command 1: Interactive Terminal Setup Wizard](#command-1-interactive-terminal-setup-wizard)
28
+ - [Command 2: Local Web GUI Server (Port 3333)](#command-2-local-web-gui-server-port-3333)
29
+ - [Command 3: Create Point-in-Time Snapshot Backup](#command-3-create-point-in-time-snapshot-backup)
30
+ - [Command 4: List Saved Snapshots on Disk](#command-4-list-saved-snapshots-on-disk)
31
+ - [Command 5: Restore / Rollback to Snapshot](#command-5-restore--rollback-to-snapshot)
32
+ - [Command 6: Clean Tracking Uninstallation](#command-6-clean-tracking-uninstallation)
33
+ - [Command 7: Open User Handbook in Browser](#command-7-open-user-handbook-in-browser)
34
+ - [Command 8: Display CLI Help Manual](#command-8-display-cli-help-manual)
35
+ 6. [Daemon & Background Service Execution](#6-daemon--background-service-execution)
36
+ - [Running as Background Daemon on Windows](#running-as-background-daemon-on-windows)
37
+ - [Running as Background Daemon on macOS](#running-as-background-daemon-on-macos)
38
+ - [Running as Background Daemon on Linux](#running-as-background-daemon-on-linux)
39
+ 7. [Web GUI Dashboard & Automated Verification Reports](#7-web-gui-dashboard--automated-verification-reports)
40
+ - [Live State Inspection & Matrix](#live-state-inspection--matrix)
41
+ - [Single-Form Independent Testing](#single-form-independent-testing)
42
+ - [CAPI Telemetry Inspector & Structured Console Log](#capi-telemetry-inspector--structured-console-log)
43
+ - [Exporting Automated Verification Reports (PDF & JSON)](#exporting-automated-verification-reports-pdf--json)
44
+ 8. [Google Sheets CRM Engine Deployment Guide](#8-google-sheets-crm-engine-deployment-guide)
45
+ 9. [Cross-Platform Troubleshooting & Diagnostics](#9-cross-platform-troubleshooting--diagnostics)
46
+
47
+ ---
48
+
49
+ ## 1. Architectural Overview
50
+
51
+ `@mahe_pkm/buzl-capi` is a zero-external-dependency Node.js suite designed to eliminate manual tracking tag insertion and brittle third-party connectors.
52
+
53
+ ```
54
+ ┌─────────────────────────────────────────────────────────────┐
55
+ │ WEBSITE VISITOR ACTION │
56
+ │ HTML Form Submit • WhatsApp Click • Call CTA │
57
+ └──────────────────────────────┬──────────────────────────────┘
58
+ │
59
+ ▼
60
+ ┌─────────────────────────────────────────────────────────────┐
61
+ │ buzl-tracking.js (Client Runtime) │
62
+ │ - Intercepts form submissions without page reload │
63
+ │ - Captures UTM parameters (source, medium, campaign) │
64
+ │ - Captures Ad Click IDs (gclid, fbclid, _fbc, _fbp) │
65
+ │ - Generates cross-channel deduplicated UUID leadId │
66
+ └──────┬───────────────────────┬───────────────────────┬──────┘
67
+ │ │ │
68
+ ▼ ▼ ▼
69
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
70
+ │ Google Tag │ │ Meta Pixel │ │ Google Sheet │
71
+ │ Manager │ │ & CAPI │ │ CRM Sync │
72
+ │ dataLayer │ │ fbq 'Lead' │ │ Apps Script │
73
+ │ Push Event │ │ Server Event │ │ Top Row (2) │
74
+ └──────────────┘ └──────────────┘ └──────────────┘
75
+ ```
76
+
77
+ ### Key Principles
78
+ - **AST-Safe Injection**: Injects GTM, Meta Pixel, and runtime scripts into HTML `<head>` and `<body>` without re-formatting or breaking existing code.
79
+ - **Unified `.buzl/snapshots/` Storage**: Automatically takes SHA-1 content-hashed backups before modifying any files, enabling instant, guaranteed rollbacks.
80
+ - **Zero Third-Party Dependencies**: The entire CLI and GUI run on native Node.js core libraries (`http`, `fs`, `path`, `crypto`, `node:assert`).
81
+
82
+ ---
83
+
84
+ ## 2. Prerequisites & Environment Setup
85
+
86
+ `@mahe_pkm/buzl-capi` requires **Node.js v16.0.0 or higher** (v18, v20, v22, and v24 LTS recommended).
87
+
88
+ ### Windows Setup
89
+
90
+ #### 1. Verify or Install Node.js via Windows Terminal / PowerShell:
91
+ ```powershell
92
+ node -v
93
+ npm -v
94
+ ```
95
+
96
+ If Node.js is not installed:
97
+ ```powershell
98
+ winget install OpenJS.NodeJS.LTS
99
+ ```
100
+
101
+ #### 2. Set PowerShell Execution Policy (if script execution is restricted):
102
+ ```powershell
103
+ Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
104
+ ```
105
+
106
+ ---
107
+
108
+ ### macOS Setup
109
+
110
+ #### 1. Verify or Install Node.js via Terminal (zsh):
111
+ ```bash
112
+ node -v
113
+ npm -v
114
+ ```
115
+
116
+ If Node.js is not installed:
117
+ ```bash
118
+ brew install node
119
+ ```
120
+ *(Or install via `nvm install --lts`)*
121
+
122
+ ---
123
+
124
+ ### Linux Setup (Ubuntu / Debian / CentOS / Arch)
125
+
126
+ #### 1. Verify or Install Node.js:
127
+ ```bash
128
+ node -v
129
+ npm -v
130
+ ```
131
+
132
+ If Node.js is not installed (Ubuntu / Debian):
133
+ ```bash
134
+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
135
+ sudo apt-get install -y nodejs
136
+ ```
137
+
138
+ Arch Linux:
139
+ ```bash
140
+ sudo pacman -S nodejs npm
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 3. NPM Package Installation, Updating & Version Management
146
+
147
+ This section covers how to install, update, and manage `@mahe_pkm/buzl-capi` across all operating systems, as well as the release publishing workflow for package maintainers.
148
+
149
+ ### 3.1. Zero-Install Execution via `npx` (Recommended)
150
+
151
+ `npx` downloads and executes the package without adding global files. However, `npx` aggressively caches packages. If a new version was recently published, `npx` might run an older cached version unless you append `@latest`.
152
+
153
+ #### 🪟 Windows (PowerShell & CMD)
154
+ ```powershell
155
+ # Always run latest version (bypassing npx cache)
156
+ npx @mahe_pkm/buzl-capi@latest
157
+
158
+ # Launch GUI directly with latest version
159
+ npx @mahe_pkm/buzl-capi@latest --gui
160
+
161
+ # Target specific folder
162
+ npx @mahe_pkm/buzl-capi@latest "C:\Projects\MyLandingPage" --gui
163
+ ```
164
+
165
+ #### 🍎 macOS (Terminal / zsh) & 🐧 Linux (bash)
166
+ ```bash
167
+ # Always run latest version (bypassing npx cache)
168
+ npx @mahe_pkm/buzl-capi@latest
169
+
170
+ # Launch GUI directly with latest version
171
+ npx @mahe_pkm/buzl-capi@latest --gui
172
+
173
+ # Target specific folder
174
+ npx @mahe_pkm/buzl-capi@latest ~/Projects/MyLandingPage --gui
175
+ ```
176
+
177
+ ---
178
+
179
+ ### 3.2. Global CLI Installation & Updating
180
+
181
+ Installing globally gives you direct access to the `buzl-tracker` and `buzl-capi` commands in any terminal.
182
+
183
+ #### 🪟 Windows (PowerShell / CMD Run as Administrator if required)
184
+ ```powershell
185
+ # Install globally
186
+ npm install -g @mahe_pkm/buzl-capi@latest
187
+
188
+ # Update existing global installation
189
+ npm update -g @mahe_pkm/buzl-capi
190
+
191
+ # Verify installed version
192
+ buzl-tracker --help
193
+ buzl-capi --help
194
+ ```
195
+
196
+ #### 🍎 macOS (Terminal / zsh) & 🐧 Linux (bash)
197
+ ```bash
198
+ # Install globally
199
+ npm install -g @mahe_pkm/buzl-capi@latest
200
+
201
+ # Update existing global installation
202
+ npm update -g @mahe_pkm/buzl-capi
203
+
204
+ # If permission error occurs (EACCES), configure npm prefix without sudo:
205
+ mkdir -p ~/.npm-global
206
+ npm config set prefix ~/.npm-global
207
+ export PATH=$PATH:~/.npm-global/bin
208
+
209
+ # Verify installed version
210
+ buzl-tracker --help
211
+ ```
212
+
213
+ ---
214
+
215
+ ### 3.3. Updating as a Local Project Dependency
216
+
217
+ If you installed the package inside your web project's `package.json`:
218
+
219
+ ```bash
220
+ # Check if a newer version is available
221
+ npm outdated @mahe_pkm/buzl-capi
222
+
223
+ # Update to latest version and record in package.json
224
+ npm install @mahe_pkm/buzl-capi@latest
225
+
226
+ # Or update all dependencies within semantic range
227
+ npm update @mahe_pkm/buzl-capi
228
+ ```
229
+
230
+ ---
231
+
232
+ ### 3.4. Author Publishing & Release Workflow (with 2FA / OTP)
233
+
234
+ For maintainers publishing updates to the npm registry:
235
+
236
+ #### Step 1: Bump Version
237
+ ```bash
238
+ # Patch update (e.g. 0.1.3 -> 0.1.4)
239
+ npm version patch
240
+
241
+ # Minor update (e.g. 0.1.4 -> 0.2.0)
242
+ npm version minor
243
+
244
+ # Major update (e.g. 0.2.0 -> 1.0.0)
245
+ npm version major
246
+ ```
247
+
248
+ #### Step 2: Push Commits & Git Tags
249
+ ```bash
250
+ git push origin main --tags
251
+ ```
252
+
253
+ #### Step 3: Publish to NPM Registry
254
+ If your npm account has Two-Factor Authentication (2FA) enabled, npm will return `npm error code EOTP`. Supply your 6-digit authenticator code via `--otp`:
255
+
256
+ #### 🪟 Windows (PowerShell)
257
+ ```powershell
258
+ # Publish with 2FA code and explicit latest tag
259
+ npm publish --tag latest --otp=123456
260
+ ```
261
+
262
+ #### 🍎 macOS / 🐧 Linux
263
+ ```bash
264
+ # Publish with 2FA code and explicit latest tag
265
+ npm publish --tag latest --otp=123456
266
+ ```
267
+
268
+ > [!IMPORTANT]
269
+ > **Why `--tag latest` is required:**
270
+ > When publishing a package where earlier versions (e.g. `1.0.1`) were previously registered, npm will block `0.1.x` from implicitly claiming the `latest` pointer. Specifying `--tag latest` ensures that `npx @mahe_pkm/buzl-capi` and `npm install` immediately resolve to your new release.
271
+
272
+ ---
273
+
274
+ ## 4. CLI Reference Matrix & Syntax Standards
275
+
276
+ | Command / Flag | Short Flag | Positional Argument | Description |
277
+ | :--- | :--- | :--- | :--- |
278
+ | `npx @mahe_pkm/buzl-capi` | — | `[dir]` | Launches the interactive terminal wizard. |
279
+ | `--gui` | `-g` | `[dir]` | Launches the local Web GUI dashboard on port 3333. |
280
+ | `--backup [name]` | `-b` | `[dir]` | Creates a timestamped SHA-1 snapshot backup. |
281
+ | `--list-backups` | — | `[dir]` | Displays all saved point-in-time snapshots for the site. |
282
+ | `--restore [name]` | `-r`, `--rollback` | `[dir]` | Restores files to a named snapshot (or latest). |
283
+ | `--uninstall` | `-u` | `[dir]` | Cleanly removes all injected tracking code from site. |
284
+ | `--handbook` | — | — | Opens the printable User Handbook in default browser. |
285
+ | `--help` | `-h` | — | Displays the command-line usage manual. |
286
+
287
+ > [!TIP]
288
+ > Both package names are binary-aliased: you can run `npx @mahe_pkm/buzl-capi` or `npx buzl-tracker` interchangeably.
289
+
290
+ ---
291
+
292
+ ## 5. OS-Specific Command Execution Handbook
293
+
294
+ ---
295
+
296
+ ### Command 1: Interactive Terminal Setup Wizard
297
+
298
+ Walks step-by-step through GTM, Meta Pixel/CAPI, Google Sheets Webhook, and WhatsApp configuration directly in the terminal with input validation and instant automated verification.
299
+
300
+ #### 🪟 Windows (PowerShell)
301
+ ```powershell
302
+ # Run in current folder
303
+ npx @mahe_pkm/buzl-capi
304
+
305
+ # Run against a specific directory
306
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage"
307
+ ```
308
+
309
+ #### 🪟 Windows (Command Prompt / CMD)
310
+ ```cmd
311
+ rem Run in current folder
312
+ npx @mahe_pkm/buzl-capi
313
+
314
+ rem Run against a specific directory
315
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage"
316
+ ```
317
+
318
+ #### 🍎 macOS (Terminal / zsh)
319
+ ```bash
320
+ # Run in current folder
321
+ npx @mahe_pkm/buzl-capi
322
+
323
+ # Run against a specific directory
324
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage
325
+ ```
326
+
327
+ #### 🐧 Linux (bash / sh)
328
+ ```bash
329
+ # Run in current folder
330
+ npx @mahe_pkm/buzl-capi
331
+
332
+ # Run against a specific directory
333
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page
334
+ ```
335
+
336
+ ---
337
+
338
+ ### Command 2: Local Web GUI Server (Port 3333)
339
+
340
+ Launches the zero-dependency browser dashboard on `http://localhost:3333` with live site scanning, visual service toggles, form testing, and report exports.
341
+
342
+ #### 🪟 Windows (PowerShell)
343
+ ```powershell
344
+ # Launch GUI for current folder
345
+ npx @mahe_pkm/buzl-capi --gui
346
+
347
+ # Launch GUI for a specific folder
348
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --gui
349
+ ```
350
+
351
+ #### 🪟 Windows (Command Prompt / CMD)
352
+ ```cmd
353
+ rem Launch GUI for current folder
354
+ npx @mahe_pkm/buzl-capi --gui
355
+
356
+ rem Launch GUI for a specific folder
357
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --gui
358
+ ```
359
+
360
+ #### 🍎 macOS (Terminal / zsh)
361
+ ```bash
362
+ # Launch GUI for current folder
363
+ npx @mahe_pkm/buzl-capi --gui
364
+
365
+ # Launch GUI for a specific folder
366
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage --gui
367
+ ```
368
+
369
+ #### 🐧 Linux (bash / sh)
370
+ ```bash
371
+ # Launch GUI for current folder
372
+ npx @mahe_pkm/buzl-capi --gui
373
+
374
+ # Launch GUI for a specific folder
375
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page --gui
376
+ ```
377
+
378
+ ---
379
+
380
+ ### Command 3: Create Point-in-Time Snapshot Backup
381
+
382
+ Creates an immutable snapshot backup inside `.buzl/snapshots/<timestamp>_<hash>/` before any file modifications.
383
+
384
+ #### 🪟 Windows (PowerShell)
385
+ ```powershell
386
+ # Create an automated snapshot
387
+ npx @mahe_pkm/buzl-capi --backup
388
+
389
+ # Create a named snapshot
390
+ npx @mahe_pkm/buzl-capi --backup "Pre-Launch Baseline"
391
+
392
+ # Create a named snapshot for a specific path
393
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --backup "Client Approval v1"
394
+ ```
395
+
396
+ #### 🪟 Windows (Command Prompt / CMD)
397
+ ```cmd
398
+ rem Create an automated snapshot
399
+ npx @mahe_pkm/buzl-capi --backup
400
+
401
+ rem Create a named snapshot
402
+ npx @mahe_pkm/buzl-capi --backup "Pre-Launch Baseline"
403
+
404
+ rem Create a named snapshot for a specific path
405
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --backup "Client Approval v1"
406
+ ```
407
+
408
+ #### 🍎 macOS (Terminal / zsh)
409
+ ```bash
410
+ # Create an automated snapshot
411
+ npx @mahe_pkm/buzl-capi --backup
412
+
413
+ # Create a named snapshot
414
+ npx @mahe_pkm/buzl-capi --backup "Pre-Launch Baseline"
415
+
416
+ # Create a named snapshot for a specific path
417
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage --backup "Client Approval v1"
418
+ ```
419
+
420
+ #### 🐧 Linux (bash / sh)
421
+ ```bash
422
+ # Create an automated snapshot
423
+ npx @mahe_pkm/buzl-capi --backup
424
+
425
+ # Create a named snapshot
426
+ npx @mahe_pkm/buzl-capi --backup "Pre-Launch Baseline"
427
+
428
+ # Create a named snapshot for a specific path
429
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page --backup "Client Approval v1"
430
+ ```
431
+
432
+ ---
433
+
434
+ ### Command 4: List Saved Snapshots on Disk
435
+
436
+ Lists all point-in-time snapshots stored in `.buzl/snapshots/` with timestamps, cryptographic SHA-1 hashes, and file counts.
437
+
438
+ #### 🪟 Windows (PowerShell)
439
+ ```powershell
440
+ # List snapshots in current folder
441
+ npx @mahe_pkm/buzl-capi --list-backups
442
+
443
+ # List snapshots for a target folder
444
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --list-backups
445
+ ```
446
+
447
+ #### 🪟 Windows (Command Prompt / CMD)
448
+ ```cmd
449
+ rem List snapshots in current folder
450
+ npx @mahe_pkm/buzl-capi --list-backups
451
+
452
+ rem List snapshots for a target folder
453
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --list-backups
454
+ ```
455
+
456
+ #### 🍎 macOS (Terminal / zsh)
457
+ ```bash
458
+ # List snapshots in current folder
459
+ npx @mahe_pkm/buzl-capi --list-backups
460
+
461
+ # List snapshots for a target folder
462
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage --list-backups
463
+ ```
464
+
465
+ #### 🐧 Linux (bash / sh)
466
+ ```bash
467
+ # List snapshots in current folder
468
+ npx @mahe_pkm/buzl-capi --list-backups
469
+
470
+ # List snapshots for a target folder
471
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page --list-backups
472
+ ```
473
+
474
+ ---
475
+
476
+ ### Command 5: Restore / Rollback to Snapshot
477
+
478
+ Reverts all HTML files in the project to an earlier snapshot state. If no name is provided, rolls back to the most recent snapshot (`latest`).
479
+
480
+ #### 🪟 Windows (PowerShell)
481
+ ```powershell
482
+ # Restore latest snapshot
483
+ npx @mahe_pkm/buzl-capi --restore
484
+
485
+ # Restore a specific named snapshot
486
+ npx @mahe_pkm/buzl-capi --restore "Pre-Launch Baseline"
487
+
488
+ # Restore target directory to named snapshot
489
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --restore "Pre-Launch Baseline"
490
+ ```
491
+
492
+ #### 🪟 Windows (Command Prompt / CMD)
493
+ ```cmd
494
+ rem Restore latest snapshot
495
+ npx @mahe_pkm/buzl-capi --restore
496
+
497
+ rem Restore a specific named snapshot
498
+ npx @mahe_pkm/buzl-capi --restore "Pre-Launch Baseline"
499
+
500
+ rem Restore target directory to named snapshot
501
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --restore "Pre-Launch Baseline"
502
+ ```
503
+
504
+ #### 🍎 macOS (Terminal / zsh)
505
+ ```bash
506
+ # Restore latest snapshot
507
+ npx @mahe_pkm/buzl-capi --restore
508
+
509
+ # Restore a specific named snapshot
510
+ npx @mahe_pkm/buzl-capi --restore "Pre-Launch Baseline"
511
+
512
+ # Restore target directory to named snapshot
513
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage --restore "Pre-Launch Baseline"
514
+ ```
515
+
516
+ #### 🐧 Linux (bash / sh)
517
+ ```bash
518
+ # Restore latest snapshot
519
+ npx @mahe_pkm/buzl-capi --restore
520
+
521
+ # Restore a specific named snapshot
522
+ npx @mahe_pkm/buzl-capi --restore "Pre-Launch Baseline"
523
+
524
+ # Restore target directory to named snapshot
525
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page --restore "Pre-Launch Baseline"
526
+ ```
527
+
528
+ ---
529
+
530
+ ### Command 6: Clean Tracking Uninstallation
531
+
532
+ Completely and cleanly strips all injected GTM snippets, Meta Pixel scripts, noscript tags, runtime tracker links (`buzl-tracking.js`), and `data-buzl-track` form attributes from all HTML files.
533
+
534
+ #### 🪟 Windows (PowerShell)
535
+ ```powershell
536
+ # Uninstall from current site
537
+ npx @mahe_pkm/buzl-capi --uninstall
538
+
539
+ # Uninstall from target site
540
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --uninstall
541
+ ```
542
+
543
+ #### 🪟 Windows (Command Prompt / CMD)
544
+ ```cmd
545
+ rem Uninstall from current site
546
+ npx @mahe_pkm/buzl-capi --uninstall
547
+
548
+ rem Uninstall from target site
549
+ npx @mahe_pkm/buzl-capi "C:\Projects\MyLandingPage" --uninstall
550
+ ```
551
+
552
+ #### 🍎 macOS (Terminal / zsh)
553
+ ```bash
554
+ # Uninstall from current site
555
+ npx @mahe_pkm/buzl-capi --uninstall
556
+
557
+ # Uninstall from target site
558
+ npx @mahe_pkm/buzl-capi ~/Projects/MyLandingPage --uninstall
559
+ ```
560
+
561
+ #### 🐧 Linux (bash / sh)
562
+ ```bash
563
+ # Uninstall from current site
564
+ npx @mahe_pkm/buzl-capi --uninstall
565
+
566
+ # Uninstall from target site
567
+ npx @mahe_pkm/buzl-capi /var/www/html/my-landing-page --uninstall
568
+ ```
569
+
570
+ ---
571
+
572
+ ### Command 7: Open User Handbook in Browser
573
+
574
+ Opens the standalone printable HTML handbook in your default web browser for viewing or saving as PDF.
575
+
576
+ #### 🪟 Windows (PowerShell)
577
+ ```powershell
578
+ npx @mahe_pkm/buzl-capi --handbook
579
+ ```
580
+
581
+ #### 🪟 Windows (Command Prompt / CMD)
582
+ ```cmd
583
+ npx @mahe_pkm/buzl-capi --handbook
584
+ ```
585
+
586
+ #### 🍎 macOS (Terminal / zsh)
587
+ ```bash
588
+ npx @mahe_pkm/buzl-capi --handbook
589
+ ```
590
+
591
+ #### 🐧 Linux (bash / sh)
592
+ ```bash
593
+ npx @mahe_pkm/buzl-capi --handbook
594
+ ```
595
+
596
+ ---
597
+
598
+ ### Command 8: Display CLI Help Manual
599
+
600
+ Displays the command-line arguments, options, and usage synopsis.
601
+
602
+ #### 🪟 Windows (PowerShell)
603
+ ```powershell
604
+ npx @mahe_pkm/buzl-capi --help
605
+ ```
606
+
607
+ #### 🪟 Windows (Command Prompt / CMD)
608
+ ```cmd
609
+ npx @mahe_pkm/buzl-capi --help
610
+ ```
611
+
612
+ #### 🍎 macOS (Terminal / zsh)
613
+ ```bash
614
+ npx @mahe_pkm/buzl-capi --help
615
+ ```
616
+
617
+ #### 🐧 Linux (bash / sh)
618
+ ```bash
619
+ npx @mahe_pkm/buzl-capi --help
620
+ ```
621
+
622
+ ---
623
+
624
+ ## 6. Daemon & Background Service Execution
625
+
626
+ When running `@mahe_pkm/buzl-capi --gui` as a persistent background daemon for local development teams or staging servers:
627
+
628
+ ### Running as Background Daemon on Windows
629
+
630
+ #### PowerShell:
631
+ ```powershell
632
+ # Start GUI in background (hidden window)
633
+ Start-Process -FilePath "npx" -ArgumentList "@mahe_pkm/buzl-capi --gui" -WindowStyle Hidden
634
+
635
+ # Check if running on port 3333
636
+ Get-NetTCPConnection -LocalPort 3333 -ErrorAction SilentlyContinue
637
+
638
+ # Stop background GUI
639
+ Stop-Process -Id (Get-NetTCPConnection -LocalPort 3333).OwningProcess -Force
640
+ ```
641
+
642
+ ---
643
+
644
+ ### Running as Background Daemon on macOS
645
+
646
+ #### Terminal (zsh):
647
+ ```bash
648
+ # Start in background with logging
649
+ nohup npx @mahe_pkm/buzl-capi --gui > ~/.buzl-gui.log 2>&1 &
650
+
651
+ # Inspect live logs
652
+ tail -f ~/.buzl-gui.log
653
+
654
+ # Stop background GUI
655
+ kill $(lsof -t -i:3333)
656
+ ```
657
+
658
+ ---
659
+
660
+ ### Running as Background Daemon on Linux
661
+
662
+ #### Terminal (bash / nohup):
663
+ ```bash
664
+ # Start in background with logging
665
+ nohup npx @mahe_pkm/buzl-capi /var/www/html --gui > /var/log/buzl-gui.log 2>&1 &
666
+
667
+ # Check running process on port 3333
668
+ sudo ss -tulpn | grep :3333
669
+
670
+ # Stop background GUI
671
+ sudo kill $(lsof -t -i:3333)
672
+ ```
673
+
674
+ #### Systemd Service Unit (Optional Production Setup):
675
+ Save to `/etc/systemd/system/buzl-tracker.service`:
676
+ ```ini
677
+ [Unit]
678
+ Description=Buzl Tracker & CAPI GUI Service
679
+ After=network.target
680
+
681
+ [Service]
682
+ Type=simple
683
+ User=www-data
684
+ WorkingDirectory=/var/www/html
685
+ ExecStart=/usr/bin/npx @mahe_pkm/buzl-capi --gui
686
+ Restart=on-failure
687
+
688
+ [Install]
689
+ WantedBy=multi-user.target
690
+ ```
691
+ Activate service:
692
+ ```bash
693
+ sudo systemctl daemon-reload
694
+ sudo systemctl enable buzl-tracker
695
+ sudo systemctl start buzl-tracker
696
+ ```
697
+
698
+ ---
699
+
700
+ ## 7. Web GUI Dashboard & Automated Verification Reports
701
+
702
+ The Web GUI (`http://localhost:3333`) provides complete visual management styled under the **Locations Design System**:
703
+
704
+ ### Live State Inspection & Matrix
705
+ - **Target Workspace Path**: Displays the active inspected directory.
706
+ - **Active Service Matrix**: Visual pills showing whether GTM, Meta Pixel, Buzl CAPI, Google Sheets, or Zoho are configured or active.
707
+ - **Individual Service Removal**: Direct **"Remove"** buttons on each active service card to selectively strip trackers (e.g. remove GTM while preserving Meta Pixel).
708
+
709
+ ### Single-Form Independent Testing
710
+ - Discovered forms are listed by archetype and selector (`#contactForm`, `.lead-form`).
711
+ - Click **"Test Form"** on any discovered form to dispatch a live payload directly through active channels with immediate status feedback.
712
+
713
+ ### CAPI Telemetry Inspector & Structured Console Log
714
+ When running verification or dispatching test leads, the GUI streams the live CAPI audit log formatted to match the staging console layout:
715
+
716
+ ```
717
+ ============================================================
718
+ BUZL CAPI LIVE DISPATCH & SUBMISSION AUDIT
719
+ ============================================================
720
+ Timestamp: 2026-09-14T13:13:45.146Z
721
+ [Executing Staging Lead Submissions]
722
+
723
+ - Staging URL: http://localhost:3333/
724
+ - CAPI Target: https://web.gobuzl.com/api/v1/capi/events
725
+ - Domain Label: my-landing-page
726
+ - Generated LeadId: my-landing-page-f0-1789391625146
727
+ - Contact Data: {"name":"Test Lead","phone":"919876543210","location":""}
728
+ - Response Status: 201 Created
729
+ - DB Record Created: my-landing-page-f0-1789391625146
730
+ - Telemetry Latency: 182ms
731
+ - Verification Ack: ACK_OK (Acknowledged)
732
+
733
+ ------------------------------------------------------------
734
+ CAPI VERIFICATION RESULT: 100% SUCCESS (201 CREATED)
735
+ ============================================================
736
+ ```
737
+
738
+ ### Exporting Automated Verification Reports (PDF & JSON)
739
+
740
+ 1. **JSON Export (`#btnExportJson`)**:
741
+ - Saves `buzl-verification-report-[timestamp].json` containing:
742
+ - Compliance summary & pass rate.
743
+ - Active project configuration state.
744
+ - Complete list of automated check results.
745
+ - Full CAPI telemetry payload, response, and `formattedAuditLog`.
746
+ 2. **Printable PDF Export (`#btnExportPdf`)**:
747
+ - Formats a clean A4 letterhead audit report.
748
+ - Triggers native browser print via an isolated, hidden iframe.
749
+ - Text is 100% selectable and copyable vector text.
750
+
751
+ ---
752
+
753
+ ## 8. Google Sheets CRM Engine Deployment Guide
754
+
755
+ `buzl-tracker` includes an enterprise-ready Google Apps Script CRM template (`Buzl_GoogleAppsScript_Template.gs`) with **zero monthly subscription fees**:
756
+
757
+ ### 30-Second Setup:
758
+ 1. Open your Google Sheet.
759
+ 2. Click **Extensions** > **Apps Script**.
760
+ 3. Clear existing code and paste the contents of `Buzl_GoogleAppsScript_Template.gs` (or copy from the GUI Google Sheets card).
761
+ 4. Click **Deploy** > **New deployment**.
762
+ 5. Select type **Web app**.
763
+ 6. Set **Execute as**: `Me` and **Who has access**: `Anyone`.
764
+ 7. Click **Deploy**, authorize permissions, and copy the generated Web App URL.
765
+ 8. Paste the URL into the **Google Sheets Webhook URL** field in `buzl-tracker`.
766
+
767
+ ### Architectural Highlights:
768
+ - **Top Row Insertion (Row 2)**: New leads insert directly at Row 2 immediately under the header.
769
+ - **Forward Layout**: `Handled By` (Col F) and `Comments` (Col G) sit next to `Lead Stage` (Col E) for rapid qualification.
770
+ - **Shift-Proof Filter Formulas**: Subtabs (`New`, `Contacted`, `Qualified`, `Converted`, `Spam`, `Test`) use `=FILTER(INDIRECT(...))` so formulas never break when rows insert at top.
771
+ - **Auto-Pruned Rep Tabs**: Generates individual tabs for each team member assigned a lead, and auto-deletes them when lead count reaches 0.
772
+
773
+ ---
774
+
775
+ ## 9. Cross-Platform Troubleshooting & Diagnostics
776
+
777
+ ### Issue 1: Port 3333 is Already in Use
778
+
779
+ #### 🪟 Windows (PowerShell):
780
+ ```powershell
781
+ # Identify process using port 3333
782
+ Get-NetTCPConnection -LocalPort 3333 | Select-Object OwningProcess
783
+
784
+ # Terminate process
785
+ Stop-Process -Id <PID> -Force
786
+ ```
787
+
788
+ #### 🍎 macOS (Terminal):
789
+ ```bash
790
+ # Identify and kill process on port 3333
791
+ sudo lsof -i :3333
792
+ kill -9 $(lsof -t -i:3333)
793
+ ```
794
+
795
+ #### 🐧 Linux (bash):
796
+ ```bash
797
+ # Identify and kill process on port 3333
798
+ sudo fuser -k 3333/tcp
799
+ ```
800
+
801
+ ---
802
+
803
+ ### Issue 2: EACCES Permission Denied on Linux / macOS
804
+
805
+ If running global binaries or executing CLI scripts fails with `EACCES`:
806
+
807
+ #### macOS / Linux:
808
+ ```bash
809
+ # Make binary executable
810
+ chmod +x bin/cli.js
811
+
812
+ # If installing globally with npm without sudo:
813
+ npm config set prefix ~/.npm-global
814
+ export PATH=$PATH:~/.npm-global/bin
815
+ ```
816
+
817
+ ---
818
+
819
+ ### Issue 3: PowerShell Script Execution Restricted (Windows)
820
+
821
+ If PowerShell displays `File ... cannot be loaded because running scripts is disabled on this system`:
822
+
823
+ #### Windows (PowerShell Run as Administrator or CurrentUser):
824
+ ```powershell
825
+ Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
826
+ ```
827
+
828
+ ---
829
+
830
+ ### Issue 4: Windows Path with Spaces
831
+
832
+ Always wrap paths with spaces in quotation marks:
833
+
834
+ ```powershell
835
+ npx @mahe_pkm/buzl-capi "C:\Users\John Doe\Desktop\My Website" --gui
836
+ ```
837
+
838
+ ---
839
+
840
+ ## 📄 License & Attribution
841
+
842
+ MIT License © 2026 Buzl Digital Solutions. Developed for high-performance lead generation teams and digital marketing operators.