diff --git a/cli/authentication.mdx b/cli/authentication.mdx
new file mode 100644
index 0000000..2419cf8
--- /dev/null
+++ b/cli/authentication.mdx
@@ -0,0 +1,98 @@
+---
+title: "Authentication"
+description: "How the Linkrunner CLI authenticates with your account"
+icon: "key"
+---
+
+The CLI uses **API keys** to authenticate with the Linkrunner API. There are two ways to obtain a key: the device login flow (recommended) or manual key creation from the dashboard.
+
+## Device Login Flow
+
+When you run `lr login`, the CLI uses an OAuth2 Device Authorization flow:
+
+1. The CLI requests a **user code** from the Linkrunner API
+2. You are shown a code (e.g. `BVKD-3NH7`) and a URL to open in your browser
+3. You open the URL, log into the Linkrunner dashboard, and authorize the code
+4. The CLI polls for approval and receives an API key automatically
+
+```
+$ lr login
+
+ Your device code: BVKD-3NH7
+
+ Open this URL to authorize:
+ https://dashboard.linkrunner.io/cli/auth?code=BVKD-3NH7
+
+ Waiting for authorization...
+
+ ✔ Logged in successfully!
+```
+
+
+The device code expires after **10 minutes**. If it expires, run `lr login` again to get a new code.
+
+
+## API Keys
+
+Each login creates an API key that is stored locally. Keys have the prefix `lr_cli_` and can be managed from the Linkrunner dashboard.
+
+### Key Properties
+
+| Property | Description |
+|---|---|
+| **Prefix** | Starts with `lr_cli_` (first 12 chars visible in dashboard) |
+| **Label** | Optional name for identification (auto-set to "CLI Login" for device flow) |
+| **Last Used** | Timestamp of the most recent API call |
+| **Created** | When the key was generated |
+
+### Managing Keys from the Dashboard
+
+Go to **Settings > CLI Keys** in the Linkrunner dashboard to:
+
+- **View** all active CLI API keys and when they were last used
+- **Create** a new key manually (useful for CI/CD or shared environments)
+- **Revoke** a key to immediately invalidate it
+
+
+Revoking a key is permanent. Any CLI session using that key will need to re-authenticate with `lr login`.
+
+
+### Creating Keys for CI/CD
+
+For automated environments where interactive login isn't possible, create a key manually:
+
+1. Go to **Settings > CLI Keys** in the dashboard
+2. Click **Create New Key**
+3. Copy the key (it's only shown once)
+4. Set it as an environment variable:
+
+```bash
+export LINKRUNNER_API_KEY=lr_cli_...
+```
+
+The CLI automatically picks up the `LINKRUNNER_API_KEY` environment variable when no stored session exists.
+
+## Credential Storage
+
+Your API key is stored in a local config file managed by [conf](https://github.com/sindresorhus/conf):
+
+- **macOS:** `~/Library/Preferences/linkrunner-nodejs/config.json`
+- **Linux:** `~/.config/linkrunner-nodejs/config.json`
+- **Windows:** `%APPDATA%/linkrunner-nodejs/config.json`
+
+## Logout
+
+To clear your stored credentials:
+
+```bash
+lr logout
+```
+
+This removes the locally stored API key but does **not** revoke it on the server. To fully revoke access, also delete the key from **Settings > CLI Keys** in the dashboard.
+
+## Security
+
+- API keys are hashed (SHA-256) before storage on the server — the raw key is never stored
+- Keys are scoped to your user account, not individual projects
+- The device flow codes use an ambiguity-excluded character set to avoid typos
+- Device codes are single-use and expire after 10 minutes
diff --git a/cli/ci-cd.mdx b/cli/ci-cd.mdx
new file mode 100644
index 0000000..112727d
--- /dev/null
+++ b/cli/ci-cd.mdx
@@ -0,0 +1,168 @@
+---
+title: "CI/CD Integration"
+description: "Use the Linkrunner CLI in your CI/CD pipelines"
+icon: "rotate"
+---
+
+## Overview
+
+The Linkrunner CLI supports CI/CD workflows through two key features:
+
+- **`--ci` flag** -- commands exit with code 0 (pass) or 1 (fail) instead of remaining interactive
+- **`--json` flag** -- structured JSON output for machine parsing
+
+These flags are available on `lr doctor`, `lr validate`, `lr analyze`, and `lr test`.
+
+## Exit Codes
+
+| Code | Meaning |
+|---|---|
+| `0` | All checks passed (no errors) |
+| `1` | One or more errors found |
+
+By default, warnings do not cause a non-zero exit. Add `--fail-on-warn` to treat warnings as failures.
+
+## Commands for CI
+
+### lr doctor --ci
+
+Validates platform configuration and source code:
+
+```bash
+# Fail on errors only
+lr doctor --ci
+
+# Fail on errors AND warnings
+lr doctor --ci --fail-on-warn
+```
+
+### lr test --ci
+
+Verifies API connectivity and token validity:
+
+```bash
+lr test --ci
+```
+
+### lr analyze --ci
+
+Runs standard checks plus AI-powered deep analysis:
+
+```bash
+lr analyze --ci --fail-on-warn
+```
+
+## Pipeline Examples
+
+### GitHub Actions
+
+```yaml
+name: Linkrunner SDK Check
+on: [push, pull_request]
+
+jobs:
+ sdk-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+
+ - name: Install Linkrunner CLI
+ run: npm install -g linkrunner-cli
+
+ - name: Validate SDK integration
+ run: lr doctor --ci --fail-on-warn
+
+ - name: Test API connectivity
+ run: lr test --ci
+```
+
+### GitLab CI
+
+```yaml
+sdk-check:
+ image: node:20
+ script:
+ - npm install -g linkrunner-cli
+ - lr doctor --ci --fail-on-warn
+ - lr test --ci
+```
+
+### Bitbucket Pipelines
+
+```yaml
+pipelines:
+ default:
+ - step:
+ name: SDK Validation
+ image: node:20
+ script:
+ - npm install -g linkrunner-cli
+ - lr doctor --ci --fail-on-warn
+```
+
+## JSON Output
+
+Use `--json` to get machine-readable output for custom processing:
+
+```bash
+lr doctor --json | jq '.summary.errors'
+```
+
+The JSON structure for `lr doctor --json`:
+
+```json
+{
+ "project": {
+ "type": "flutter",
+ "sdkVersion": "3.2.1",
+ "root": "/path/to/project"
+ },
+ "results": [
+ {
+ "id": "check-id",
+ "name": "Check name",
+ "status": "pass",
+ "severity": "error",
+ "message": "Description",
+ "fix": "Suggested fix",
+ "autoFixable": false,
+ "docsUrl": "https://..."
+ }
+ ],
+ "summary": {
+ "passed": 5,
+ "warnings": 1,
+ "errors": 0
+ }
+}
+```
+
+## Combining Flags
+
+You can combine `--ci` and `--json` for both structured output and exit codes:
+
+```bash
+# Get JSON output AND exit code
+lr doctor --ci --json > results.json
+echo "Exit code: $?"
+```
+
+## Requirements
+
+- The project must contain a `.linkrunner.json` file (for `lr test`) or recognizable project files (for `lr doctor`)
+- No interactive prompts are shown when `--ci` or `--json` is used
+- `lr test` and `lr status` require a `.linkrunner.json` file created by `lr init`
+
+
+For CI environments, run `lr init` locally first and commit the `.linkrunner.json` file to your repository. The CLI reads this file to identify your project during CI runs.
+
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- full diagnostics reference
+- [lr test](/cli/commands/test) -- API connectivity checks
+- [lr analyze](/cli/commands/analyze) -- AI-powered analysis
diff --git a/cli/commands/analyze.mdx b/cli/commands/analyze.mdx
new file mode 100644
index 0000000..0183657
--- /dev/null
+++ b/cli/commands/analyze.mdx
@@ -0,0 +1,105 @@
+---
+title: "lr analyze"
+description: "Run AI-powered deep analysis of your SDK integration"
+icon: "robot"
+---
+
+## Usage
+
+```bash
+lr analyze [options]
+```
+
+## Description
+
+Runs all standard `lr doctor` checks plus an AI-powered deep analysis of your codebase. This is equivalent to running `lr doctor --deep`.
+
+The AI analysis inspects your source code for subtle integration issues, incorrect usage patterns, missing best practices, and platform-specific problems that pattern-based checks cannot catch.
+
+Requires authentication. Run `lr login` first.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--json` | Output results as JSON |
+| `--ci` | Exit with code 0 (pass) or 1 (fail) |
+| `--fail-on-warn` | Treat warnings as failures in CI mode |
+
+## What It Does
+
+1. Runs all standard platform configuration checks (same as `lr doctor`)
+2. Runs source code pattern scanning (same as `lr doctor`)
+3. Sends project context to an AI model for deep analysis
+4. Reports any additional issues found by the AI, including:
+ - File path and line number of the issue
+ - Severity level (error, warn, or info)
+ - Suggested fix
+
+## Examples
+
+### Basic analysis
+
+```bash
+lr analyze
+```
+
+```
+Linkrunner Doctor
+Diagnosing your SDK integration...
+
+ Project: react-native (SDK v2.3.0)
+ Root: /path/to/project
+
+── Platform Configuration ──
+ ✔ rn-linkrunner found in package.json
+ ...
+
+── Source Code ──
+ ✔ init() call found
+ ...
+
+── Deep Analysis (AI-powered) ──
+ ✘ [src/App.tsx:15] init() called outside useEffect - may run on every render
+ Fix: Move init() inside a useEffect with an empty dependency array
+ ⚠ [src/screens/Payment.tsx:42] capturePayment amount is hardcoded
+ Fix: Use the actual transaction amount from your payment provider
+ ✔ No additional issues found by AI analysis.
+```
+
+### JSON output for scripting
+
+```bash
+lr analyze --json
+```
+
+The JSON output includes a `deepAnalysis` array in addition to the standard `results`:
+
+```json
+{
+ "project": { "type": "react-native", "sdkVersion": "2.3.0", "root": "..." },
+ "results": [...],
+ "summary": { "passed": 5, "warnings": 1, "errors": 1 },
+ "deepAnalysis": [
+ {
+ "file": "src/App.tsx",
+ "line": 15,
+ "severity": "error",
+ "message": "init() called outside useEffect",
+ "fix": "Move init() inside a useEffect with an empty dependency array"
+ }
+ ]
+}
+```
+
+### In CI
+
+```bash
+lr analyze --ci --fail-on-warn
+```
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- standard diagnostics without AI analysis
+- [lr suggest](/cli/commands/suggest) -- AI-powered feature suggestions
+- [CI/CD Integration](/cli/ci-cd) -- pipeline examples
diff --git a/cli/commands/deeplink-push.mdx b/cli/commands/deeplink-push.mdx
new file mode 100644
index 0000000..ba93a43
--- /dev/null
+++ b/cli/commands/deeplink-push.mdx
@@ -0,0 +1,97 @@
+---
+title: "lr deeplink push"
+description: "Push deep link verification files to Linkrunner-hosted domains"
+icon: "cloud-arrow-up"
+---
+
+## Usage
+
+```bash
+lr deeplink push [options]
+```
+
+## Description
+
+Generates and pushes deep link verification files (`assetlinks.json` for Android and `apple-app-site-association` for iOS) to your Linkrunner-hosted domains. This eliminates the need to manually host these files on your own server.
+
+Requires authentication and a `.linkrunner.json` file. Your project must have at least one domain configured in the Linkrunner dashboard.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--skip-android` | Skip Android verification file |
+| `--skip-ios` | Skip iOS verification file |
+| `--yes` | Auto-confirm all prompts |
+| `--json` | Output results as JSON |
+
+## What It Does
+
+### Android — Digital Asset Links
+
+1. **Resolves SHA-256 fingerprints** using this priority:
+ - Fingerprints already in `.linkrunner.json`
+ - Auto-extracted from your debug keystore (if `keytool` is available)
+ - Auto-extracted from your Gradle signing config
+ - Manual input (with format validation)
+2. **Generates `assetlinks.json`** with your package name and fingerprints
+3. **Pushes to all project domains** so they're served at `https://{domain}/.well-known/assetlinks.json`
+
+### iOS — Apple App Site Association
+
+1. **Resolves Team ID** from `.linkrunner.json` (`team_id` or `app_prefix`), or prompts for manual input
+2. **Generates AASA file** with your team ID and bundle ID
+3. **Pushes to all project domains** so it's served at `https://{domain}/.well-known/apple-app-site-association`
+
+After pushing, any extracted fingerprints or team IDs that were entered manually are saved back to `.linkrunner.json` for future use.
+
+## Examples
+
+### Push both platforms
+
+```bash
+lr deeplink push
+```
+
+```
+── Push Deep Link Verification Files ──
+ Project: My App
+✔ Found 1 domain(s): get.myapp.com
+
+── Android — Digital Asset Links ──
+ Using SHA-256 fingerprints from .linkrunner.json (1 fingerprint(s))
+
+── iOS — Apple App Site Association ──
+
+? Push verification files to 1 domain(s)? Yes
+✔ Verification objects pushed successfully
+
+ ✔ https://get.myapp.com/.well-known/apple-app-site-association
+ ✔ https://get.myapp.com/.well-known/assetlinks.json
+```
+
+### iOS only
+
+```bash
+lr deeplink push --skip-android
+```
+
+### Non-interactive
+
+```bash
+lr deeplink push --yes
+```
+
+## Verifying Your Setup
+
+After pushing, use `lr test --deep` to confirm the verification files are accessible and valid:
+
+```bash
+lr test --deep
+```
+
+## Related
+
+- [lr deeplink setup](/cli/commands/deeplink) -- configure intent filters and associated domains locally
+- [Deep Linking Verification](/features/deep-linking-verification) -- verification file details
+- [lr test](/cli/commands/test) -- verify deep link domain and files
diff --git a/cli/commands/deeplink.mdx b/cli/commands/deeplink.mdx
new file mode 100644
index 0000000..70a5b6c
--- /dev/null
+++ b/cli/commands/deeplink.mdx
@@ -0,0 +1,138 @@
+---
+title: "lr deeplink setup"
+description: "Configure deep linking for Android App Links and iOS Universal Links"
+icon: "link"
+---
+
+## Usage
+
+```bash
+lr deeplink setup [options]
+```
+
+## Description
+
+Guides you through configuring deep linking for your project. It modifies your Android `AndroidManifest.xml` with the required intent filter and generates the verification files (`assetlinks.json` for Android and `apple-app-site-association` for iOS) that need to be hosted on your deep link domain.
+
+Requires a `.linkrunner.json` file. Run `lr init` first if you don't have one.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--domain ` | Deep link domain (overrides the value in `.linkrunner.json`) |
+| `--skip-android` | Skip Android configuration |
+| `--skip-ios` | Skip iOS configuration |
+
+## What It Does
+
+### Android Configuration
+
+1. **Intent filter** -- adds an `autoVerify` intent filter to the main activity in your `AndroidManifest.xml`:
+
+```xml
+
+
+
+
+
+
+
+```
+
+If the intent filter is already present, it is skipped. Before applying, the change is shown and you are asked to confirm. A `.bak` backup is created automatically.
+
+2. **Digital Asset Links** -- generates an `assetlinks.json` file that you need to host at `https://{domain}/.well-known/assetlinks.json`:
+
+```json
+[
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.myapp.android",
+ "sha256_cert_fingerprints": ["AB:CD:EF:..."]
+ }
+ }
+]
+```
+
+
+If no `sha256_cert_fingerprints` are configured in your `.linkrunner.json`, the CLI warns you. Add them to the `android` section of your config.
+
+
+### iOS Configuration
+
+1. **Associated Domains** -- displays the Associated Domain entitlement you need to add in Xcode:
+
+```
+applinks:links.myapp.com
+```
+
+2. **Apple App Site Association** -- generates an AASA file to host at `https://{domain}/.well-known/apple-app-site-association`:
+
+```json
+{
+ "applinks": {
+ "apps": [],
+ "details": [
+ {
+ "appID": "ABCDE12345.com.myapp.ios",
+ "paths": ["*"]
+ }
+ ]
+ }
+}
+```
+
+
+The `appID` is constructed from your `team_id` (or `app_prefix`) and `bundle_id` in `.linkrunner.json`. If `team_id` is missing, the CLI warns you to add it.
+
+
+## Domain Resolution
+
+The deep link domain is resolved in this order:
+
+1. `--domain` flag value
+2. `deep_link_domain` from `.linkrunner.json`
+3. Interactive prompt if neither is available
+
+## Examples
+
+### Full setup
+
+```bash
+lr deeplink setup
+```
+
+### Specify domain
+
+```bash
+lr deeplink setup --domain links.myapp.com
+```
+
+### iOS only
+
+```bash
+lr deeplink setup --skip-android
+```
+
+### Android only
+
+```bash
+lr deeplink setup --skip-ios
+```
+
+## Verifying Your Setup
+
+After hosting the verification files, use `lr test --deep` to confirm they are accessible:
+
+```bash
+lr test --deep
+```
+
+## Related
+
+- [Deep Linking Setup](/features/deep-linking-setup) -- dashboard configuration guide
+- [Deep Linking Verification](/features/deep-linking-verification) -- verification file details
+- [lr test](/cli/commands/test) -- verify deep link domain and files
diff --git a/cli/commands/doctor.mdx b/cli/commands/doctor.mdx
new file mode 100644
index 0000000..1d8dcc4
--- /dev/null
+++ b/cli/commands/doctor.mdx
@@ -0,0 +1,167 @@
+---
+title: "lr doctor"
+description: "Diagnose and validate your SDK integration"
+icon: "stethoscope"
+---
+
+## Usage
+
+```bash
+lr doctor [options]
+```
+
+## Description
+
+Runs a comprehensive diagnostic check on your Linkrunner SDK integration. It detects your project type, validates platform-specific configuration, scans your source code for correct SDK usage, and optionally runs an AI-powered deep analysis.
+
+`lr validate` is an alias for this command with the same options.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--json` | Output results as JSON instead of formatted text |
+| `--fix` | Attempt to auto-fix detected issues |
+| `--deep` | Run AI-powered deep analysis in addition to standard checks |
+| `--ci` | Exit with code 0 (pass) or 1 (fail) for CI pipelines |
+| `--fail-on-warn` | Treat warnings as failures when using `--ci` |
+
+## What It Checks
+
+### Platform Configuration
+
+Platform-specific validators run based on your detected project type:
+
+- **Flutter** -- `pubspec.yaml` dependencies, Android/iOS native configuration
+- **React Native** -- `package.json` dependencies, native module setup
+- **Expo** -- `app.json` plugin configuration, native setup
+- **Capacitor** -- Capacitor plugin setup, native configuration
+- **iOS** -- Info.plist, entitlements, Podfile/SPM setup
+- **Android** -- AndroidManifest.xml, build.gradle, permissions
+- **Web** -- package.json dependencies, SDK initialization
+
+### Source Code
+
+Scans your source files for common integration patterns:
+
+- SDK initialization (`init()`)
+- User signup tracking (`signup()`)
+- Event tracking (`trackEvent()`)
+- Payment capture (`capturePayment()`)
+- Deep link handling
+
+### Deep Analysis (AI-powered)
+
+When `--deep` is passed, the CLI sends your project context to an AI model that analyzes your code for:
+
+- Subtle integration issues not caught by pattern matching
+- Incorrect SDK usage patterns
+- Missing best practices
+- Platform-specific gotchas
+
+Deep analysis requires authentication. Run `lr login` first to enable AI-powered features.
+
+## Validation Results
+
+Each check produces a result with one of three statuses:
+
+| Status | Meaning |
+|---|---|
+| **pass** | Check passed successfully |
+| **warn** | Potential issue found, but not blocking |
+| **error** | Critical issue that needs to be fixed |
+
+Results include a message describing the finding and, when applicable, a suggested fix.
+
+## Examples
+
+### Basic diagnostics
+
+```bash
+lr doctor
+```
+
+```
+Linkrunner Doctor
+Diagnosing your SDK integration...
+
+ Project: flutter (SDK v3.2.1)
+ Root: /path/to/project
+
+── Platform Configuration ──
+ ✔ linkrunner package found in pubspec.yaml
+ ✔ Android minSdkVersion >= 21
+ ✔ INTERNET permission present
+ ⚠ NSUserTrackingUsageDescription not found in Info.plist
+ Fix: Add NSUserTrackingUsageDescription to your Info.plist
+
+── Source Code ──
+ ✔ init() call found
+ ✔ signup() call found
+ ⚠ capturePayment() not found
+ Fix: Add payment tracking for revenue attribution
+
+Summary: 4 passed, 2 warnings, 0 errors
+```
+
+### With auto-fix
+
+```bash
+lr doctor --fix
+```
+
+### JSON output
+
+```bash
+lr doctor --json
+```
+
+```json
+{
+ "project": {
+ "type": "flutter",
+ "sdkVersion": "3.2.1",
+ "root": "/path/to/project"
+ },
+ "results": [
+ {
+ "id": "flutter-pubspec",
+ "name": "linkrunner in pubspec.yaml",
+ "status": "pass",
+ "severity": "error",
+ "message": "linkrunner package found in pubspec.yaml",
+ "autoFixable": false
+ }
+ ],
+ "summary": {
+ "passed": 4,
+ "warnings": 2,
+ "errors": 0
+ }
+}
+```
+
+### Deep analysis
+
+```bash
+lr doctor --deep
+```
+
+### CI mode
+
+```bash
+# Fail only on errors
+lr doctor --ci
+
+# Fail on errors AND warnings
+lr doctor --ci --fail-on-warn
+```
+
+See [CI/CD Integration](/cli/ci-cd) for pipeline examples.
+
+## Related
+
+- [`lr analyze`](/cli/commands/analyze) -- shorthand for `lr doctor --deep`
+- [`lr test`](/cli/commands/test) -- verify token validity and API connectivity
+- [`lr suggest`](/cli/commands/suggest) -- get feature integration suggestions
+- [CI/CD Integration](/cli/ci-cd) -- using doctor in automated pipelines
diff --git a/cli/commands/env.mdx b/cli/commands/env.mdx
new file mode 100644
index 0000000..0e00942
--- /dev/null
+++ b/cli/commands/env.mdx
@@ -0,0 +1,87 @@
+---
+title: "lr env"
+description: "Show or switch the CLI environment"
+icon: "globe"
+---
+
+## Usage
+
+```bash
+lr env [environment]
+```
+
+## Description
+
+Displays the current environment or switches to a different one. The environment controls which Linkrunner API server the CLI communicates with.
+
+## Environments
+
+| Environment | API Server |
+|---|---|
+| `production` | `https://api.linkrunner.io` (default) |
+| `staging` | `https://staging-api.linkrunner.io` |
+| `local` | `http://localhost:3000` |
+
+## Show Current Environment
+
+```bash
+lr env
+```
+
+```
+Current environment: production
+ API: https://api.linkrunner.io
+```
+
+If the `LINKRUNNER_API_URL` environment variable is set, the output indicates the override:
+
+```
+Current environment: production
+ API: https://custom-api.example.com
+ (overridden by LINKRUNNER_API_URL env var)
+```
+
+## Switch Environment
+
+```bash
+lr env staging
+```
+
+```
+Switched to staging environment.
+ API: https://staging-api.linkrunner.io
+```
+
+The selected environment is persisted to your global config and used for all subsequent commands until changed.
+
+## One-Off Override
+
+Use the global `--env` flag to override the environment for a single command without changing the stored setting:
+
+```bash
+lr status --env staging
+lr doctor --env local
+```
+
+## Environment Variable Override
+
+Set `LINKRUNNER_API_URL` to point the CLI at a custom API server. This takes the highest priority, overriding both the stored environment and the `--env` flag:
+
+```bash
+export LINKRUNNER_API_URL=http://localhost:4000
+lr test
+```
+
+## Resolution Order
+
+The API base URL is resolved in this order (highest priority first):
+
+1. `LINKRUNNER_API_URL` environment variable
+2. `--env` flag on the current command
+3. Stored environment (set via `lr env `)
+4. `production` (default)
+
+## Related
+
+- [lr test](/cli/commands/test) -- verify connectivity to the current environment
+- [lr status](/cli/commands/status) -- view project dashboard
diff --git a/cli/commands/events-suggest.mdx b/cli/commands/events-suggest.mdx
new file mode 100644
index 0000000..e9fa5a8
--- /dev/null
+++ b/cli/commands/events-suggest.mdx
@@ -0,0 +1,114 @@
+---
+title: "lr events suggest"
+description: "Get AI-suggested events optimized for ad campaign performance"
+icon: "wand-magic-sparkles"
+---
+
+## Usage
+
+```bash
+lr events suggest [options]
+```
+
+## Description
+
+Analyzes your codebase with AI to recommend the most impactful events for ad campaign optimization. The suggestions are tailored to your app's functionality and connected ad networks, distinguishing between custom events and revenue events.
+
+Requires authentication. Run `lr login` first.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--platform ` | Override the auto-detected platform (`flutter`, `react-native`, `expo`, `ios`, `android`, `capacitor`, `web`) |
+| `--json` | Output suggestions as JSON |
+| `--no-insert` | Skip code insertion prompts |
+| `--project-id ` | Project ID for ad network context (defaults to `.linkrunner.json` value) |
+
+## How It Works
+
+1. **Scans your codebase** to understand your app's functionality
+2. **Checks connected ad networks** (if project ID is available) for postback mapping context
+3. **Generates 5 event suggestions** using AI, including a mix of custom and revenue events
+4. **Lets you select** which events to add via an interactive checklist
+5. **Generates platform-specific code** for each selected event
+6. **Offers to copy** all generated code to your clipboard
+
+## Output
+
+Each suggested event includes:
+
+- **Name** -- the event name to use in your code
+- **Type** -- `custom` or `revenue`
+- **Description** -- what the event tracks
+- **Why it helps** -- how it improves campaign optimization
+- **Ad network mapping** -- which ad network events it maps to
+
+```
+── Suggested Events for Ad Campaign Optimization ──
+
+ Your app handles payments. 2 revenue events and 3 custom events suggested.
+
+ 1. * add_to_cart [ custom ]
+ User adds an item to their shopping cart
+ Why: High-intent signal for campaign lookalike optimization
+ Maps to: Meta AddToCart, Google add_to_cart
+
+ 2. $ purchase [ revenue ]
+ User completes a purchase
+ Why: Primary conversion event for ROAS optimization
+ Maps to: Meta Purchase, Google in_app_purchase
+
+? Select events to add: (all selected by default)
+```
+
+## JSON Output
+
+```bash
+lr events suggest --json
+```
+
+```json
+{
+ "hasRevenue": true,
+ "events": [
+ {
+ "name": "add_to_cart",
+ "type": "custom",
+ "description": "User adds an item to their shopping cart",
+ "whyItHelps": "High-intent signal for campaign lookalike optimization",
+ "adNetworkMapping": "Meta AddToCart, Google add_to_cart",
+ "sampleProperties": {
+ "item_id": "SKU-123",
+ "item_name": "Example Product"
+ }
+ }
+ ]
+}
+```
+
+## Examples
+
+### Interactive mode
+
+```bash
+lr events suggest
+```
+
+### With specific project context
+
+```bash
+lr events suggest --project-id 123
+```
+
+### Non-interactive (JSON output, no insertion)
+
+```bash
+lr events suggest --json --no-insert
+```
+
+## Related
+
+- [lr events add](/cli/commands/events) -- manually create event tracking code
+- [lr suggest](/cli/commands/suggest) -- general SDK feature suggestions
+- [Event Capture API](/api-reference/event-capture) -- server-side event tracking
diff --git a/cli/commands/events.mdx b/cli/commands/events.mdx
new file mode 100644
index 0000000..95b6e5c
--- /dev/null
+++ b/cli/commands/events.mdx
@@ -0,0 +1,117 @@
+---
+title: "lr events add"
+description: "Generate event tracking code snippets for your platform"
+icon: "bolt"
+---
+
+## Usage
+
+```bash
+lr events add [options]
+```
+
+## Description
+
+Interactive code generator that produces platform-specific event tracking snippets. Supports custom events, payment/revenue tracking, and signup events. The generated code can be copied to clipboard or auto-inserted into your source files using AI-powered file analysis.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--platform ` | Override the auto-detected platform (`flutter`, `react-native`, `expo`, `ios`, `android`, `capacitor`, `web`) |
+| `--type ` | Skip the event type prompt (`custom`, `payment`, `signup`) |
+
+## Event Types
+
+### Custom Event
+
+Tracks any in-app event with a name and optional key-value properties.
+
+```
+? Event name: add_to_cart
+? Add a property? Yes
+? Property key: item_id
+? Property value: SKU-123
+? Add another property? No
+```
+
+### Payment / Revenue
+
+Tracks a payment with amount, currency, optional transaction ID, and optional properties.
+
+```
+? Payment amount: 9.99
+? Currency code: USD
+? Transaction ID (optional): txn_abc123
+? Add a property? No
+```
+
+### Signup
+
+Tracks user registration with user ID, optional name, and optional email.
+
+```
+? User ID: user_456
+? User name (optional): Jane Doe
+? User email (optional): jane@example.com
+```
+
+The Web SDK does not have a `signup` method. Use `trackEvent` for custom events on web.
+
+## Generated Code Examples
+
+The output is tailored to your platform. For example, a custom event on Flutter:
+
+```dart
+await LinkRunner().trackEvent(
+ name: 'add_to_cart',
+ data: {
+ 'item_id': 'SKU-123',
+ },
+);
+```
+
+The same event on React Native:
+
+```typescript
+await linkrunner.trackEvent({
+ name: 'add_to_cart',
+ data: {
+ item_id: 'SKU-123',
+ },
+});
+```
+
+## Auto-insertion
+
+After generating the code, the CLI offers to automatically insert it into the correct location in your source files:
+
+```
+? Would you like me to insert this into your code? Yes
+```
+
+This uses AI to analyze your project and find the appropriate insertion point. If auto-insertion is unavailable or you decline, you can copy the snippet to your clipboard instead.
+
+## Examples
+
+### Interactive mode
+
+```bash
+lr events add
+```
+
+### Skip prompts with flags
+
+```bash
+# Generate a payment event for Flutter
+lr events add --platform flutter --type payment
+
+# Generate a custom event for React Native
+lr events add --platform react-native --type custom
+```
+
+## Related
+
+- [lr suggest](/cli/commands/suggest) -- see which SDK features you're using
+- [lr init](/cli/commands/init) -- generates initial code snippets during setup
+- [Event Capture API](/api-reference/event-capture) -- server-side event tracking
diff --git a/cli/commands/init.mdx b/cli/commands/init.mdx
new file mode 100644
index 0000000..78aac00
--- /dev/null
+++ b/cli/commands/init.mdx
@@ -0,0 +1,140 @@
+---
+title: "lr init"
+description: "Initialize the Linkrunner SDK in your project"
+icon: "play"
+---
+
+## Usage
+
+```bash
+lr init
+```
+
+## Description
+
+Interactive setup wizard that configures the Linkrunner SDK in your project. Run this from your project root directory. The command walks through the full setup process: detecting your platform, authenticating, selecting a project, installing the SDK, configuring native files, generating code snippets, and saving a config file.
+
+## Setup Steps
+
+### Step 1: Detect Project Type
+
+The CLI auto-detects your project type by examining files in the current directory:
+
+- `pubspec.yaml` -- Flutter
+- `package.json` with `expo` dependency -- Expo
+- `package.json` with `react-native` dependency -- React Native
+- `package.json` with `@capacitor/core` dependency -- Capacitor
+- `.xcodeproj` or `.xcworkspace` -- iOS
+- `build.gradle` or `build.gradle.kts` -- Android
+- `package.json` (fallback) -- Web
+
+If detection succeeds, you are asked to confirm. If it fails, you select your platform manually from the list.
+
+### Step 2: Authenticate
+
+If you are not already logged in, the CLI triggers the `lr login` flow. See [lr login](/cli/commands/login).
+
+### Step 3: Select or Create a Project
+
+The CLI fetches your existing Linkrunner projects and lets you choose one, or create a new project. When creating a new project, you provide:
+
+- Project name
+- Company name
+- App Store link (optional)
+- Play Store link (optional)
+- Billing account
+
+At least one store link (App Store or Play Store) is required when creating a new project.
+
+### Step 4: Fetch Credentials
+
+The CLI retrieves your project token and SDK credentials. If your platform needs Android or iOS credentials and they don't exist yet, they are created automatically.
+
+### Step 5: Install SDK
+
+Based on your platform, the CLI offers to run the appropriate install command:
+
+| Platform | Install Command |
+|---|---|
+| Flutter | `flutter pub add linkrunner` |
+| React Native | `npm install rn-linkrunner` |
+| Expo | `npm install rn-linkrunner && npx expo install expo-linkrunner` |
+| Web | `npm install @linkrunner/web-sdk` |
+| Capacitor | `npm install capacitor-linkrunner && npx cap sync` |
+| iOS / Android | Manual setup (instructions provided) |
+
+You can skip the automatic install and run the command yourself later.
+
+### Step 6: Platform Configuration
+
+The CLI detects and offers to apply platform-specific configuration changes:
+
+**Android** (Flutter, React Native, Expo, Capacitor):
+- Adds `INTERNET` and `ACCESS_NETWORK_STATE` permissions to `AndroidManifest.xml`
+
+**iOS** (Flutter, React Native, Expo, Capacitor):
+- Adds `NSUserTrackingUsageDescription` to `Info.plist` for App Tracking Transparency
+
+**Expo**:
+- Adds the `expo-linkrunner` plugin to `app.json`
+
+Each change is shown before applying, and a `.bak` backup file is created automatically.
+
+### Step 7: Code Snippets
+
+The CLI generates platform-specific code snippets for:
+
+1. **Initialization** -- add to your app startup
+2. **User Registration (Signup)** -- call once after user onboarding
+3. **Set User Data** -- call each time the app opens with a logged-in user
+
+For each snippet, you can optionally let the CLI auto-insert the code into your source files using AI-powered file analysis.
+
+### Step 8: Save Config
+
+A `.linkrunner.json` file is saved in your project root containing your project token, project ID, platform settings, and credentials.
+
+### Step 9: Run Doctor
+
+You are offered the option to run `lr doctor` to verify the setup. See [lr doctor](/cli/commands/doctor).
+
+## Example Output
+
+```
+── Linkrunner SDK Setup ──
+
+ Detected project type: flutter
+
+? Is this a flutter project? Yes
+? Select a project: My App (My Company)
+✔ Credentials fetched
+
+ Install command: flutter pub add linkrunner
+
+? Run "flutter pub add linkrunner"? Yes
+✔ Install Flutter SDK complete
+
+── Platform Configuration ──
+✔ Add INTERNET and ACCESS_NETWORK_STATE permissions (already present)
+✔ Add NSUserTrackingUsageDescription for App Tracking Transparency (already present)
+
+── Code Snippets ──
+ 1. Initialization
+ ...
+
+✔ .linkrunner.json saved at /path/to/project/.linkrunner.json
+
+ Setup complete!
+
+ Project: My App
+ Platform: flutter
+ Config: /path/to/project/.linkrunner.json
+
+ Run `lr doctor` anytime to verify your integration.
+```
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- verify your setup after init
+- [lr login](/cli/commands/login) -- authentication details
+- [lr deeplink setup](/cli/commands/deeplink) -- configure deep linking after init
diff --git a/cli/commands/login.mdx b/cli/commands/login.mdx
new file mode 100644
index 0000000..4ff44e9
--- /dev/null
+++ b/cli/commands/login.mdx
@@ -0,0 +1,77 @@
+---
+title: "lr login"
+description: "Authenticate with your Linkrunner account"
+icon: "right-to-bracket"
+---
+
+## Usage
+
+```bash
+lr login
+```
+
+## Description
+
+Authenticates you with Linkrunner using a magic link sent to your email. Authentication is required for commands that interact with the Linkrunner API, including `lr init`, `lr test`, `lr status`, `lr suggest` (AI features), and `lr analyze`.
+
+## Authentication Flow
+
+1. The CLI prompts for your email address
+2. A magic link is sent to your inbox (expires in 15 minutes)
+3. You choose how to verify:
+ - **Paste the token or URL** from the email directly into the terminal
+ - **Open the link** in your browser manually
+4. The CLI verifies the token and stores your session
+
+```
+? Enter your email: you@example.com
+✔ Magic link sent!
+
+ Check your inbox at you@example.com
+ The link expires in 15 minutes
+
+? How would you like to verify?
+ > Paste the token or URL from the email
+ I'll open the link in my email myself
+
+? Paste your token or magic link URL: https://...?token=abc123
+✔ Logged in successfully!
+
+ Welcome, you@example.com!
+```
+
+
+You can paste either the full URL from the email or just the token value. The CLI extracts the token automatically.
+
+
+## Re-authentication
+
+If you are already logged in, the CLI shows your current email and asks if you want to switch accounts:
+
+```
+ Currently logged in as you@example.com
+
+? Login with a different account? (y/N)
+```
+
+## Credential Storage
+
+Your auth token and email are stored in a global config file managed by [conf](https://github.com/sindresorhus/conf), typically located at:
+
+- **macOS:** `~/Library/Preferences/linkrunner-nodejs/config.json`
+- **Linux:** `~/.config/linkrunner-nodejs/config.json`
+- **Windows:** `%APPDATA%/linkrunner-nodejs/config.json`
+
+## Logout
+
+To clear your stored credentials:
+
+```bash
+lr logout
+```
+
+## Related
+
+- [lr init](/cli/commands/init) -- requires authentication
+- [lr status](/cli/commands/status) -- requires authentication
+- [lr analyze](/cli/commands/analyze) -- requires authentication for AI features
diff --git a/cli/commands/referral.mdx b/cli/commands/referral.mdx
new file mode 100644
index 0000000..f05e69f
--- /dev/null
+++ b/cli/commands/referral.mdx
@@ -0,0 +1,110 @@
+---
+title: "lr referral setup"
+description: "Configure referral code tracking for your project"
+icon: "share-nodes"
+---
+
+## Usage
+
+```bash
+lr referral setup [options]
+```
+
+## Description
+
+Configures referral code tracking by scanning your codebase for existing referral patterns, helping you choose a referral parameter name, and generating platform-specific code to extract referral codes from deep links.
+
+Requires authentication and a `.linkrunner.json` file. Run `lr init` first if you don't have one.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--param ` | Referral query parameter name (skip detection and selection) |
+| `--yes` | Accept defaults without prompting |
+| `--json` | Output results as JSON |
+
+## What It Does
+
+### 1. Scans for Existing Referral Patterns
+
+The CLI scans your codebase for existing referral flows, including:
+
+- Referral SDKs (e.g., Branch, Firebase Dynamic Links)
+- URL parameter extraction patterns
+- Referral-related variable names and functions
+
+If patterns are found, the CLI shows the evidence and suggests using the same parameter name for consistency.
+
+### 2. Chooses a Parameter Name
+
+If no existing pattern is detected (or you want a different name), you choose from:
+
+- `ref` (recommended)
+- `referrer`
+- `invite_code`
+- Custom name
+
+### 3. Generates Your Referral Link Format
+
+```
+https://get.yourapp.com?ref=REFERRAL_CODE
+https://get.yourapp.com/path?ref=REFERRAL_CODE
+```
+
+### 4. Generates Code Snippet
+
+Platform-specific code to extract the referral code from the deep link URL in your app. For example, in Flutter:
+
+```dart
+final initData = await LinkRunner().init(
+ token: 'YOUR_TOKEN',
+);
+
+final referralCode = initData.deepLinkData?['ref'];
+if (referralCode != null) {
+ // Handle referral code
+}
+```
+
+## Examples
+
+### Interactive setup
+
+```bash
+lr referral setup
+```
+
+### With a specific parameter name
+
+```bash
+lr referral setup --param invite_code
+```
+
+### Non-interactive
+
+```bash
+lr referral setup --param ref --yes
+```
+
+### JSON output
+
+```bash
+lr referral setup --json
+```
+
+```json
+{
+ "param_name": "ref",
+ "domain": "get.yourapp.com",
+ "link_format": "https://get.yourapp.com?ref=REFERRAL_CODE",
+ "platform": "flutter",
+ "code_snippet": "// referral extraction code..."
+}
+```
+
+## Related
+
+- [Referral Codes](/features/referral-codes) -- dashboard configuration guide
+- [lr deeplink setup](/cli/commands/deeplink) -- configure deep linking (required for referral links)
+- [lr init](/cli/commands/init) -- set up your project first
diff --git a/cli/commands/status.mdx b/cli/commands/status.mdx
new file mode 100644
index 0000000..dc17f5d
--- /dev/null
+++ b/cli/commands/status.mdx
@@ -0,0 +1,132 @@
+---
+title: "lr status"
+description: "View your project dashboard and recent activity"
+icon: "chart-line"
+---
+
+## Usage
+
+```bash
+lr status [options]
+```
+
+## Description
+
+Displays a dashboard summary for your Linkrunner project, including project info, recent activity metrics (installs, signups, events, revenue), active campaigns, and integration health. Requires authentication and a `.linkrunner.json` file.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--json` | Output results as JSON |
+| `--days ` | Activity window in days (default: `7`) |
+
+## Dashboard Sections
+
+### Project Info
+
+Shows your project name, ID, configured platforms, deep link domain, and current environment (production or staging).
+
+### Recent Activity
+
+Displays metrics for the specified time window:
+
+- **Installs** -- total new installs
+- **Signups** -- total user signups
+- **Events** -- total tracked events
+- **Revenue** -- total revenue with currency
+
+### Active Campaigns
+
+Lists your active campaigns with name, platform, and status.
+
+### Integration Health
+
+Quick health checks on your local configuration:
+
+| Check | Pass Condition |
+|---|---|
+| Config found | `.linkrunner.json` exists |
+| Token configured | `project_token` is set |
+| Platforms | At least one platform configured |
+| Deep link domain | `deep_link_domain` is set |
+
+## Examples
+
+### Default (last 7 days)
+
+```bash
+lr status
+```
+
+```
+Linkrunner Status
+
+── Project Info ──
+ Name: My App
+ ID: 12345
+ Platforms: android, ios
+ Domain: links.myapp.com
+ Environment: production
+
+── Recent Activity (last 7 days) ──
+ Installs: 1,234
+ Signups: 567
+ Events: 8,901
+ Revenue: $2,345.67
+
+── Active Campaigns ──
+ - Summer Sale (meta) — active
+ - App Launch (google) — active
+
+── Integration Health ──
+ ✔ .linkrunner.json found
+ ✔ Project token configured
+ ✔ Platforms: android, ios
+ ✔ Deep link domain configured
+```
+
+### Custom time window
+
+```bash
+lr status --days 30
+```
+
+### JSON output
+
+```bash
+lr status --json
+```
+
+```json
+{
+ "project": {
+ "name": "My App",
+ "id": "12345",
+ "platforms": ["android", "ios"],
+ "deep_link_domain": "links.myapp.com",
+ "environment": "production"
+ },
+ "activity": {
+ "days": 7,
+ "installs": 1234,
+ "signups": 567,
+ "events": 8901,
+ "revenue": 2345.67,
+ "currency": "USD"
+ },
+ "campaigns": [
+ { "id": 1, "name": "Summer Sale", "status": "active", "platform": "meta" }
+ ],
+ "health": [
+ { "check": "config_found", "status": "pass", "message": ".linkrunner.json found" },
+ { "check": "token_configured", "status": "pass", "message": "Project token configured" }
+ ]
+}
+```
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- detailed integration diagnostics
+- [lr test](/cli/commands/test) -- verify API connectivity
+- [lr login](/cli/commands/login) -- authenticate before using status
diff --git a/cli/commands/suggest.mdx b/cli/commands/suggest.mdx
new file mode 100644
index 0000000..951c685
--- /dev/null
+++ b/cli/commands/suggest.mdx
@@ -0,0 +1,127 @@
+---
+title: "lr suggest"
+description: "Get SDK feature integration suggestions"
+icon: "lightbulb"
+---
+
+## Usage
+
+```bash
+lr suggest [options]
+```
+
+## Description
+
+Scans your source code to determine which Linkrunner SDK features you are using and which ones are missing. Provides examples and documentation links for unintegrated features. Optionally includes AI-powered recommendations tailored to your specific project.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--json` | Output results as JSON |
+| `--no-ai` | Skip AI-powered recommendations |
+
+## Checked Features
+
+The CLI scans your source files for these SDK features:
+
+| Feature | Description | Severity |
+|---|---|---|
+| `init()` | SDK initialization | Error (required) |
+| `signup()` | User registration tracking | Warning |
+| `setUserData()` | User data enrichment | Warning |
+| `trackEvent()` | Custom event tracking | Warning |
+| `capturePayment()` | Revenue tracking | Warning |
+| Deep links | Deep link handling | Warning |
+
+Each feature is checked using platform-specific patterns. For example, Flutter looks for `LinkRunner().init(`, while React Native looks for `linkrunner.init(`.
+
+## Output
+
+For each missing feature, the CLI shows:
+
+- Why it matters
+- A code example for your platform
+- A link to the documentation
+
+```
+── Feature Integration Status ──
+ ✔ init() — SDK initialization
+ ✔ signup() — User registration tracking
+ ⚠ setUserData() — User data enrichment
+ Enables user-level analytics and segmentation
+ Example:
+ await linkrunner.setUserData({ id: 'USER_ID' });
+ Docs: https://docs.linkrunner.io/sdk/react-native
+ ⚠ trackEvent() — Custom event tracking
+ Track in-app events for campaign optimization
+ Example:
+ await linkrunner.trackEvent({ name: 'event_name', data: {} });
+ Docs: https://docs.linkrunner.io/sdk/react-native
+ ✔ capturePayment() — Revenue tracking
+ ⚠ Deep links — Deep link handling
+ Enable deferred deep links and attribution
+ Example:
+ const initData = await linkrunner.getInitData();
+ Docs: https://docs.linkrunner.io/sdk/react-native
+
+Score: 3/6 features integrated
+```
+
+## AI Recommendations
+
+When you are authenticated and `--no-ai` is not set, the CLI sends your project context to an AI model for personalized suggestions. These go beyond the standard feature checks:
+
+```
+── AI Recommendations ──
+ * Deferred Deep Linking
+ Your app has onboarding screens — consider routing users to specific
+ content after install using deferred deep links.
+ Example:
+ const initData = await linkrunner.getInitData();
+```
+
+## JSON Output
+
+```bash
+lr suggest --json
+```
+
+```json
+{
+ "platform": "react-native",
+ "sdkVersion": "2.3.0",
+ "root": "/path/to/project",
+ "features": [
+ {
+ "key": "init",
+ "name": "init()",
+ "description": "SDK initialization",
+ "found": true,
+ "example": "await linkrunner.init({ token: 'YOUR_TOKEN' });",
+ "docsUrl": "https://docs.linkrunner.io/sdk/react-native"
+ },
+ {
+ "key": "signup",
+ "name": "signup()",
+ "description": "User registration tracking",
+ "found": false,
+ "example": "await linkrunner.signup({ userId: 'USER_ID' });",
+ "docsUrl": "https://docs.linkrunner.io/sdk/react-native"
+ }
+ ],
+ "score": { "integrated": 3, "total": 6 },
+ "aiSuggestions": [
+ {
+ "feature": "Deferred Deep Linking",
+ "reason": "Your app has onboarding screens...",
+ "example": "const initData = await linkrunner.getInitData();"
+ }
+ ]
+}
+```
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- validate configuration and code
+- [lr events add](/cli/commands/events) -- generate event tracking code
diff --git a/cli/commands/test.mdx b/cli/commands/test.mdx
new file mode 100644
index 0000000..8579dc5
--- /dev/null
+++ b/cli/commands/test.mdx
@@ -0,0 +1,113 @@
+---
+title: "lr test"
+description: "Test SDK connectivity and token validity"
+icon: "flask-vial"
+---
+
+## Usage
+
+```bash
+lr test [options]
+```
+
+## Description
+
+Verifies that your project token is valid and the Linkrunner API is reachable. With the `--deep` flag, it also checks that your deep link domain and verification files (`assetlinks.json` and `apple-app-site-association`) are correctly hosted.
+
+Requires a `.linkrunner.json` file in your project. Run `lr init` first if you don't have one.
+
+## Options
+
+| Flag | Description |
+|---|---|
+| `--json` | Output results as JSON |
+| `--deep` | Also verify deep link domain and verification files |
+| `--ci` | Exit with code 0 (pass) or 1 (fail) |
+
+## What It Checks
+
+### Token Verification
+
+- Sends your project token to the Linkrunner API
+- Confirms the token is valid and the project exists
+- Reports API response time
+
+### Deep Link Verification (`--deep`)
+
+When your `.linkrunner.json` includes a `deep_link_domain`, the `--deep` flag checks:
+
+| Check | URL |
+|---|---|
+| Domain reachability | `https://{domain}` |
+| Android assetlinks.json | `https://{domain}/.well-known/assetlinks.json` |
+| iOS apple-app-site-association | `https://{domain}/.well-known/apple-app-site-association` |
+
+Each check has a 10-second timeout.
+
+## Examples
+
+### Basic token test
+
+```bash
+lr test
+```
+
+```
+Linkrunner SDK Test
+
+ Environment: production
+ Project: My App (ID: 12345)
+
+── Token Verification ──
+ ✔ Project token is valid
+ ✔ API responded in 142ms
+
+Summary: 2 passed, 0 warnings, 0 errors
+```
+
+### With deep link checks
+
+```bash
+lr test --deep
+```
+
+```
+── Token Verification ──
+ ✔ Project token is valid
+ ✔ API responded in 142ms
+
+── Deep Link Verification ──
+ ✔ Domain links.myapp.com is reachable
+ ✔ /.well-known/assetlinks.json returns valid response
+ ✔ /.well-known/apple-app-site-association returns valid response
+
+Summary: 5 passed, 0 warnings, 0 errors
+```
+
+### JSON output
+
+```bash
+lr test --json
+```
+
+### CI mode
+
+```bash
+lr test --ci
+```
+
+Returns exit code 1 if any errors are found.
+
+## Error Handling
+
+| HTTP Status | Meaning | Suggested Fix |
+|---|---|---|
+| 401 | Invalid project token | Check `.linkrunner.json` or run `lr init` |
+| 404 | Project not found | Project may have been deleted; run `lr init` |
+| Network error | Cannot reach API | Check network connection |
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- full integration diagnostics
+- [lr init](/cli/commands/init) -- create `.linkrunner.json`
+- [lr deeplink setup](/cli/commands/deeplink) -- configure deep link verification files
diff --git a/cli/installation.mdx b/cli/installation.mdx
new file mode 100644
index 0000000..fbd8c0a
--- /dev/null
+++ b/cli/installation.mdx
@@ -0,0 +1,86 @@
+---
+title: "Installation"
+description: "Install and set up the Linkrunner CLI"
+icon: "download"
+---
+
+## Requirements
+
+- Node.js 18+ or [Bun](https://bun.sh) runtime
+- A Linkrunner account ([sign up](https://dashboard.linkrunner.io))
+
+## Install via npm
+
+```bash
+npm install -g linkrunner-cli
+```
+
+## Install via Bun
+
+```bash
+bun install -g linkrunner-cli
+```
+
+## Verify Installation
+
+```bash
+lr --version
+```
+
+You should see output like:
+
+```
+0.1.0
+```
+
+## Authenticate
+
+After installing, log in with your Linkrunner account:
+
+```bash
+lr login
+```
+
+This sends a magic link to your email. Paste the token or URL from the email to complete authentication. See [lr login](/cli/commands/login) for details.
+
+## Initialize a Project
+
+Navigate to your project directory and run:
+
+```bash
+cd your-app/
+lr init
+```
+
+This walks you through:
+
+1. Detecting your project type (Flutter, React Native, Expo, iOS, Android, Capacitor, or Web)
+2. Selecting or creating a Linkrunner project
+3. Installing the appropriate SDK package
+4. Configuring native platform files
+5. Generating initialization code snippets
+6. Saving a `.linkrunner.json` config file
+
+See [lr init](/cli/commands/init) for the full walkthrough.
+
+## Update
+
+To update to the latest version:
+
+```bash
+npm update -g linkrunner-cli
+```
+
+## Uninstall
+
+```bash
+npm uninstall -g linkrunner-cli
+```
+
+This removes the CLI binary. Your `.linkrunner.json` project config and global auth credentials are not affected.
+
+To also clear stored credentials:
+
+```bash
+lr logout
+```
diff --git a/cli/llm-usage.mdx b/cli/llm-usage.mdx
new file mode 100644
index 0000000..a2c1202
--- /dev/null
+++ b/cli/llm-usage.mdx
@@ -0,0 +1,183 @@
+---
+title: "LLM / AI Agent Usage"
+description: "Use the Linkrunner CLI non-interactively with Claude Code, Cursor, and other AI coding assistants"
+icon: "robot"
+---
+
+The `lr` CLI supports fully non-interactive operation, making it usable by LLMs and AI coding agents like Claude Code and Cursor. Every interactive prompt can be bypassed with flags, and most commands support `--json` output.
+
+## Authentication
+
+AI agents need a CLI token or API key. Set it as an environment variable and authenticate non-interactively:
+
+```bash
+export LINKRUNNER_TOKEN="your-token-here"
+lr login --token $LINKRUNNER_TOKEN
+```
+
+Tokens persist in `~/.config/linkrunner-cli/config.json` after login.
+
+## Non-Interactive Init
+
+The `lr init` command is fully scriptable with flags:
+
+```bash
+lr init --project-id 123 --yes --json
+```
+
+### All Init Flags
+
+| Flag | Purpose |
+|------|---------|
+| `--project-id ` | Use this project directly (skip selection prompt) |
+| `--platform ` | Override auto-detected platform type |
+| `--skip-install` | Skip SDK package installation |
+| `--skip-config` | Skip platform config modifications (AndroidManifest, Info.plist) |
+| `--skip-snippets` | Skip code snippet display and auto-insertion |
+| `--skip-doctor` | Skip post-setup doctor check |
+| `--yes` | Accept all defaults without prompting |
+| `--json` | Output structured JSON result |
+
+Valid platform types: `flutter`, `react-native`, `expo`, `ios`, `android`, `capacitor`, `web`
+
+### JSON Output Schema
+
+When using `--json`, init returns:
+
+```json
+{
+ "success": true,
+ "project": {
+ "id": 123,
+ "name": "My App",
+ "company": "My Company"
+ },
+ "platform": "flutter",
+ "configPath": "/path/to/.linkrunner.json",
+ "projectToken": "tok_...",
+ "sdkInstall": {
+ "installed": true,
+ "command": "flutter pub add linkrunner"
+ },
+ "configModifications": {
+ "applied": ["Add INTERNET and ACCESS_NETWORK_STATE permissions"],
+ "skipped": []
+ },
+ "snippets": {
+ "init": "// initialization code...",
+ "signup": "// signup code...",
+ "setUserData": "// setUserData code..."
+ }
+}
+```
+
+## Complete Non-Interactive Command Reference
+
+### Diagnostics
+
+```bash
+lr doctor --json # Validate SDK integration, JSON output
+lr doctor --fix --json # Auto-fix issues
+lr test --json # Test API connectivity and token validity
+lr test --deep --json # Also verify deep link domains
+lr analyze --json # AI-powered deep analysis
+```
+
+### Deep Linking
+
+```bash
+lr deeplink setup --domain example.com --yes # Configure without prompts
+lr deeplink setup --skip-ios --yes # Android only
+```
+
+### Event Tracking
+
+```bash
+# Custom event (fully non-interactive)
+lr events add --platform flutter --type custom --name "purchase_complete" --json --no-insert
+
+# Payment event (outputs code, no auto-insert)
+lr events add --platform react-native --type payment --json --no-insert
+
+# Signup event
+lr events add --platform expo --type signup --json --no-insert
+```
+
+### Project Info
+
+```bash
+lr status --json # Project dashboard data
+lr suggest --json # Feature recommendations
+```
+
+## LLM Workflows
+
+### Initial Project Setup
+
+```bash
+# 1. Authenticate
+lr login --token $LINKRUNNER_TOKEN
+
+# 2. Initialize SDK (non-interactive)
+lr init --project-id 123 --yes --json
+
+# 3. Verify setup
+lr doctor --json
+```
+
+### Diagnose and Fix Issues
+
+```bash
+# 1. Check for problems
+lr doctor --json
+
+# 2. Auto-fix what's possible
+lr doctor --fix --json
+
+# 3. Verify API connectivity
+lr test --json
+```
+
+### Add Event Tracking
+
+```bash
+# 1. Generate event code
+lr events add --platform flutter --type custom --name "button_click" --json --no-insert
+
+# 2. Parse the JSON output and insert the code at the appropriate location
+```
+
+### Minimal Setup (Skip Everything Optional)
+
+```bash
+lr init --project-id 123 --platform flutter --skip-install --skip-config --skip-snippets --skip-doctor --json
+```
+
+This creates only the `.linkrunner.json` config file without touching any other project files.
+
+## Context File Templates
+
+The CLI includes template files that AI agents can use for context:
+
+- **`LINKRUNNER_CLAUDE.md`** -- append to your project's `CLAUDE.md` for Claude Code
+- **`linkrunner.cursorrules`** -- add to your project root for Cursor
+
+These templates contain the complete non-interactive command reference, common workflows, and key config file locations.
+
+## Key Config Files
+
+| File | Purpose |
+|------|---------|
+| `.linkrunner.json` | Project configuration (token, platform settings, credentials) |
+| `android/app/src/main/AndroidManifest.xml` | Android permissions and deep link intent filters |
+| `ios//Info.plist` | iOS tracking permissions |
+| `app.json` | Expo plugin configuration |
+
+## Global Flags
+
+These flags work with any command:
+
+| Flag | Purpose |
+|------|---------|
+| `--debug` | Enable verbose debug logging |
+| `--env ` | Override environment (production, staging, local) |
diff --git a/cli/overview.mdx b/cli/overview.mdx
new file mode 100644
index 0000000..b89b574
--- /dev/null
+++ b/cli/overview.mdx
@@ -0,0 +1,64 @@
+---
+title: "CLI Overview"
+description: "The Linkrunner CLI helps you set up, validate, and debug your SDK integration from the terminal"
+icon: "terminal"
+---
+
+The `lr` CLI is a developer tool for integrating and maintaining the Linkrunner SDK in your mobile and web projects. It automates setup, validates configuration, generates code snippets, and provides real-time project diagnostics -- all from the terminal.
+
+## What You Can Do
+
+
+
+ Run `lr init` and the CLI detects your platform, installs the SDK, configures native files, and generates initialization code. No manual setup required.
+
+
+ `lr doctor` validates your entire integration -- platform config, source code patterns, deep link setup -- and tells you exactly what to fix.
+
+
+ `lr analyze` uses an LLM to inspect your codebase for subtle integration issues that rule-based checks can miss.
+
+
+ `lr events add` interactively generates custom events, payment tracking, and signup code -- and inserts it directly into your source files.
+
+
+ `lr deeplink setup` configures Android App Links and iOS Universal Links with intent filters and verification files.
+
+
+ `lr status` shows installs, signups, events, revenue, and active campaigns without leaving your terminal.
+
+
+
+## Supported Platforms
+
+The CLI auto-detects your project type and tailors its behavior accordingly:
+
+| Platform | Detection Method |
+|---|---|
+| Flutter | `pubspec.yaml` in project root |
+| React Native | `react-native` in `package.json` dependencies |
+| Expo | `expo` in `package.json` dependencies |
+| iOS | `.xcodeproj` or `.xcworkspace` in project root |
+| Android | `build.gradle` or `build.gradle.kts` in project root |
+| Capacitor | `@capacitor/core` in `package.json` dependencies |
+| Web | `package.json` present (fallback) |
+
+## All Commands
+
+| Command | Description |
+|---|---|
+| [`lr login`](/cli/commands/login) | Authenticate with your Linkrunner account |
+| `lr logout` | Log out from the CLI |
+| [`lr init`](/cli/commands/init) | Initialize the SDK in your project |
+| [`lr doctor`](/cli/commands/doctor) | Diagnose SDK integration issues |
+| `lr validate` | Alias for `lr doctor` |
+| [`lr analyze`](/cli/commands/analyze) | Run AI-powered deep analysis |
+| [`lr test`](/cli/commands/test) | Verify token validity and API connectivity |
+| [`lr events add`](/cli/commands/events) | Generate event tracking code |
+| [`lr deeplink setup`](/cli/commands/deeplink) | Configure deep linking |
+| [`lr suggest`](/cli/commands/suggest) | Get SDK feature suggestions |
+| [`lr status`](/cli/commands/status) | View project dashboard |
+
+## CI/CD Ready
+
+Every command supports `--json` output and meaningful exit codes, so you can plug `lr doctor` or `lr test` into your CI pipeline to catch integration regressions automatically. See the [CI/CD guide](/cli/ci-cd) for setup instructions.
diff --git a/cli/quickstart.mdx b/cli/quickstart.mdx
new file mode 100644
index 0000000..e9b9833
--- /dev/null
+++ b/cli/quickstart.mdx
@@ -0,0 +1,83 @@
+---
+title: "Quickstart"
+description: "Go from zero to a validated Linkrunner integration in under 5 minutes"
+icon: "rocket"
+---
+
+## 1. Authenticate
+
+```bash
+lr login
+```
+
+This sends a magic link to your email. Paste the token or URL from the email to complete authentication.
+
+## 2. Initialize Your Project
+
+Navigate to your project directory and run:
+
+```bash
+cd your-app/
+lr init
+```
+
+The CLI walks you through:
+
+1. Detecting your project type (Flutter, React Native, Expo, iOS, Android, Capacitor, or Web)
+2. Selecting or creating a Linkrunner project
+3. Installing the appropriate SDK package
+4. Configuring native platform files
+5. Generating initialization code snippets
+6. Saving a `.linkrunner.json` config file
+
+## 3. Validate Your Integration
+
+```bash
+lr doctor
+```
+
+This checks your platform configuration, source code patterns, and deep link setup. Fix anything it flags, then run it again until you get a clean report.
+
+## What's Next
+
+
+
+ Configure Android App Links and iOS Universal Links.
+
+
+ Generate custom event, payment, and signup tracking code.
+
+
+ Deep-scan your codebase for subtle integration issues.
+
+
+ Check installs, events, revenue, and campaigns from the terminal.
+
+
+
+## Configuration Files
+
+The CLI uses two configuration locations:
+
+- **Global config** -- stored in your system config directory (managed by [conf](https://github.com/sindresorhus/conf)). Contains your auth token and email.
+- **Project config** -- `.linkrunner.json` in your project root. Created by `lr init` and contains your project token, platform settings, and deep link domain.
+
+Example `.linkrunner.json`:
+
+```json
+{
+ "project_token": "your_token_here",
+ "project_id": "12345",
+ "project_name": "My App",
+ "platforms": ["android", "ios"],
+ "deep_link_domain": "links.myapp.com",
+ "android": {
+ "package_name": "com.myapp.android",
+ "sha256_cert_fingerprints": ["AB:CD:EF:..."]
+ },
+ "ios": {
+ "bundle_id": "com.myapp.ios",
+ "team_id": "ABCDE12345"
+ }
+}
+```
diff --git a/cli/troubleshooting.mdx b/cli/troubleshooting.mdx
new file mode 100644
index 0000000..fc66ce2
--- /dev/null
+++ b/cli/troubleshooting.mdx
@@ -0,0 +1,175 @@
+---
+title: "Troubleshooting"
+description: "Common CLI issues and how to resolve them"
+icon: "wrench"
+---
+
+## Authentication Issues
+
+### "Not authenticated" error
+
+```
+✘ Not authenticated
+ Fix: Run `lr login` to authenticate
+```
+
+Run `lr login` and complete the magic link flow. Your auth token is stored globally and persists across sessions.
+
+### Magic link expired
+
+```
+✘ Verification failed
+ The link may have expired. Run `lr login` to try again.
+```
+
+Magic links expire after 15 minutes. Run `lr login` again to request a new one.
+
+### Cannot receive magic link email
+
+- Check your spam/junk folder
+- Verify you are using the email associated with your Linkrunner account
+- Contact [darshil@linkrunner.io](mailto:darshil@linkrunner.io) if the issue persists
+
+## Project Detection Issues
+
+### "Could not detect project type"
+
+```
+✘ Could not detect project type. Run this command from your project root.
+```
+
+The CLI detects project type by looking for marker files in the current directory:
+
+| File | Detected As |
+|---|---|
+| `pubspec.yaml` | Flutter |
+| `package.json` with `expo` | Expo |
+| `package.json` with `react-native` | React Native |
+| `package.json` with `@capacitor/core` | Capacitor |
+| `.xcodeproj` / `.xcworkspace` | iOS |
+| `build.gradle` / `build.gradle.kts` | Android |
+| `package.json` (any) | Web |
+
+Make sure you are running the command from your project root directory where these files exist.
+
+### Wrong project type detected
+
+During `lr init`, if the wrong type is detected, choose "No" when asked to confirm and select the correct type from the list.
+
+For `lr events add`, use the `--platform` flag to override:
+
+```bash
+lr events add --platform react-native
+```
+
+## Configuration Issues
+
+### "No .linkrunner.json found"
+
+```
+✘ No .linkrunner.json found
+ Fix: Run `lr init` to set up your project
+```
+
+Commands like `lr test`, `lr status`, and `lr deeplink setup` require a `.linkrunner.json` file. Run `lr init` from your project root to create one.
+
+The CLI searches up to 10 parent directories for this file, so you can run commands from subdirectories.
+
+### Invalid project token
+
+```
+✘ Invalid project token
+ Fix: Check your .linkrunner.json or run `lr init` to reconfigure
+```
+
+Your project token may have been rotated or the project deleted. Run `lr init` again to re-fetch credentials.
+
+## Deep Link Issues
+
+### "Domain not reachable"
+
+```
+⚠ Domain links.myapp.com is not reachable
+ Fix: Verify your deep link domain is correctly configured
+```
+
+- Confirm your domain DNS is configured correctly
+- Check that HTTPS is working on the domain
+- Verify the domain in your [Linkrunner dashboard](https://dashboard.linkrunner.io/settings?s=domains)
+
+### "assetlinks.json not found" or "apple-app-site-association not found"
+
+```
+⚠ /.well-known/assetlinks.json not found
+ Fix: Upload assetlinks.json to your deep link domain for Android App Links
+```
+
+Use `lr deeplink setup` to generate the verification files, then host them at:
+
+- **Android:** `https://{domain}/.well-known/assetlinks.json`
+- **iOS:** `https://{domain}/.well-known/apple-app-site-association`
+
+See [Deep Linking Verification](/features/deep-linking-verification) for hosting details.
+
+### "No SHA-256 certificate fingerprints configured"
+
+Add your signing certificate fingerprints to `.linkrunner.json`:
+
+```json
+{
+ "android": {
+ "package_name": "com.myapp.android",
+ "sha256_cert_fingerprints": ["AB:CD:EF:..."]
+ }
+}
+```
+
+You can get your fingerprint with:
+
+```bash
+keytool -list -v -keystore your-keystore.jks
+```
+
+## AI Features
+
+### "Deep analysis unavailable"
+
+```
+ℹ Deep analysis unavailable. Run 'lr login' to enable AI-powered features.
+```
+
+AI features (`lr analyze`, `lr doctor --deep`, `lr suggest` with AI) require authentication. Run `lr login` first.
+
+### "Deep analysis could not be completed"
+
+The AI service may be temporarily unavailable. Standard diagnostics still run. Try again later.
+
+## SDK Install Issues
+
+### Install command fails during lr init
+
+If the automatic install fails:
+
+```
+⚠ Install may have issues. Run manually: flutter pub add linkrunner
+```
+
+Run the install command manually. Common causes:
+
+- Network issues
+- Package manager not installed or not in PATH
+- Incompatible SDK version
+
+## Getting Help
+
+If you cannot resolve an issue:
+
+1. Run `lr doctor --json` and save the output
+2. Run `lr test --json` and save the output
+3. Contact [darshil@linkrunner.io](mailto:darshil@linkrunner.io) with both outputs
+
+## Related
+
+- [lr doctor](/cli/commands/doctor) -- diagnose integration issues
+- [lr test](/cli/commands/test) -- test API connectivity
+- [lr init](/cli/commands/init) -- set up or reconfigure your project
diff --git a/docs.json b/docs.json
index 69b3d27..9dbb0f5 100644
--- a/docs.json
+++ b/docs.json
@@ -95,6 +95,33 @@
"pages": ["billing/overview"]
}
]
+ },
+ {
+ "tab": "CLI",
+ "groups": [
+ {
+ "group": "Getting Started",
+ "pages": ["cli/overview", "cli/installation", "cli/quickstart"]
+ },
+ {
+ "group": "Commands",
+ "pages": [
+ "cli/commands/login",
+ "cli/commands/init",
+ "cli/commands/doctor",
+ "cli/commands/test",
+ "cli/commands/analyze",
+ "cli/commands/events",
+ "cli/commands/deeplink",
+ "cli/commands/suggest",
+ "cli/commands/status"
+ ]
+ },
+ {
+ "group": "Guides",
+ "pages": ["cli/ci-cd", "cli/troubleshooting"]
+ }
+ ]
}
]
},
diff --git a/features/deep-linking-setup.mdx b/features/deep-linking-setup.mdx
index 01071c5..62c3c78 100644
--- a/features/deep-linking-setup.mdx
+++ b/features/deep-linking-setup.mdx
@@ -4,6 +4,10 @@ description: "Learn how to set up deep linking with subdomains and custom URI sc
icon: "link"
---
+
+ **CLI shortcut:** Run `lr deeplink setup` to configure deep linking for Android and iOS automatically. [Learn more →](/cli/commands/deeplink)
+
+
Deep links allow users to navigate directly to specific content within your app by clicking on a URL. There are two primary approaches to deep linking:
1. **[HTTP/HTTPS Deep Links](#httphttps-deep-linking-with-subdomains)** (including subdomains): URLs with `http://` or `https://` protocols that can open your app when clicked.
diff --git a/features/deep-linking-verification.mdx b/features/deep-linking-verification.mdx
index 0c64f40..08df745 100644
--- a/features/deep-linking-verification.mdx
+++ b/features/deep-linking-verification.mdx
@@ -4,6 +4,10 @@ description: "Learn how to verify your domains for App Links on Android and Univ
icon: "check"
---
+
+ **CLI shortcut:** Run `lr deeplink setup` to configure deep linking, or `lr test --deep` to verify your deep link setup. [Learn more →](/cli/commands/deeplink)
+
+
For HTTP/HTTPS deep links to work reliably, you need to verify that your app is the legitimate owner of the domain. This verification process is different for Android (App Links) and iOS (Universal Links).
This guide explains how to verify your domains for both platforms and integrate with Linkrunner.
diff --git a/features/deferred-deep-linking.mdx b/features/deferred-deep-linking.mdx
index ba80f3b..a997595 100644
--- a/features/deferred-deep-linking.mdx
+++ b/features/deferred-deep-linking.mdx
@@ -6,6 +6,10 @@ icon: "link-simple"
Direct users to specific screens after they install your app from a campaign link. Works on Android & iOS.
+
+ **CLI shortcut:** Run `lr doctor` to verify your `getAttributionData` integration is working correctly. [Learn more →](/cli/commands/doctor)
+
+
## Quick Example
**Campaign Setup:** Enable deferred deep linking, set URL to `get.yourdomain.com/product/123`
diff --git a/features/skadnetwork-integration.mdx b/features/skadnetwork-integration.mdx
index 411519f..325263b 100644
--- a/features/skadnetwork-integration.mdx
+++ b/features/skadnetwork-integration.mdx
@@ -6,6 +6,10 @@ icon: "apple"
SKAdNetwork integration allows Linkrunner to provide privacy-preserving attribution for iOS campaigns through Apple's framework.
+
+ **CLI shortcut:** Run `lr doctor` to validate your Info.plist configuration for SKAdNetwork. [Learn more →](/cli/commands/doctor)
+
+
## Prerequisites
### SDK Updates
diff --git a/introduction.mdx b/introduction.mdx
index 84af3d3..97de76c 100644
--- a/introduction.mdx
+++ b/introduction.mdx
@@ -18,11 +18,43 @@ Linkrunner is a Mobile Measurement Partner (MMP) that helps you track user journ
Validate your integration end-to-end
-
- Access attribution data programmatically
+
+ Automate SDK setup and validation from the terminal
+## Linkrunner CLI
+
+The `lr` CLI automates SDK integration end-to-end — from installing packages and configuring native files to generating tracking code and validating your setup. What typically takes hours of reading docs, editing config files, and debugging platform-specific issues can be done in minutes with a single command.
+
+
+
+ Detects your platform, installs the SDK, configures native files, and generates initialization code — all from `lr init`
+
+
+ `lr doctor` validates your configuration, source code patterns, and deep link setup with actionable fix suggestions before you ship
+
+
+ `lr analyze` uses AI to inspect your codebase for subtle integration issues that manual reviews miss
+
+
+
+
+
+ Generate event tracking, payment, and signup code with `lr events add` — auto-inserted into your source files
+
+
+ JSON output and exit codes let you catch integration regressions automatically in every build
+
+
+ Set up Android App Links and iOS Universal Links with `lr deeplink setup` — no manual file editing
+
+
+
+
+ Install the CLI and integrate your SDK in under 5 minutes
+
+
## Key Capabilities
diff --git a/sdk/android.mdx b/sdk/android.mdx
index cbc7ce7..f3d6da6 100644
--- a/sdk/android.mdx
+++ b/sdk/android.mdx
@@ -33,6 +33,10 @@ dependencyResolutionManagement {
}
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your Android project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Step 2: Required Permissions
Add the following permissions to your `AndroidManifest.xml` file:
@@ -177,6 +181,10 @@ class MyApplication : Application() {
}
```
+
+ **CLI shortcut:** Use `lr init` to generate this initialization code automatically. [Learn more →](/cli/commands/init)
+
+
### SDK Signing Parameters (Optional)
For enhanced security, the LinkRunner SDK requires the following signing parameters during initialization:
@@ -231,6 +239,10 @@ private fun onSignup() {
}
```
+
+ **CLI shortcut:** Use `lr events add` to generate signup tracking code. [Learn more →](/cli/commands/events)
+
+
## Getting Attribution Data
To get attribution data and deeplink information for the current installation, use the `getAttributionData` function:
@@ -350,6 +362,10 @@ private fun trackEvent() {
}
```
+
+ **CLI shortcut:** Use `lr events add --type custom` to generate event tracking snippets. [Learn more →](/cli/commands/events)
+
+
### Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include an `amount` parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
@@ -440,6 +456,10 @@ private fun capturePayment() {
| `PAYMENT_FAILED` | Payment failed |
| `PAYMENT_CANCELLED` | Payment was cancelled |
+
+ **CLI shortcut:** Use `lr events add --type payment` to generate payment tracking code. [Learn more →](/cli/commands/events)
+
+
### Removing Payments
To remove or refund a payment:
@@ -626,6 +646,10 @@ class MainActivity : AppCompatActivity() {
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/capacitor.mdx b/sdk/capacitor.mdx
index 88c48ba..b5371d7 100644
--- a/sdk/capacitor.mdx
+++ b/sdk/capacitor.mdx
@@ -16,6 +16,10 @@ npm install capacitor-linkrunner
yarn add capacitor-linkrunner
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your Capacitor project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Step 2: Sync Native Projects
```bash
@@ -116,6 +120,9 @@ const init = async () => {
init();
```
+
+ **CLI shortcut:** Use `lr init` to generate this initialization code automatically. [Learn more →](/cli/commands/init)
+
## User Registration
@@ -160,6 +167,10 @@ const onSignup = async () => {
};
```
+
+ **CLI shortcut:** Use `lr events add` to generate signup tracking code. [Learn more →](/cli/commands/events)
+
+
## Getting Attribution Data
To get attribution data and deeplink information for the current installation, use the `getAttributionData` function:
@@ -251,6 +262,10 @@ const trackEvent = async () => {
};
```
+
+ **CLI shortcut:** Use `lr events add --type custom` to generate event tracking snippets. [Learn more →](/cli/commands/events)
+
+
### Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include an `amount` parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
@@ -312,6 +327,10 @@ const capturePayment = async () => {
- `PAYMENT_FAILED` - Payment attempt failed
- `PAYMENT_CANCELLED` - Payment was cancelled
+
+ **CLI shortcut:** Use `lr events add --type payment` to generate payment tracking code. [Learn more →](/cli/commands/events)
+
+
### Removing Payments
Remove payment records (for refunds or cancellations):
@@ -371,6 +390,10 @@ When PII hashing is enabled, sensitive user data like name, email, and phone num
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/expo.mdx b/sdk/expo.mdx
index cf87a6e..9c58eec 100644
--- a/sdk/expo.mdx
+++ b/sdk/expo.mdx
@@ -29,6 +29,10 @@ npm install rn-linkrunner
npx expo install expo-linkrunner
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your Expo project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Step 2: Add Plugin to app.json
**Important**: You must add the expo-linkrunner plugin to your `app.json` plugins array:
@@ -139,6 +143,10 @@ Starting with version 3.0.0, the Expo SDK has been redesigned to use a new archi
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/flutter.mdx b/sdk/flutter.mdx
index 76cb767..f793db3 100644
--- a/sdk/flutter.mdx
+++ b/sdk/flutter.mdx
@@ -48,6 +48,10 @@ This command will automatically:
- Add the latest version of `linkrunner` to your `pubspec.yaml`
- Download and install the package and its dependencies
+
+ **CLI shortcut:** Run `lr init` to auto-configure your Flutter project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Step 2: Platform Specific Setup
#### Android Configuration
@@ -163,6 +167,10 @@ void initState() {
}
```
+
+ **CLI shortcut:** Use `lr init` to generate this initialization code automatically. [Learn more →](/cli/commands/init)
+
+
### Platform-Specific SDK Signing
For applications requiring different signing keys per platform:
@@ -228,6 +236,10 @@ Future onSignup() async {
}
```
+
+ **CLI shortcut:** Use `lr events add` to generate signup tracking code. [Learn more →](/cli/commands/events)
+
+
## Getting Attribution Data
To get attribution data and deeplink information for the current installation, use the `getAttributionData` function:
@@ -355,6 +367,10 @@ Future trackEvent() async {
}
```
+
+ **CLI shortcut:** Use `lr events add --type custom` to generate event tracking snippets. [Learn more →](/cli/commands/events)
+
+
### Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include an `amount` parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
@@ -429,6 +445,10 @@ Future capturePayment() async {
- `PaymentStatus.PAYMENT_FAILED` - Payment attempt failed
- `PaymentStatus.PAYMENT_CANCELLED` - Payment was cancelled
+
+ **CLI shortcut:** Use `lr events add --type payment` to generate payment tracking code. [Learn more →](/cli/commands/events)
+
+
### Removing Payments
Remove payment records (for refunds or cancellations):
@@ -760,6 +780,10 @@ class _HomeScreenState extends State {
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/ios.mdx b/sdk/ios.mdx
index fb031ca..f5e914c 100644
--- a/sdk/ios.mdx
+++ b/sdk/ios.mdx
@@ -46,6 +46,10 @@ targets: [
]
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your iOS project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Importing in Swift
After installation, you can import the SDK in your Swift files:
@@ -120,6 +124,10 @@ struct MyApp: App {
}
```
+
+ **CLI shortcut:** Use `lr init` to generate this initialization code automatically. [Learn more →](/cli/commands/init)
+
+
### SDK Signing Parameters (Optional)
For enhanced security, the LinkRunner SDK requires the following signing parameters during initialization:
@@ -174,6 +182,10 @@ func onSignup() async {
}
```
+
+ **CLI shortcut:** Use `lr events add` to generate signup tracking code. [Learn more →](/cli/commands/events)
+
+
## Getting Attribution Data
To get attribution data and deeplink information for the current installation, use the `getAttributionData` function:
@@ -280,6 +292,10 @@ func trackEvent() async {
}
```
+
+ **CLI shortcut:** Use `lr events add --type custom` to generate event tracking snippets. [Learn more →](/cli/commands/events)
+
+
### Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include an `amount` parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
@@ -357,6 +373,10 @@ public enum PaymentStatus: String, Sendable {
}
```
+
+ **CLI shortcut:** Use `lr events add --type payment` to generate payment tracking code. [Learn more →](/cli/commands/events)
+
+
### Removing Payments
Remove payment records (for refunds or cancellations):
@@ -479,6 +499,10 @@ struct ContentView: View {
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/react-native.mdx b/sdk/react-native.mdx
index ce8b76e..cac579a 100644
--- a/sdk/react-native.mdx
+++ b/sdk/react-native.mdx
@@ -16,6 +16,10 @@ npm install rn-linkrunner
yarn add rn-linkrunner
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your React Native project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Step 2: iOS Configuration
If you're developing for iOS, follow these additional steps:
@@ -93,6 +97,10 @@ const init = async () => {
};
```
+
+ **CLI shortcut:** Use `lr init` to generate this initialization code automatically. [Learn more →](/cli/commands/init)
+
+
## User Registration
Call the `signup` method once after the user has completed your app's onboarding process:
@@ -134,6 +142,10 @@ const onSignup = async () => {
};
```
+
+ **CLI shortcut:** Use `lr events add` to generate signup tracking code. [Learn more →](/cli/commands/events)
+
+
## Getting Attribution Data
To get attribution data and deeplink information for the current installation, use the `getAttributionData` function:
@@ -218,6 +230,10 @@ const trackEvent = async () => {
};
```
+
+ **CLI shortcut:** Use `lr events add --type custom` to generate event tracking snippets. [Learn more →](/cli/commands/events)
+
+
### Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include an `amount` parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
@@ -277,6 +293,10 @@ const capturePayment = async () => {
- `PAYMENT_FAILED` - Payment attempt failed
- `PAYMENT_CANCELLED` - Payment was cancelled
+
+ **CLI shortcut:** Use `lr events add --type payment` to generate payment tracking code. [Learn more →](/cli/commands/events)
+
+
### Removing Payments
Remove payment records (for refunds or cancellations):
@@ -332,6 +352,10 @@ When PII hashing is enabled, sensitive user data like name, email, and phone num
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).
diff --git a/sdk/web.mdx b/sdk/web.mdx
index 35982ad..ca9ea48 100644
--- a/sdk/web.mdx
+++ b/sdk/web.mdx
@@ -40,6 +40,10 @@ npm install @linkrunner/web-sdk
yarn add @linkrunner/web-sdk
```
+
+ **CLI shortcut:** Run `lr init` to auto-configure your web project and generate initialization code. [Learn more →](/cli/commands/init)
+
+
### Module Import
After installing via NPM, import the SDK:
@@ -247,6 +251,10 @@ export default function Home() {
+
+ **CLI shortcut:** Run `lr doctor` to validate your full integration, or `lr analyze` for AI-powered analysis. [Learn more →](/cli/commands/doctor)
+
+
## Support
If you encounter issues during integration, contact us at [darshil@linkrunner.io](mailto:darshil@linkrunner.io).