@clickzetta/cz-cli-darwin-arm64 0.3.81 → 0.3.83

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 (201) hide show
  1. package/bin/cz-cli +0 -0
  2. package/bin/skills/clickzetta-access-control/LICENSE +16 -0
  3. package/bin/skills/clickzetta-access-control/SKILL.md +243 -0
  4. package/bin/skills/clickzetta-access-control/eval_cases.jsonl +3 -0
  5. package/bin/skills/clickzetta-access-control/references/dynamic-masking.md +86 -0
  6. package/bin/skills/clickzetta-access-control/references/grant-revoke.md +103 -0
  7. package/bin/skills/clickzetta-access-control/references/role-management.md +66 -0
  8. package/bin/skills/clickzetta-access-control/references/user-management.md +61 -0
  9. package/bin/skills/clickzetta-app-python-sdk/LICENSE +16 -0
  10. package/bin/skills/clickzetta-app-python-sdk/SKILL.md +153 -0
  11. package/bin/skills/clickzetta-app-python-sdk/eval_cases.jsonl +12 -0
  12. package/bin/skills/clickzetta-app-python-sdk/references/bulkload.md +196 -0
  13. package/bin/skills/clickzetta-app-python-sdk/references/connector.md +143 -0
  14. package/bin/skills/clickzetta-app-python-sdk/references/realtime.md +122 -0
  15. package/bin/skills/clickzetta-batch-sync-pipeline/LICENSE +16 -0
  16. package/bin/skills/clickzetta-batch-sync-pipeline/SKILL.md +227 -0
  17. package/bin/skills/clickzetta-batch-sync-pipeline/eval_cases.jsonl +5 -0
  18. package/bin/skills/clickzetta-bi-connect/LICENSE +16 -0
  19. package/bin/skills/clickzetta-bi-connect/SKILL.md +176 -0
  20. package/bin/skills/clickzetta-bi-connect/eval_cases.jsonl +5 -0
  21. package/bin/skills/clickzetta-bi-connect/references/bi-tools.md +170 -0
  22. package/bin/skills/clickzetta-cdc-sync-pipeline/LICENSE +16 -0
  23. package/bin/skills/clickzetta-cdc-sync-pipeline/SKILL.md +633 -0
  24. package/bin/skills/clickzetta-cdc-sync-pipeline/eval_cases.jsonl +5 -0
  25. package/bin/skills/clickzetta-data-ingest-pipeline/LICENSE +16 -0
  26. package/bin/skills/clickzetta-data-ingest-pipeline/SKILL.md +237 -0
  27. package/bin/skills/clickzetta-data-ingest-pipeline/eval_cases.jsonl +5 -0
  28. package/bin/skills/clickzetta-data-retention/LICENSE +16 -0
  29. package/bin/skills/clickzetta-data-retention/SKILL.md +160 -0
  30. package/bin/skills/clickzetta-data-retention/eval_cases.jsonl +5 -0
  31. package/bin/skills/clickzetta-data-retention/references/lifecycle-reference.md +175 -0
  32. package/bin/skills/clickzetta-data-science/LICENSE +16 -0
  33. package/bin/skills/clickzetta-data-science/SKILL.md +125 -0
  34. package/bin/skills/clickzetta-data-science/eval_cases.jsonl +12 -0
  35. package/bin/skills/clickzetta-data-science/references/bitmap-profile.md +146 -0
  36. package/bin/skills/clickzetta-data-science/references/data-patterns.md +110 -0
  37. package/bin/skills/clickzetta-data-science/references/setup.md +160 -0
  38. package/bin/skills/clickzetta-data-science/references/stats-functions.md +195 -0
  39. package/bin/skills/clickzetta-data-science/references/write-and-infer.md +122 -0
  40. package/bin/skills/clickzetta-data-science/references/zettapark-api.md +156 -0
  41. package/bin/skills/clickzetta-data-sharing/LICENSE +16 -0
  42. package/bin/skills/clickzetta-data-sharing/SKILL.md +160 -0
  43. package/bin/skills/clickzetta-data-sharing/eval_cases.jsonl +3 -0
  44. package/bin/skills/clickzetta-data-sharing/references/share-ddl.md +134 -0
  45. package/bin/skills/clickzetta-dba-guide/LICENSE +16 -0
  46. package/bin/skills/clickzetta-dba-guide/SKILL.md +542 -0
  47. package/bin/skills/clickzetta-dba-guide/eval_cases.jsonl +3 -0
  48. package/bin/skills/clickzetta-dw-modeling/LICENSE +16 -0
  49. package/bin/skills/clickzetta-dw-modeling/SKILL.md +351 -0
  50. package/bin/skills/clickzetta-dw-modeling/eval_cases.jsonl +4 -0
  51. package/bin/skills/clickzetta-dw-modeling/references/modeling-patterns.md +100 -0
  52. package/bin/skills/clickzetta-dynamic-table/LICENSE +16 -0
  53. package/bin/skills/clickzetta-dynamic-table/SKILL.md +230 -0
  54. package/bin/skills/clickzetta-dynamic-table/best-practices/dimension-table-join-guide.md +253 -0
  55. package/bin/skills/clickzetta-dynamic-table/best-practices/medallion-and-stream-patterns.md +124 -0
  56. package/bin/skills/clickzetta-dynamic-table/best-practices/non-partitioned-merge-into-warning.md +96 -0
  57. package/bin/skills/clickzetta-dynamic-table/best-practices/performance-optimization.md +109 -0
  58. package/bin/skills/clickzetta-dynamic-table/best-practices/scheduling-guide.md +135 -0
  59. package/bin/skills/clickzetta-dynamic-table/dt-creator/SKILL.md +15 -0
  60. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/dt-declaration-strategy.md +185 -0
  61. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/incremental-config-reference.md +427 -0
  62. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/refresh-history-guide.md +260 -0
  63. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/sql-limitations.md +80 -0
  64. package/bin/skills/clickzetta-dynamic-table/dynamic-table-alter/SKILL.md +190 -0
  65. package/bin/skills/clickzetta-dynamic-table/eval_cases.jsonl +5 -0
  66. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/SKILL.md +27 -0
  67. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-column-validation-rules.md +118 -0
  68. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-conversion-rules.md +225 -0
  69. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-placeholder-rules.md +182 -0
  70. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-refresh-rules.md +98 -0
  71. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-self-reference-rules.md +76 -0
  72. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-workflow.md +109 -0
  73. package/bin/skills/clickzetta-external-catalog/LICENSE +16 -0
  74. package/bin/skills/clickzetta-external-catalog/SKILL.md +123 -0
  75. package/bin/skills/clickzetta-external-catalog/eval_cases.jsonl +5 -0
  76. package/bin/skills/clickzetta-external-catalog/references/external-catalog-ddl.md +130 -0
  77. package/bin/skills/clickzetta-external-function/LICENSE +16 -0
  78. package/bin/skills/clickzetta-external-function/SKILL.md +203 -0
  79. package/bin/skills/clickzetta-external-function/eval_cases.jsonl +4 -0
  80. package/bin/skills/clickzetta-external-function/references/external-function-ddl.md +171 -0
  81. package/bin/skills/clickzetta-file-import-pipeline/LICENSE +16 -0
  82. package/bin/skills/clickzetta-file-import-pipeline/SKILL.md +190 -0
  83. package/bin/skills/clickzetta-file-import-pipeline/eval_cases.jsonl +5 -0
  84. package/bin/skills/clickzetta-index-manager/LICENSE +16 -0
  85. package/bin/skills/clickzetta-index-manager/SKILL.md +140 -0
  86. package/bin/skills/clickzetta-index-manager/eval_cases.jsonl +5 -0
  87. package/bin/skills/clickzetta-index-manager/references/bloomfilter-index.md +67 -0
  88. package/bin/skills/clickzetta-index-manager/references/index-management.md +73 -0
  89. package/bin/skills/clickzetta-index-manager/references/inverted-index.md +80 -0
  90. package/bin/skills/clickzetta-index-manager/references/vector-index.md +81 -0
  91. package/bin/skills/clickzetta-java-sdk/LICENSE +16 -0
  92. package/bin/skills/clickzetta-java-sdk/SKILL.md +186 -0
  93. package/bin/skills/clickzetta-java-sdk/eval_cases.jsonl +12 -0
  94. package/bin/skills/clickzetta-java-sdk/references/bulkload.md +163 -0
  95. package/bin/skills/clickzetta-java-sdk/references/realtime.md +212 -0
  96. package/bin/skills/clickzetta-kafka-ingest-pipeline/LICENSE +16 -0
  97. package/bin/skills/clickzetta-kafka-ingest-pipeline/SKILL.md +769 -0
  98. package/bin/skills/clickzetta-kafka-ingest-pipeline/eval_cases.jsonl +5 -0
  99. package/bin/skills/clickzetta-kafka-ingest-pipeline/references/kafka-pipe-syntax.md +324 -0
  100. package/bin/skills/clickzetta-lakehouse-connect/LICENSE +16 -0
  101. package/bin/skills/clickzetta-lakehouse-connect/SKILL.md +218 -0
  102. package/bin/skills/clickzetta-lakehouse-connect/eval_cases.jsonl +3 -0
  103. package/bin/skills/clickzetta-lakehouse-connect/evals/evals.json +35 -0
  104. package/bin/skills/clickzetta-lakehouse-connect/references/config-file.md +435 -0
  105. package/bin/skills/clickzetta-lakehouse-connect/references/jdbc.md +478 -0
  106. package/bin/skills/clickzetta-lakehouse-connect/references/python-sdk.md +225 -0
  107. package/bin/skills/clickzetta-lakehouse-connect/references/sqlalchemy.md +468 -0
  108. package/bin/skills/clickzetta-lakehouse-connect/references/zettapark-session.md +445 -0
  109. package/bin/skills/clickzetta-manage-comments/LICENSE +16 -0
  110. package/bin/skills/clickzetta-manage-comments/SKILL.md +219 -0
  111. package/bin/skills/clickzetta-manage-comments/eval_cases.jsonl +3 -0
  112. package/bin/skills/clickzetta-metadata/LICENSE +16 -0
  113. package/bin/skills/clickzetta-metadata/SKILL.md +502 -0
  114. package/bin/skills/clickzetta-metadata/eval_cases.jsonl +5 -0
  115. package/bin/skills/clickzetta-metadata/references/instance-views-reference.md +276 -0
  116. package/bin/skills/clickzetta-metadata/references/metering-views-reference.md +137 -0
  117. package/bin/skills/clickzetta-metadata/references/show-desc-reference.md +326 -0
  118. package/bin/skills/clickzetta-metadata/references/views-reference.md +271 -0
  119. package/bin/skills/clickzetta-monitoring/LICENSE +16 -0
  120. package/bin/skills/clickzetta-monitoring/SKILL.md +215 -0
  121. package/bin/skills/clickzetta-monitoring/eval_cases.jsonl +5 -0
  122. package/bin/skills/clickzetta-monitoring/references/job-history-analysis.md +97 -0
  123. package/bin/skills/clickzetta-monitoring/references/show-jobs.md +48 -0
  124. package/bin/skills/clickzetta-oss-ingest-pipeline/LICENSE +16 -0
  125. package/bin/skills/clickzetta-oss-ingest-pipeline/SKILL.md +562 -0
  126. package/bin/skills/clickzetta-oss-ingest-pipeline/eval_cases.jsonl +5 -0
  127. package/bin/skills/clickzetta-overview/LICENSE +16 -0
  128. package/bin/skills/clickzetta-overview/SKILL.md +102 -0
  129. package/bin/skills/clickzetta-overview/eval_cases.jsonl +5 -0
  130. package/bin/skills/clickzetta-overview/references/brands-and-endpoints.md +79 -0
  131. package/bin/skills/clickzetta-overview/references/object-model.md +311 -0
  132. package/bin/skills/clickzetta-overview/references/studio-modules.md +173 -0
  133. package/bin/skills/clickzetta-pipeline-review/LICENSE +16 -0
  134. package/bin/skills/clickzetta-pipeline-review/SKILL.md +377 -0
  135. package/bin/skills/clickzetta-query-optimizer/LICENSE +16 -0
  136. package/bin/skills/clickzetta-query-optimizer/SKILL.md +156 -0
  137. package/bin/skills/clickzetta-query-optimizer/eval_cases.jsonl +5 -0
  138. package/bin/skills/clickzetta-query-optimizer/references/explain.md +56 -0
  139. package/bin/skills/clickzetta-query-optimizer/references/hints-and-sortkey.md +78 -0
  140. package/bin/skills/clickzetta-query-optimizer/references/optimize.md +65 -0
  141. package/bin/skills/clickzetta-query-optimizer/references/result-cache.md +49 -0
  142. package/bin/skills/clickzetta-query-optimizer/references/show-jobs.md +42 -0
  143. package/bin/skills/clickzetta-realtime-sync-pipeline/LICENSE +16 -0
  144. package/bin/skills/clickzetta-realtime-sync-pipeline/SKILL.md +323 -0
  145. package/bin/skills/clickzetta-realtime-sync-pipeline/eval_cases.jsonl +5 -0
  146. package/bin/skills/clickzetta-semantic-view/LICENSE +16 -0
  147. package/bin/skills/clickzetta-semantic-view/SKILL.md +207 -0
  148. package/bin/skills/clickzetta-semantic-view/eval_cases.jsonl +12 -0
  149. package/bin/skills/clickzetta-semantic-view/references/semantic-view-reference.md +167 -0
  150. package/bin/skills/clickzetta-spark-flink-connector/LICENSE +16 -0
  151. package/bin/skills/clickzetta-spark-flink-connector/SKILL.md +92 -0
  152. package/bin/skills/clickzetta-spark-flink-connector/eval_cases.jsonl +5 -0
  153. package/bin/skills/clickzetta-spark-flink-connector/references/flink.md +147 -0
  154. package/bin/skills/clickzetta-spark-flink-connector/references/spark.md +132 -0
  155. package/bin/skills/clickzetta-sql-pipeline-manager/LICENSE +16 -0
  156. package/bin/skills/clickzetta-sql-pipeline-manager/SKILL.md +485 -0
  157. package/bin/skills/clickzetta-sql-pipeline-manager/eval_cases.jsonl +12 -0
  158. package/bin/skills/clickzetta-sql-pipeline-manager/evals/evals.json +166 -0
  159. package/bin/skills/clickzetta-sql-pipeline-manager/references/dynamic-table.md +185 -0
  160. package/bin/skills/clickzetta-sql-pipeline-manager/references/materialized-view.md +129 -0
  161. package/bin/skills/clickzetta-sql-pipeline-manager/references/pipe.md +222 -0
  162. package/bin/skills/clickzetta-sql-pipeline-manager/references/table-stream.md +125 -0
  163. package/bin/skills/clickzetta-sql-syntax-guide/LICENSE +16 -0
  164. package/bin/skills/clickzetta-sql-syntax-guide/SKILL.md +249 -0
  165. package/bin/skills/clickzetta-sql-syntax-guide/eval_cases.jsonl +3 -0
  166. package/bin/skills/clickzetta-sql-syntax-guide/references/ddl-reference.md +350 -0
  167. package/bin/skills/clickzetta-sql-syntax-guide/references/dml-reference.md +279 -0
  168. package/bin/skills/clickzetta-sql-syntax-guide/references/dql-reference.md +504 -0
  169. package/bin/skills/clickzetta-sql-syntax-guide/references/functions-reference.md +372 -0
  170. package/bin/skills/clickzetta-sql-syntax-guide/references/migration-databricks.md +260 -0
  171. package/bin/skills/clickzetta-sql-syntax-guide/references/migration-snowflake.md +382 -0
  172. package/bin/skills/clickzetta-sql-syntax-guide/references/vs-snowflake.md +346 -0
  173. package/bin/skills/clickzetta-sql-syntax-guide/references/vs-spark.md +229 -0
  174. package/bin/skills/clickzetta-studio-task-manager/LICENSE +16 -0
  175. package/bin/skills/clickzetta-studio-task-manager/SKILL.md +652 -0
  176. package/bin/skills/clickzetta-table-lineage/LICENSE +16 -0
  177. package/bin/skills/clickzetta-table-lineage/SKILL.md +90 -0
  178. package/bin/skills/clickzetta-table-lineage/eval_cases.jsonl +1 -0
  179. package/bin/skills/clickzetta-table-lineage/references/normalize_func.sql +14 -0
  180. package/bin/skills/clickzetta-table-lineage/references/table_cost.sql +38 -0
  181. package/bin/skills/clickzetta-table-lineage/references/table_lineage_standalone.html +562 -0
  182. package/bin/skills/clickzetta-table-lineage/references/table_relation.sql +25 -0
  183. package/bin/skills/clickzetta-table-stream-pipeline/LICENSE +16 -0
  184. package/bin/skills/clickzetta-table-stream-pipeline/SKILL.md +206 -0
  185. package/bin/skills/clickzetta-table-stream-pipeline/eval_cases.jsonl +5 -0
  186. package/bin/skills/clickzetta-vcluster-manager/LICENSE +16 -0
  187. package/bin/skills/clickzetta-vcluster-manager/SKILL.md +212 -0
  188. package/bin/skills/clickzetta-vcluster-manager/eval_cases.jsonl +5 -0
  189. package/bin/skills/clickzetta-vcluster-manager/references/vc-cache.md +54 -0
  190. package/bin/skills/clickzetta-vcluster-manager/references/vcluster-ddl.md +150 -0
  191. package/bin/skills/clickzetta-volume-manager/LICENSE +16 -0
  192. package/bin/skills/clickzetta-volume-manager/SKILL.md +292 -0
  193. package/bin/skills/clickzetta-volume-manager/eval_cases.jsonl +5 -0
  194. package/bin/skills/clickzetta-volume-manager/references/volume-ddl.md +199 -0
  195. package/bin/skills/clickzetta-zettapark/LICENSE +16 -0
  196. package/bin/skills/clickzetta-zettapark/SKILL.md +248 -0
  197. package/bin/skills/clickzetta-zettapark/eval_cases.jsonl +12 -0
  198. package/bin/skills/clickzetta-zettapark/references/zettapark-api.md +283 -0
  199. package/bin/skills/cz-cli/SKILL.md +313 -0
  200. package/bin/skills/cz-cli/references/profile-setup.md +120 -0
  201. package/package.json +1 -1
@@ -0,0 +1,313 @@
1
+ ---
2
+ name: cz-cli
3
+ description: "Delegate ClickZetta Lakehouse OPERATIONS (run SQL, manage tables/schemas, create Studio tasks, set up sync/ingest pipelines, configure profiles) to the cz-cli agent. TRIGGER when user wants to EXECUTE something on Lakehouse: query data, create/alter tables, deploy tasks, build pipelines, set up a new connection. SKIP when user is developing the cz-cli tool itself (cwd is the cz-cli source repo, editing CLI source/tests, debugging build/install/unlink/permission issues), or only discussing cz-cli design/code without wanting to run anything on Lakehouse."
4
+ ---
5
+
6
+ # cz-cli — ClickZetta Lakehouse Subagent
7
+
8
+ You have no direct Lakehouse access. Always delegate via cz-cli.
9
+
10
+ ## Capabilities
11
+
12
+ ### SQL & Data Operations
13
+ - Execute any SQL against Lakehouse: SELECT, DDL (CREATE/ALTER/DROP TABLE, SCHEMA, VIEW), DML (INSERT, UPDATE, DELETE, MERGE INTO)
14
+ - Run async jobs and fetch results
15
+ - Preview table data and row counts
16
+
17
+ ### Table & Schema Management
18
+ - List, describe, create, and drop tables and schemas
19
+ - View table history, indexes, partitions, and statistics
20
+ - Add or update column/table comments
21
+ - Create Dynamic Tables for auto-incremental ETL (ODS→DWD→DWS pipelines)
22
+ - Create Materialized Views for pre-computed aggregations
23
+ - Create Table Streams to capture INSERT/UPDATE/DELETE changes for CDC UPSERT
24
+
25
+ ### Studio Task Management
26
+ - Create, configure, deploy, and delete Studio tasks (SQL, Shell, Python, integration, flow)
27
+ - Save task content and cron schedule
28
+ - Deploy, undeploy, and execute tasks ad-hoc
29
+ - Monitor run instances: list, detail, wait, logs, stop, rerun, backfill
30
+ - View run statistics and dependencies
31
+
32
+ ### Data Sync Pipelines
33
+ - Create single-table realtime CDC sync tasks (MySQL/PostgreSQL/SQL Server → Lakehouse, task_type=28)
34
+ - Create multi-table or whole-database CDC sync tasks — mirror, merge, or sharded-table consolidation (task_type=281)
35
+ - Create offline batch sync tasks with Cron scheduling — single-table (task_type=10) or multi-table (task_type=291)
36
+ - Manage sync task lifecycle: start, stop, offline, backfill, add tables, re-sync individual tables
37
+
38
+ ### Data Ingestion Pipelines
39
+ - Create continuous OSS/S3/COS ingest PIPE (LIST_PURGE scan mode or EVENT_NOTIFICATION mode)
40
+ - Create continuous Kafka ingest PIPE using READ_KAFKA function
41
+ - One-shot file import from URL, local path, or Volume (COPY INTO)
42
+ - Manage PIPE lifecycle: pause, resume, adjust batch interval, view load history
43
+
44
+ ### Data Recovery
45
+ - Query data at a historical point in time (Time Travel: TIMESTAMP AS OF)
46
+ - Roll back a table to a previous version (RESTORE TABLE)
47
+ - Recover accidentally dropped tables, dynamic tables, or materialized views (UNDROP TABLE)
48
+ - Inspect change history (DESC HISTORY) and deleted objects (SHOW TABLES HISTORY)
49
+ - Configure retention: data_retention_days, data_lifecycle
50
+
51
+ ### Connection & Environment Management
52
+ - Create, update, delete, and switch connection profiles (multi-cloud, multi-region)
53
+ - Check connection status and switch workspace
54
+ - List and test external data sources, browse catalogs and objects
55
+ - Generate Python SDK / ZettaPark / SQLAlchemy / JDBC connection code from profile parameters
56
+
57
+ ## Route to cz-cli
58
+
59
+ - SQL against Lakehouse (SELECT, DDL, DML)
60
+ - Studio task development, scheduling, monitoring
61
+ - Data pipelines (sync, import, CDC, streaming)
62
+ - Profile and connection configuration
63
+ - Performance analysis and optimization
64
+
65
+ ## Keep in host agent
66
+
67
+ - General programming unrelated to ClickZetta
68
+ - Local file operations, git
69
+ - Non-ClickZetta databases (PostgreSQL, MySQL standalone)
70
+
71
+ ## Execution strategy
72
+
73
+ **MANDATORY: Follow this order every time. No exceptions.**
74
+
75
+ **Step 1 — MUST check LLM first:**
76
+
77
+ ```bash
78
+ cz-cli agent llm show
79
+ ```
80
+
81
+ **Step 2 — If active LLM is configured (kind != "none"), you MUST use agent run:**
82
+
83
+ ```bash
84
+ cz-cli agent run "<request>" --format a2a --dangerously-skip-permissions
85
+ ```
86
+
87
+ Do NOT use direct cz-cli subcommands when an active LLM is available. Always delegate the full request to `cz-cli agent run`.
88
+
89
+ The output includes a `session_id`. Use it to inspect the run:
90
+ - `cz-cli agent session status <session_id>` — current state (`busy`/`retry` with `progress`, `idle` with `result`, or `error`)
91
+ - `cz-cli agent export <session_id>` — full conversation (messages, tool calls, reasoning, text). Wait until `status` is `idle` before exporting; otherwise the conversation may still be in progress.
92
+
93
+ **Step 3 — ONLY if no active LLM (kind: "none" or empty list), fall back to direct commands:**
94
+
95
+ Decompose the request into concrete `cz-cli` subcommands (`sql`, `schema`, `table`, `task`, `runs`, `job`, `datasource`, `profile`, etc.), execute them, and synthesize the result.
96
+
97
+ Use direct commands for local setup and diagnostics even when agent path is available: `cz-cli profile ...`, `cz-cli -p <profile> status`, `cz-cli agent llm ...`, `cz-cli --help`.
98
+
99
+ With session continuity:
100
+
101
+ ```bash
102
+ cz-cli agent run "<request>" --format a2a --dangerously-skip-permissions --session <session_id>
103
+ ```
104
+
105
+ Reuse `session_id` for follow-ups on the same topic. Omit `--session` to start fresh.
106
+
107
+ ## Async mode (non-TTY / long-running tasks)
108
+
109
+ When running in non-TTY environments (e.g. as a subagent from Claude Code) or for long-running tasks, use async mode to avoid blocking:
110
+
111
+ ### Submit asynchronously
112
+
113
+ ```bash
114
+ cz-cli agent run "<request>" --async --format a2a --dangerously-skip-permissions
115
+ ```
116
+
117
+ Returns immediately with a session ID:
118
+ ```json
119
+ {"session_id": "01JXF3K...", "status": "running", "message": "Session submitted asynchronously"}
120
+ ```
121
+
122
+ Note: In non-TTY with `--format a2a` or `--format json`, async mode activates automatically (no `--async` flag needed).
123
+
124
+ ### Poll status
125
+
126
+ ```bash
127
+ cz-cli agent session status <session_id> [--wait]
128
+ ```
129
+
130
+ By default this returns the current status once. With `--wait`, it keeps waiting and streams progress until completion or timeout.
131
+
132
+ While running:
133
+ ```json
134
+ {"session_id": "01JXF3K...", "status": "busy", "progress": "$ cz-cli table list -o table"}
135
+ ```
136
+
137
+ Other progress examples you may see during polling:
138
+ - `"💭 Thinking..."` — LLM is reasoning
139
+ - `"✏ Generating response..."` — LLM is writing the reply
140
+ - `"✱ Grep \"error\" · 3 matches"` — running a search tool
141
+ - `"↻ Retry (attempt 2)"` — retrying a failed LLM call (paired with a `retry` field describing the reason)
142
+
143
+ When complete:
144
+ ```json
145
+ {"session_id": "01JXF3K...", "status": "idle", "result": "Here are the results:\n..."}
146
+ ```
147
+
148
+ The `result` field is the final text reply. For full conversation details (thinking, tool calls, intermediate text), use `cz-cli agent export <session_id>`.
149
+
150
+ If the session does not exist:
151
+ ```json
152
+ {"session_id": "ses_invalid", "error": "Session not found"}
153
+ ```
154
+ (exits with code 1)
155
+
156
+ ### Retrieve full conversation (thinking + tool calls + text)
157
+
158
+ ```bash
159
+ cz-cli agent export <session_id>
160
+ ```
161
+
162
+ Returns complete session with all message parts:
163
+ ```json
164
+ {
165
+ "info": { "id": "...", "title": "...", "time": {...} },
166
+ "messages": [
167
+ {
168
+ "info": { "role": "user" },
169
+ "parts": [{ "type": "text", "text": "original prompt" }]
170
+ },
171
+ {
172
+ "info": { "role": "assistant" },
173
+ "parts": [
174
+ { "type": "reasoning", "text": "thinking content..." },
175
+ { "type": "tool", "tool": "bash", "state": { "status": "completed", "input": {...}, "output": "..." } },
176
+ { "type": "text", "text": "final answer..." }
177
+ ]
178
+ }
179
+ ]
180
+ }
181
+ ```
182
+
183
+ Part types in export:
184
+ - `reasoning` — LLM thinking/reasoning blocks
185
+ - `tool` — tool calls with full input/output (bash, read, write, edit, glob, grep, etc.)
186
+ - `text` — final text response
187
+ - `step-start` / `step-finish` — step boundaries
188
+ - `patch` — code diffs
189
+ - `subtask` — delegated sub-tasks
190
+
191
+ ### Async workflow pattern
192
+
193
+ ```bash
194
+ # 1. Submit
195
+ SESSION=$(cz-cli agent run "complex analysis" --async --format a2a --dangerously-skip-permissions | jq -r '.session_id')
196
+
197
+ # 2. Poll until done, printing progress along the way
198
+ while true; do
199
+ STATUS=$(cz-cli agent session status $SESSION)
200
+ STATE=$(echo "$STATUS" | jq -r '.status')
201
+ if [ "$STATE" = "idle" ]; then
202
+ echo "$STATUS" | jq -r '.result'
203
+ break
204
+ fi
205
+ echo "$STATUS" | jq -r '.progress // empty'
206
+ sleep 5
207
+ done
208
+
209
+ # Need full conversation (thinking + tool calls)?
210
+ cz-cli agent export $SESSION
211
+ ```
212
+
213
+ ### With session continuity (async)
214
+
215
+ ```bash
216
+ # First turn
217
+ SESSION=$(cz-cli agent run "describe sales table" --async --format a2a --dangerously-skip-permissions | jq -r '.session_id')
218
+ # ... wait for completion ...
219
+
220
+ # Follow-up turn on same session
221
+ cz-cli agent run "now show row counts" --async --format a2a --dangerously-skip-permissions --session $SESSION
222
+ ```
223
+
224
+ ### Important notes for async mode
225
+
226
+ - **Permissions:** Always use `--dangerously-skip-permissions` — async mode cannot handle interactive permission prompts
227
+ - **Server requirement:** An agent runtime server must be running (or will be started automatically)
228
+ - **Error handling:** If session is already busy, returns `{"error": "session busy"}`
229
+
230
+ ## Multi-environment (profiles)
231
+
232
+ When the user specifies an environment or profile (e.g. "use uat_test", "on the test instance"):
233
+
234
+ ```bash
235
+ cz-cli agent run "<request>" --profile uat_test --format a2a --dangerously-skip-permissions
236
+ ```
237
+
238
+ Available profiles: read `~/.clickzetta/profiles.toml` or run `cz-cli profile list`.
239
+
240
+ ## Adding a new profile
241
+
242
+ **Trigger conditions:** User says "configure new environment", "add profile", "can't connect", mentions an unknown profile name, or provides connection credentials.
243
+
244
+ ### Step 1 — Collect information (guided Q&A)
245
+
246
+ If all required fields are already provided, skip directly to Step 2.
247
+
248
+ Otherwise, ask for missing ones. Accept all at once or prompt one by one.
249
+
250
+ **Required fields:**
251
+
252
+ | Field | Question to ask | Example |
253
+ |-------|----------------|---------|
254
+ | `service` | Which cloud region? (see table below, or provide the service endpoint directly) | `cn-shanghai-alicloud.api.clickzetta.com` |
255
+ | `instance` | What is the instance name? | `billingsh` |
256
+ | `workspace` | What is the workspace name? | `meter_n_bill` |
257
+ | `username` | What is the username? | `billing_admin` |
258
+ | `password` | What is the password? | — |
259
+ | `name` | What should this profile be named? (suggested format below) | `billingsh` |
260
+
261
+ **Common service endpoints (offer as options):**
262
+
263
+ | Region | service | Suggested profile prefix |
264
+ |--------|---------|--------------------------|
265
+ | Alibaba Cloud East China 2 (Shanghai) | `cn-shanghai-alicloud.api.clickzetta.com` | `cn-shanghai` |
266
+ | Tencent Cloud East China (Shanghai) | `ap-shanghai-tencentcloud.api.clickzetta.com` | `ap-shanghai` |
267
+ | Tencent Cloud North China (Beijing) | `ap-beijing-tencentcloud.api.clickzetta.com` | `ap-beijing` |
268
+ | Tencent Cloud South China (Guangzhou) | `ap-guangzhou-tencentcloud.api.clickzetta.com` | `ap-guangzhou` |
269
+ | AWS China (Beijing) | `cn-north-1-aws.api.clickzetta.com` | `cn-north-1` |
270
+
271
+ **Inference rules (reduce unnecessary questions):**
272
+ - If the user describes a cloud region in natural language (e.g. "Alibaba Cloud Shanghai", "Tencent Cloud Beijing", "阿里云上海", "腾讯云北京"), look up the service endpoint from the table above — do NOT ask the user to provide it again.
273
+ - If the user hasn't provided a profile name, suggest `<prefix>-<instance>` using the prefix from the table (e.g. `cn-shanghai-billingsh`). Confirm with the user or proceed if they don't object.
274
+
275
+ ### Step 2 — Create profile
276
+
277
+ Run `cz-cli profile create` with all collected fields:
278
+
279
+ ```bash
280
+ cz-cli profile create <name> \
281
+ --username <username> \
282
+ --password <password> \
283
+ --instance <instance> \
284
+ --workspace <workspace> \
285
+ --service <service> \
286
+ --schema public \
287
+ --vcluster default
288
+ ```
289
+
290
+ ### Step 3 — Verify connection
291
+
292
+ After creating, run:
293
+
294
+ ```bash
295
+ cz-cli status --profile <name>
296
+ ```
297
+
298
+ A successful response looks like:
299
+ ```json
300
+ {"data": {"connected": true, "workspace": "...", "time_ms": ...}}
301
+ ```
302
+
303
+ If it fails, report the error and ask the user to double-check credentials or service endpoint.
304
+
305
+ ## Error handling
306
+
307
+ All errors in non-TTY mode output JSON to stdout:
308
+
309
+ ```json
310
+ {"ok": false, "error": "NO_PROFILE", "next_steps": ["cz-cli setup --credential <base64>"]}
311
+ ```
312
+
313
+ On `NO_PROFILE` error: check if a profile can be configured via username/password (see "Adding a new profile" above). If the user has a base64 credential instead, guide them to run `cz-cli setup --credential <base64>`. See `references/profile-setup.md`.
@@ -0,0 +1,120 @@
1
+ # Profile Setup — Connection Onboarding Guide
2
+
3
+ Use this reference when any command returns error code `NO_PROFILE`.
4
+
5
+ ## Preferred: `cz-cli setup`
6
+
7
+ The recommended first-time onboarding entry point:
8
+
9
+ ```
10
+ cz-cli setup --credential "<base64_string>"
11
+ ```
12
+
13
+ Or interactive (TTY only):
14
+
15
+ ```
16
+ cz-cli setup
17
+ ```
18
+
19
+ For AI agents (non-TTY), always pass `--credential`. Without it, the command outputs JSON with registration URLs and exits 1.
20
+
21
+ ## What setup does
22
+
23
+ Writes two files:
24
+ - `~/.clickzetta/profiles.toml` — connection profile (`[profiles.default]`)
25
+ - `~/.local/share/clickzetta/auth.json` — API key
26
+
27
+ ## Profile management
28
+
29
+ List profiles (forwarded to cz-tool):
30
+ ```
31
+ cz-cli profile list
32
+ ```
33
+
34
+ All `cz-cli profile *` subcommands are forwarded to the `cz-tool` binary at `~/.clickzetta/cz-tool/cz-tool`.
35
+
36
+ ## LLM configuration
37
+
38
+ After setup, the ClickZetta built-in LLM is used by default. To use a different LLM:
39
+
40
+ ```bash
41
+ # Add and select Claude
42
+ cz-cli agent llm add my-claude --provider anthropic --api-key sk-ant-... --use
43
+
44
+ # Add OpenAI
45
+ cz-cli agent llm add my-openai --provider openai --api-key sk-...
46
+
47
+ # Check what's active
48
+ cz-cli agent llm show
49
+
50
+ # Switch between configured LLMs
51
+ cz-cli agent llm use my-claude
52
+
53
+ # Fall back to ClickZetta built-in
54
+ cz-cli agent llm reset
55
+
56
+ # Full help
57
+ cz-cli agent llm --help
58
+ ```
59
+
60
+ Supported providers: `anthropic`, `openai`, `openai-compatible`, `bedrock`, `google`, `azure`
61
+
62
+ For `openai-compatible` (third-party relays), add `--base-url <url>`.
63
+
64
+ ## Error JSON reference
65
+
66
+ ```json
67
+ // No profile at all
68
+ {"ok": false, "error": "NO_PROFILE", "profile_exists": false,
69
+ "next_steps": ["cz-cli setup --credential <base64>"],
70
+ "register_urls": ["https://accounts.clickzetta.com/register?ref=cz-cli"]}
71
+
72
+ // Profile exists but no api_key, has llm entries
73
+ {"ok": false, "error": "NO_PROFILE", "profile_exists": true, "has_llm_entry": true,
74
+ "next_steps": ["cz-cli agent llm show", "cz-cli agent llm add <name> --provider <p> --api-key <k> --use"]}
75
+
76
+ // Profile exists but no api_key, no llm entries
77
+ {"ok": false, "error": "NO_PROFILE", "profile_exists": true, "has_llm_entry": false,
78
+ "next_steps": ["cz-cli setup --credential <base64>", "cz-cli agent llm add my-claude --provider anthropic --api-key <key> --use"],
79
+ "supported_providers": ["anthropic", "openai", "openai-compatible", "bedrock", "google", "azure"]}
80
+ ```
81
+
82
+ ## Alternative: username/password profile (no credential required)
83
+
84
+ If the user has an existing instance account (username + password) but no base64 credential, use `cz-cli profile create` directly:
85
+
86
+ ```bash
87
+ cz-cli profile create <name> \
88
+ --username <username> \
89
+ --password <password> \
90
+ --instance <instance_name> \
91
+ --workspace <workspace_name> \
92
+ --service <service_host> \
93
+ --schema public \
94
+ --vcluster default
95
+ ```
96
+
97
+ **Common service endpoints:**
98
+
99
+ | 云区域 | service |
100
+ |--------|---------|
101
+ | 阿里云 华东2(上海) | `cn-shanghai-alicloud.api.clickzetta.com` |
102
+ | 腾讯云 华东(上海) | `ap-shanghai-tencentcloud.api.clickzetta.com` |
103
+ | 腾讯云 华北(北京) | `ap-beijing-tencentcloud.api.clickzetta.com` |
104
+ | 腾讯云 华南(广州) | `ap-guangzhou-tencentcloud.api.clickzetta.com` |
105
+ | AWS 中国(北京) | `cn-north-1-aws.api.clickzetta.com` |
106
+
107
+ After creating, verify with:
108
+ ```bash
109
+ cz-cli status --profile <name>
110
+ ```
111
+
112
+ Note: `profile discover` / `list-workspaces` / `render-command` require a Studio page URL (`https://<instance>.accounts.clickzetta.com`) and are not usable when only a service endpoint + credentials are available.
113
+
114
+ ## Step-by-step: no credential available
115
+
116
+ If the user doesn't have a base64 credential, guide them to:
117
+
118
+ 1. Register at `https://accounts.clickzetta.com/register?ref=cz-cli` (China) or `https://accounts.singdata.com/register?ref=cz-cli` (International)
119
+ 2. Copy the credential string from the registration page
120
+ 3. Run `cz-cli setup --credential "<base64_string>"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickzetta/cz-cli-darwin-arm64",
3
- "version": "0.3.81",
3
+ "version": "0.3.83",
4
4
  "description": "cz-cli binary for macOS ARM64 (Apple Silicon)",
5
5
  "os": [
6
6
  "darwin"