@loglens/cli
v1.1.0
Published
Command-line interface for LogLens log analytics
Readme
LogLens CLI
LogLens log analytics from your terminal.
Install
npm install -g @loglens/cli
# or
pnpm add -g @loglens/cliRequires Node.js 18+.
Authenticate
loglens config set-key llapi_xxxxxxxxxxxxxxxx
loglens config set-website 23955f93-02cf-4728-b4d2-8022c4a2cc82API keys are managed at app.loglens.ai/settings. Once a default website is set you can omit -w on every subsequent command. Config is stored at ~/.loglens/config.json.
loglens config show # print current config (key redacted)
loglens config set-url <u> # override API URL (default: https://api.loglens.ai)Commands
All analytics commands accept -w <id> (website), -h <hours> (default 24), --start/--end (ISO 8601), --json, --csv.
Account
| Command | Description |
|---|---|
| loglens websites | List every website on your account |
$ loglens websites
ID Domain Name
──────────────────────────────────── ────────────────────────── ─────────────
23955f93-02cf-4728-b4d2-8022c4a2cc82 keywordspeopleuse.com KPU
8c1e09a3-7720-4f01-9921-bb35a0a17f24 example.com ExampleTraffic analytics
| Command | Description |
|---|---|
| loglens summary | Headline metrics (requests, unique IPs, bot share, error rate) |
| loglens traffic [--interval 1h\|1d] | Time-series traffic buckets |
| loglens bots [--split-variants] | Bot/crawler breakdown with verification status |
| loglens paths | Top URL paths |
| loglens geography | Requests by country |
| loglens status-codes | HTTP status code distribution |
| loglens ips | Top client IPs |
| loglens ip-requests --ip <addr> | Per-IP request log (paginated) |
| loglens referrers | Top referrers |
| loglens devices | Device type breakdown |
$ loglens bots -h 168
Bot Requests Category Verified
───────────────── ───────── ────────── ──────────
Googlebot 142,318 search verified
GPTBot 38,221 ai verified
ClaudeBot 12,907 ai verified
bingbot 9,144 search verified
PerplexityBot 4,012 ai unverifiedSEO and crawl
All seo subcommands accept -h <hours> and --bot <name> (e.g. googlebot).
| Command | Description |
|---|---|
| loglens seo overview | Crawler analytics summary |
| loglens seo sitemap [--status never_crawled\|stale\|...] | Sitemap coverage by URL |
| loglens seo budget-urls [--dir /blog] | Crawl budget per URL within a directory |
| loglens seo url-patterns [--min-urls 3] | Auto-detected URL patterns and crawl frequency |
| loglens seo path-explorer | Hierarchical directory tree of crawled paths |
| loglens seo status-consistency [--min-requests 3] | URLs returning inconsistent status codes |
| loglens seo requests [--filter errors\|redirects\|slow] | Raw crawler request log |
| loglens seo robots | Robots.txt fetch and disallow analysis |
| loglens seo url-history --url /blog/post | Crawl history for one URL |
| loglens seo index-coverage | Google index coverage summary |
| loglens seo index-urls --bucket indexed\|crawled_not_indexed\|... | URLs in a specific coverage bucket |
| loglens seo events | Site events / annotations |
$ loglens seo url-patterns --bot googlebot -h 168
Pattern URLs Requests % Crawl Type Flags
──────────────────────────── ───── ──────── ─────── ──────── ─────
/blog/{slug} 412 8,221 34.20 template -
/keyword/{slug} 1,983 5,107 21.25 template -
/api/v1/{*} 14 802 3.34 api noindexOperations
| Command | Description |
|---|---|
| loglens exports | List background export jobs (status, row count, download URL) |
| loglens alerts [--severity critical\|warning\|info] [--alert-type ...] | Fired alert history |
| loglens alerts-config | Current alert configuration (enabled types, thresholds, recipients) |
| loglens llms [--countries US,GB] | LLM/AI-crawler analytics (GPTBot, ClaudeBot, PerplexityBot, etc.) |
$ loglens alerts -h 168 --severity critical
Alert ID Type Severity Name Fired
──────────────────────────────────── ─────────────── ──────── ───────────────────────── ────────────────────
3f8a-... error_spike_5xx critical 5xx spike on /api 2026-05-09T14:02:11Z
b21c-... bot_surge critical GPTBot 12x baseline 2026-05-08T03:44:00Z$ loglens llms -h 168
Total Requests 184,221
Unique Bots 7
Top Bot GPTBot
Top Bot Share 42.10%
Verified Share 91.30%Output formats
- default — colourised table, headers bolded, numbers right-aligned. Where it adds signal (traffic time-series, bot trends), a small inline sparkline is rendered. Long string columns are truncated to 50 chars.
--json— pretty-printed JSON. The full upstream API response, untouched. Pipe tojq.--csv— RFC-4180 CSV with quoted headers. Suitable for spreadsheets.
Examples
Top crawlers for the last 7 days as JSON, piped into jq:
loglens bots -h 168 --json | jq '.bots[] | select(.category == "ai") | {name, requests}'Export every 404 from the last 24h as CSV for the SEO team:
loglens seo requests --filter errors --page-size 500 --csv > 404s.csvWatch the live alert feed (re-run every minute):
watch -n 60 'loglens alerts -h 1 --severity critical'Crawl-budget audit for /blog, sorted/filtered downstream:
loglens seo budget-urls --dir /blog --bot googlebot -h 168 --json \
| jq '.urls | sort_by(-.requests) | .[0:20]'Daily LLM-traffic snapshot mailed to the team:
loglens llms -h 24 --csv | mail -s "Daily AI crawler report" [email protected]