insightfulpipe 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +281 -31
- package/package.json +3 -1
- package/scripts/postinstall.js +33 -0
- package/skills/insightfulpipe/SKILL.md +281 -31
package/SKILL.md
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: insightfulpipe
|
|
3
|
-
description: Query and manage marketing data across 40+ platforms — Google Analytics, Google Ads, Facebook Ads, Instagram, Shopify, HubSpot, Klaviyo, TikTok, LinkedIn, and more.
|
|
3
|
+
description: "Query and manage marketing data across 40+ platforms — Google Analytics, Google Ads, Facebook Ads, Instagram, Shopify, HubSpot, Klaviyo, TikTok, LinkedIn, and more."
|
|
4
4
|
homepage: https://insightfulpipe.com
|
|
5
|
-
metadata:
|
|
5
|
+
metadata:
|
|
6
|
+
{
|
|
7
|
+
"openclaw":
|
|
8
|
+
{
|
|
9
|
+
"emoji": "📊",
|
|
10
|
+
"requires": { "bins": ["insightfulpipe"], "env": ["INSIGHTFULPIPE_TOKEN"] },
|
|
11
|
+
"install":
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
"id": "node",
|
|
15
|
+
"kind": "node",
|
|
16
|
+
"package": "insightfulpipe",
|
|
17
|
+
"bins": ["insightfulpipe"],
|
|
18
|
+
"label": "Install InsightfulPipe CLI (npm)",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
}
|
|
6
23
|
---
|
|
7
24
|
|
|
8
25
|
## Install InsightfulPipe if it doesn't exist
|
|
@@ -23,49 +40,282 @@ npm release: https://www.npmjs.com/package/insightfulpipe
|
|
|
23
40
|
|
|
24
41
|
---
|
|
25
42
|
|
|
43
|
+
## Important: Authentication
|
|
44
|
+
|
|
45
|
+
The `INSIGHTFULPIPE_TOKEN` environment variable should already be configured. Do NOT ask the user to set it or export it. Just run commands directly. If a command fails with "Invalid token" or "Not authenticated", then tell the user their token is not configured.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
26
49
|
## Core Workflow
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
2. **Discover** — List platforms and available actions
|
|
30
|
-
3. **Schema** — Get the exact request body for an action
|
|
31
|
-
4. **Query** — Execute read operations (reports, analytics, listings)
|
|
32
|
-
5. **Execute** — Execute write operations (create, update, delete, publish)
|
|
51
|
+
Every query follows: discover → schema → execute. Run commands directly — do not ask the user for permission to run each one.
|
|
33
52
|
|
|
34
53
|
```bash
|
|
35
|
-
# 1.
|
|
36
|
-
export INSIGHTFULPIPE_TOKEN=ip_sk_your_token
|
|
37
|
-
# or
|
|
38
|
-
insightfulpipe auth
|
|
39
|
-
|
|
40
|
-
# 2. Discover
|
|
41
|
-
insightfulpipe platforms
|
|
54
|
+
# 1. Get account IDs (workspace_id, brand_id, source IDs)
|
|
42
55
|
insightfulpipe accounts --platform <platform> --json
|
|
56
|
+
|
|
57
|
+
# 2. See available actions
|
|
43
58
|
insightfulpipe helper <platform>
|
|
44
59
|
|
|
45
|
-
# 3.
|
|
60
|
+
# 3. Get request body schema for specific actions
|
|
46
61
|
insightfulpipe helper <platform> --actions <action1>,<action2>
|
|
47
62
|
|
|
48
|
-
# 4.
|
|
49
|
-
insightfulpipe query <platform> -b '{"action":"
|
|
63
|
+
# 4. Execute read query
|
|
64
|
+
insightfulpipe query <platform> -b '{"action":"<action>","workspace_id":<id>,"brand_id":<id>,...}'
|
|
65
|
+
|
|
66
|
+
# 5. Execute write operation (requires --yes)
|
|
67
|
+
insightfulpipe action <platform> -b '{"action":"<action>",...}' --yes
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Platform Examples
|
|
73
|
+
|
|
74
|
+
### Google Analytics — Top Pages
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
insightfulpipe accounts --platform google-analytics --json
|
|
78
|
+
insightfulpipe helper google-analytics --actions pages
|
|
79
|
+
insightfulpipe query google-analytics -b '{
|
|
80
|
+
"action": "pages",
|
|
81
|
+
"workspace_id": xxx,
|
|
82
|
+
"brand_id": xxx,
|
|
83
|
+
"property_id": "properties/xxx",
|
|
84
|
+
"dimensions": ["pagePath"],
|
|
85
|
+
"metrics": ["screenPageViews", "activeUsers"],
|
|
86
|
+
"start_date": "2026-03-01",
|
|
87
|
+
"end_date": "2026-03-20",
|
|
88
|
+
"limit": 10
|
|
89
|
+
}'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Google Analytics — Traffic Sources
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
insightfulpipe query google-analytics -b '{
|
|
96
|
+
"action": "traffic_sources",
|
|
97
|
+
"workspace_id": xxx,
|
|
98
|
+
"brand_id": xxx,
|
|
99
|
+
"property_id": "properties/xxx",
|
|
100
|
+
"dimensions": ["sessionSource", "sessionMedium"],
|
|
101
|
+
"metrics": ["sessions", "totalUsers", "bounceRate"],
|
|
102
|
+
"start_date": "2026-03-01",
|
|
103
|
+
"end_date": "2026-03-20"
|
|
104
|
+
}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Google Analytics — Freeform Report
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
insightfulpipe query google-analytics -b '{
|
|
111
|
+
"action": "get_report",
|
|
112
|
+
"workspace_id": xxx,
|
|
113
|
+
"brand_id": xxx,
|
|
114
|
+
"property_id": "properties/xxx",
|
|
115
|
+
"dimensions": ["date", "country"],
|
|
116
|
+
"metrics": ["activeUsers", "sessions"],
|
|
117
|
+
"start_date": "2026-03-01",
|
|
118
|
+
"end_date": "2026-03-20"
|
|
119
|
+
}'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Google Search Console — Top Queries
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
insightfulpipe query google-search-console -b '{
|
|
126
|
+
"action": "search_analytics",
|
|
127
|
+
"workspace_id": xxx,
|
|
128
|
+
"brand_id": xxx,
|
|
129
|
+
"site_url": "https://example.com/",
|
|
130
|
+
"dimensions": ["query"],
|
|
131
|
+
"start_date": "2026-03-01",
|
|
132
|
+
"end_date": "2026-03-20",
|
|
133
|
+
"row_limit": 10
|
|
134
|
+
}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Google Search Console — Pages by Country
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
insightfulpipe query google-search-console -b '{
|
|
141
|
+
"action": "search_analytics",
|
|
142
|
+
"workspace_id": xxx,
|
|
143
|
+
"brand_id": xxx,
|
|
144
|
+
"site_url": "https://example.com/",
|
|
145
|
+
"dimensions": ["page", "country"],
|
|
146
|
+
"start_date": "2026-03-01",
|
|
147
|
+
"end_date": "2026-03-20",
|
|
148
|
+
"row_limit": 20
|
|
149
|
+
}'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Google Sheets — Peek at Columns Then Query
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# First peek to see column names
|
|
156
|
+
insightfulpipe query google-sheets -b '{
|
|
157
|
+
"action": "get_sheet_peak",
|
|
158
|
+
"workspace_id": xxx,
|
|
159
|
+
"brand_id": xxx,
|
|
160
|
+
"spreadsheet_id": "xxx",
|
|
161
|
+
"sheet_id": "0"
|
|
162
|
+
}'
|
|
163
|
+
|
|
164
|
+
# Then query with filters using exact column names from peek
|
|
165
|
+
insightfulpipe query google-sheets -b '{
|
|
166
|
+
"action": "query_sheet_data",
|
|
167
|
+
"workspace_id": xxx,
|
|
168
|
+
"brand_id": xxx,
|
|
169
|
+
"spreadsheet_id": "xxx",
|
|
170
|
+
"sheet_id": "0",
|
|
171
|
+
"select": "Name,Email,Status",
|
|
172
|
+
"where": "Status=Active",
|
|
173
|
+
"limit": 50
|
|
174
|
+
}'
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Google Sheets — Write Cells
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
insightfulpipe action google-sheets -b '{
|
|
181
|
+
"action": "update_cells",
|
|
182
|
+
"workspace_id": xxx,
|
|
183
|
+
"brand_id": xxx,
|
|
184
|
+
"spreadsheet_id": "xxx",
|
|
185
|
+
"sheet_id": "0",
|
|
186
|
+
"range": "A1:C2",
|
|
187
|
+
"values": [["Name", "Email", "Status"], ["John", "john@example.com", "Active"]]
|
|
188
|
+
}' --yes
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Shopify — Recent Orders
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
insightfulpipe query shopify -b '{
|
|
195
|
+
"action": "get_orders",
|
|
196
|
+
"workspace_id": xxx,
|
|
197
|
+
"brand_id": xxx,
|
|
198
|
+
"status": "any",
|
|
199
|
+
"limit": 10
|
|
200
|
+
}'
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Shopify — Products
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
insightfulpipe query shopify -b '{
|
|
207
|
+
"action": "get_products",
|
|
208
|
+
"workspace_id": xxx,
|
|
209
|
+
"brand_id": xxx,
|
|
210
|
+
"limit": 10
|
|
211
|
+
}'
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Any Other Platform
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Same pattern works for all platforms:
|
|
218
|
+
insightfulpipe helper <platform> # See actions
|
|
219
|
+
insightfulpipe helper <platform> --actions <action> # Get body schema
|
|
220
|
+
insightfulpipe query <platform> -b '{...}' # Execute
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Supported platforms include: facebook-ads, instagram, tiktok-ads, tiktok-pages, linkedin-ads, linkedin-pages, hubspot, klaviyo, mailchimp, stripe, slack, telegram, and many more. Run `insightfulpipe platforms` to see the full list.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Common Patterns
|
|
228
|
+
|
|
229
|
+
### Pattern 1: Pipe to jq
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Extract just page paths from GA response
|
|
233
|
+
insightfulpipe query google-analytics -b '{...}' | jq '.data[].pagePath'
|
|
234
|
+
|
|
235
|
+
# Get total sessions
|
|
236
|
+
insightfulpipe query google-analytics -b '{...}' | jq '[.data[].sessions] | add'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Pattern 2: Compare Data Across Platforms
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# GA traffic
|
|
243
|
+
GA=$(insightfulpipe query google-analytics -b '{
|
|
244
|
+
"action": "traffic_sources", "workspace_id": xxx, "brand_id": xxx,
|
|
245
|
+
"property_id": "properties/xxx",
|
|
246
|
+
"dimensions": ["sessionSource"], "metrics": ["sessions"],
|
|
247
|
+
"start_date": "2026-03-01", "end_date": "2026-03-20"
|
|
248
|
+
}')
|
|
249
|
+
|
|
250
|
+
# GSC queries
|
|
251
|
+
GSC=$(insightfulpipe query google-search-console -b '{
|
|
252
|
+
"action": "search_analytics", "workspace_id": xxx, "brand_id": xxx,
|
|
253
|
+
"site_url": "https://example.com/",
|
|
254
|
+
"dimensions": ["query"],
|
|
255
|
+
"start_date": "2026-03-01", "end_date": "2026-03-20", "row_limit": 10
|
|
256
|
+
}')
|
|
257
|
+
|
|
258
|
+
echo "$GA" | jq '.data[:5]'
|
|
259
|
+
echo "$GSC" | jq '.data[:5]'
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Pattern 3: Write Operations
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Always use "action" (not "query") and --yes for writes
|
|
266
|
+
insightfulpipe action google-sheets -b '{
|
|
267
|
+
"action": "create_sheet",
|
|
268
|
+
"workspace_id": xxx,
|
|
269
|
+
"brand_id": xxx,
|
|
270
|
+
"spreadsheet_id": "xxx",
|
|
271
|
+
"title": "New Sheet"
|
|
272
|
+
}' --yes
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Pattern 4: Use Prompts for Guided Analysis
|
|
50
276
|
|
|
51
|
-
|
|
52
|
-
insightfulpipe
|
|
277
|
+
```bash
|
|
278
|
+
insightfulpipe prompts google-analytics # List templates
|
|
279
|
+
insightfulpipe prompts google-analytics --id 12 # Get specific prompt
|
|
53
280
|
```
|
|
54
281
|
|
|
55
|
-
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Gotchas
|
|
56
285
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
286
|
+
1. **Never guess the request body** — always run `helper <platform> --actions <action>` first.
|
|
287
|
+
2. **Replace ALL "xxx" placeholders** — get real values from `accounts --platform <platform> --json`.
|
|
288
|
+
3. **GA property_id needs "properties/" prefix** — use `"properties/510157516"` not `"510157516"`.
|
|
289
|
+
4. **Date format is YYYY-MM-DD** — use `"2026-03-20"` not `"2026-03-20T00:00:00Z"`.
|
|
290
|
+
5. **Use `query` for reads, `action --yes` for writes** — using the wrong one will fail.
|
|
291
|
+
6. **Google Sheets: peek before query** — call `get_sheet_peak` first to see column names.
|
|
292
|
+
7. **Different platforms have different source IDs** — GA uses `property_id`, GSC uses `site_url`, Shopify uses `shop_domain`, Facebook Ads uses `ad_account_id`.
|
|
293
|
+
8. **Empty data is not an error** — `{"status":"success","data":[]}` means no data matched your filters.
|
|
294
|
+
9. **Do not ask the user to export the token** — it should already be set. If auth fails, tell the user to check their token configuration.
|
|
61
295
|
|
|
62
|
-
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## All Commands
|
|
63
299
|
|
|
64
300
|
```bash
|
|
65
|
-
|
|
66
|
-
insightfulpipe
|
|
67
|
-
insightfulpipe
|
|
68
|
-
insightfulpipe
|
|
69
|
-
insightfulpipe
|
|
70
|
-
insightfulpipe
|
|
301
|
+
# Discovery
|
|
302
|
+
insightfulpipe platforms # All supported platforms
|
|
303
|
+
insightfulpipe accounts --platform <platform> --json # Account IDs
|
|
304
|
+
insightfulpipe sources --platform <platform> # Sources with IDs
|
|
305
|
+
insightfulpipe brands --workspace <id> # Brand metadata
|
|
306
|
+
insightfulpipe whoami # Current user
|
|
307
|
+
insightfulpipe doctor # Check auth
|
|
308
|
+
|
|
309
|
+
# Schema
|
|
310
|
+
insightfulpipe helper <platform> # List actions
|
|
311
|
+
insightfulpipe helper <platform> --actions <a1>,<a2> # Body schema
|
|
312
|
+
|
|
313
|
+
# Execute
|
|
314
|
+
insightfulpipe query <platform> -b '<json>' # Read data
|
|
315
|
+
insightfulpipe query <platform> -f file.json # Read from file
|
|
316
|
+
insightfulpipe action <platform> -b '<json>' --yes # Write data
|
|
317
|
+
|
|
318
|
+
# Prompts
|
|
319
|
+
insightfulpipe prompts <platform> # List templates
|
|
320
|
+
insightfulpipe prompts <platform> --id <id> # Get prompt
|
|
71
321
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insightfulpipe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "InsightfulPipe CLI — query your marketing data from the terminal",
|
|
5
5
|
"bin": {
|
|
6
6
|
"insightfulpipe": "bin/cli.js"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"bin/",
|
|
10
10
|
"src/",
|
|
11
|
+
"scripts/",
|
|
11
12
|
"skills/",
|
|
12
13
|
"README.md",
|
|
13
14
|
"CHANGELOG.md",
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"type": "module",
|
|
19
20
|
"scripts": {
|
|
20
21
|
"start": "node bin/cli.js",
|
|
22
|
+
"postinstall": "node scripts/postinstall.js",
|
|
21
23
|
"test": "node --test",
|
|
22
24
|
"test:unit": "node --test test/cli.test.js",
|
|
23
25
|
"test:live": "node --test test/live-smoke.test.js"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
4
|
+
import { join, dirname } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
|
|
7
|
+
// Auto-detect skills directory: env var > known OpenClaw paths
|
|
8
|
+
const KNOWN_PATHS = [
|
|
9
|
+
process.env.OPENCLAW_SKILLS_DIR,
|
|
10
|
+
'/openclaw/skills',
|
|
11
|
+
join(process.env.HOME || '', '.openclaw', 'skills'),
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const skillsDir = KNOWN_PATHS.find((p) => p && existsSync(p));
|
|
15
|
+
if (!skillsDir) {
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const targetDir = join(skillsDir, 'insightfulpipe');
|
|
20
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const skillSource = join(__dirname, '..', 'skills', 'insightfulpipe', 'SKILL.md');
|
|
22
|
+
|
|
23
|
+
if (!existsSync(skillSource)) {
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
mkdirSync(targetDir, { recursive: true });
|
|
29
|
+
writeFileSync(join(targetDir, 'SKILL.md'), readFileSync(skillSource));
|
|
30
|
+
console.log(`InsightfulPipe skill installed to ${targetDir}`);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error(`Warning: could not install skill to ${targetDir}: ${err.message}`);
|
|
33
|
+
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: insightfulpipe
|
|
3
|
-
description: Query and manage marketing data across 40+ platforms — Google Analytics, Google Ads, Facebook Ads, Instagram, Shopify, HubSpot, Klaviyo, TikTok, LinkedIn, and more.
|
|
3
|
+
description: "Query and manage marketing data across 40+ platforms — Google Analytics, Google Ads, Facebook Ads, Instagram, Shopify, HubSpot, Klaviyo, TikTok, LinkedIn, and more."
|
|
4
4
|
homepage: https://insightfulpipe.com
|
|
5
|
-
metadata:
|
|
5
|
+
metadata:
|
|
6
|
+
{
|
|
7
|
+
"openclaw":
|
|
8
|
+
{
|
|
9
|
+
"emoji": "📊",
|
|
10
|
+
"requires": { "bins": ["insightfulpipe"], "env": ["INSIGHTFULPIPE_TOKEN"] },
|
|
11
|
+
"install":
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
"id": "node",
|
|
15
|
+
"kind": "node",
|
|
16
|
+
"package": "insightfulpipe",
|
|
17
|
+
"bins": ["insightfulpipe"],
|
|
18
|
+
"label": "Install InsightfulPipe CLI (npm)",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
}
|
|
6
23
|
---
|
|
7
24
|
|
|
8
25
|
## Install InsightfulPipe if it doesn't exist
|
|
@@ -23,49 +40,282 @@ npm release: https://www.npmjs.com/package/insightfulpipe
|
|
|
23
40
|
|
|
24
41
|
---
|
|
25
42
|
|
|
43
|
+
## Important: Authentication
|
|
44
|
+
|
|
45
|
+
The `INSIGHTFULPIPE_TOKEN` environment variable should already be configured. Do NOT ask the user to set it or export it. Just run commands directly. If a command fails with "Invalid token" or "Not authenticated", then tell the user their token is not configured.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
26
49
|
## Core Workflow
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
2. **Discover** — List platforms and available actions
|
|
30
|
-
3. **Schema** — Get the exact request body for an action
|
|
31
|
-
4. **Query** — Execute read operations (reports, analytics, listings)
|
|
32
|
-
5. **Execute** — Execute write operations (create, update, delete, publish)
|
|
51
|
+
Every query follows: discover → schema → execute. Run commands directly — do not ask the user for permission to run each one.
|
|
33
52
|
|
|
34
53
|
```bash
|
|
35
|
-
# 1.
|
|
36
|
-
export INSIGHTFULPIPE_TOKEN=ip_sk_your_token
|
|
37
|
-
# or
|
|
38
|
-
insightfulpipe auth
|
|
39
|
-
|
|
40
|
-
# 2. Discover
|
|
41
|
-
insightfulpipe platforms
|
|
54
|
+
# 1. Get account IDs (workspace_id, brand_id, source IDs)
|
|
42
55
|
insightfulpipe accounts --platform <platform> --json
|
|
56
|
+
|
|
57
|
+
# 2. See available actions
|
|
43
58
|
insightfulpipe helper <platform>
|
|
44
59
|
|
|
45
|
-
# 3.
|
|
60
|
+
# 3. Get request body schema for specific actions
|
|
46
61
|
insightfulpipe helper <platform> --actions <action1>,<action2>
|
|
47
62
|
|
|
48
|
-
# 4.
|
|
49
|
-
insightfulpipe query <platform> -b '{"action":"
|
|
63
|
+
# 4. Execute read query
|
|
64
|
+
insightfulpipe query <platform> -b '{"action":"<action>","workspace_id":<id>,"brand_id":<id>,...}'
|
|
65
|
+
|
|
66
|
+
# 5. Execute write operation (requires --yes)
|
|
67
|
+
insightfulpipe action <platform> -b '{"action":"<action>",...}' --yes
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Platform Examples
|
|
73
|
+
|
|
74
|
+
### Google Analytics — Top Pages
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
insightfulpipe accounts --platform google-analytics --json
|
|
78
|
+
insightfulpipe helper google-analytics --actions pages
|
|
79
|
+
insightfulpipe query google-analytics -b '{
|
|
80
|
+
"action": "pages",
|
|
81
|
+
"workspace_id": xxx,
|
|
82
|
+
"brand_id": xxx,
|
|
83
|
+
"property_id": "properties/xxx",
|
|
84
|
+
"dimensions": ["pagePath"],
|
|
85
|
+
"metrics": ["screenPageViews", "activeUsers"],
|
|
86
|
+
"start_date": "2026-03-01",
|
|
87
|
+
"end_date": "2026-03-20",
|
|
88
|
+
"limit": 10
|
|
89
|
+
}'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Google Analytics — Traffic Sources
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
insightfulpipe query google-analytics -b '{
|
|
96
|
+
"action": "traffic_sources",
|
|
97
|
+
"workspace_id": xxx,
|
|
98
|
+
"brand_id": xxx,
|
|
99
|
+
"property_id": "properties/xxx",
|
|
100
|
+
"dimensions": ["sessionSource", "sessionMedium"],
|
|
101
|
+
"metrics": ["sessions", "totalUsers", "bounceRate"],
|
|
102
|
+
"start_date": "2026-03-01",
|
|
103
|
+
"end_date": "2026-03-20"
|
|
104
|
+
}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Google Analytics — Freeform Report
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
insightfulpipe query google-analytics -b '{
|
|
111
|
+
"action": "get_report",
|
|
112
|
+
"workspace_id": xxx,
|
|
113
|
+
"brand_id": xxx,
|
|
114
|
+
"property_id": "properties/xxx",
|
|
115
|
+
"dimensions": ["date", "country"],
|
|
116
|
+
"metrics": ["activeUsers", "sessions"],
|
|
117
|
+
"start_date": "2026-03-01",
|
|
118
|
+
"end_date": "2026-03-20"
|
|
119
|
+
}'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Google Search Console — Top Queries
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
insightfulpipe query google-search-console -b '{
|
|
126
|
+
"action": "search_analytics",
|
|
127
|
+
"workspace_id": xxx,
|
|
128
|
+
"brand_id": xxx,
|
|
129
|
+
"site_url": "https://example.com/",
|
|
130
|
+
"dimensions": ["query"],
|
|
131
|
+
"start_date": "2026-03-01",
|
|
132
|
+
"end_date": "2026-03-20",
|
|
133
|
+
"row_limit": 10
|
|
134
|
+
}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Google Search Console — Pages by Country
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
insightfulpipe query google-search-console -b '{
|
|
141
|
+
"action": "search_analytics",
|
|
142
|
+
"workspace_id": xxx,
|
|
143
|
+
"brand_id": xxx,
|
|
144
|
+
"site_url": "https://example.com/",
|
|
145
|
+
"dimensions": ["page", "country"],
|
|
146
|
+
"start_date": "2026-03-01",
|
|
147
|
+
"end_date": "2026-03-20",
|
|
148
|
+
"row_limit": 20
|
|
149
|
+
}'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Google Sheets — Peek at Columns Then Query
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# First peek to see column names
|
|
156
|
+
insightfulpipe query google-sheets -b '{
|
|
157
|
+
"action": "get_sheet_peak",
|
|
158
|
+
"workspace_id": xxx,
|
|
159
|
+
"brand_id": xxx,
|
|
160
|
+
"spreadsheet_id": "xxx",
|
|
161
|
+
"sheet_id": "0"
|
|
162
|
+
}'
|
|
163
|
+
|
|
164
|
+
# Then query with filters using exact column names from peek
|
|
165
|
+
insightfulpipe query google-sheets -b '{
|
|
166
|
+
"action": "query_sheet_data",
|
|
167
|
+
"workspace_id": xxx,
|
|
168
|
+
"brand_id": xxx,
|
|
169
|
+
"spreadsheet_id": "xxx",
|
|
170
|
+
"sheet_id": "0",
|
|
171
|
+
"select": "Name,Email,Status",
|
|
172
|
+
"where": "Status=Active",
|
|
173
|
+
"limit": 50
|
|
174
|
+
}'
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Google Sheets — Write Cells
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
insightfulpipe action google-sheets -b '{
|
|
181
|
+
"action": "update_cells",
|
|
182
|
+
"workspace_id": xxx,
|
|
183
|
+
"brand_id": xxx,
|
|
184
|
+
"spreadsheet_id": "xxx",
|
|
185
|
+
"sheet_id": "0",
|
|
186
|
+
"range": "A1:C2",
|
|
187
|
+
"values": [["Name", "Email", "Status"], ["John", "john@example.com", "Active"]]
|
|
188
|
+
}' --yes
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Shopify — Recent Orders
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
insightfulpipe query shopify -b '{
|
|
195
|
+
"action": "get_orders",
|
|
196
|
+
"workspace_id": xxx,
|
|
197
|
+
"brand_id": xxx,
|
|
198
|
+
"status": "any",
|
|
199
|
+
"limit": 10
|
|
200
|
+
}'
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Shopify — Products
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
insightfulpipe query shopify -b '{
|
|
207
|
+
"action": "get_products",
|
|
208
|
+
"workspace_id": xxx,
|
|
209
|
+
"brand_id": xxx,
|
|
210
|
+
"limit": 10
|
|
211
|
+
}'
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Any Other Platform
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Same pattern works for all platforms:
|
|
218
|
+
insightfulpipe helper <platform> # See actions
|
|
219
|
+
insightfulpipe helper <platform> --actions <action> # Get body schema
|
|
220
|
+
insightfulpipe query <platform> -b '{...}' # Execute
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Supported platforms include: facebook-ads, instagram, tiktok-ads, tiktok-pages, linkedin-ads, linkedin-pages, hubspot, klaviyo, mailchimp, stripe, slack, telegram, and many more. Run `insightfulpipe platforms` to see the full list.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Common Patterns
|
|
228
|
+
|
|
229
|
+
### Pattern 1: Pipe to jq
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Extract just page paths from GA response
|
|
233
|
+
insightfulpipe query google-analytics -b '{...}' | jq '.data[].pagePath'
|
|
234
|
+
|
|
235
|
+
# Get total sessions
|
|
236
|
+
insightfulpipe query google-analytics -b '{...}' | jq '[.data[].sessions] | add'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Pattern 2: Compare Data Across Platforms
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# GA traffic
|
|
243
|
+
GA=$(insightfulpipe query google-analytics -b '{
|
|
244
|
+
"action": "traffic_sources", "workspace_id": xxx, "brand_id": xxx,
|
|
245
|
+
"property_id": "properties/xxx",
|
|
246
|
+
"dimensions": ["sessionSource"], "metrics": ["sessions"],
|
|
247
|
+
"start_date": "2026-03-01", "end_date": "2026-03-20"
|
|
248
|
+
}')
|
|
249
|
+
|
|
250
|
+
# GSC queries
|
|
251
|
+
GSC=$(insightfulpipe query google-search-console -b '{
|
|
252
|
+
"action": "search_analytics", "workspace_id": xxx, "brand_id": xxx,
|
|
253
|
+
"site_url": "https://example.com/",
|
|
254
|
+
"dimensions": ["query"],
|
|
255
|
+
"start_date": "2026-03-01", "end_date": "2026-03-20", "row_limit": 10
|
|
256
|
+
}')
|
|
257
|
+
|
|
258
|
+
echo "$GA" | jq '.data[:5]'
|
|
259
|
+
echo "$GSC" | jq '.data[:5]'
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Pattern 3: Write Operations
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Always use "action" (not "query") and --yes for writes
|
|
266
|
+
insightfulpipe action google-sheets -b '{
|
|
267
|
+
"action": "create_sheet",
|
|
268
|
+
"workspace_id": xxx,
|
|
269
|
+
"brand_id": xxx,
|
|
270
|
+
"spreadsheet_id": "xxx",
|
|
271
|
+
"title": "New Sheet"
|
|
272
|
+
}' --yes
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Pattern 4: Use Prompts for Guided Analysis
|
|
50
276
|
|
|
51
|
-
|
|
52
|
-
insightfulpipe
|
|
277
|
+
```bash
|
|
278
|
+
insightfulpipe prompts google-analytics # List templates
|
|
279
|
+
insightfulpipe prompts google-analytics --id 12 # Get specific prompt
|
|
53
280
|
```
|
|
54
281
|
|
|
55
|
-
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Gotchas
|
|
56
285
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
286
|
+
1. **Never guess the request body** — always run `helper <platform> --actions <action>` first.
|
|
287
|
+
2. **Replace ALL "xxx" placeholders** — get real values from `accounts --platform <platform> --json`.
|
|
288
|
+
3. **GA property_id needs "properties/" prefix** — use `"properties/510157516"` not `"510157516"`.
|
|
289
|
+
4. **Date format is YYYY-MM-DD** — use `"2026-03-20"` not `"2026-03-20T00:00:00Z"`.
|
|
290
|
+
5. **Use `query` for reads, `action --yes` for writes** — using the wrong one will fail.
|
|
291
|
+
6. **Google Sheets: peek before query** — call `get_sheet_peak` first to see column names.
|
|
292
|
+
7. **Different platforms have different source IDs** — GA uses `property_id`, GSC uses `site_url`, Shopify uses `shop_domain`, Facebook Ads uses `ad_account_id`.
|
|
293
|
+
8. **Empty data is not an error** — `{"status":"success","data":[]}` means no data matched your filters.
|
|
294
|
+
9. **Do not ask the user to export the token** — it should already be set. If auth fails, tell the user to check their token configuration.
|
|
61
295
|
|
|
62
|
-
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## All Commands
|
|
63
299
|
|
|
64
300
|
```bash
|
|
65
|
-
|
|
66
|
-
insightfulpipe
|
|
67
|
-
insightfulpipe
|
|
68
|
-
insightfulpipe
|
|
69
|
-
insightfulpipe
|
|
70
|
-
insightfulpipe
|
|
301
|
+
# Discovery
|
|
302
|
+
insightfulpipe platforms # All supported platforms
|
|
303
|
+
insightfulpipe accounts --platform <platform> --json # Account IDs
|
|
304
|
+
insightfulpipe sources --platform <platform> # Sources with IDs
|
|
305
|
+
insightfulpipe brands --workspace <id> # Brand metadata
|
|
306
|
+
insightfulpipe whoami # Current user
|
|
307
|
+
insightfulpipe doctor # Check auth
|
|
308
|
+
|
|
309
|
+
# Schema
|
|
310
|
+
insightfulpipe helper <platform> # List actions
|
|
311
|
+
insightfulpipe helper <platform> --actions <a1>,<a2> # Body schema
|
|
312
|
+
|
|
313
|
+
# Execute
|
|
314
|
+
insightfulpipe query <platform> -b '<json>' # Read data
|
|
315
|
+
insightfulpipe query <platform> -f file.json # Read from file
|
|
316
|
+
insightfulpipe action <platform> -b '<json>' --yes # Write data
|
|
317
|
+
|
|
318
|
+
# Prompts
|
|
319
|
+
insightfulpipe prompts <platform> # List templates
|
|
320
|
+
insightfulpipe prompts <platform> --id <id> # Get prompt
|
|
71
321
|
```
|