@graphit/cli 0.1.2 → 0.1.4

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.
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "graphit-cli",
3
+ "owner": {
4
+ "name": "Graphit",
5
+ "email": "support@graphit-app.com",
6
+ "url": "https://graphit-app.com"
7
+ },
8
+ "metadata": {
9
+ "description": "Graphit CLI plugin for AI coding assistants",
10
+ "version": "1.0.0"
11
+ },
12
+ "plugins": [
13
+ {
14
+ "name": "graphit",
15
+ "description": "Build custom HTML dashboards from real data. KB-aware queries, entity wrapping, cached data sources.",
16
+ "source": {
17
+ "type": "npm",
18
+ "package": "@graphit/cli"
19
+ },
20
+ "version": "0.1.3",
21
+ "category": "data-visualization",
22
+ "tags": ["bi", "dashboard", "sql", "data", "visualization"]
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "graphit",
3
+ "version": "0.1.3",
4
+ "description": "Build custom HTML dashboards from real data using the Graphit CLI. KB-aware queries, entity wrapping, cached data sources.",
5
+ "author": {
6
+ "name": "Graphit",
7
+ "email": "support@graphit-app.com",
8
+ "url": "https://graphit-app.com"
9
+ },
10
+ "homepage": "https://graphit-app.com",
11
+ "repository": "https://github.com/graphit-app/graphit-cli",
12
+ "license": "UNLICENSED",
13
+ "keywords": [
14
+ "graphit",
15
+ "bi",
16
+ "dashboard",
17
+ "custom-dashboard",
18
+ "data-visualization",
19
+ "knowledge-base",
20
+ "sql",
21
+ "cli"
22
+ ]
23
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "graphit",
3
+ "version": "0.1.3",
4
+ "description": "Build custom HTML dashboards from real data using the Graphit CLI. KB-aware queries, entity wrapping, cached data sources.",
5
+ "author": {
6
+ "name": "Graphit",
7
+ "email": "support@graphit-app.com",
8
+ "url": "https://graphit-app.com"
9
+ },
10
+ "homepage": "https://graphit-app.com",
11
+ "repository": "https://github.com/graphit-app/graphit-cli",
12
+ "keywords": [
13
+ "graphit",
14
+ "bi",
15
+ "dashboard",
16
+ "custom-dashboard",
17
+ "data-visualization",
18
+ "knowledge-base",
19
+ "sql",
20
+ "cli"
21
+ ]
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphit/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Graphit CLI - Build custom dashboards from any AI coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,9 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "skill"
19
+ "skills",
20
+ ".claude-plugin",
21
+ ".codex-plugin"
20
22
  ],
21
23
  "keywords": [
22
24
  "graphit",
@@ -12,6 +12,27 @@ description: >
12
12
 
13
13
  Build custom HTML dashboards from real data using the Graphit CLI.
14
14
 
15
+ ## Session Start
16
+
17
+ Run `graphit --version` at the start of every session to confirm the CLI is installed.
18
+ If the output includes an "Update available" banner, tell the user to update before proceeding and explain that outdated versions may be missing commands or bug fixes.
19
+
20
+ ## Error Recovery
21
+
22
+ When any `graphit` command fails with an unexpected error (unknown command, unrecognized flag, non-zero exit with unclear message), suggest `npm update -g @graphit/cli` before investigating further. Outdated CLI versions are the most common cause of unexpected errors.
23
+ Do NOT suggest updating for normal operational failures (expired auth, bad SQL syntax, network timeout, entity not found).
24
+
25
+ ## After Setup
26
+
27
+ After `graphit setup` completes successfully, offer to add a Graphit section to the project's CLAUDE.md (or AGENTS.md for Codex) so future sessions know Graphit is available without activating the skill. Suggested snippet:
28
+
29
+ ```
30
+ ## Graphit
31
+ Use `/graphit` to build custom HTML dashboards from real data.
32
+ Run `graphit ds list` to see cached data sources before querying.
33
+ Run `graphit kb list` to explore available metrics and dimensions.
34
+ ```
35
+
15
36
  ## HARD CONSTRAINTS (violating these produces a broken dashboard)
16
37
 
17
38
  ### 1. ZERO external resources
@@ -81,10 +102,13 @@ NEVER embed query results as static JS variables. The dashboard iframe provides
81
102
 
82
103
  | Command | Description |
83
104
  |---------|-------------|
84
- | `graphit kb list <type>` | List metrics, dimensions, tables, rules, domains, synonyms |
105
+ | `graphit kb list <type>` | List metrics, dimensions, tables, rules, domains, synonyms, templates |
85
106
  | `graphit kb get <type> <name>` | Full entity details by name |
86
107
  | `graphit kb search <query>` | Search across all KB types |
87
108
  | `graphit kb explore metric <name>` | Metric -> tables -> dimensions graph |
109
+ | `graphit kb create template --name X --file template.html --description "..."` | Save a reusable chart template (--file or --render-code) |
110
+ | `graphit kb update template <name> --file template.html --description "..."` | Update a template (--file or --render-code) |
111
+ | `graphit kb delete template <name> --yes` | Delete a template |
88
112
  | `graphit ds list` | List cached data sources (use these for fast queries) |
89
113
  | `graphit query "<sql>" --ds <id>` | Query cached data source (~100ms) |
90
114
  | `graphit query "<sql>" --warehouse --connection <id>` | Query live Snowflake (~10s) |
@@ -168,7 +192,7 @@ The iframe also provides optional convenience helpers if you want quick standard
168
192
 
169
193
  These are shortcuts, not requirements. Use them when a standard chart is all you need. Hand-roll when you want full control over the visualization.
170
194
 
171
- `graphit.chart` types: `"bar"`, `"line"`, `"area"`, `"donut"` (alias `"pie"`), `"scatter"` (alias `"bubble"`), `"stacked-bar"` (alias `"stacked"`), `"heatmap"`, `"funnel"`, `"gauge"`, `"sparkline"`. Config: `x` (category field), `y` (value field), `series` (group-by field), `title`, `height` (140-900px), `valueFormat` (`"currency"` | `"percent"` | `"number"`), `colors` (array). Scatter adds: `size` (bubble radius field), `label` (tooltip field). Gauge adds: `min`, `max`, `format`. Sparkline adds: `width`, `showValue`.
195
+ `graphit.chart` types: `"bar"`, `"horizontal-bar"` (alias `"hbar"` - use when category labels are long), `"line"`, `"area"`, `"donut"` (alias `"pie"`), `"scatter"` (alias `"bubble"`), `"stacked-bar"` (alias `"stacked"`), `"heatmap"`, `"funnel"`, `"gauge"`, `"sparkline"`. Config: `x` (category field), `y` (value field), `series` (group-by field), `title`, `height` (140-900px), `valueFormat` (`"currency"` | `"percent"` | `"number"`), `colors` (array). Scatter adds: `size` (bubble radius field), `label` (tooltip field). Gauge adds: `min`, `max`, `format`. Sparkline adds: `width`, `showValue`.
172
196
 
173
197
  `graphit.kpi` config: `value`, `label`, `format` (`"currency"` | `"percent"` | `"number"`), `compareValue`, `compareLabel`.
174
198
 
@@ -27,6 +27,9 @@ Config: requires `series` field for stacking groups.
27
27
  CSS grid. X = columns, Y = rows. Background intensity scales linearly (rgba teal, 0.08-0.98). Text flips white at >55% intensity. Headers auto-generated. Capped at 40x40.
28
28
  Config: `x` (column), `y` (row), `value` (intensity, falls back to `y`).
29
29
 
30
+ ### horizontal-bar / hbar
31
+ CSS horizontal bars for long category labels that overlap on vertical bar x-axis. Labels on the left, proportional bars in the middle, formatted values on the right. Each bar colored from the palette. Use instead of `bar` when categories have names longer than ~10 characters.
32
+
30
33
  ### funnel
31
34
  CSS horizontal bars narrowing top-to-bottom. First bar = 100% width, rest proportional. Shows step-over-step conversion rate. Colors cycle through palette.
32
35
 
@@ -38,6 +41,14 @@ Config: `value`, `min` (default 0), `max` (default 100), `format`, `label`, `col
38
41
  Inline SVG polyline for KPI cards or table cells. No axes, no grid - just trend shape. Single data point renders as a dot.
39
42
  Config: `y`, `width` (default 120), `height` (default 32), `label`, `showValue` (default true), `valueFormat`.
40
43
 
44
+ ## Saved templates
45
+
46
+ Templates are reusable chart components saved to the org's KB. At dashboard load, the SDK fetches the org's template bundle and registers them alongside built-in types.
47
+
48
+ **Usage:** `graphit.TEMPLATE_NAME(el, {data, value: 'revenue', label: 'Revenue'})` or via `graphit.chart(el, {type: 'TEMPLATE_NAME', ...})`.
49
+
50
+ Templates are org-specific - they exist only when users have saved them. The agent's context provider lists available templates each turn. Use `list_templates()` to discover them and `get_template(name)` to read the render code.
51
+
41
52
  ## Color tokens
42
53
 
43
54
  | Token | Usage |
File without changes