thoughtleaders-cli 0.6.19__tar.gz → 0.6.20__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.
Files changed (91) hide show
  1. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/.claude-plugin/plugin.json +1 -1
  2. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/PKG-INFO +2 -1
  3. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/pyproject.toml +2 -1
  4. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/__init__.py +1 -1
  5. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/schema.py +72 -0
  6. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/.claude-plugin/marketplace.json +0 -0
  7. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/.github/workflows/python-publish.yml +0 -0
  8. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/.gitignore +0 -0
  9. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/AGENTS.md +0 -0
  10. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/CLAUDE.md +0 -0
  11. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/LICENSE +0 -0
  12. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/README.md +0 -0
  13. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/agents/tl-analyst.md +0 -0
  14. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/commands/tl-balance.md +0 -0
  15. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/commands/tl-reports.md +0 -0
  16. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/commands/tl-sponsorships.md +0 -0
  17. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/commands/tl.md +0 -0
  18. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/docs/architecture.md +0 -0
  19. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/hooks/hooks.json +0 -0
  20. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/hooks/scripts/post-usage.sh +0 -0
  21. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/hooks/scripts/pre-check.sh +0 -0
  22. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl/SKILL.md +0 -0
  23. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl/references/business-glossary.md +0 -0
  24. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl/references/elasticsearch-schema.md +0 -0
  25. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl/references/firebolt-schema.md +0 -0
  26. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl/references/postgres-schema.md +0 -0
  27. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/SKILL.md +0 -0
  28. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/examples/e2e_findings.md +0 -0
  29. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/examples/golden_queries.md +0 -0
  30. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/columns_brands.md +0 -0
  31. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/columns_channels.md +0 -0
  32. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/columns_content.md +0 -0
  33. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/columns_sponsorships.md +0 -0
  34. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/intelligence_filterset_schema.json +0 -0
  35. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/intelligence_widget_schema.json +0 -0
  36. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/report_glossary.md +0 -0
  37. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/sortable_columns.json +0 -0
  38. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/sponsorship_filterset_schema.json +0 -0
  39. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/sponsorship_widget_schema.json +0 -0
  40. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/references/widgets.md +0 -0
  41. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/column_builder.md +0 -0
  42. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/database_query.md +0 -0
  43. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/keyword_research.md +0 -0
  44. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/name_resolver.md +0 -0
  45. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/sample_judge.md +0 -0
  46. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/similar_channels.md +0 -0
  47. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/topic_matcher.md +0 -0
  48. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/skills/tl-report-builder/tools/widget_builder.md +0 -0
  49. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/_completions.py +0 -0
  50. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/auth/__init__.py +0 -0
  51. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/auth/commands.py +0 -0
  52. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/auth/login.py +0 -0
  53. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/auth/pkce.py +0 -0
  54. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/auth/token_store.py +0 -0
  55. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/client/__init__.py +0 -0
  56. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/client/errors.py +0 -0
  57. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/client/http.py +0 -0
  58. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/__init__.py +0 -0
  59. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/_comments_common.py +0 -0
  60. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/ask.py +0 -0
  61. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/balance.py +0 -0
  62. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/brands.py +0 -0
  63. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/changelog.py +0 -0
  64. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/channels.py +0 -0
  65. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/db.py +0 -0
  66. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/deals.py +0 -0
  67. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/describe.py +0 -0
  68. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/doctor.py +0 -0
  69. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/matches.py +0 -0
  70. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/proposals.py +0 -0
  71. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/recommender.py +0 -0
  72. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/reports.py +0 -0
  73. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/setup.py +0 -0
  74. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/snapshots.py +0 -0
  75. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/sponsorships.py +0 -0
  76. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/uploads.py +0 -0
  77. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/commands/whoami.py +0 -0
  78. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/config.py +0 -0
  79. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/filters.py +0 -0
  80. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/hints.py +0 -0
  81. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/main.py +0 -0
  82. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/output/__init__.py +0 -0
  83. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/output/formatter.py +0 -0
  84. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/src/tl_cli/self_update.py +0 -0
  85. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/__init__.py +0 -0
  86. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/test_auth.py +0 -0
  87. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/test_filters.py +0 -0
  88. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/test_output.py +0 -0
  89. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/test_reports.py +0 -0
  90. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/tests/test_sponsorships.py +0 -0
  91. {thoughtleaders_cli-0.6.19 → thoughtleaders_cli-0.6.20}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tl-cli",
3
- "version": "0.6.19",
3
+ "version": "0.6.20",
4
4
  "description": "ThoughtLeaders CLI — query sponsorship deals, channels, brands, uploads, and intelligence from the terminal",
5
5
  "author": {
6
6
  "name": "ThoughtLeaders",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thoughtleaders-cli
3
- Version: 0.6.19
3
+ Version: 0.6.20
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
@@ -20,6 +20,7 @@ Requires-Python: >=3.12
20
20
  Requires-Dist: authlib>=1.3
21
21
  Requires-Dist: httpx>=0.27
22
22
  Requires-Dist: keyring>=25.0
23
+ Requires-Dist: pyyaml>=6.0
23
24
  Requires-Dist: rich>=13.0
24
25
  Requires-Dist: toon-format==0.9.0b1
25
26
  Requires-Dist: typer>=0.16
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "thoughtleaders-cli"
7
- version = "0.6.19"
7
+ version = "0.6.20"
8
8
  description = "ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -36,6 +36,7 @@ dependencies = [
36
36
  # the beta, but uv refuses pre-releases under `>=` when a stable exists.
37
37
  # An exact pin is the one form uv will resolve without `--prerelease=allow`.
38
38
  "toon-format==0.9.0b1",
39
+ "pyyaml>=6.0",
39
40
  ]
40
41
 
41
42
  [project.scripts]
@@ -1,3 +1,3 @@
1
1
  """ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence."""
2
2
 
3
- __version__ = "0.6.19"
3
+ __version__ = "0.6.20"
@@ -1,10 +1,14 @@
1
1
  """tl schema — Show raw-db schema documentation for `tl db pg|fb|es`."""
2
2
 
3
3
  import json
4
+ import re
4
5
 
5
6
  import typer
7
+ import yaml
6
8
  from rich.console import Console
7
9
  from rich.markdown import Markdown
10
+ from rich.text import Text
11
+ from rich.tree import Tree
8
12
 
9
13
  from tl_cli.client.errors import ApiError, handle_api_error
10
14
  from tl_cli.client.http import get_client
@@ -12,6 +16,68 @@ from tl_cli.client.http import get_client
12
16
  app = typer.Typer(help="Show schema documentation for raw db queries (`tl db pg|fb|es`)")
13
17
  console = Console()
14
18
 
19
+ # Pulls the YAML body out of the server's ```yaml … ``` fenced block. Any
20
+ # non-YAML preface (e.g. error / empty-set markdown) won't match and is
21
+ # rendered through the markdown fallback path.
22
+ _YAML_FENCE_RE = re.compile(r'```yaml\n(.*?)\n```', re.DOTALL)
23
+
24
+
25
+ def _try_render_yaml_tree(content: str) -> bool:
26
+ """Render the YAML schema as a Rich Tree, one tree per table.
27
+
28
+ Returns True if rendering succeeded. Returns False on any failure
29
+ (no fence, parse error, unexpected shape) so the caller falls back
30
+ to plain markdown rendering.
31
+ """
32
+ match = _YAML_FENCE_RE.search(content)
33
+ if not match:
34
+ return False
35
+ try:
36
+ data = yaml.safe_load(match.group(1))
37
+ except yaml.YAMLError:
38
+ return False
39
+ if not isinstance(data, dict) or not data:
40
+ return False
41
+
42
+ rendered = False
43
+ for table_name, fields in data.items():
44
+ if not isinstance(fields, dict):
45
+ continue
46
+ rendered = True
47
+
48
+ # Table-level metadata sits alongside columns under `__`-prefixed
49
+ # keys; surface them in the tree label, never as children.
50
+ table_comment = fields.get('__comment')
51
+ primary_index = fields.get('__primary_index')
52
+ label = Text()
53
+ label.append(str(table_name), style='bold cyan')
54
+ if table_comment:
55
+ label.append(f' — {table_comment}', style='italic dim')
56
+ if primary_index:
57
+ label.append(f' — primary index {primary_index}', style='italic dim')
58
+
59
+ tree = Tree(label, guide_style='dim')
60
+ for fname, fval in fields.items():
61
+ if isinstance(fname, str) and fname.startswith('__'):
62
+ continue
63
+ if isinstance(fval, dict):
64
+ ftype = str(fval.get('type', '?'))
65
+ fcomment = fval.get('comment')
66
+ else:
67
+ ftype = str(fval)
68
+ fcomment = None
69
+ line = Text()
70
+ line.append(str(fname), style='yellow')
71
+ line.append(': ')
72
+ line.append(ftype, style='green')
73
+ if fcomment:
74
+ line.append(f' — {fcomment}', style='dim')
75
+ tree.add(line)
76
+ console.print(tree)
77
+ console.print()
78
+
79
+ return rendered
80
+
15
81
 
16
82
  def _show(db: str, json_output: bool, table: str | None = None) -> None:
17
83
  client = get_client()
@@ -23,6 +89,12 @@ def _show(db: str, json_output: bool, table: str | None = None) -> None:
23
89
  return
24
90
  content = data.get("content", "")
25
91
  if console.is_terminal:
92
+ # PG/FB output is a fenced YAML mapping; render as a Rich Tree
93
+ # for terminals. ES is still markdown prose, and error / empty
94
+ # responses also have no fence — both fall through to the
95
+ # markdown renderer.
96
+ if db in ("pg", "fb") and _try_render_yaml_tree(content):
97
+ return
26
98
  console.print(Markdown(content))
27
99
  else:
28
100
  print(content)