@data-silo/cli
v0.2.0
Published
Command-line client for the Data Silo analytics API.
Readme
@data-silo/cli
Command-line client for the Data Silo analytics API.
Install
npm install -g @data-silo/cliOr run it without installing:
npx @data-silo/cli stats --site YOUR_SITE_IDSetup
Create an API key from a site's Settings page in the Data Silo dashboard, then export it:
export DATASILO_API_KEY=your_key_hereIf you're self-hosting Data Silo instead of using the hosted app, also set:
export DATASILO_API_URL=https://your-instance.example.comUsage
datasilo <command> --site <siteId> [--range 7d|30d|90d]| Command | Description |
| ----------- | ---------------------------------------------------------|
| stats | Pageviews, visitors, bounce rate, avg. duration, live visitors |
| top-pages | Most-viewed pages for the range |
| revenue | Revenue by traffic source (requires Stripe attribution) |
| Flag | Description |
| ----------------- | ----------------------------------------------------|
| --site <id> | required, the site's UUID (from its Settings page) |
| --range <range> | 7d, 30d, or 90d (default: 7d) |
| --api-key <key> | overrides DATASILO_API_KEY for this call |
| --api-url <url> | overrides DATASILO_API_URL for this call |
| --raw | compact JSON instead of pretty-printed |
| -v, --version | print the installed CLI version |
| -h, --help | show usage |
Example
datasilo stats --site 4f9a1c2e-... --range 30d{
"range": "30d",
"liveVisitors": 3,
"pageviews": 12480,
"visitors": 5211,
"bounceRate": 42.1,
"avgDurationSeconds": 96
}Related
- @data-silo/mcp — the same data as MCP tools, for use with Claude Desktop and other MCP clients
