hap-cli 0.5.0__tar.gz → 0.6.0__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 (99) hide show
  1. hap_cli-0.6.0/PKG-INFO +517 -0
  2. hap_cli-0.6.0/hap_cli/README.md +488 -0
  3. hap_cli-0.6.0/hap_cli/README_CN.md +885 -0
  4. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/__init__.py +1 -1
  5. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/app_cmd.py +84 -29
  6. hap_cli-0.5.0/hap_cli/commands/config_cmd.py → hap_cli-0.6.0/hap_cli/commands/auth_cmd.py +73 -35
  7. hap_cli-0.6.0/hap_cli/commands/calendar_cmd.py +291 -0
  8. hap_cli-0.6.0/hap_cli/commands/chat_cmd.py +284 -0
  9. hap_cli-0.6.0/hap_cli/commands/contact_cmd.py +222 -0
  10. hap_cli-0.6.0/hap_cli/commands/department_cmd.py +129 -0
  11. hap_cli-0.6.0/hap_cli/commands/group_cmd.py +240 -0
  12. hap_cli-0.6.0/hap_cli/commands/instance_cmd.py +638 -0
  13. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/node_cmd.py +34 -3
  14. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/optionset_cmd.py +31 -17
  15. hap_cli-0.6.0/hap_cli/commands/page_cmd.py +243 -0
  16. hap_cli-0.6.0/hap_cli/commands/post_cmd.py +280 -0
  17. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/record_cmd.py +67 -4
  18. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/workflow_cmd.py +2 -2
  19. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/worksheet_cmd.py +133 -16
  20. hap_cli-0.6.0/hap_cli/context.py +71 -0
  21. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/app.py +108 -15
  22. hap_cli-0.6.0/hap_cli/core/auth.py +557 -0
  23. hap_cli-0.6.0/hap_cli/core/calendar_mod.py +329 -0
  24. hap_cli-0.6.0/hap_cli/core/chat.py +284 -0
  25. hap_cli-0.6.0/hap_cli/core/contact.py +194 -0
  26. hap_cli-0.6.0/hap_cli/core/department.py +115 -0
  27. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/flow_node.py +19 -13
  28. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/group.py +28 -8
  29. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/instance.py +396 -2
  30. hap_cli-0.6.0/hap_cli/core/optionset.py +140 -0
  31. hap_cli-0.6.0/hap_cli/core/page.py +236 -0
  32. hap_cli-0.6.0/hap_cli/core/post.py +240 -0
  33. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/record.py +77 -5
  34. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/role.py +10 -2
  35. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/session.py +143 -18
  36. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/workflow.py +89 -16
  37. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/worksheet.py +156 -14
  38. hap_cli-0.6.0/hap_cli/hap_cli.py +232 -0
  39. hap_cli-0.6.0/hap_cli/skills/SKILL.md +358 -0
  40. hap_cli-0.6.0/hap_cli/tests/conftest.py +107 -0
  41. hap_cli-0.6.0/hap_cli/tests/test_core.py +4103 -0
  42. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/tests/test_full_e2e.py +65 -28
  43. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/tests/test_integration.py +79 -18
  44. hap_cli-0.6.0/hap_cli/tests/test_integration_approval.py +237 -0
  45. hap_cli-0.6.0/hap_cli/tests/test_integration_destructive.py +294 -0
  46. hap_cli-0.6.0/hap_cli/tests/test_integration_misc.py +164 -0
  47. hap_cli-0.6.0/hap_cli/tests/test_integration_social.py +202 -0
  48. hap_cli-0.6.0/hap_cli/tests/test_integration_workflow.py +145 -0
  49. hap_cli-0.6.0/hap_cli/tests/test_integration_worksheet_extra.py +150 -0
  50. hap_cli-0.6.0/hap_cli/tests/test_org_id_cli.py +104 -0
  51. hap_cli-0.6.0/hap_cli/tests/test_org_id_docs.py +57 -0
  52. hap_cli-0.6.0/hap_cli/tests/test_parameter_conventions.py +41 -0
  53. hap_cli-0.6.0/hap_cli/tests/test_parameter_mapping_registry.py +96 -0
  54. hap_cli-0.6.0/hap_cli/utils/options.py +46 -0
  55. hap_cli-0.6.0/hap_cli/utils/parameter_mapping.py +17 -0
  56. hap_cli-0.6.0/hap_cli.egg-info/PKG-INFO +517 -0
  57. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli.egg-info/SOURCES.txt +14 -6
  58. {hap_cli-0.5.0 → hap_cli-0.6.0}/setup.py +1 -1
  59. hap_cli-0.5.0/PKG-INFO +0 -223
  60. hap_cli-0.5.0/hap_cli/README.md +0 -194
  61. hap_cli-0.5.0/hap_cli/README_CN.md +0 -601
  62. hap_cli-0.5.0/hap_cli/commands/ai_cmd.py +0 -224
  63. hap_cli-0.5.0/hap_cli/commands/calendar_cmd.py +0 -138
  64. hap_cli-0.5.0/hap_cli/commands/chat_cmd.py +0 -101
  65. hap_cli-0.5.0/hap_cli/commands/contact_cmd.py +0 -125
  66. hap_cli-0.5.0/hap_cli/commands/department_cmd.py +0 -168
  67. hap_cli-0.5.0/hap_cli/commands/group_cmd.py +0 -128
  68. hap_cli-0.5.0/hap_cli/commands/instance_cmd.py +0 -310
  69. hap_cli-0.5.0/hap_cli/commands/page_cmd.py +0 -102
  70. hap_cli-0.5.0/hap_cli/commands/plugin_cmd.py +0 -133
  71. hap_cli-0.5.0/hap_cli/commands/post_cmd.py +0 -155
  72. hap_cli-0.5.0/hap_cli/context.py +0 -43
  73. hap_cli-0.5.0/hap_cli/core/ai.py +0 -133
  74. hap_cli-0.5.0/hap_cli/core/auth.py +0 -219
  75. hap_cli-0.5.0/hap_cli/core/calendar_mod.py +0 -114
  76. hap_cli-0.5.0/hap_cli/core/chat.py +0 -73
  77. hap_cli-0.5.0/hap_cli/core/contact.py +0 -85
  78. hap_cli-0.5.0/hap_cli/core/department.py +0 -131
  79. hap_cli-0.5.0/hap_cli/core/optionset.py +0 -112
  80. hap_cli-0.5.0/hap_cli/core/page.py +0 -138
  81. hap_cli-0.5.0/hap_cli/core/plugin.py +0 -87
  82. hap_cli-0.5.0/hap_cli/core/post.py +0 -118
  83. hap_cli-0.5.0/hap_cli/hap_cli.py +0 -105
  84. hap_cli-0.5.0/hap_cli/skills/SKILL.md +0 -383
  85. hap_cli-0.5.0/hap_cli/tests/test_core.py +0 -1824
  86. hap_cli-0.5.0/hap_cli/utils/options.py +0 -10
  87. hap_cli-0.5.0/hap_cli.egg-info/PKG-INFO +0 -223
  88. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/__init__.py +0 -0
  89. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/commands/role_cmd.py +0 -0
  90. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/core/__init__.py +0 -0
  91. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/skills/__init__.py +0 -0
  92. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/tests/__init__.py +0 -0
  93. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/utils/__init__.py +0 -0
  94. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli/utils/formatting.py +0 -0
  95. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli.egg-info/dependency_links.txt +0 -0
  96. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli.egg-info/entry_points.txt +0 -0
  97. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli.egg-info/requires.txt +0 -0
  98. {hap_cli-0.5.0 → hap_cli-0.6.0}/hap_cli.egg-info/top_level.txt +0 -0
  99. {hap_cli-0.5.0 → hap_cli-0.6.0}/setup.cfg +0 -0
hap_cli-0.6.0/PKG-INFO ADDED
@@ -0,0 +1,517 @@
1
+ Metadata-Version: 2.4
2
+ Name: hap-cli
3
+ Version: 0.6.0
4
+ Summary: CLI harness for MingDAO HAP - Enterprise no-code platform
5
+ Author: hap-cli
6
+ License: Apache-2.0
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: click>=8.0
17
+ Requires-Dist: requests>=2.28
18
+ Provides-Extra: crypto
19
+ Requires-Dist: pycryptodome>=3.15; extra == "crypto"
20
+ Dynamic: author
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: license
25
+ Dynamic: provides-extra
26
+ Dynamic: requires-dist
27
+ Dynamic: requires-python
28
+ Dynamic: summary
29
+
30
+ # hap-cli
31
+
32
+ CLI harness for **MingDAO HAP** (明道云) - an enterprise no-code platform (hap).
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ pip install hap-cli
38
+ ```
39
+
40
+ ## Quick Start
41
+
42
+ ### 1. Login
43
+
44
+ **Option A: Browser login (recommended)**
45
+
46
+ ```bash
47
+ # MingDAO SaaS (default)
48
+ hap auth login
49
+
50
+ # Specify server
51
+ hap auth login mingdao # MingDAO
52
+ hap auth login nocoly # Nocoly
53
+ hap auth login https://hap.example.com # Self-hosted
54
+ ```
55
+
56
+ Opens your browser to the MingDAO login page. After login, the token is saved automatically, your organizations are fetched immediately, and the first org is stored as the current org.
57
+
58
+ **Option B: Manual token**
59
+
60
+ ```bash
61
+ hap auth set \
62
+ --server https://your-mingdao-server.com \
63
+ --token YOUR_MD_PSS_ID_TOKEN
64
+ ```
65
+
66
+ **Other auth commands**
67
+
68
+ ```bash
69
+ hap auth whoami # Show current user info
70
+ hap auth logout # Clear saved token
71
+ ```
72
+
73
+ ### 2. Find your org and app IDs
74
+
75
+ ```bash
76
+ hap auth list-my-orgs # list orgs, current one is marked with *
77
+ hap auth switch-org ORG_ID # switch the saved current org
78
+ hap app list # uses the saved current org by default
79
+ hap app list --org-id ORG_ID # or override it explicitly
80
+ hap app list-managed # also uses the saved current org
81
+ hap app list-managed --org-id ORG_ID # explicit org override
82
+ ```
83
+
84
+ ### 3. List worksheets
85
+
86
+ ```bash
87
+ hap app worksheets APP_ID
88
+ ```
89
+
90
+ ### 4. Query records
91
+
92
+ ```bash
93
+ hap worksheet record list WORKSHEET_ID --page-size 10
94
+ ```
95
+
96
+ ### 5. JSON output (for automation)
97
+
98
+ ```bash
99
+ hap --json worksheet record list WORKSHEET_ID
100
+ ```
101
+
102
+ ## Commands
103
+
104
+ ### auth — Authentication & Session
105
+
106
+ | Command | Description |
107
+ |---|---|
108
+ | `auth login` | Login via browser |
109
+ | `auth logout` | Clear saved auth token |
110
+ | `auth set` | Set server address and auth token |
111
+ | `auth show` | Show current configuration |
112
+ | `auth whoami` | Show current logged-in user info |
113
+ | `auth list-my-orgs` | List all organizations for current user |
114
+ | `auth switch-org` | Switch saved current organization |
115
+
116
+ ### app — Application Management
117
+
118
+ | Command | Description |
119
+ |---|---|
120
+ | `app list` | List applications in organization |
121
+ | `app list-managed` | List apps where current user is admin |
122
+ | `app info` | Get application info |
123
+ | `app worksheets` | List worksheets in an application |
124
+ | `app create` | Create a new application |
125
+ | `app update` | Update application info |
126
+ | `app delete` | Delete an application |
127
+ | `app add-section` | Add a section to an application |
128
+ | `app edit-section` | Edit section name |
129
+ | `app delete-section` | Delete an application section |
130
+ | `app backup` | Backup an application |
131
+ | `app restore` | Restore application from backup |
132
+ | `app export` | Batch export applications |
133
+ | `app exports` | List export records for an application |
134
+ | `app backup-logs` | Get backup/restore operation logs |
135
+ | `app usage` | Get application usage statistics |
136
+ | `app logs` | Get application operation logs (org-level; pass APP_ID to filter) |
137
+
138
+ #### app optionset — Option Set Management
139
+
140
+ | Command | Description |
141
+ |---|---|
142
+ | `app optionset list` | List option sets for an application |
143
+ | `app optionset get` | Get option set details |
144
+ | `app optionset save` | Create or update an option set |
145
+ | `app optionset delete` | Delete (or disable) an option set |
146
+ | `app optionset move` | Move an option set to another application |
147
+
148
+ #### app role — Role Management
149
+
150
+ | Command | Description |
151
+ |---|---|
152
+ | `app role list` | List roles for an application |
153
+ | `app role permissions` | Get role details and permissions |
154
+ | `app role create` | Create a new role |
155
+ | `app role rename` | Rename a role |
156
+ | `app role delete` | Delete a role |
157
+ | `app role set-permissions` | Edit role permissions |
158
+ | `app role add-member` | Add member to a role |
159
+ | `app role remove-member` | Remove member from a role |
160
+ | `app role apply` | Apply to join a role |
161
+ | `app role approve` | Approve role application |
162
+ | `app role reject` | Reject role application |
163
+ | `app role pending` | Get pending role applications |
164
+
165
+ ### worksheet — Worksheet Operations
166
+
167
+ | Command | Description |
168
+ |---|---|
169
+ | `worksheet info` | Get worksheet information |
170
+ | `worksheet fields` | List worksheet fields/controls |
171
+ | `worksheet views` | List worksheet views |
172
+ | `worksheet view-detail` | Get detailed configuration of a single view |
173
+ | `worksheet create` | Create a new worksheet |
174
+ | `worksheet update` | Update worksheet alias and/or description |
175
+ | `worksheet copy` | Copy a worksheet |
176
+ | `worksheet add-view` | Create a new view |
177
+ | `worksheet delete-view` | Delete a view |
178
+ | `worksheet copy-view` | Copy a view |
179
+ | `worksheet sort-views` | Reorder views |
180
+ | `worksheet buttons` | Get custom action buttons for a worksheet |
181
+ | `worksheet save-button` | Create or update a custom action button |
182
+ | `worksheet delete-button` | Delete a custom action button |
183
+ | `worksheet rules` | Get business rules for a worksheet |
184
+ | `worksheet save-rule` | Save a single business rule |
185
+ | `worksheet switches` | Get feature switches for a worksheet |
186
+ | `worksheet edit-switch` | Edit a single feature switch |
187
+ | `worksheet form-settings` | Get worksheet form submission/advanced settings |
188
+ | `worksheet save-form-settings` | Update worksheet form submission/advanced settings |
189
+ | `worksheet save-fields` | Save the complete fields/controls list for a worksheet |
190
+ | `worksheet field-types` | Show field type constants reference table |
191
+
192
+ #### worksheet record — Record CRUD
193
+
194
+ | Command | Description |
195
+ |---|---|
196
+ | `worksheet record list` | Query records (with filtering and pagination) |
197
+ | `worksheet record get` | Get a single record by ID |
198
+ | `worksheet record create` | Create a new record |
199
+ | `worksheet record update` | Update a record |
200
+ | `worksheet record delete` | Delete record(s) by ID |
201
+ | `worksheet record discussions` | Get discussions/comments for a record |
202
+ | `worksheet record add-discussion` | Add a discussion/comment to a record |
203
+ | `worksheet record delete-discussion` | Delete a discussion/comment |
204
+ | `worksheet record logs` | Get operation logs for a record |
205
+ | `worksheet record pivot` | Get pivot table data via statistics service |
206
+ | `worksheet record bottom-stats` | Get worksheet bottom summary statistics |
207
+
208
+ ### workflow — Workflow Management
209
+
210
+ | Command | Description |
211
+ |---|---|
212
+ | `workflow list` | List workflows in an application |
213
+ | `workflow get` | Get workflow details |
214
+ | `workflow create` | Create a new workflow |
215
+ | `workflow update` | Update workflow info |
216
+ | `workflow copy` | Copy/clone a workflow |
217
+ | `workflow move` | Move a workflow to another application |
218
+ | `workflow delete` | Delete a workflow |
219
+ | `workflow publish` | Publish (enable) or disable a workflow |
220
+ | `workflow rollback` | Rollback to previous version |
221
+ | `workflow history` | Get workflow version history |
222
+ | `workflow config-get` | Get workflow global configuration |
223
+ | `workflow config-set` | Save workflow global configuration (JSON string) |
224
+ | `workflow trigger` | Trigger/start a workflow by process ID |
225
+ | `workflow trigger-pbp` | Trigger a PBP (packaged business process) workflow |
226
+ | `workflow stats` | Get workflow usage statistics |
227
+ | `workflow groups` | List workflow groups |
228
+
229
+ #### workflow node — Workflow Node Management
230
+
231
+ | Command | Description |
232
+ |---|---|
233
+ | `workflow node list` | List all nodes in a workflow |
234
+ | `workflow node get` | Get node details/configuration |
235
+ | `workflow node add` | Add a node to a workflow |
236
+ | `workflow node delete` | Delete a node from a workflow |
237
+ | `workflow node rename` | Rename a node |
238
+ | `workflow node desc` | Update node description/alias |
239
+ | `workflow node save` | Save full node configuration (JSON string) |
240
+ | `workflow node save-action` | Configure data operation node (add/edit/delete records) |
241
+ | `workflow node save-search` | Configure search node (get single record) |
242
+ | `workflow node save-get-more` | Configure get-more-records node |
243
+ | `workflow node controls` | Get worksheet fields/controls available for node config |
244
+ | `workflow node form-property` | Get node form property |
245
+ | `workflow node sub-processes` | List available sub-processes |
246
+ | `workflow node test-code` | Test a code block node |
247
+ | `workflow node test-webhook` | Test a WebHook node |
248
+ | `workflow node test-ai` | Test an AI text generation node |
249
+ | `workflow node json-to-controls` | Convert JSON to workflow controls |
250
+ | `workflow node code-templates` | List code templates |
251
+ | `workflow node create-code-template` | Create a code template |
252
+ | `workflow node types` | Show all available node types and action IDs |
253
+ | `workflow node list-types` | List NODE_TYPE enum as a table |
254
+
255
+ ### approval — Approval Management
256
+
257
+ | Command | Description |
258
+ |---|---|
259
+ | `approval todo` | List pending tasks |
260
+ | `approval todo-count` | Get pending workflow task count |
261
+ | `approval todo-filters` | Advanced pending list (full RequestTodo filters) |
262
+ | `approval archived` | List archived processes |
263
+ | `approval history` | Get workflow execution history |
264
+ | `approval history-detail` | Get execution history detail (with node info) |
265
+ | `approval get` | Get process instance details |
266
+ | `approval work-item` | Get work items for a process instance |
267
+ | `approval operations` | Get available operations for a task |
268
+ | `approval op-history` | Get operation history for a process instance |
269
+ | `approval approve` | Approve a workflow task |
270
+ | `approval reject` | Reject a workflow task |
271
+ | `approval submit` | Submit a fill-in task |
272
+ | `approval sign` | Add a co-signer to a task |
273
+ | `approval forward` | Forward a task to another user |
274
+ | `approval urge` | Send a reminder for a pending task |
275
+ | `approval revoke` | Revoke a submitted process instance |
276
+ | `approval terminate` | Terminate a running process instance |
277
+ | `approval restart` | Restart a completed/rejected process |
278
+ | `approval retry` | Retry a failed process instance |
279
+ | `approval batch` | Batch approve or reject tasks |
280
+ | `approval retry-batch` | Batch retry failed process instances |
281
+ | `approval end-batch` | Batch terminate process instances |
282
+ | `approval list-types` | Show approval-related enum values (operationType etc.) |
283
+
284
+ #### approval delegation — Approval Delegation
285
+
286
+ | Command | Description |
287
+ |---|---|
288
+ | `approval delegation create` | Create a delegation |
289
+ | `approval delegation list` | List current user's delegations |
290
+ | `approval delegation list-by-company` | List all delegations in organization |
291
+ | `approval delegation list-by-principals` | List delegations for specified principals |
292
+ | `approval delegation update` | Edit delegation; pass `--status 0` to end |
293
+
294
+ ### custom-page — Custom Page Management
295
+
296
+ | Command | Description |
297
+ |---|---|
298
+ | `custom-page info` | Get saved custom page layout |
299
+ | `custom-page create` | Create a new custom page |
300
+ | `custom-page rename` | Edit custom page meta info |
301
+ | `custom-page copy` | Copy a custom page |
302
+ | `custom-page delete` | Delete a custom page |
303
+ | `custom-page save` | Save complete custom page layout |
304
+ | `custom-page update-config` | Update custom page metadata (description/config) |
305
+ | `custom-page component-types` | Show available custom page component types (reference) |
306
+
307
+ ### contact — Contacts & Address Book
308
+
309
+ | Command | Description |
310
+ |---|---|
311
+ | `contact search` | Search contacts and departments |
312
+ | `contact resolve` | Resolve accountId by name/email/phone |
313
+ | `contact friends` | List contacts in address book |
314
+ | `contact friend-requests` | List pending friend requests |
315
+ | `contact add-friend` | Send a friend request |
316
+ | `contact accept-friend` | Accept a friend request |
317
+ | `contact reject-friend` | Reject a friend request (notifies requester) |
318
+ | `contact ignore-friend` | Silently ignore a pending friend request |
319
+ | `contact remove-friend` | Remove a friend from address book |
320
+
321
+ ### department — Department Queries
322
+
323
+ | Command | Description |
324
+ |---|---|
325
+ | `department list` | List sub-departments |
326
+ | `department tree` | Get full department tree |
327
+ | `department info` | Get department details |
328
+ | `department members` | Get department members |
329
+ | `department search` | Search departments and users |
330
+
331
+ ### post — Feed Posts
332
+
333
+ | Command | Description |
334
+ |---|---|
335
+ | `post list` | List feed posts |
336
+ | `post get` | Get post details |
337
+ | `post create` | Create a new post |
338
+ | `post update` | Update a post |
339
+ | `post delete` | Delete a post |
340
+ | `post search` | Search posts by keyword and date range |
341
+ | `post pinned` | List pinned posts |
342
+ | `post top` | Pin or unpin a post |
343
+ | `post like` | Like or unlike a post |
344
+ | `post favorite` | Favorite or unfavorite a post |
345
+ | `post comments` | List comments on a post |
346
+ | `post comment` | Add a comment to a post |
347
+
348
+ ### calendar — Calendar Management
349
+
350
+ | Command | Description |
351
+ |---|---|
352
+ | `calendar list` | List calendar events within a date range (filterable) |
353
+ | `calendar get` | Get calendar event details |
354
+ | `calendar create` | Create a new calendar event |
355
+ | `calendar update` | Update a calendar event |
356
+ | `calendar delete` | Delete a calendar event |
357
+ | `calendar categories` | List calendar categories |
358
+ | `calendar add-member` | Add member to a calendar event |
359
+ | `calendar remove-member` | Remove member from a calendar event |
360
+
361
+ ### chat — Chat & Messaging
362
+
363
+ | Command | Description |
364
+ |---|---|
365
+ | `chat list` | List recent chat sessions |
366
+ | `chat history` | Get 1-on-1 or group chat history |
367
+ | `chat send` | Send a message to one or more users |
368
+ | `chat send-file` | Send a file to a chat (supports both 1-on-1 and group) |
369
+ | `chat send-card` | Send a card to a chat (supports both 1-on-1 and group) |
370
+ | `chat card-detail` | Resolve card references embedded in chat messages |
371
+ | `chat start` | Start a 1-on-1 chat with another user |
372
+
373
+ #### chat group — Group Management
374
+
375
+ | Command | Description |
376
+ |---|---|
377
+ | `chat group list` | List groups |
378
+ | `chat group info` | Get group information |
379
+ | `chat group create` | Create a group chat (supports keyword member resolution, at least 2 members) |
380
+ | `chat group update` | Update group name and/or announcement |
381
+ | `chat group delete` | Disband a group |
382
+ | `chat group members` | List group members |
383
+ | `chat group remove-member` | Remove member from a group |
384
+ | `chat group files` | List files in a group |
385
+
386
+ ## Workflow Management
387
+
388
+ ```bash
389
+ # Create a workflow
390
+ hap workflow create --company-id CID --name "My Flow" --app-id APP_ID
391
+
392
+ # Add an approval node
393
+ hap workflow node add PROCESS_ID --type 4 --name "Manager Approval"
394
+
395
+ # Configure the node
396
+ hap workflow node save PROCESS_ID NODE_ID --type 4 --config '{"accounts":[...]}'
397
+
398
+ # Test a code node
399
+ hap workflow node test-code PROCESS_ID NODE_ID --code "return 1+1"
400
+
401
+ # Test a webhook node
402
+ hap workflow node test-webhook PROCESS_ID NODE_ID --url https://api.example.com
403
+
404
+ # Publish the workflow
405
+ hap workflow publish PROCESS_ID
406
+
407
+ # Trigger it
408
+ hap workflow trigger PROCESS_ID --source-id ROW_ID
409
+
410
+ # Check version history
411
+ hap workflow history PROCESS_ID
412
+
413
+ # Rollback to previous version
414
+ hap workflow rollback PROCESS_ID
415
+
416
+ # Get/set global config
417
+ hap workflow config-get PROCESS_ID
418
+ hap workflow config-set PROCESS_ID --config '{"allowRevoke":true}'
419
+ ```
420
+
421
+ ## Approval & Todo
422
+
423
+ ```bash
424
+ # Check pending task count
425
+ hap approval todo-count
426
+
427
+ # List pending approval tasks
428
+ hap approval todo --type 4
429
+
430
+ # View instance detail
431
+ hap approval get INSTANCE_ID
432
+
433
+ # Approve
434
+ hap approval approve INSTANCE_ID --opinion "Looks good"
435
+
436
+ # Reject with reason
437
+ hap approval reject INSTANCE_ID --opinion "Need revision"
438
+
439
+ # Forward to another user
440
+ hap approval forward INSTANCE_ID --to USER_ID
441
+
442
+ # Add co-signer
443
+ hap approval sign INSTANCE_ID --to USER_ID --before
444
+
445
+ # Batch approve
446
+ hap approval batch --action 4 -s ID1 -s ID2
447
+
448
+ # View execution history
449
+ hap approval history --process-id PROCESS_ID --status 2
450
+ ```
451
+
452
+ ## REPL Mode
453
+
454
+ ```bash
455
+ hap repl
456
+ hap> worksheet record list WORKSHEET_ID
457
+ hap> --json workflow list APP_ID
458
+ hap> approval todo-count
459
+ hap> quit
460
+ ```
461
+
462
+ ## API Authentication
463
+
464
+ The CLI uses MingDAO's `md_pss_id` session token. Use `hap auth login` for
465
+ browser-based login, or `hap auth set --token TOKEN` to set the token manually.
466
+
467
+ Commands that expose `--org-id` will use the saved current org when you omit the option.
468
+
469
+ For private deployments with encrypted API responses, install crypto support:
470
+
471
+ ```bash
472
+ pip install hap-cli[crypto]
473
+ ```
474
+
475
+ ## More Examples
476
+
477
+ ```bash
478
+ # List orgs, then apps
479
+ hap auth list-my-orgs
480
+ hap app list
481
+ hap auth switch-org ORG_ID
482
+ hap app list-managed
483
+
484
+ # Get worksheet fields
485
+ hap worksheet fields WORKSHEET_ID
486
+
487
+ # Create a record
488
+ hap worksheet record create WORKSHEET_ID -f "c001=value1" -f "c002=value2"
489
+
490
+ # Copy a workflow
491
+ hap workflow copy PROCESS_ID --name "Copy of Flow"
492
+
493
+ # Move workflow to another app
494
+ hap workflow move PROCESS_ID TARGET_APP_ID
495
+
496
+ # List code templates
497
+ hap workflow node code-templates --keyword "email"
498
+
499
+ # Test AI node
500
+ hap workflow node test-ai PROCESS_ID NODE_ID --prompt "Summarize this" --model gpt-4
501
+
502
+ # Manage app roles
503
+ hap app role list APP_ID
504
+ hap app role add-member APP_ID ROLE_ID -u USER_ID
505
+
506
+ # Manage option sets
507
+ hap app optionset list APP_ID
508
+
509
+ # Manage chat groups
510
+ hap chat group list
511
+
512
+ # Terminate a stuck instance
513
+ hap approval terminate INSTANCE_ID --yes
514
+
515
+ # Retry a failed instance
516
+ hap approval retry INSTANCE_ID
517
+ ```