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

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/package.json +1 -1
  3. package/bin/skills/clickzetta-access-control/LICENSE +0 -16
  4. package/bin/skills/clickzetta-access-control/SKILL.md +0 -243
  5. package/bin/skills/clickzetta-access-control/eval_cases.jsonl +0 -3
  6. package/bin/skills/clickzetta-access-control/references/dynamic-masking.md +0 -86
  7. package/bin/skills/clickzetta-access-control/references/grant-revoke.md +0 -103
  8. package/bin/skills/clickzetta-access-control/references/role-management.md +0 -66
  9. package/bin/skills/clickzetta-access-control/references/user-management.md +0 -61
  10. package/bin/skills/clickzetta-app-python-sdk/LICENSE +0 -16
  11. package/bin/skills/clickzetta-app-python-sdk/SKILL.md +0 -153
  12. package/bin/skills/clickzetta-app-python-sdk/eval_cases.jsonl +0 -12
  13. package/bin/skills/clickzetta-app-python-sdk/references/bulkload.md +0 -196
  14. package/bin/skills/clickzetta-app-python-sdk/references/connector.md +0 -143
  15. package/bin/skills/clickzetta-app-python-sdk/references/realtime.md +0 -122
  16. package/bin/skills/clickzetta-batch-sync-pipeline/LICENSE +0 -16
  17. package/bin/skills/clickzetta-batch-sync-pipeline/SKILL.md +0 -227
  18. package/bin/skills/clickzetta-batch-sync-pipeline/eval_cases.jsonl +0 -5
  19. package/bin/skills/clickzetta-bi-connect/LICENSE +0 -16
  20. package/bin/skills/clickzetta-bi-connect/SKILL.md +0 -176
  21. package/bin/skills/clickzetta-bi-connect/eval_cases.jsonl +0 -5
  22. package/bin/skills/clickzetta-bi-connect/references/bi-tools.md +0 -170
  23. package/bin/skills/clickzetta-cdc-sync-pipeline/LICENSE +0 -16
  24. package/bin/skills/clickzetta-cdc-sync-pipeline/SKILL.md +0 -633
  25. package/bin/skills/clickzetta-cdc-sync-pipeline/eval_cases.jsonl +0 -5
  26. package/bin/skills/clickzetta-data-ingest-pipeline/LICENSE +0 -16
  27. package/bin/skills/clickzetta-data-ingest-pipeline/SKILL.md +0 -237
  28. package/bin/skills/clickzetta-data-ingest-pipeline/eval_cases.jsonl +0 -5
  29. package/bin/skills/clickzetta-data-retention/LICENSE +0 -16
  30. package/bin/skills/clickzetta-data-retention/SKILL.md +0 -160
  31. package/bin/skills/clickzetta-data-retention/eval_cases.jsonl +0 -5
  32. package/bin/skills/clickzetta-data-retention/references/lifecycle-reference.md +0 -175
  33. package/bin/skills/clickzetta-data-science/LICENSE +0 -16
  34. package/bin/skills/clickzetta-data-science/SKILL.md +0 -125
  35. package/bin/skills/clickzetta-data-science/eval_cases.jsonl +0 -12
  36. package/bin/skills/clickzetta-data-science/references/bitmap-profile.md +0 -146
  37. package/bin/skills/clickzetta-data-science/references/data-patterns.md +0 -110
  38. package/bin/skills/clickzetta-data-science/references/setup.md +0 -160
  39. package/bin/skills/clickzetta-data-science/references/stats-functions.md +0 -195
  40. package/bin/skills/clickzetta-data-science/references/write-and-infer.md +0 -122
  41. package/bin/skills/clickzetta-data-science/references/zettapark-api.md +0 -156
  42. package/bin/skills/clickzetta-data-sharing/LICENSE +0 -16
  43. package/bin/skills/clickzetta-data-sharing/SKILL.md +0 -160
  44. package/bin/skills/clickzetta-data-sharing/eval_cases.jsonl +0 -3
  45. package/bin/skills/clickzetta-data-sharing/references/share-ddl.md +0 -134
  46. package/bin/skills/clickzetta-dba-guide/LICENSE +0 -16
  47. package/bin/skills/clickzetta-dba-guide/SKILL.md +0 -542
  48. package/bin/skills/clickzetta-dba-guide/eval_cases.jsonl +0 -3
  49. package/bin/skills/clickzetta-dw-modeling/LICENSE +0 -16
  50. package/bin/skills/clickzetta-dw-modeling/SKILL.md +0 -351
  51. package/bin/skills/clickzetta-dw-modeling/eval_cases.jsonl +0 -4
  52. package/bin/skills/clickzetta-dw-modeling/references/modeling-patterns.md +0 -100
  53. package/bin/skills/clickzetta-dynamic-table/LICENSE +0 -16
  54. package/bin/skills/clickzetta-dynamic-table/SKILL.md +0 -230
  55. package/bin/skills/clickzetta-dynamic-table/best-practices/dimension-table-join-guide.md +0 -253
  56. package/bin/skills/clickzetta-dynamic-table/best-practices/medallion-and-stream-patterns.md +0 -124
  57. package/bin/skills/clickzetta-dynamic-table/best-practices/non-partitioned-merge-into-warning.md +0 -96
  58. package/bin/skills/clickzetta-dynamic-table/best-practices/performance-optimization.md +0 -109
  59. package/bin/skills/clickzetta-dynamic-table/best-practices/scheduling-guide.md +0 -135
  60. package/bin/skills/clickzetta-dynamic-table/dt-creator/SKILL.md +0 -15
  61. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/dt-declaration-strategy.md +0 -185
  62. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/incremental-config-reference.md +0 -427
  63. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/refresh-history-guide.md +0 -260
  64. package/bin/skills/clickzetta-dynamic-table/dt-creator/references/sql-limitations.md +0 -80
  65. package/bin/skills/clickzetta-dynamic-table/dynamic-table-alter/SKILL.md +0 -190
  66. package/bin/skills/clickzetta-dynamic-table/eval_cases.jsonl +0 -5
  67. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/SKILL.md +0 -27
  68. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-column-validation-rules.md +0 -118
  69. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-conversion-rules.md +0 -225
  70. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-placeholder-rules.md +0 -182
  71. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-refresh-rules.md +0 -98
  72. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-self-reference-rules.md +0 -76
  73. package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-workflow.md +0 -109
  74. package/bin/skills/clickzetta-external-catalog/LICENSE +0 -16
  75. package/bin/skills/clickzetta-external-catalog/SKILL.md +0 -123
  76. package/bin/skills/clickzetta-external-catalog/eval_cases.jsonl +0 -5
  77. package/bin/skills/clickzetta-external-catalog/references/external-catalog-ddl.md +0 -130
  78. package/bin/skills/clickzetta-external-function/LICENSE +0 -16
  79. package/bin/skills/clickzetta-external-function/SKILL.md +0 -203
  80. package/bin/skills/clickzetta-external-function/eval_cases.jsonl +0 -4
  81. package/bin/skills/clickzetta-external-function/references/external-function-ddl.md +0 -171
  82. package/bin/skills/clickzetta-file-import-pipeline/LICENSE +0 -16
  83. package/bin/skills/clickzetta-file-import-pipeline/SKILL.md +0 -190
  84. package/bin/skills/clickzetta-file-import-pipeline/eval_cases.jsonl +0 -5
  85. package/bin/skills/clickzetta-index-manager/LICENSE +0 -16
  86. package/bin/skills/clickzetta-index-manager/SKILL.md +0 -140
  87. package/bin/skills/clickzetta-index-manager/eval_cases.jsonl +0 -5
  88. package/bin/skills/clickzetta-index-manager/references/bloomfilter-index.md +0 -67
  89. package/bin/skills/clickzetta-index-manager/references/index-management.md +0 -73
  90. package/bin/skills/clickzetta-index-manager/references/inverted-index.md +0 -80
  91. package/bin/skills/clickzetta-index-manager/references/vector-index.md +0 -81
  92. package/bin/skills/clickzetta-java-sdk/LICENSE +0 -16
  93. package/bin/skills/clickzetta-java-sdk/SKILL.md +0 -186
  94. package/bin/skills/clickzetta-java-sdk/eval_cases.jsonl +0 -12
  95. package/bin/skills/clickzetta-java-sdk/references/bulkload.md +0 -163
  96. package/bin/skills/clickzetta-java-sdk/references/realtime.md +0 -212
  97. package/bin/skills/clickzetta-kafka-ingest-pipeline/LICENSE +0 -16
  98. package/bin/skills/clickzetta-kafka-ingest-pipeline/SKILL.md +0 -769
  99. package/bin/skills/clickzetta-kafka-ingest-pipeline/eval_cases.jsonl +0 -5
  100. package/bin/skills/clickzetta-kafka-ingest-pipeline/references/kafka-pipe-syntax.md +0 -324
  101. package/bin/skills/clickzetta-lakehouse-connect/LICENSE +0 -16
  102. package/bin/skills/clickzetta-lakehouse-connect/SKILL.md +0 -218
  103. package/bin/skills/clickzetta-lakehouse-connect/eval_cases.jsonl +0 -3
  104. package/bin/skills/clickzetta-lakehouse-connect/evals/evals.json +0 -35
  105. package/bin/skills/clickzetta-lakehouse-connect/references/config-file.md +0 -435
  106. package/bin/skills/clickzetta-lakehouse-connect/references/jdbc.md +0 -478
  107. package/bin/skills/clickzetta-lakehouse-connect/references/python-sdk.md +0 -225
  108. package/bin/skills/clickzetta-lakehouse-connect/references/sqlalchemy.md +0 -468
  109. package/bin/skills/clickzetta-lakehouse-connect/references/zettapark-session.md +0 -445
  110. package/bin/skills/clickzetta-manage-comments/LICENSE +0 -16
  111. package/bin/skills/clickzetta-manage-comments/SKILL.md +0 -219
  112. package/bin/skills/clickzetta-manage-comments/eval_cases.jsonl +0 -3
  113. package/bin/skills/clickzetta-metadata/LICENSE +0 -16
  114. package/bin/skills/clickzetta-metadata/SKILL.md +0 -502
  115. package/bin/skills/clickzetta-metadata/eval_cases.jsonl +0 -5
  116. package/bin/skills/clickzetta-metadata/references/instance-views-reference.md +0 -276
  117. package/bin/skills/clickzetta-metadata/references/metering-views-reference.md +0 -137
  118. package/bin/skills/clickzetta-metadata/references/show-desc-reference.md +0 -326
  119. package/bin/skills/clickzetta-metadata/references/views-reference.md +0 -271
  120. package/bin/skills/clickzetta-monitoring/LICENSE +0 -16
  121. package/bin/skills/clickzetta-monitoring/SKILL.md +0 -215
  122. package/bin/skills/clickzetta-monitoring/eval_cases.jsonl +0 -5
  123. package/bin/skills/clickzetta-monitoring/references/job-history-analysis.md +0 -97
  124. package/bin/skills/clickzetta-monitoring/references/show-jobs.md +0 -48
  125. package/bin/skills/clickzetta-oss-ingest-pipeline/LICENSE +0 -16
  126. package/bin/skills/clickzetta-oss-ingest-pipeline/SKILL.md +0 -562
  127. package/bin/skills/clickzetta-oss-ingest-pipeline/eval_cases.jsonl +0 -5
  128. package/bin/skills/clickzetta-overview/LICENSE +0 -16
  129. package/bin/skills/clickzetta-overview/SKILL.md +0 -102
  130. package/bin/skills/clickzetta-overview/eval_cases.jsonl +0 -5
  131. package/bin/skills/clickzetta-overview/references/brands-and-endpoints.md +0 -79
  132. package/bin/skills/clickzetta-overview/references/object-model.md +0 -311
  133. package/bin/skills/clickzetta-overview/references/studio-modules.md +0 -173
  134. package/bin/skills/clickzetta-pipeline-review/LICENSE +0 -16
  135. package/bin/skills/clickzetta-pipeline-review/SKILL.md +0 -377
  136. package/bin/skills/clickzetta-query-optimizer/LICENSE +0 -16
  137. package/bin/skills/clickzetta-query-optimizer/SKILL.md +0 -156
  138. package/bin/skills/clickzetta-query-optimizer/eval_cases.jsonl +0 -5
  139. package/bin/skills/clickzetta-query-optimizer/references/explain.md +0 -56
  140. package/bin/skills/clickzetta-query-optimizer/references/hints-and-sortkey.md +0 -78
  141. package/bin/skills/clickzetta-query-optimizer/references/optimize.md +0 -65
  142. package/bin/skills/clickzetta-query-optimizer/references/result-cache.md +0 -49
  143. package/bin/skills/clickzetta-query-optimizer/references/show-jobs.md +0 -42
  144. package/bin/skills/clickzetta-realtime-sync-pipeline/LICENSE +0 -16
  145. package/bin/skills/clickzetta-realtime-sync-pipeline/SKILL.md +0 -323
  146. package/bin/skills/clickzetta-realtime-sync-pipeline/eval_cases.jsonl +0 -5
  147. package/bin/skills/clickzetta-semantic-view/LICENSE +0 -16
  148. package/bin/skills/clickzetta-semantic-view/SKILL.md +0 -207
  149. package/bin/skills/clickzetta-semantic-view/eval_cases.jsonl +0 -12
  150. package/bin/skills/clickzetta-semantic-view/references/semantic-view-reference.md +0 -167
  151. package/bin/skills/clickzetta-spark-flink-connector/LICENSE +0 -16
  152. package/bin/skills/clickzetta-spark-flink-connector/SKILL.md +0 -92
  153. package/bin/skills/clickzetta-spark-flink-connector/eval_cases.jsonl +0 -5
  154. package/bin/skills/clickzetta-spark-flink-connector/references/flink.md +0 -147
  155. package/bin/skills/clickzetta-spark-flink-connector/references/spark.md +0 -132
  156. package/bin/skills/clickzetta-sql-pipeline-manager/LICENSE +0 -16
  157. package/bin/skills/clickzetta-sql-pipeline-manager/SKILL.md +0 -485
  158. package/bin/skills/clickzetta-sql-pipeline-manager/eval_cases.jsonl +0 -12
  159. package/bin/skills/clickzetta-sql-pipeline-manager/evals/evals.json +0 -166
  160. package/bin/skills/clickzetta-sql-pipeline-manager/references/dynamic-table.md +0 -185
  161. package/bin/skills/clickzetta-sql-pipeline-manager/references/materialized-view.md +0 -129
  162. package/bin/skills/clickzetta-sql-pipeline-manager/references/pipe.md +0 -222
  163. package/bin/skills/clickzetta-sql-pipeline-manager/references/table-stream.md +0 -125
  164. package/bin/skills/clickzetta-sql-syntax-guide/LICENSE +0 -16
  165. package/bin/skills/clickzetta-sql-syntax-guide/SKILL.md +0 -249
  166. package/bin/skills/clickzetta-sql-syntax-guide/eval_cases.jsonl +0 -3
  167. package/bin/skills/clickzetta-sql-syntax-guide/references/ddl-reference.md +0 -350
  168. package/bin/skills/clickzetta-sql-syntax-guide/references/dml-reference.md +0 -279
  169. package/bin/skills/clickzetta-sql-syntax-guide/references/dql-reference.md +0 -504
  170. package/bin/skills/clickzetta-sql-syntax-guide/references/functions-reference.md +0 -372
  171. package/bin/skills/clickzetta-sql-syntax-guide/references/migration-databricks.md +0 -260
  172. package/bin/skills/clickzetta-sql-syntax-guide/references/migration-snowflake.md +0 -382
  173. package/bin/skills/clickzetta-sql-syntax-guide/references/vs-snowflake.md +0 -346
  174. package/bin/skills/clickzetta-sql-syntax-guide/references/vs-spark.md +0 -229
  175. package/bin/skills/clickzetta-studio-task-manager/LICENSE +0 -16
  176. package/bin/skills/clickzetta-studio-task-manager/SKILL.md +0 -652
  177. package/bin/skills/clickzetta-table-lineage/LICENSE +0 -16
  178. package/bin/skills/clickzetta-table-lineage/SKILL.md +0 -90
  179. package/bin/skills/clickzetta-table-lineage/eval_cases.jsonl +0 -1
  180. package/bin/skills/clickzetta-table-lineage/references/normalize_func.sql +0 -14
  181. package/bin/skills/clickzetta-table-lineage/references/table_cost.sql +0 -38
  182. package/bin/skills/clickzetta-table-lineage/references/table_lineage_standalone.html +0 -562
  183. package/bin/skills/clickzetta-table-lineage/references/table_relation.sql +0 -25
  184. package/bin/skills/clickzetta-table-stream-pipeline/LICENSE +0 -16
  185. package/bin/skills/clickzetta-table-stream-pipeline/SKILL.md +0 -206
  186. package/bin/skills/clickzetta-table-stream-pipeline/eval_cases.jsonl +0 -5
  187. package/bin/skills/clickzetta-vcluster-manager/LICENSE +0 -16
  188. package/bin/skills/clickzetta-vcluster-manager/SKILL.md +0 -212
  189. package/bin/skills/clickzetta-vcluster-manager/eval_cases.jsonl +0 -5
  190. package/bin/skills/clickzetta-vcluster-manager/references/vc-cache.md +0 -54
  191. package/bin/skills/clickzetta-vcluster-manager/references/vcluster-ddl.md +0 -150
  192. package/bin/skills/clickzetta-volume-manager/LICENSE +0 -16
  193. package/bin/skills/clickzetta-volume-manager/SKILL.md +0 -292
  194. package/bin/skills/clickzetta-volume-manager/eval_cases.jsonl +0 -5
  195. package/bin/skills/clickzetta-volume-manager/references/volume-ddl.md +0 -199
  196. package/bin/skills/clickzetta-zettapark/LICENSE +0 -16
  197. package/bin/skills/clickzetta-zettapark/SKILL.md +0 -248
  198. package/bin/skills/clickzetta-zettapark/eval_cases.jsonl +0 -12
  199. package/bin/skills/clickzetta-zettapark/references/zettapark-api.md +0 -283
  200. package/bin/skills/cz-cli/SKILL.md +0 -311
  201. package/bin/skills/cz-cli/references/profile-setup.md +0 -120
@@ -1,311 +0,0 @@
1
- ---
2
- name: cz-cli
3
- description: "Route ALL ClickZetta Lakehouse operations to cz-cli: SQL, Studio tasks, tables, pipelines, profiles. Use when user mentions ClickZetta, Lakehouse, cz-cli, or needs profile/connection lakehouse configuration."
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>
128
- ```
129
-
130
- While running:
131
- ```json
132
- {"session_id": "01JXF3K...", "status": "busy", "progress": "$ cz-cli table list -o table"}
133
- ```
134
-
135
- Other progress examples you may see during polling:
136
- - `"💭 Thinking..."` — LLM is reasoning
137
- - `"✏ Generating response..."` — LLM is writing the reply
138
- - `"✱ Grep \"error\" · 3 matches"` — running a search tool
139
- - `"↻ Retry (attempt 2)"` — retrying a failed LLM call (paired with a `retry` field describing the reason)
140
-
141
- When complete:
142
- ```json
143
- {"session_id": "01JXF3K...", "status": "idle", "result": "Here are the results:\n..."}
144
- ```
145
-
146
- The `result` field is the final text reply. For full conversation details (thinking, tool calls, intermediate text), use `cz-cli agent export <session_id>`.
147
-
148
- If the session does not exist:
149
- ```json
150
- {"session_id": "ses_invalid", "error": "Session not found"}
151
- ```
152
- (exits with code 1)
153
-
154
- ### Retrieve full conversation (thinking + tool calls + text)
155
-
156
- ```bash
157
- cz-cli agent export <session_id>
158
- ```
159
-
160
- Returns complete session with all message parts:
161
- ```json
162
- {
163
- "info": { "id": "...", "title": "...", "time": {...} },
164
- "messages": [
165
- {
166
- "info": { "role": "user" },
167
- "parts": [{ "type": "text", "text": "original prompt" }]
168
- },
169
- {
170
- "info": { "role": "assistant" },
171
- "parts": [
172
- { "type": "reasoning", "text": "thinking content..." },
173
- { "type": "tool", "tool": "bash", "state": { "status": "completed", "input": {...}, "output": "..." } },
174
- { "type": "text", "text": "final answer..." }
175
- ]
176
- }
177
- ]
178
- }
179
- ```
180
-
181
- Part types in export:
182
- - `reasoning` — LLM thinking/reasoning blocks
183
- - `tool` — tool calls with full input/output (bash, read, write, edit, glob, grep, etc.)
184
- - `text` — final text response
185
- - `step-start` / `step-finish` — step boundaries
186
- - `patch` — code diffs
187
- - `subtask` — delegated sub-tasks
188
-
189
- ### Async workflow pattern
190
-
191
- ```bash
192
- # 1. Submit
193
- SESSION=$(cz-cli agent run "complex analysis" --async --format a2a --dangerously-skip-permissions | jq -r '.session_id')
194
-
195
- # 2. Poll until done, printing progress along the way
196
- while true; do
197
- STATUS=$(cz-cli agent session status $SESSION)
198
- STATE=$(echo "$STATUS" | jq -r '.status')
199
- if [ "$STATE" = "idle" ]; then
200
- echo "$STATUS" | jq -r '.result'
201
- break
202
- fi
203
- echo "$STATUS" | jq -r '.progress // empty'
204
- sleep 5
205
- done
206
-
207
- # Need full conversation (thinking + tool calls)?
208
- cz-cli agent export $SESSION
209
- ```
210
-
211
- ### With session continuity (async)
212
-
213
- ```bash
214
- # First turn
215
- SESSION=$(cz-cli agent run "describe sales table" --async --format a2a --dangerously-skip-permissions | jq -r '.session_id')
216
- # ... wait for completion ...
217
-
218
- # Follow-up turn on same session
219
- cz-cli agent run "now show row counts" --async --format a2a --dangerously-skip-permissions --session $SESSION
220
- ```
221
-
222
- ### Important notes for async mode
223
-
224
- - **Permissions:** Always use `--dangerously-skip-permissions` — async mode cannot handle interactive permission prompts
225
- - **Server requirement:** An agent runtime server must be running (or will be started automatically)
226
- - **Error handling:** If session is already busy, returns `{"error": "session busy"}`
227
-
228
- ## Multi-environment (profiles)
229
-
230
- When the user specifies an environment or profile (e.g. "use uat_test", "on the test instance"):
231
-
232
- ```bash
233
- cz-cli agent run "<request>" --profile uat_test --format a2a --dangerously-skip-permissions
234
- ```
235
-
236
- Available profiles: read `~/.clickzetta/profiles.toml` or run `cz-cli profile list`.
237
-
238
- ## Adding a new profile
239
-
240
- **Trigger conditions:** User says "configure new environment", "add profile", "can't connect", mentions an unknown profile name, or provides connection credentials.
241
-
242
- ### Step 1 — Collect information (guided Q&A)
243
-
244
- If all required fields are already provided, skip directly to Step 2.
245
-
246
- Otherwise, ask for missing ones. Accept all at once or prompt one by one.
247
-
248
- **Required fields:**
249
-
250
- | Field | Question to ask | Example |
251
- |-------|----------------|---------|
252
- | `service` | Which cloud region? (see table below, or provide the service endpoint directly) | `cn-shanghai-alicloud.api.clickzetta.com` |
253
- | `instance` | What is the instance name? | `billingsh` |
254
- | `workspace` | What is the workspace name? | `meter_n_bill` |
255
- | `username` | What is the username? | `billing_admin` |
256
- | `password` | What is the password? | — |
257
- | `name` | What should this profile be named? (suggested format below) | `billingsh` |
258
-
259
- **Common service endpoints (offer as options):**
260
-
261
- | Region | service | Suggested profile prefix |
262
- |--------|---------|--------------------------|
263
- | Alibaba Cloud East China 2 (Shanghai) | `cn-shanghai-alicloud.api.clickzetta.com` | `cn-shanghai` |
264
- | Tencent Cloud East China (Shanghai) | `ap-shanghai-tencentcloud.api.clickzetta.com` | `ap-shanghai` |
265
- | Tencent Cloud North China (Beijing) | `ap-beijing-tencentcloud.api.clickzetta.com` | `ap-beijing` |
266
- | Tencent Cloud South China (Guangzhou) | `ap-guangzhou-tencentcloud.api.clickzetta.com` | `ap-guangzhou` |
267
- | AWS China (Beijing) | `cn-north-1-aws.api.clickzetta.com` | `cn-north-1` |
268
-
269
- **Inference rules (reduce unnecessary questions):**
270
- - 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.
271
- - 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.
272
-
273
- ### Step 2 — Create profile
274
-
275
- Run `cz-cli profile create` with all collected fields:
276
-
277
- ```bash
278
- cz-cli profile create <name> \
279
- --username <username> \
280
- --password <password> \
281
- --instance <instance> \
282
- --workspace <workspace> \
283
- --service <service> \
284
- --schema public \
285
- --vcluster default
286
- ```
287
-
288
- ### Step 3 — Verify connection
289
-
290
- After creating, run:
291
-
292
- ```bash
293
- cz-cli status --profile <name>
294
- ```
295
-
296
- A successful response looks like:
297
- ```json
298
- {"data": {"connected": true, "workspace": "...", "time_ms": ...}}
299
- ```
300
-
301
- If it fails, report the error and ask the user to double-check credentials or service endpoint.
302
-
303
- ## Error handling
304
-
305
- All errors in non-TTY mode output JSON to stdout:
306
-
307
- ```json
308
- {"ok": false, "error": "NO_PROFILE", "next_steps": ["cz-cli setup --credential <base64>"]}
309
- ```
310
-
311
- 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`.
@@ -1,120 +0,0 @@
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>"`