thoughtleaders-cli 0.6.8__tar.gz → 0.6.10__tar.gz
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.
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/.claude-plugin/plugin.json +1 -1
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/PKG-INFO +7 -6
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/README.md +4 -3
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/agents/tl-analyst.md +1 -1
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/docs/architecture.md +9 -7
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/pyproject.toml +10 -3
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/skills/tl/SKILL.md +19 -29
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/SKILL.md +1397 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/examples/e2e_findings.md +264 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/examples/golden_queries.md +150 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/columns_brands.md +106 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/columns_channels.md +131 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/columns_content.md +98 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/columns_sponsorships.md +116 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/intelligence_filterset_schema.json +392 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/intelligence_widget_schema.json +194 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/report_glossary.md +181 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/sortable_columns.json +64 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/sponsorship_filterset_schema.json +217 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/sponsorship_widget_schema.json +165 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/references/widgets.md +252 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/column_builder.md +384 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/database_query.md +210 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/keyword_research.md +217 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/name_resolver.md +162 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/sample_judge.md +223 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/similar_channels.md +61 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/topic_matcher.md +269 -0
- thoughtleaders_cli-0.6.10/skills/tl-report-builder/tools/widget_builder.md +278 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/__init__.py +1 -1
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/client/http.py +3 -0
- thoughtleaders_cli-0.6.10/src/tl_cli/commands/_comments_common.py +106 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/brands.py +2 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/channels.py +2 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/sponsorships.py +4 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/uploads.py +2 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/main.py +0 -2
- thoughtleaders_cli-0.6.8/src/tl_cli/commands/comments.py +0 -63
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/.claude-plugin/marketplace.json +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/.github/workflows/python-publish.yml +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/.gitignore +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/AGENTS.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/CLAUDE.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/LICENSE +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/commands/tl-balance.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/commands/tl-reports.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/commands/tl-sponsorships.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/commands/tl.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/hooks/hooks.json +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/hooks/scripts/post-usage.sh +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/hooks/scripts/pre-check.sh +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/skills/tl/references/business-glossary.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/skills/tl/references/elasticsearch-schema.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/skills/tl/references/firebolt-schema.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/skills/tl/references/postgres-schema.md +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/_completions.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/auth/__init__.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/auth/commands.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/auth/login.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/auth/pkce.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/auth/token_store.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/client/__init__.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/client/errors.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/__init__.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/ask.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/balance.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/changelog.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/db.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/deals.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/describe.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/doctor.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/matches.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/proposals.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/recommender.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/reports.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/schema.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/setup.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/snapshots.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/commands/whoami.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/config.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/filters.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/hints.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/output/__init__.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/output/formatter.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/src/tl_cli/self_update.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/tests/__init__.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/tests/test_auth.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/tests/test_filters.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/tests/test_output.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/tests/test_sponsorships.py +0 -0
- {thoughtleaders_cli-0.6.8 → thoughtleaders_cli-0.6.10}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thoughtleaders-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.10
|
|
4
4
|
Summary: ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence
|
|
5
5
|
Project-URL: Homepage, https://thoughtleaders.io
|
|
6
6
|
Project-URL: Repository, https://github.com/ThoughtLeaders-io/thoughtleaders-cli
|
|
@@ -21,8 +21,8 @@ Requires-Dist: authlib>=1.3
|
|
|
21
21
|
Requires-Dist: httpx>=0.27
|
|
22
22
|
Requires-Dist: keyring>=25.0
|
|
23
23
|
Requires-Dist: rich>=13.0
|
|
24
|
-
Requires-Dist: toon-format
|
|
25
|
-
Requires-Dist: typer
|
|
24
|
+
Requires-Dist: toon-format==0.9.0b1
|
|
25
|
+
Requires-Dist: typer>=0.16
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
28
|
# tl cli
|
|
@@ -125,9 +125,10 @@ tl brands show Nike
|
|
|
125
125
|
# Run a saved report
|
|
126
126
|
tl reports run 42
|
|
127
127
|
|
|
128
|
-
# Comments on
|
|
129
|
-
tl
|
|
130
|
-
tl
|
|
128
|
+
# Comments — available on sponsorships, channels, brands, and uploads
|
|
129
|
+
tl sponsorships comment-list 12345
|
|
130
|
+
tl sponsorships comment-add 12345 "Looks good"
|
|
131
|
+
tl channels comment-add 7890 "Strong recent winners"
|
|
131
132
|
|
|
132
133
|
# Show information about the logged-in user
|
|
133
134
|
tl whoami
|
|
@@ -98,9 +98,10 @@ tl brands show Nike
|
|
|
98
98
|
# Run a saved report
|
|
99
99
|
tl reports run 42
|
|
100
100
|
|
|
101
|
-
# Comments on
|
|
102
|
-
tl
|
|
103
|
-
tl
|
|
101
|
+
# Comments — available on sponsorships, channels, brands, and uploads
|
|
102
|
+
tl sponsorships comment-list 12345
|
|
103
|
+
tl sponsorships comment-add 12345 "Looks good"
|
|
104
|
+
tl channels comment-add 7890 "Strong recent winners"
|
|
104
105
|
|
|
105
106
|
# Show information about the logged-in user
|
|
106
107
|
tl whoami
|
|
@@ -64,7 +64,7 @@ tl db pg "SELECT a.id, a.send_date, a.publish_status, b.name AS brand, ch.channe
|
|
|
64
64
|
ORDER BY a.send_date
|
|
65
65
|
LIMIT 100 OFFSET 0"
|
|
66
66
|
```
|
|
67
|
-
Then suggest `tl
|
|
67
|
+
Then suggest `tl sponsorships comment-add <id> "..."` for each.
|
|
68
68
|
|
|
69
69
|
### Multi-step research (mix raw + similarity)
|
|
70
70
|
"Find channels similar to the ones Nike sponsors and compare their pricing"
|
|
@@ -56,8 +56,9 @@ All data commands use explicit subcommands: `list`, `show`, `create`/`add`. Runn
|
|
|
56
56
|
| `tl brands similar <brand>` | Find similar brands (similarity search, 25 credits) |
|
|
57
57
|
| `tl snapshots channel <id>` | Channel metrics over time (Firebolt channel_metrics) |
|
|
58
58
|
| `tl snapshots video <id> --channel <id>` | Video view curve (Firebolt article_metrics, --channel required) |
|
|
59
|
-
| `tl
|
|
60
|
-
| `tl
|
|
59
|
+
| `tl <entity> comment-list <id>` | List comments on a sponsorship/channel/brand/upload (free) |
|
|
60
|
+
| `tl <entity> comment-add <id> "message"` | Add a comment (free) |
|
|
61
|
+
| `tl <entity> comment-edit <comment-id> "message"` | Edit one of your own comments (author or superuser; free) |
|
|
61
62
|
|
|
62
63
|
### Raw database access (escape hatch for joins / aggregations / complex filters)
|
|
63
64
|
|
|
@@ -180,7 +181,7 @@ tools: [Bash, Read]
|
|
|
180
181
|
|
|
181
182
|
What the agent does:
|
|
182
183
|
- **Multi-step research**: "Find channels similar to the ones Nike sponsors and compare their pricing" → `tl brands show Nike --json` → extract initial channel IDs → `tl channels similar <initial-id> --json` for each (enriched with cpm) → union + dedupe → compile comparison table
|
|
183
|
-
- **Cross-resource analysis**: "Show me deal slippage and add comments" → `tl sponsorships status:pending send-date-end:2026-03 --json` → identify slipping sponsorships → `tl
|
|
184
|
+
- **Cross-resource analysis**: "Show me deal slippage and add comments" → `tl sponsorships status:pending send-date-end:2026-03 --json` → identify slipping sponsorships → `tl sponsorships comment-add <id> "flagged for slippage"` for each
|
|
184
185
|
- **Report comparison**: "Compare my Q1 report to Q4" → `tl reports run <id> --since 2026-01 --until 2026-03 --json` → `tl reports run <id> --since 2025-10 --until 2025-12 --json` → synthesize
|
|
185
186
|
- **Discovery workflows**: "What's my best performing brand this quarter" → `tl sponsorships status:sold purchase-date-start:2026-01 --json` → aggregate by brand → `tl brands show <top_brand> --json` → full picture
|
|
186
187
|
- **Credit-aware**: checks balance before multi-query workflows, estimates total cost, asks user to confirm if expensive
|
|
@@ -315,7 +316,7 @@ tl-cli/
|
|
|
315
316
|
│ │ ├── brands.py # tl brands (show/history/similar)
|
|
316
317
|
│ │ ├── snapshots.py # tl snapshots (Firebolt metrics)
|
|
317
318
|
│ │ ├── reports.py # tl reports / tl reports run
|
|
318
|
-
│ │ ├──
|
|
319
|
+
│ │ ├── _comments_common.py # comment-list/add/edit subcommands shared across entity apps
|
|
319
320
|
│ │ ├── db.py # tl db pg|fb|es (raw read-only queries)
|
|
320
321
|
│ │ ├── schema.py # tl schema pg|fb|es (live schema docs)
|
|
321
322
|
│ │ ├── describe.py # tl describe list/show (schema/filter/pricing discovery)
|
|
@@ -394,8 +395,9 @@ Most CLI endpoints can reuse existing views/utilities rather than being built fr
|
|
|
394
395
|
| **`GET /api/cli/v1/snapshots/video/<id>`** | `api/v2/article-history` (`ArticleHistoryView`) — already queries Firebolt `article_metrics` with pagination, enforces `channel_id:article_id` format. | Direct reuse — already enforces channel_id requirement |
|
|
395
396
|
| **`GET /api/cli/v1/reports`** | `api/campaigns` (`CampaignViewSet.list`) — returns user's saved campaigns with ownership filtering | Filter to user's campaigns, add CLI envelope |
|
|
396
397
|
| **`GET /api/cli/v1/reports/<id>/run`** | `api/campaigns/<id>` detail + the view's existing data loading via `load_campaign_data()` in `data_api_utils.py` — campaigns store their filter config, which gets passed to the appropriate data view (SponsorshipsView, ArticlesView, ThoughtleadersView) | Load campaign config → dispatch to appropriate existing view → wrap results |
|
|
397
|
-
| **`GET /api/cli/v1
|
|
398
|
-
| **`POST /api/cli/v1
|
|
398
|
+
| **`GET /api/cli/v1/<entity_type>/<entity_id>/comments`** | Same query against the `Comment` table; entity_type ∈ {sponsorship, channel, brand, upload} | List comments scoped to caller's organization |
|
|
399
|
+
| **`POST /api/cli/v1/<entity_type>/<entity_id>/comments`** | Insert into `Comment` with the matching FK column | Create comment for the named entity |
|
|
400
|
+
| **`PATCH /api/cli/v1/comment/<comment_id>`** | Update `Comment.content` after author/superuser check | Edit a single comment by ID |
|
|
399
401
|
| **`GET /api/cli/v1/whoami`** | New — reads Profile, Organization, brands M2M | New (joins Profile → User, Organization → Plan, Profile.brands → ChannelList) |
|
|
400
402
|
| **`GET /api/cli/v1/balance`** | New — reads `CliCreditAccount` | New (simple model read) |
|
|
401
403
|
| **`GET /api/cli/v1/describe`** | New — static metadata | New (hardcoded resource definitions) |
|
|
@@ -563,7 +565,7 @@ Build each command + its server endpoint together:
|
|
|
563
565
|
11. `tl snapshots video abc --channel 12345` returns view curve
|
|
564
566
|
12. `tl reports` lists saved reports (free)
|
|
565
567
|
13. `tl reports run 789` executes saved report (credits based on results)
|
|
566
|
-
14. `tl
|
|
568
|
+
14. `tl sponsorships comment-list 12345` lists comments (free) — same shape under `tl channels`, `tl brands`, `tl uploads`
|
|
567
569
|
15. `tl sponsorships create --channel 1 --brand 2` creates proposal (free)
|
|
568
570
|
16. `tl setup claude` installs plugin
|
|
569
571
|
17. Claude Code skill triggers on data questions, uses `tl describe` for discovery
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "thoughtleaders-cli"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.10"
|
|
8
8
|
description = "ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -23,12 +23,19 @@ classifiers = [
|
|
|
23
23
|
"Topic :: Office/Business",
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
|
-
|
|
26
|
+
# `typer` >= 0.16 made click/rich/shellingham required — the `[all]` extra
|
|
27
|
+
# was removed and uv warns about it. Drop the extra to silence the warning;
|
|
28
|
+
# behaviour is identical because the bundled deps are pulled either way.
|
|
29
|
+
"typer>=0.16",
|
|
27
30
|
"rich>=13.0",
|
|
28
31
|
"httpx>=0.27",
|
|
29
32
|
"keyring>=25.0",
|
|
30
33
|
"authlib>=1.3",
|
|
31
|
-
|
|
34
|
+
# `toon-format` only publishes pre-releases (0.9.0b1 is the only modern
|
|
35
|
+
# release; 0.1.0 is the lone stable). pip/pipx accept `>=0.9.0b1` and pull
|
|
36
|
+
# the beta, but uv refuses pre-releases under `>=` when a stable exists.
|
|
37
|
+
# An exact pin is the one form uv will resolve without `--prerelease=allow`.
|
|
38
|
+
"toon-format==0.9.0b1",
|
|
32
39
|
]
|
|
33
40
|
|
|
34
41
|
[project.scripts]
|
|
@@ -5,24 +5,17 @@ description: Query and analyze ThoughtLeaders business data using the `tl` CLI.
|
|
|
5
5
|
|
|
6
6
|
# ThoughtLeaders Data Analyst
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Run the `tl` CLI to query ThoughtLeaders' sponsorship platform data. Use it to answer questions about deals, channels, brands, uploads, metrics, etc.
|
|
9
9
|
|
|
10
10
|
## Core Principles
|
|
11
11
|
|
|
12
|
-
**
|
|
12
|
+
**Default to raw database queries.** For anything beyond a trivially simple lookup, reach for `tl db pg|fb|es`. Avoid the structured `tl <resource>` commands (`sponsorships list`, `channels show`, `brands history`, etc.).
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Always run `tl schema pg|fb|es` before writing a raw query.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
**When you only need the schema of one table, you MUST call `tl schema pg <table>` (or `tl schema fb <table>`) — never the unscoped form**, to reduce token counts. ES has no per-table form (the index is a single document shape) — `tl schema es` is the only call there.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- **Anything else** (use `tl db pg|fb|es`): aggregations, joins, conditions the structured filters don't expose, comparing across resources, computing rates / shares / percentiles, anything that would otherwise need a paginated walk + client-side reduce.
|
|
20
|
-
|
|
21
|
-
Always run `tl describe show <resource>` before using a structured command, and `tl schema pg|fb|es` before writing a raw query.
|
|
22
|
-
|
|
23
|
-
**When you only need the schema of one table, you MUST call `tl schema pg <table>` (or `tl schema fb <table>`) — never the unscoped form.** The unscoped `tl schema pg` returns *every* table visible to your role, which is dozens of tables and tens of thousands of tokens; the single-table form returns only the section you need, in the same markdown layout. Reaching for the unscoped form when you already know the table name is a tokens/latency tax with zero benefit. ES has no per-table form (the index is a single document shape) — `tl schema es` is the only call there.
|
|
24
|
-
|
|
25
|
-
**Process data with shell tools, not your context window.** Don't pull large result sets into your reasoning context just to filter, sort, count, or extract a field — that wastes tokens and slows you down. Pipe `tl … --json` (or `--csv`) into `jq`, `yq`, `rg`, or `duckdb` and read only the answer back. Pick the tool by shape:
|
|
18
|
+
**Process data with shell tools, not your context window.** Don't pull large result sets into your reasoning context just to filter, sort, count, or extract a field — that wastes tokens and slows you down. Pipe `tl … --json` (or `--csv`, or `--toon`) into `jq`, `yq`, `rg`, or `duckdb`, as appropriate, and read only the answer back. Pick the tool by shape:
|
|
26
19
|
|
|
27
20
|
- **`jq`** — filter, project, and transform JSON. The default for `tl … --json` post-processing.
|
|
28
21
|
```bash
|
|
@@ -68,6 +61,13 @@ Other key concepts:
|
|
|
68
61
|
- **Reports** — saved report configurations that can be re-run
|
|
69
62
|
- **Comments** — notes attached to sponsorships
|
|
70
63
|
- **Adspots** — types of ads a channel carries (e.g. mention, dedicated video, product placement). Returned by `tl channels show`; each carries price/cost.
|
|
64
|
+
- **Profiles** — per-organization actors that own sponsorship records on behalf of either side of a deal. A profile is buyer-side or seller-side:
|
|
65
|
+
- *Buyer-side (brand) profiles* — represent a sponsoring brand. Each brand profile has an M2M link to at most one `Brand` record (which are the actual advertiser identities). On a sponsorship, `creator_profile` is the buyer-side profile.
|
|
66
|
+
- *Seller-side (publisher) profiles* — attached to a `Publication`, which in turn owns one or more `Channel` records. A channel's adspots therefore inherit ownership through `channel.publication.profile`.
|
|
67
|
+
- **How to tell them apart** — three signals on the `thoughtleaders_profile` row, used in this order:
|
|
68
|
+
1. **`persona`** (canonical) — `1=Brand`, `4=Media Agency`, `3=Talent Manager` are buyer-side; `2=Creator`, `5=Creator Service` are seller-side. May be null on legacy rows.
|
|
69
|
+
2. **`is_advertiser` / `is_publisher`** booleans — feature flags; either or both can be true for staff-style profiles, but on normal user profiles they reliably mark side.
|
|
70
|
+
- Org scoping for sponsorships is profile-mediated: a sponsorship belongs to your org if **either** `creator_profile.organization` (brand side) **or** `ad_spot.channel.publication.profile.organization` (publisher side) matches yours.
|
|
71
71
|
- **MSN** (Media Selling Network) — the ~11k YouTube channels that have opted in to receive sponsorship offers. A channels is in the MSN group if the `channel.media_selling_network_join_date` field is not null.
|
|
72
72
|
- **MBN** (Media Buying Network) — the brand-side counterpart to MSN: brand profiles that have opted in to receive proposed sponsorships. A profile is in the MBN group if the `profile.media_buying_network_join_date` field is not null.
|
|
73
73
|
- **TPP** (ThoughtLeaders Partner Program, a.k.a. "TL channels") — the smaller, exclusive ~169 channels TL manages directly. A channel is in the TPP group if the `channel.is_tl_channel` is True.
|
|
@@ -169,26 +169,16 @@ tl recommender top-brands "<tag>" # Top brands (deduped from profiles) load
|
|
|
169
169
|
tl recommender inspect-channel <ref> # Show a channel's similarity-profile breakdown (25 credits; Intelligence)
|
|
170
170
|
tl recommender inspect-brand <ref> # Show a brand profile's ideal similarity-profile breakdown (25 credits; Intelligence)
|
|
171
171
|
tl recommender similar-to-profile <id> # Channels closest to a brand profile's ideal profile (25 credits; Intelligence)
|
|
172
|
-
tl snapshots channel <id> # Channel metrics over time
|
|
173
|
-
tl snapshots video <id> --channel <id> # Video view curve
|
|
174
|
-
tl reports # List saved reports
|
|
172
|
+
tl snapshots channel <id> # Channel metrics over time (Firebolt-backed)
|
|
173
|
+
tl snapshots video <id> --channel <id> # Video view curve (--channel required!)
|
|
174
|
+
tl reports # List saved reports
|
|
175
175
|
tl reports run <id> # Run a saved report (credits vary)
|
|
176
|
-
tl
|
|
177
|
-
tl
|
|
176
|
+
tl <entity> comment-list <id> # List comments on a sponsorship/channel/brand/upload
|
|
177
|
+
tl <entity> comment-add <id> "msg" # Add a comment (free)
|
|
178
|
+
tl <entity> comment-edit <comment-id> "msg" # Edit own comment (author or superuser; free)
|
|
178
179
|
```
|
|
179
180
|
|
|
180
|
-
**
|
|
181
|
-
|
|
182
|
-
| Rows | mult=1.0 (comments, uploads, sponsorships) | mult=1.2 (snapshots) | mult=1.3 (reports) | mult=1.4 (db.pg / db.fb / db.es) |
|
|
183
|
-
|---:|---:|---:|---:|---:|
|
|
184
|
-
| 1 | 1 | 1 | 1 | 1 |
|
|
185
|
-
| 10 | 3 | 3 | 4 | 4 |
|
|
186
|
-
| 50 | 15 | 18 | 19 | 20 |
|
|
187
|
-
| 100 | 33 | 39 | 42 | 45 |
|
|
188
|
-
| 200 | 74 | 88 | 96 | 103 |
|
|
189
|
-
| 500 | 219 | 263 | 285 | 307 |
|
|
190
|
-
|
|
191
|
-
The marginal per-row cost is exactly proportional to `mult` — a 1.4× resource costs 1.4× the row part of a 1.0× resource at any size. Splitting a 500-row pull into ten 50-row calls saves ~30% but burns 10 setup floors instead of 1; "narrow the query" is almost always the better move than "fragment the pagination."
|
|
181
|
+
**Credit costs are server-authoritative — run `tl describe` (overview) or `tl describe show <resource>` (one resource) to see the current rates and multipliers for every endpoint. Do not memorise rate values — they change.**
|
|
192
182
|
|
|
193
183
|
### Updating records
|
|
194
184
|
|