@tenderprompt/cli 0.1.5 → 0.1.6

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 (2) hide show
  1. package/README.md +93 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -19,6 +19,28 @@ Then run:
19
19
  tender --help
20
20
  ```
21
21
 
22
+ ## What You Can Do
23
+
24
+ Use the CLI to work with Tender Apps from a local checkout or coding-agent
25
+ session:
26
+
27
+ - sign in with a bounded device token and optional artifact scope
28
+ - list, create, and rename apps
29
+ - bootstrap a local app checkout with Tender project context
30
+ - configure the Tender artifact Git remote and credential helper
31
+ - validate app source locally before pushing
32
+ - build and preview a commit through the Tender API
33
+ - publish only after a dry run or explicit `--confirm publish`
34
+ - inspect artifact-scoped analytics without SQL or platform credentials
35
+ - run server-validated chart specs and export aggregate rows
36
+ - generate starter analytics suggestions
37
+ - create saved analytics dashboards and charts, with `--dry-run` available for
38
+ write previews
39
+
40
+ The CLI is deterministic by design: every workflow has a non-interactive flag
41
+ path, supports `--json` where automation needs structured output, and avoids
42
+ interactive prompts unless the command is explicitly an auth flow.
43
+
22
44
  ## Typical Flow
23
45
 
24
46
  ```bash
@@ -35,6 +57,15 @@ tender app preview artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
35
57
  tender app publish artifact_123 --commit "$(git rev-parse HEAD)" --confirm publish --stream --json
36
58
  ```
37
59
 
60
+ For agents, keep the pattern simple:
61
+
62
+ 1. use `tender app context fetch` or `tender app init` to get local context
63
+ 2. inspect and edit files locally
64
+ 3. run `tender app doctor` and local project checks
65
+ 4. push source with Git
66
+ 5. call `preview`, `publish --dry-run`, then `publish --confirm publish` only
67
+ when the user asked to publish
68
+
38
69
  ## Auth
39
70
 
40
71
  Use the device login flow to mint a local token:
@@ -83,6 +114,64 @@ tender app preview artifact_123 --commit "$(git rev-parse HEAD)" --stream --json
83
114
  tender app publish artifact_123 --dry-run --json
84
115
  ```
85
116
 
117
+ ## Analytics
118
+
119
+ Analytics commands are artifact-scoped and go through Tender's server-side
120
+ validation. The CLI never exposes raw query credentials, raw SQL, or cross-app
121
+ data.
122
+
123
+ Start with capabilities. This is the self-documenting entrypoint for coding
124
+ agents:
125
+
126
+ ```bash
127
+ tender app analytics capabilities artifact_123 --include-catalog --range 30d --json
128
+ ```
129
+
130
+ That response tells the agent:
131
+
132
+ - which analytics commands are supported
133
+ - the safe chart-spec shape
134
+ - retention, range, quota, and security limits
135
+ - existing saved dashboards and charts
136
+ - bounded observed event names, request paths, property keys, rough types, and
137
+ counts from artifact-scoped catalog samples
138
+
139
+ Common read-only commands:
140
+
141
+ ```bash
142
+ tender app analytics summary artifact_123 --range 30d --json
143
+
144
+ tender app analytics query artifact_123 --spec chart.json --json
145
+
146
+ tender app analytics query artifact_123 --spec - --json < chart.json
147
+
148
+ tender app analytics export catalog artifact_123 --range 30d --json
149
+
150
+ tender app analytics export query artifact_123 --spec chart.json --format csv
151
+
152
+ tender app analytics suggestions artifact_123 --range 30d --json
153
+ ```
154
+
155
+ Safe write previews:
156
+
157
+ ```bash
158
+ tender app analytics dashboards artifact_123 --create "Agent dashboard" --dry-run --json
159
+
160
+ tender app analytics charts create artifact_123 \
161
+ --dashboard analytics_dashboard_123 \
162
+ --title "Signup funnel" \
163
+ --spec funnel.json \
164
+ --dry-run \
165
+ --json
166
+ ```
167
+
168
+ Real saved-dashboard writes use the same commands without `--dry-run`.
169
+
170
+ Agents should combine `capabilities --include-catalog` with local source-code
171
+ inspection. For example, inspect where the app calls
172
+ `__TP_ANALYTICS.invoke(...)`, propose a chart spec, validate it with
173
+ `analytics query`, and only then create a saved chart.
174
+
86
175
  ## Safety Model
87
176
 
88
177
  - Local agents run in the user's environment, not in Tender.
@@ -93,6 +182,10 @@ tender app publish artifact_123 --dry-run --json
93
182
  - `tender app publish` requires `--dry-run` or `--confirm publish`.
94
183
  - Tokens are stored outside the project checkout and are not written into Git
95
184
  remote URLs.
185
+ - Analytics commands use tenant/artifact-scoped API routes. They do not expose
186
+ raw query credentials or raw SQL.
187
+ - Raw analytics event export is intentionally not available; exports are bounded
188
+ catalog metadata or validated aggregate query rows.
96
189
 
97
190
  ## Related Package
98
191
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tenderprompt/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "bin": {
6
- "tender": "./bin/tender.js"
6
+ "tender": "bin/tender.js"
7
7
  },
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",