notiqo
v0.1.2
Published
Notiqo CLI - scan repositories and generate analytics tracking plans
Readme
Notiqo CLI
Notiqo CLI scans source code repositories and generates a complete analytics tracking plan: it detects events already instrumented in your code, flags naming and coverage issues, suggests missing events with meaningful properties, and maps conversion funnels — all without requiring any manual configuration.
Features
- Framework detection: Flutter, React, Next.js, Node.js, Angular, and more via tree-sitter
- Universal language support: Dart, JavaScript, TypeScript, Python, Java, Go, Rust
- App type detection: e-commerce, SaaS, fintech, edtech, social, marketplace, content
- Business Context Collection: Interactive questionnaire captures problem statement, target users, key actions, and business objectives
- Existing event detection: reads live analytics SDK calls (Mixpanel, Amplitude, Segment, Firebase, PostHog, custom wrappers)
- Event quality analysis: flags camelCase names, missing industry-standard properties,
_triggeredsuffix anti-patterns - New event suggestions: surfaces gaps between what you track and what you should track
- AI-powered LLM Mode (optional
--llm): LangChain agent orchestration with specialized tools- TechScanner: Detects technologies in codebase
- EventAnalyzer: Detects existing events + suggests new ones from business context
- FunnelGenerator: Generates conversion funnels based on app type
- QualityAdvisor: Generates business insights and strategic recommendations
- Conversion funnel detection: Multiple industry templates (e-commerce, SaaS, fintech, etc.)
- Output formats:
tracking-plan.mdand/ortracking-plan.json - Notiqo web sync: push the generated plan to your Notiqo dashboard
Usage
npm install
npm run buildBasic Scan (Rule-Based)
# Basic scan — generates tracking-plan.md in the target directory
node dist/cli/index.js scan .
# Output both markdown and JSON
node dist/cli/index.js scan . --format both
# Force app type (skips auto-detection)
node dist/cli/index.js scan . --app-type ecommerceLLM-Enhanced Scan (AI-Powered)
# Enable AI enhancement with MiniMax
node dist/cli/index.js scan . --llm --minimax-key <your-api-key>
# Full pipeline with all options
node dist/cli/index.js scan . --format both --llm --minimax-key <key> --push --token <notiqo-token>Environment Variables for Business Context
When using --llm, you can pre-fill the business context questionnaire via environment variables:
NOTIQO_PROBLEM="Fast food restaurant app for ordering" \
NOTIQO_USERS="Customers ordering food" \
NOTIQO_ACTIONS="Browse menu, add to cart, checkout, payment, track order" \
NOTIQO_OBJECTIVES="Increase sales, improve customer experience" \
NOTIQO_FUNNELS="Purchase flow, Cart recovery" \
node dist/cli/index.js scan . --llm --minimax-key <key>| Environment Variable | Description | Required |
|--------------------|-------------|----------|
| NOTIQO_PROBLEM | What problem does your app solve? | Yes |
| NOTIQO_USERS | Who are your users? | Yes |
| NOTIQO_ACTIONS | Main actions users do (comma-separated) | Yes |
| NOTIQO_OBJECTIVES | Business objectives (comma-separated) | Yes |
| NOTIQO_FUNNELS | Known funnels (optional) | No |
CLI Options
| Option | Description | Default |
|--------|-------------|---------|
| --format <md\|json\|both> | Output file format | md |
| --app-type <type> | Force app type: ecommerce, saas, fintech, edtech, social, marketplace, content | auto-detect |
| --llm | Enable LLM agent orchestration | false |
| --minimax-key <key> | MiniMax API key (or MINIMAX_API_KEY env var) | — |
| --push | Push plan to Notiqo web | false |
| --token <token> | Notiqo API token (or NOTIQO_TOKEN env var) | — |
Architecture
LLM Mode: Agent Orchestration
The LLM mode uses LangChain with a ReAct agent that orchestrates specialized tools:
┌─────────────────────────────────────────────────────────┐
│ AnalyticsOrchestrator │
│ - Receives business context from user │
│ - Orchestrates 4 specialized tools │
│ - Synthesizes final tracking plan │
└─────────────────────────────────────────────────────────┘
│ │ │ │
┌────▼────┐ ┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│ Tech │ │ Event │ │ Funnel │ │ Quality │
│ Scanner │ │ Analyzer│ │Generator│ │ Advisor │
└─────────┘ └─────────┘ └─────────┘ └─────────┘Tools
- TechScanner: Scans project for config files and file extensions to detect technologies
- EventAnalyzer: Scans codebase for existing SDK calls + generates suggestions from business context
- FunnelGenerator: Generates conversion funnels using industry templates (ecommerce, saas, etc.)
- QualityAdvisor: Generates business insights and strategic recommendations
Rule-Based Mode: Pipeline
1. Framework detection (Flutter / React / Next.js / Node / Angular)
2. Code scanning (AST-first, regex fallback)
├── Functions with business-relevant names
├── Existing analytics SDK calls
├── Screens / pages, routes, API calls
3. AppType detection (ecommerce / saas / fintech / …)
4. Event generation
├── Existing events → quality analysis
└── New suggestions → from functions, routes
5. Funnel detection
├── AppType-matched templates
└── Steps resolved against events
6. Plan generation tracking-plan.md / tracking-plan.jsonProject Structure
/src
/api
notiqo-client.ts # HTTP client for Notiqo web push
/cli
index.ts # Command registration (commander)
/commands
scan.ts # Scan command handler
business-context-questionnaire.ts # Interactive questionnaire for LLM mode
/core
business-context.ts # BusinessContext types for agent orchestration
shared-memory.ts # Shared memory store for agent communication
types.ts # Domain entities
interfaces.ts # Ports: FrameworkDetector, CodeScanner, LlmClient…
scan-orchestrator.ts # Rule-based pipeline orchestrator
/event-generator
ai-function-classifier.ts # LLM-based function classification
rule-based-event-generator.ts # Rule-based event generation
/framework-detectors
flutter-detector.ts
react-detector.ts
next-detector.ts
node-backend-detector.ts
framework-detector-resolver.ts
/funnel-detector
funnel-template-library.ts # Industry templates
funnel-generator.ts # Funnel generation
/llm
langchain-client.ts # LLM client abstraction
orchestrator.ts # AnalyticsOrchestrator (main agent)
/tools
tech-scanner-tool.ts # TechScanner tool
event-analyzer-tool.ts # EventAnalyzer tool
funnel-generator-tool.ts # FunnelGenerator tool
quality-advisor-tool.ts # QualityAdvisor tool
base-tool.ts # Base tool interface
minimax-llm-client.ts # MiniMax LLM client
noop-llm-client.ts # No-op fallback
/scanner
analytics-call-extractor.ts # Detects SDK calls from AST
ast-extractor.ts # Tree-sitter traversal
repository-scanner.ts # File traversal and aggregation
tree-sitter-factory.ts # Parser factory
language.ts # File extension → language mapping
/tracking-plan
tracking-plan-generator.ts # Builds TrackingPlan, renders markdown/JSON
tracking-plan-writer.ts # Writes output files
/utils
question.ts # CLI questionnaire utilityLLM Integration
LLM enhancement is off by default. Enable with --llm.
Provider: MiniMax (https://api.minimax.io/v1/text/chatcompletion_v2)
Model: MiniMax-Text-01
Key: --minimax-key <key> or MINIMAX_API_KEY env var
Agent Tools
| Tool | Purpose | Input |
|------|---------|-------|
| tech_scanner | Detects technologies in project | { projectPath: string } |
| event_analyzer | Detects existing events + suggests new | { projectPath?: string } |
| funnel_generator | Generates conversion funnels | { appType?: string } |
| quality_advisor | Generates insights + recommendations | {} |
Graceful Degradation
If the LLM call fails or no key is provided, the system falls back to rule-based logic transparently.
Existing Event Detection
The scanner reads analytics SDK calls directly from source code:
| SDK | Detected patterns |
|-----|-------------------|
| Firebase | .logEvent(name: 'event'), FirebaseAnalytics.instance.logEvent(...) |
| Mixpanel | mixpanel.track('event', {...}) |
| Amplitude | amplitude.track('event', {...}) |
| Segment | analytics.track('event', {...}) |
| PostHog | posthog.capture('event', {...}) |
| Custom | analytics.trackEvent(...), trackEvent(...), sendEvent(...) |
Output Structure
The generated tracking-plan.md has four sections:
## Existing Tracked Events
Events already instrumented in the codebase.
## Event Improvements
Naming issues and missing recommended properties.
## Suggested New Events
Gaps in coverage with suggested properties.
## Conversion Funnels
Industry-matched funnels with steps resolved to event names.Example Output
LLM Mode
Notiqo Scan Results (LLM Mode)
==============================
Problem: Fast food restaurant app for ordering
Target users: Customers ordering food
Business objectives: Increase sales, improve customer experience
Detected technologies: 4
- JavaScript (frontend)
- HTML (frontend)
- Dart (mobile)
Existing tracked events: 8
New events suggested: 5
Suggested funnels: 2
Business insights: 6
Strategic recommendations: 2
New events suggested:
- browsed
- item_added
- checkout_started
- payment_completed
- order_placed
Business insights:
- Purchase flow events are covered - good for revenue analytics
- Customer experience objective detected - consider tracking engagement events
- ...
Strategic recommendations:
- [medium] Track cart behavior
- [low] Consider NPS/survey trackingRule-Based Mode
Notiqo Scan Results
===================
Detected framework: flutter
Detected app type: ecommerce
Detected screens: 278
Detected routes: 0
Existing tracked events: 62
New events suggested: 12
Improvements found: 6
Suggested funnels: 4
Output files:
- /project/tracking-plan.md
- /project/tracking-plan.json