@tingwillforever/meegle-cli 1.0.0-dev.20260519131637322 → 1.0.0

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.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![Node.js](https://img.shields.io/badge/node-%3E%3D16-brightgreen.svg)](https://nodejs.org/)
5
+ [![npm version](https://img.shields.io/npm/v/@tingwillforever/meegle-cli.svg)](https://www.npmjs.com/package/@tingwillforever/meegle-cli)
6
+
5
7
  [English](./README.md) | [简体中文](./README.zh-CN.md)
6
8
 
7
9
  Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=readme&utm_campaign=meegle_cli) ([Lark Project](https://project.feishu.cn?utm_source=github&utm_medium=readme&utm_campaign=meegle_cli)). Manage work items, schedules, and data from your terminal — no browser needed.
@@ -11,7 +13,7 @@ Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=r
11
13
  ## Why Meegle CLI?
12
14
 
13
15
  - **Agent-Native** — Ships a bundled [AI Agent Skill](#ai-agent-skill) that teaches Trae, Claude Code, Cursor, Windsurf, Gemini CLI and other agents how to drive Meegle with one command. Every CLI command is designed for both humans and agents, with structured JSON output and `--dry-run` previews
14
- - **Broad Coverage** — 12 business domains (work items, workflow, subtasks, comments, work hours, relations, my-work, views, charts, team, user, project) and 40+ commands mapping to Meegle's core capabilities
16
+ - **Broad Coverage** — 12 business domains (work items, workflow, subtasks, comments, work hours, views, charts, team, user, spaces, attachments, releases / deploy tasks, URL parsing) and 40+ commands mapping to the private-deployment surface
15
17
  - **Two-Layer Parameters** — Ergonomic `--flag-name` for everyday use, fallback `--params <json>` for complex payloads like `fields[]` — pick the right granularity per call
16
18
  - **Flexible Output** — `json` / `table` / `ndjson` / `raw`, with `--select` dot-path projection for piping to other tools
17
19
  - **Secure by Default** — OS keychain credential storage, `${VAR}` env-var templating so secrets never land in config files, multi-profile switching for staging / prod
@@ -20,18 +22,20 @@ Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=r
20
22
 
21
23
  | Category | Capabilities |
22
24
  | -------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
23
- | 📋 [Work Items](#workitem--work-items) | Create, read, update, batch-read, query (MQL), list operation records, inspect metadata |
25
+ | 📋 [Work Items](#workitem--work-items) | Create, read, update, batch-read, search by params/filter, list operation records, inspect metadata |
24
26
  | 🔀 [Workflow](#workflow--workflow) | Transition nodes & states, update node fields, list available transitions and required fields |
25
- | ✅ [Subtasks](#subtask--subtasks) | Create, update, complete, rollback subtasks |
26
- | 💬 [Comments](#comment--comments) | Add and list comments on work items |
27
- | ⏱️ [Work Hours](#workhour--work-hours) | List work hour records, view team-member schedules |
28
- | 🔗 [Relations](#relation--relations) | List related work items, inspect relation-type definitions |
29
- | 📌 [My Work](#mywork--my-work) | View this week / overdue / completed to-dos |
30
- | 👁️ [Views](#view--views) | Create and update fixed views, search views by name |
27
+ | ✅ [Subtasks](#subtask--subtasks) | Create, list, update, complete, rollback subtasks |
28
+ | 💬 [Comments](#comment--comments) | Add, list, update comments on work items |
29
+ | ⏱️ [Work Hours](#workhour--work-hours) | List work hour records |
30
+ | 👁️ [Views](#view--views) | Search, get, create, update views; fixed-view item access |
31
31
  | 📊 [Charts](#chart--charts) | List charts under a view, fetch chart details |
32
- | 👥 [Team & User](#team--user--people) | List teams, team members, search users, view current login |
33
- | 🗂️ [Projects](#project--projects) | Search projects by keyword |
34
- | 🔐 [Auth & Config](#authentication) | Remote MCP SSO config, profile config, env-var injection |
32
+ | 👥 [Team & User](#team--user--people) | List team members, search users, view current login |
33
+ | 🗂️ [Spaces](#space--spaces) | List spaces, get space detail, list business lines |
34
+ | 📎 [Attachments](#attachment--attachments) | Upload file to a work item field, download by UUID, delete |
35
+ | 🚀 [Releases](#release--release-deploy-tasks) | Release-first deploy task surface — list / inspect / prepare / create / execute / verify / apply-whitelist |
36
+ | 🔗 [URL Parsing](#url--url-parsing) | Offline decode of Meegle / Feishu Project URLs into `url_kind` + structured fields |
37
+ | 🔐 [Auth & Config](#authentication) | Remote MCP SSO login, status, multi-profile config, env-var injection |
38
+ | 🩺 [Doctor](#authentication) | Read-only diagnostics for the active profile (runtime, network, session) |
35
39
  | 🤖 [Agent Skill](#ai-agent-skill) | Pre-built skill for Trae / Claude Code / Cursor / Windsurf / Gemini CLI / Copilot |
36
40
 
37
41
  ## Installation
@@ -42,47 +46,36 @@ Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=r
42
46
 
43
47
  ### Install
44
48
 
45
- Install the published package with a GitHub token that can read packages:
46
-
47
49
  ```bash
48
- npm config set @tingwillforever:registry https://npm.pkg.github.com
49
- npm config set //npm.pkg.github.com/:_authToken <github_pat_with_read_packages>
50
- npm install -g @tingwillforever/meegle-cli@latest
50
+ npm install -g @tingwillforever/meegle-cli
51
51
  ```
52
52
 
53
53
  ## Quick Start
54
54
 
55
55
  For ordinary users, the CLI is a thin client for the deployed Meegle MCP Server.
56
56
  You do not need to configure plugin credentials, project credentials, or a local
57
- MCP runtime.
57
+ MCP runtime — `auth login` opens the browser, completes enterprise SSO, and
58
+ exchanges the SSO ticket for a refreshable session managed by the MCP Server.
58
59
 
59
60
  ```bash
60
- # 1. Start ordinary-user remote MCP SSO login
61
- meegle auth login
61
+ # 1. Install the CLI
62
+ npm install -g @tingwillforever/meegle-cli
62
63
 
63
- # 2. Inspect the current authorization summary returned by the server
64
- meegle auth whoami --format table
64
+ # 2. Log in via remote MCP SSO (opens browser)
65
+ meegle auth login
65
66
 
66
- # 3. Verify the installed CLI and runtime
67
- meegle version
67
+ # 3. Verify session and runtime
68
+ meegle auth status
68
69
  meegle doctor --format json
69
70
  ```
70
71
 
71
- `auth login` opens the browser, completes enterprise SSO, exchanges the SSO
72
- ticket for an MCP-managed session, and stores the refreshable session locally.
73
- The production package should embed the production MCP endpoint. Use
74
- `mcp_server_url` or `--mcp-server-url ...` only for local debugging, staging, or
75
- temporary bootstrap.
76
-
77
- `auth whoami` shows the authenticated domain account plus the Meegle user key,
78
- project scope, and business-line scope returned by the server.
79
-
80
- If login reports that access must be requested or approved, SSO has identified
81
- you successfully but the MCP Server has not found an active access grant for
82
- your account yet. Ask an administrator to approve or maintain your grant through
72
+ If `auth login` reports that access must be requested or approved, SSO has
73
+ identified you successfully but the MCP Server has no active access grant for
74
+ your account. Ask an administrator to approve or maintain your grant through
83
75
  the MCP Server access-request / access-grant APIs.
84
76
 
85
- If `doctor` fails, stop and fix runtime/config first. Do not start with business commands.
77
+ If `doctor` fails, fix runtime/config first do not start with business
78
+ commands.
86
79
 
87
80
  ## AI Agent Skill
88
81
 
@@ -90,16 +83,16 @@ If `doctor` fails, stop and fix runtime/config first. Do not start with business
90
83
 
91
84
  ### Install
92
85
 
93
- Complete [Installation](#installation) first, then install the skill:
86
+ Complete [Installation](#installation) first, then add the skill:
94
87
 
95
88
  ```bash
96
- npx -y skills add tingwillforever/meegle-cli --skill meegle -y -g
89
+ # Installs the skill into every supported agent CLI on this machine
90
+ npx -y skills add https://github.com/tingwillforever/meegle-cli --skill meegle -y -g
97
91
  ```
98
92
 
99
- Private-repository install prerequisites:
100
-
101
- - the machine must already be able to access `tingwillforever/meegle-cli`
102
- - `skills add` will clone the private GitHub repository, so the user should authenticate with GitHub first, for example with `gh auth login`, or have working git/SSH credentials for that repository
93
+ `npx skills add` reads `skills/meegle/SKILL.md` from this repo and registers it
94
+ into the skill directory of every agent CLI it finds (Trae, Claude Code,
95
+ Cursor, Windsurf, Gemini CLI, Copilot CLI). Re-run any time to pick up updates.
103
96
 
104
97
  ### What it covers
105
98
 
@@ -132,15 +125,16 @@ The agent consults the skill, runs `meegle doctor` first when needed, picks the
132
125
 
133
126
  | Command | Description |
134
127
  |---------|-------------|
135
- | `workitem create` | Create a work item |
136
- | `workitem get` | View work item details |
128
+ | `workitem create` | Create a new work item |
129
+ | `workitem get` | Query work items by IDs — returns full details, fields, workflow state, metadata |
137
130
  | `workitem +batch-get` | Batch-read work items by IDs (client-side fan-out over `workitem get`; `+` marks scenario/sugar commands) |
138
- | `workitem update` | Update work item fields |
139
- | `workitem search-by-params` | Search work items with structured field filters |
140
- | `workitem search-filter` | Search work items by title/name filter |
141
- | `workitem list-op-records` | View operation records |
142
- | `workitem meta-types` | List work item types |
143
- | `workitem meta-create-fields` | List fields available at creation |
131
+ | `workitem update` | Update fields on an existing work item |
132
+ | `workitem search-by-params` | Advanced search by field-level filters within a space |
133
+ | `workitem search-filter` | Search work items by name/title filter within a space |
134
+ | `workitem search-filter-across` | Search by name filter across multiple spaces |
135
+ | `workitem list-op-records` | Get operation history / audit log |
136
+ | `workitem meta-types` | List work item types available in a space |
137
+ | `workitem meta-create-fields` | List field metadata available at creation time |
144
138
  | `workitem meta-fields` | List field configurations |
145
139
  | `workitem meta-roles` | List role configurations |
146
140
 
@@ -148,75 +142,101 @@ The agent consults the skill, runs `meegle doctor` first when needed, picks the
148
142
 
149
143
  | Command | Description |
150
144
  |---------|-------------|
151
- | `workflow transition` | Transition or rollback a node |
152
- | `workflow transition-state` | Transition a state-flow state |
153
- | `workflow update-node` | Update a node |
154
- | `workflow list-state-transitions` | List available state transitions |
155
- | `workflow list-state-required` | List required fields for transitions |
145
+ | `workflow transition` | Transition or rollback a workflow node (node-flow) |
146
+ | `workflow transition-state` | Transition a state-flow work item to a new state |
147
+ | `workflow update-node` | Update node metadata — schedule, owners, fields |
148
+ | `workflow list-state-transitions` | List the work item's nodes, states, owners, and available transitions |
149
+ | `workflow list-state-required` | List required fields for a workflow transition |
156
150
 
157
151
  ### subtask — Subtasks
158
152
 
159
153
  | Command | Description |
160
154
  |---------|-------------|
161
- | `subtask update` | Create / update / complete / rollback subtasks |
155
+ | `subtask create` | Create a sub-task under a workflow node |
156
+ | `subtask list` | List sub-tasks under a node |
157
+ | `subtask update` | Update sub-task name, owners, schedule, note |
158
+ | `subtask operate` | Confirm (complete) or rollback a sub-task |
162
159
 
163
160
  ### comment — Comments
164
161
 
165
162
  | Command | Description |
166
163
  |---------|-------------|
167
- | `comment add` | Add a comment |
168
- | `comment list` | List comments |
164
+ | `comment add` | Add a comment (plain text or rich text) |
165
+ | `comment list` | List comments on a work item |
166
+ | `comment update` | Update an existing comment |
169
167
 
170
168
  ### workhour — Work Hours
171
169
 
172
170
  | Command | Description |
173
171
  |---------|-------------|
174
172
  | `workhour list-records` | List work hour records |
175
- | `workhour list-schedule` | View team member schedules |
176
-
177
- ### relation — Relations
178
-
179
- | Command | Description |
180
- |---------|-------------|
181
173
 
182
174
  ### view — Views
183
175
 
184
176
  | Command | Description |
185
177
  |---------|-------------|
178
+ | `view search` | Search view configurations in a space; returns `view_type` (0=system list, 1=condition/panoramic, 2=fixed) |
179
+ | `view get` | Get items in a system / fixed list view (typically `view_type=0` or `2`) |
186
180
  | `view create-fixed` | Create a fixed view |
187
- | `view get` | View details of a view |
188
181
  | `view update-fixed` | Update a fixed view |
189
- | `view search` | Search views by name |
190
182
 
191
183
  ### chart — Charts
192
184
 
193
185
  | Command | Description |
194
186
  |---------|-------------|
195
- | `chart get` | View chart details |
196
187
  | `chart list` | List charts under a view |
188
+ | `chart get` | Fetch chart details |
197
189
 
198
190
  ### team / user — People
199
191
 
200
192
  | Command | Description |
201
193
  |---------|-------------|
202
- | `team list-members` | List team members |
203
- | `user me` | View current logged-in user information |
204
- | `user query` | Query user information |
194
+ | `team list-members` | List team members in a space |
195
+ | `user me` | Show current logged-in user information |
196
+ | `user query` | Query user details by `user_key`, `out_id`, or `email` |
197
+
198
+ ### space — Spaces
199
+
200
+ | Command | Description |
201
+ |---------|-------------|
202
+ | `space list` | List all spaces accessible to the current user |
203
+ | `space detail` | Get detailed information about specific spaces by key |
204
+ | `space business-lines` | Get all business lines in a space |
205
205
 
206
- ### spaceProjects
206
+ ### attachmentAttachments
207
207
 
208
208
  | Command | Description |
209
209
  |---------|-------------|
210
- | `space list` | List projects |
210
+ | `attachment upload` | Upload and attach a file to a work item field |
211
+ | `attachment upload-file` | Upload a generic file (rich-text image, attachment field) |
212
+ | `attachment download` | Download an attachment by UUID |
213
+ | `attachment delete` | Delete an attachment (destructive) |
214
+
215
+ ### release — Release Deploy Tasks
216
+
217
+ | Command | Description |
218
+ |---------|-------------|
219
+ | `release deploy-task-list` | List deploy tasks for a release work item |
220
+ | `release deploy-task-inspect` | Inspect a deploy task with pod status and mismatch warnings |
221
+ | `release deploy-task-prepare` | Prepare a Kubelink deploy-task creation payload from `appName` / `iBuildId` |
222
+ | `release deploy-task-create` | Create release-oriented deploy tasks |
223
+ | `release deploy-task-execute` | Execute deployment for deploy tasks |
224
+ | `release deploy-task-verify` | Run verification for deploy tasks |
225
+ | `release deploy-task-apply-white-list` | Apply whitelist after explicit user confirmation |
226
+
227
+ ### url — URL Parsing
228
+
229
+ | Command | Description |
230
+ |---------|-------------|
231
+ | `url decode` | Offline decode a Meegle / Feishu Project URL into structured fields (returns `url_kind`) |
211
232
 
212
233
  ### auth — Authentication
213
234
 
214
235
  | Command | Description |
215
236
  |---------|-------------|
216
- | `auth login` | Start remote MCP SSO login |
237
+ | `auth login` | Start remote MCP SSO login (browser-based) |
238
+ | `auth status` | View authentication status |
217
239
  | `auth logout` | Log out and revoke the remote session when possible |
218
- | `auth status` | View login status |
219
- | `auth whoami` | Show the current authenticated identity and authorization summary |
220
240
 
221
241
  ### config — Configuration
222
242
 
@@ -232,7 +252,9 @@ The agent consults the skill, runs `meegle doctor` first when needed, picks the
232
252
 
233
253
  | Command | Description |
234
254
  |---------|-------------|
235
- | `inspect [command]` | Inspect command parameters |
255
+ | `doctor` | Run read-only diagnostics for the active profile |
256
+ | `inspect [command]` | Show parameter details for a command (e.g. `inspect workitem.create`) |
257
+ | `version` | Print the CLI version |
236
258
  | `completion bash\|zsh\|fish` | Generate shell completion script |
237
259
  | `completion install` | Auto-install shell completion |
238
260
 
@@ -262,7 +284,6 @@ Verification-state guidance:
262
284
  - `release deploy-task-prepare`
263
285
  - `release deploy-task-list`
264
286
  - `release deploy-task-inspect`
265
- - `integration kubelink-app-catalog-resolve`
266
287
 
267
288
  These are `verified` and are the default-safe first picks.
268
289
 
@@ -270,18 +291,13 @@ These are `verified` and are the default-safe first picks.
270
291
  - `release deploy-task-execute`
271
292
  - `release deploy-task-apply-white-list`
272
293
  - `release deploy-task-verify`
273
- - `integration kubelink-deploy-task-create`
274
- - `integration kubelink-deploy-task-upgrade`
275
- - `integration kubelink-deploy-task-verify`
276
- - `integration kubelink-deploy-task-apply-white-list`
277
- - `integration kubelink-deploy-task-inspect`
278
294
 
279
295
  These are `conditional`. Use `meegle inspect <resource>.<method>` first if the parameter shape is unclear, and do not run them blindly in agentic workflows.
280
296
 
281
297
  Advanced fallback:
282
298
 
283
- - stay on `release` commands for ordinary release-oriented deploy-task requests
284
- - use `integration` only when you already have exact Kubelink payloads or record IDs, or when the release-layer command cannot express the action
299
+ - stay on `release` commands they cover the full release-oriented deploy-task surface
300
+ - if a backend-only Kubelink action is needed that the release layer cannot express, raise the case rather than reaching for an unsupported integration command
285
301
 
286
302
  ## Common Examples
287
303
 
@@ -294,7 +310,7 @@ meegle workitem get \
294
310
  --work-item-type-key WORK_ITEM_TYPE_KEY \
295
311
  --work-item-ids 12345
296
312
 
297
- # View workflow state, nodes, and transitions
313
+ # View workflow state, nodes, owners, and possible transitions
298
314
  meegle workflow list-state-transitions \
299
315
  --project-key PROJ \
300
316
  --work-item-type-key WORK_ITEM_TYPE_KEY \
@@ -339,31 +355,45 @@ per-item `error` field. A 401 from the server aborts the whole run.
339
355
  ### Creating Work Items
340
356
 
341
357
  ```bash
342
- # Pass fields[] via --params (JSON)
343
- meegle workitem create --project-key PROJ --work-item-type story \
358
+ # Required flags + extra fields[] via --params (JSON)
359
+ meegle workitem create \
360
+ --project-key PROJ \
361
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
362
+ --name "Optimize login flow" \
344
363
  --params '{"fields":[
345
- {"field_key":"name","field_value":"Optimize login flow"},
346
364
  {"field_key":"priority","field_value":"P1"}
347
365
  ]}'
348
366
 
349
367
  # Complex field values (arrays, nested JSON) also go through --params
350
- meegle workitem create --project-key PROJ --work-item-type story \
368
+ meegle workitem create \
369
+ --project-key PROJ \
370
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
371
+ --name "Scheduled task" \
351
372
  --params '{"fields":[
352
- {"field_key":"name","field_value":"Scheduled task"},
353
373
  {"field_key":"schedule","field_value":[1722182400000,1722355199999]}
354
374
  ]}'
355
375
  ```
356
376
 
357
377
  ### Updating Fields
358
378
 
379
+ `workitem update` requires `--work-item-id`, `--project-key`, and
380
+ `--work-item-type-key`. Field values come through `--update-fields` (one
381
+ `key=value` per entry) or via `--params` for complex payloads.
382
+
359
383
  ```bash
360
- # Update work item name
361
- meegle workitem update --work-item-id 12345 \
362
- --params '{"fields":[{"field_key":"name","field_value":"New title"}]}'
384
+ # Update a single field via --update-fields
385
+ meegle workitem update \
386
+ --project-key PROJ \
387
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
388
+ --work-item-id 12345 \
389
+ --update-fields 'name=New title'
363
390
 
364
- # Update multiple fields at once
365
- meegle workitem update --work-item-id 12345 \
366
- --params '{"fields":[
391
+ # Update multiple fields with a JSON payload
392
+ meegle workitem update \
393
+ --project-key PROJ \
394
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
395
+ --work-item-id 12345 \
396
+ --params '{"update_fields":[
367
397
  {"field_key":"name","field_value":"New title"},
368
398
  {"field_key":"priority","field_value":"P0"}
369
399
  ]}'
@@ -372,61 +402,61 @@ meegle workitem update --work-item-id 12345 \
372
402
  ### Work Item Search
373
403
 
374
404
  ```bash
375
- # Query P0 stories in a project by title/name filter
376
- meegle workitem search-filter --project-key PROJ \
377
- --work-item-type-key STORY_TYPE_KEY \
378
- --name P0
379
- ```
380
-
381
- ### Viewing Schedules
405
+ # Filter by name across one or more work item types in a space
406
+ meegle workitem search-filter \
407
+ --project-key PROJ \
408
+ --work-item-type-keys STORY_TYPE_KEY \
409
+ --work-item-name "login"
382
410
 
383
- ```bash
384
- # View team member schedules
385
- meegle workhour list-schedule --project-key PROJ \
386
- --start-time 2026-03-01 --end-time 2026-03-31 \
387
- --user-keys "Alice,Bob,Charlie"
411
+ # Structured field-level search (advanced)
412
+ meegle workitem search-by-params \
413
+ --project-key PROJ \
414
+ --work-item-type-key STORY_TYPE_KEY \
415
+ --params '{"search_params":{"conditions":[
416
+ {"field_key":"priority","operator":"=","value":"P0"}
417
+ ]}}'
388
418
  ```
389
419
 
390
420
  ### Searching Users
391
421
 
392
422
  ```bash
393
- meegle user query --user-keys "Alice,Bob"
423
+ # Resolve current login
424
+ meegle user query --user-keys "current_login_user()"
425
+
426
+ # Look up by email
427
+ meegle user query --emails "alice@example.com,bob@example.com"
394
428
  ```
395
429
 
396
430
  ### Deploy Tasks
397
431
 
398
432
  ```bash
399
- # Prepare a release-oriented deploy-task payload
400
- meegle release deploy-task-prepare \
401
- --project-key PROJ \
402
- --release-id RELEASE_ID \
403
- --appName APP_NAME \
404
- --format json
433
+ # 1. Verify runtime first
434
+ meegle doctor --format json
405
435
 
406
- # List deploy tasks bound to a release
436
+ # 2. List deploy tasks bound to a release
407
437
  meegle release deploy-task-list \
408
438
  --project-key PROJ \
409
439
  --release-id RELEASE_ID \
410
440
  --format json
411
441
 
412
- # Inspect one deploy task with release context
442
+ # 3. Inspect one deploy task with pod-status detail
413
443
  meegle release deploy-task-inspect \
444
+ --recordID RECORD_ID \
445
+ --format json
446
+
447
+ # 4. Prepare a deploy-task creation payload
448
+ meegle release deploy-task-prepare \
414
449
  --project-key PROJ \
415
450
  --release-id RELEASE_ID \
416
- --recordID RECORD_ID \
451
+ --appName APP_NAME \
417
452
  --format json
418
453
 
419
- # Apply whitelist from the release layer after explicit user confirmation
454
+ # 5. Apply whitelist after explicit user confirmation
420
455
  meegle release deploy-task-apply-white-list \
421
456
  --project-key PROJ \
422
457
  --release-id RELEASE_ID \
423
458
  --recordIDs RECORD_ID \
424
459
  --format json
425
-
426
- # Resolve app/chart candidates from the advanced Kubelink layer
427
- meegle integration kubelink-app-catalog-resolve \
428
- --appName APP_NAME \
429
- --format json
430
460
  ```
431
461
 
432
462
  ## Parameter Passing
@@ -470,8 +500,11 @@ meegle workitem search-filter --set project_key=PROJ --set work_item_type_keys=W
470
500
  All commands support `--params` to pass a full JSON parameter body:
471
501
 
472
502
  ```bash
473
- meegle workitem create --project-key PROJ --work-item-type story \
474
- --params '{"fields":[{"field_key":"name","field_value":"Title"}]}'
503
+ meegle workitem create \
504
+ --project-key PROJ \
505
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
506
+ --name "Title" \
507
+ --params '{"fields":[{"field_key":"priority","field_value":"P1"}]}'
475
508
  ```
476
509
 
477
510
  ### Priority
@@ -564,8 +597,12 @@ loss-less.
564
597
  For commands with side effects, preview the rendered request with `--dry-run` before executing:
565
598
 
566
599
  ```bash
567
- meegle workitem create --project-key PROJ --work-item-type story \
568
- --params '{"fields":[{"field_key":"name","field_value":"Test"}]}' --dry-run
600
+ meegle workitem create \
601
+ --project-key PROJ \
602
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
603
+ --name "Test" \
604
+ --params '{"fields":[{"field_key":"priority","field_value":"P2"}]}' \
605
+ --dry-run
569
606
  ```
570
607
 
571
608
  ### Command Introspection
@@ -588,7 +625,7 @@ means the remote MCP SSO path shown in [Quick Start](#quick-start):
588
625
  - run `meegle auth login`
589
626
  - the production package uses its built-in production MCP endpoint by default
590
627
  - use `meegle config set mcp_server_url ...` only for local debugging or staging overrides
591
- - inspect the granted identity and scope with `meegle auth whoami`
628
+ - check the active session with `meegle auth status`
592
629
 
593
630
  Run `meegle doctor --format json` after login. If `doctor` fails, stop and fix
594
631
  config before running business commands.
@@ -597,7 +634,7 @@ Example ordinary-user remote MCP SSO login commands:
597
634
 
598
635
  ```bash
599
636
  meegle auth login
600
- meegle auth whoami --format table
637
+ meegle auth status
601
638
  ```
602
639
 
603
640
  Bootstrap / one-off override example:
@@ -608,7 +645,7 @@ meegle auth login
608
645
 
609
646
  # or a one-off endpoint override
610
647
  meegle auth login --mcp-server-url https://mcp.example.com/mcp
611
- meegle auth whoami --format table
648
+ meegle auth status
612
649
  ```
613
650
 
614
651
  ### Generic OAuth / Device Code flows
@@ -657,7 +694,7 @@ Before publishing the ordinary-user package:
657
694
  - update `DefaultRemoteMCPServerURL` in `internal/products/meegle/config.go` to the production `/mcp` endpoint
658
695
  - build the CLI package with `make meegle-cli`
659
696
  - install the staged or published package in a clean shell and run `meegle auth login`
660
- - confirm `meegle auth whoami --format table` shows the expected account, Meegle user key, projects, and business lines
697
+ - confirm `meegle auth status` shows an active session and the expected account / scope
661
698
  - leave `mcp_server_url` unset for ordinary users; use it only for local or staging overrides
662
699
 
663
700
  ### Sandbox / CI: Direct Environment-Variable Injection
package/README.zh-CN.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![Node.js](https://img.shields.io/badge/node-%3E%3D16-brightgreen.svg)](https://nodejs.org/)
5
+ [![npm version](https://img.shields.io/npm/v/@tingwillforever/meegle-cli.svg)](https://www.npmjs.com/package/@tingwillforever/meegle-cli)
6
+
5
7
  [English](./README.md) | [简体中文](./README.zh-CN.md)
6
8
 
7
9
  飞书项目([Meegle](https://meegle.com?utm_source=github&utm_medium=readme&utm_campaign=meegle_cli) / [Lark Project](https://project.feishu.cn?utm_source=github&utm_medium=readme&utm_campaign=meegle_cli))命令行工具。在终端中管理工作项、查看排期、搜索数据,无需打开浏览器。
@@ -11,7 +13,7 @@
11
13
  ## 为什么选择 Meegle CLI?
12
14
 
13
15
  - **Agent 友好** — 附带一份 [AI Agent Skill](#ai-agent-skill),一条命令即可把 Meegle 操作手册喂给 Trae、Claude Code、Cursor、Windsurf、Gemini CLI 等主流 Agent。CLI 命令同时面向人类和 Agent 设计,结构化 JSON 输出、`--dry-run` 预览
14
- - **覆盖完整** — 12 个业务域(工作项、工作流、子任务、评论、工时、关联、我的工作、视图、图表、团队、用户、空间),40+ 命令映射到 Meegle 核心能力
16
+ - **覆盖完整** — 12 个业务域(工作项、工作流、子任务、评论、工时、视图、度量、团队、用户、空间、附件、发布 / 部署任务、URL 解析),40+ 命令映射到私有化部署面
15
17
  - **两层参数模型** — 日常用 `--flag-name` 轻便直接,复杂载荷(如 `fields[]`)用 `--params <json>` 兜底 —— 按场景选择合适粒度
16
18
  - **输出格式灵活** — 支持 `json` / `table` / `ndjson` / `raw`,配合 `--select` 点路径投影可直接 pipe 给其他工具
17
19
  - **默认安全** — 凭证存进系统 keychain、`${VAR}` 环境变量模板让 secret 不落地到 config 文件、多 profile 分离 staging / prod
@@ -20,18 +22,20 @@
20
22
 
21
23
  | 域 | 能力 |
22
24
  | -------------------------------------------------- | ---------------------------------------------------------------------------------------- |
23
- | 📋 [工作项](#workitem--工作项域) | 创建、查看、更新、批量读、MQL 查询、查看操作记录、读元数据 |
25
+ | 📋 [工作项](#workitem--工作项域) | 创建、查看、更新、批量读、按字段/标题搜索、查看操作记录、读字段元数据 |
24
26
  | 🔀 [工作流](#workflow--工作流域) | 节点和状态流转、更新节点字段、列出可用流转和必填字段 |
25
- | ✅ [子任务](#subtask--子任务) | 创建、更新、完成、回滚子任务 |
26
- | 💬 [评论](#comment--评论域) | 在工作项上添加和列出评论 |
27
- | ⏱️ [工时](#workhour--工时域) | 列出工时记录、查看团队成员排期 |
28
- | 🔗 [关联](#relation--关系域) | 列出关联工作项、查看关联类型定义 |
29
- | 📌 [我的工作](#mywork--工作台域) | 查看本周 / 已完成 / 逾期待办 |
30
- | 👁️ [视图](#view--视图域) | 创建和更新固定视图、按名称搜索视图 |
31
- | 📊 [图表](#chart--度量域) | 列出视图下的图表、查看图表详情 |
32
- | 👥 [团队与用户](#team--user--人员域) | 列出团队、团队成员、搜索用户、查看当前登录身份 |
33
- | 🗂️ [空间](#project--空间域) | 按关键词搜索空间 |
34
- | 🔐 [认证与配置](#认证) | 远端 MCP SSO 配置、多 profile 配置、环境变量注入 |
27
+ | ✅ [子任务](#subtask--子任务) | 在工作流节点下创建、列出、更新、完成、回滚子任务 |
28
+ | 💬 [评论](#comment--评论域) | 添加、列出、更新工作项评论 |
29
+ | ⏱️ [工时](#workhour--工时域) | 列出工时登记记录 |
30
+ | 👁️ [视图](#view--视图域) | 搜索、查看、创建、更新视图,固定视图条目读取 |
31
+ | 📊 [度量](#chart--度量域) | 列出视图下的图表、查看图表详情 |
32
+ | 👥 [团队与用户](#team--user--人员域) | 查看团队成员、搜索用户、查看当前登录身份 |
33
+ | 🗂️ [空间](#space--空间域) | 列出空间、查看空间详情、查看业务线 |
34
+ | 📎 [附件](#attachment--附件域) | 上传文件到工作项字段、按 UUID 下载、删除 |
35
+ | 🚀 [发布](#release--发布部署任务) | release-first 部署任务面 —— list / inspect / prepare / create / execute / verify / apply-whitelist |
36
+ | 🔗 [URL 解析](#url--url-解析) | 离线解析飞书项目 / Meegle URL,输出 `url_kind` + 结构化字段 |
37
+ | 🔐 [认证与配置](#认证) | 远端 MCP SSO 登录、状态、多 profile 配置、环境变量注入 |
38
+ | 🩺 [Doctor](#认证) | 当前 profile 只读诊断(运行时、网络、会话) |
35
39
  | 🤖 [Agent Skill](#ai-agent-skill) | 内置 skill 供 Trae / Claude Code / Cursor / Windsurf / Gemini / Copilot 使用 |
36
40
 
37
41
  ## 安装
@@ -42,43 +46,34 @@
42
46
 
43
47
  ### 安装命令
44
48
 
45
- 使用具备 package 读取权限的 GitHub token 安装已发布的包:
46
-
47
49
  ```bash
48
- npm config set @tingwillforever:registry https://npm.pkg.github.com
49
- npm config set //npm.pkg.github.com/:_authToken <github_pat_with_read_packages>
50
- npm install -g @tingwillforever/meegle-cli@latest
50
+ npm install -g @tingwillforever/meegle-cli
51
51
  ```
52
52
 
53
53
  ## 快速开始
54
54
 
55
55
  对于普通用户,CLI 只是已部署 Meegle MCP Server 的轻量客户端。你不需要配置
56
- plugin 凭据、project 凭据,也不需要在本机启动 MCP runtime
56
+ plugin 凭据、project 凭据,也不需要在本机启动 MCP runtime —— `auth login`
57
+ 会拉起浏览器完成企业 SSO,再把 SSO ticket 交换成由 MCP Server 管理的可刷新
58
+ 本地会话。
57
59
 
58
60
  ```bash
59
- # 1. 发起普通用户远端 MCP SSO 登录
60
- meegle auth login
61
+ # 1. 安装 CLI
62
+ npm install -g @tingwillforever/meegle-cli
61
63
 
62
- # 2. 查看服务端返回的当前授权摘要
63
- meegle auth whoami --format table
64
+ # 2. 远端 MCP SSO 登录(自动拉起浏览器)
65
+ meegle auth login
64
66
 
65
- # 3. 验证安装结果和运行时状态
66
- meegle version
67
+ # 3. 验证会话与运行时
68
+ meegle auth status
67
69
  meegle doctor --format json
68
70
  ```
69
71
 
70
- `auth login` 会拉起浏览器完成企业 SSO,再把 SSO ticket 交换成由 MCP
71
- Server 管理的本地可刷新会话。正式安装包应内置生产 MCP 地址。只有本地调试、
72
- 预发验证或临时引导时,才需要设置 `mcp_server_url` 或显式传
73
- `--mcp-server-url ...`。
72
+ 如果 `auth login` 提示需要申请或审批访问权限,说明 SSO 已确认你的身份,但
73
+ MCP Server 还没有找到你的 active access grant。请联系管理员通过 MCP Server
74
+ access-request / access-grant API 审批或维护权限。
74
75
 
75
- `auth whoami` 会展示当前登录域账号、Meegle user key,以及服务端下发的项目和业务线授权范围。
76
-
77
- 如果登录提示需要申请或审批访问权限,说明 SSO 已确认你的身份,但 MCP Server
78
- 还没有找到你的 active access grant。请联系管理员通过 MCP Server 的
79
- access-request / access-grant API 审批或维护权限。
80
-
81
- 如果 `doctor` 没过,不要直接跑业务命令,先把运行时/配置补齐。
76
+ 如果 `doctor` 没过,先把运行时/配置补齐,不要直接跑业务命令。
82
77
 
83
78
  ## AI Agent Skill
84
79
 
@@ -86,16 +81,16 @@ access-request / access-grant API 审批或维护权限。
86
81
 
87
82
  ### 安装
88
83
 
89
- 先完成[安装](#安装),然后安装 skill:
84
+ 先完成[安装](#安装),然后注册 skill:
90
85
 
91
86
  ```bash
92
- npx -y skills add tingwillforever/meegle-cli --skill meegle -y -g
87
+ # 自动检测本机已安装的 Agent CLI 并逐个注册
88
+ npx -y skills add https://github.com/tingwillforever/meegle-cli --skill meegle -y -g
93
89
  ```
94
90
 
95
- 私有仓库安装前提:
96
-
97
- - 机器本身必须已经有 `tingwillforever/meegle-cli` 的访问权限
98
- - `skills add` 会 clone 私有 GitHub 仓库,因此用户应先完成 GitHub 认证,例如 `gh auth login`,或确保本机 git/SSH 已能访问该仓库
91
+ `npx skills add` 会读取本仓库的 `skills/meegle/SKILL.md`,把它注册到本机
92
+ 所有受支持的 Agent CLI(Trae、Claude Code、Cursor、Windsurf、Gemini CLI、
93
+ Copilot CLI)。后续 skill 有更新只需重跑同一条命令。
99
94
 
100
95
  ### 覆盖内容
101
96
 
@@ -128,91 +123,118 @@ Agent 会参考 skill,必要时先跑 `meegle doctor`,再自动选择合适
128
123
 
129
124
  | 命令 | 说明 |
130
125
  |------|------|
131
- | `workitem create` | 创建工作项 |
132
- | `workitem get` | 查看工作项概况 |
133
- | `workitem +batch-get` | 按 ID 批量读取工作项(客户端侧在 `workitem get` 之上做扇出;`+` 前缀代表场景/语法糖命令) |
126
+ | `workitem create` | 创建新工作项 |
127
+ | `workitem get` | ID 查询工作项 —— 返回字段、工作流状态、元数据 |
128
+ | `workitem +batch-get` | 按 ID 批量读取(客户端侧在 `workitem get` 之上做扇出;`+` 前缀代表场景/语法糖命令) |
134
129
  | `workitem update` | 修改工作项字段 |
135
- | `workitem search-by-params` | 使用结构化字段条件搜索工作项 |
136
- | `workitem search-filter` | 按标题 / 名称过滤搜索工作项 |
137
- | `workitem list-op-records` | 查看操作记录 |
138
- | `workitem meta-types` | 查看工作项类型列表 |
139
- | `workitem meta-create-fields` | 查看创建时可用字段 |
140
- | `workitem meta-fields` | 查看字段配置 |
141
- | `workitem meta-roles` | 查看角色配置 |
130
+ | `workitem search-by-params` | 在空间内按字段级条件做高级搜索 |
131
+ | `workitem search-filter` | 在空间内按名称/标题过滤搜索 |
132
+ | `workitem search-filter-across` | 跨多个空间按名称过滤搜索 |
133
+ | `workitem list-op-records` | 查看操作历史 / 审计记录 |
134
+ | `workitem meta-types` | 列出空间下的工作项类型 |
135
+ | `workitem meta-create-fields` | 列出创建时可用的字段元数据 |
136
+ | `workitem meta-fields` | 列出字段配置 |
137
+ | `workitem meta-roles` | 列出角色配置 |
142
138
 
143
139
  ### workflow — 工作流域
144
140
 
145
141
  | 命令 | 说明 |
146
142
  |------|------|
147
- | `workflow transition` | 流转或回滚节点 |
148
- | `workflow transition-state` | 流转状态流状态 |
149
- | `workflow update-node` | 修改节点 |
150
- | `workflow list-state-transitions` | 查看可流转状态 |
151
- | `workflow list-state-required` | 查看流转必填信息 |
143
+ | `workflow transition` | 节点流转或回滚(节点流) |
144
+ | `workflow transition-state` | 状态流模式下流转工作项到新状态 |
145
+ | `workflow update-node` | 更新节点元数据 —— 排期、负责人、字段 |
146
+ | `workflow list-state-transitions` | 查询工作项的节点、状态、负责人和可执行流转 |
147
+ | `workflow list-state-required` | 查看流转所需的必填字段 |
152
148
 
153
149
  ### subtask — 子任务
154
150
 
155
151
  | 命令 | 说明 |
156
152
  |------|------|
157
- | `subtask update` | 创建/修改/完成/回滚子任务 |
153
+ | `subtask create` | 在工作流节点下创建子任务 |
154
+ | `subtask list` | 列出节点下的子任务 |
155
+ | `subtask update` | 修改子任务名称、负责人、排期、备注 |
156
+ | `subtask operate` | 确认(完成)或回滚一个子任务 |
158
157
 
159
158
  ### comment — 评论域
160
159
 
161
160
  | 命令 | 说明 |
162
161
  |------|------|
163
- | `comment add` | 添加评论 |
164
- | `comment list` | 查看评论列表 |
162
+ | `comment add` | 添加评论(纯文本或富文本) |
163
+ | `comment list` | 查看工作项评论列表 |
164
+ | `comment update` | 修改已存在的评论 |
165
165
 
166
166
  ### workhour — 工时域
167
167
 
168
168
  | 命令 | 说明 |
169
169
  |------|------|
170
170
  | `workhour list-records` | 查看工时登记记录 |
171
- | `workhour list-schedule` | 查看人员排期 |
172
-
173
- ### relation — 关系域
174
-
175
- | 命令 | 说明 |
176
- |------|------|
177
171
 
178
172
  ### view — 视图域
179
173
 
180
174
  | 命令 | 说明 |
181
175
  |------|------|
176
+ | `view search` | 搜索空间下的视图配置;返回 `view_type`(0=系统列表,1=条件/全景,2=固定) |
177
+ | `view get` | 读取系统/固定列表视图条目(通常 `view_type=0` 或 `2`) |
182
178
  | `view create-fixed` | 创建固定视图 |
183
- | `view get` | 查看视图详情 |
184
179
  | `view update-fixed` | 更新固定视图 |
185
- | `view search` | 按名称搜索视图 |
186
180
 
187
181
  ### chart — 度量域
188
182
 
189
183
  | 命令 | 说明 |
190
184
  |------|------|
185
+ | `chart list` | 列出视图下的图表 |
191
186
  | `chart get` | 查看图表详情 |
192
- | `chart list` | 查看视图下的图表列表 |
193
187
 
194
188
  ### team / user — 人员域
195
189
 
196
190
  | 命令 | 说明 |
197
191
  |------|------|
198
- | `team list-members` | 查看团队成员 |
192
+ | `team list-members` | 查看空间团队成员 |
199
193
  | `user me` | 查看当前登录用户信息 |
200
- | `user query` | 查询用户信息 |
194
+ | `user query` | `user_key` / `out_id` / `email` 查询用户详情 |
201
195
 
202
196
  ### space — 空间域
203
197
 
204
198
  | 命令 | 说明 |
205
199
  |------|------|
206
- | `space list` | 列出空间信息 |
200
+ | `space list` | 列出当前用户可访问的所有空间 |
201
+ | `space detail` | 按 key 查询指定空间的详细信息 |
202
+ | `space business-lines` | 查看空间下的业务线 |
203
+
204
+ ### attachment — 附件域
205
+
206
+ | 命令 | 说明 |
207
+ |------|------|
208
+ | `attachment upload` | 上传文件并附加到工作项字段 |
209
+ | `attachment upload-file` | 上传通用文件(富文本图片、附件字段) |
210
+ | `attachment download` | 按 UUID 下载附件 |
211
+ | `attachment delete` | 删除附件(destructive) |
212
+
213
+ ### release — 发布部署任务
214
+
215
+ | 命令 | 说明 |
216
+ |------|------|
217
+ | `release deploy-task-list` | 列出发布单下的部署任务 |
218
+ | `release deploy-task-inspect` | 查看部署任务详情,包含 pod 状态和不一致告警 |
219
+ | `release deploy-task-prepare` | 基于 `appName` / `iBuildId` 准备 Kubelink 部署任务创建载荷 |
220
+ | `release deploy-task-create` | 创建 release-oriented 部署任务 |
221
+ | `release deploy-task-execute` | 执行部署 |
222
+ | `release deploy-task-verify` | 执行部署校验 |
223
+ | `release deploy-task-apply-white-list` | 在用户显式确认后应用白名单 |
224
+
225
+ ### url — URL 解析
226
+
227
+ | 命令 | 说明 |
228
+ |------|------|
229
+ | `url decode` | 离线解析飞书项目 / Meegle URL,返回 `url_kind` + 结构化字段 |
207
230
 
208
231
  ### auth — 认证域
209
232
 
210
233
  | 命令 | 说明 |
211
234
  |------|------|
212
- | `auth login` | 发起远端 MCP SSO 登录 |
213
- | `auth logout` | 登出,并在可达时撤销远端会话 |
235
+ | `auth login` | 发起远端 MCP SSO 登录(基于浏览器) |
214
236
  | `auth status` | 查看登录状态 |
215
- | `auth whoami` | 查看当前登录身份和授权摘要 |
237
+ | `auth logout` | 登出,并在可达时撤销远端会话 |
216
238
 
217
239
  ### config — 配置域
218
240
 
@@ -228,7 +250,9 @@ Agent 会参考 skill,必要时先跑 `meegle doctor`,再自动选择合适
228
250
 
229
251
  | 命令 | 说明 |
230
252
  |------|------|
231
- | `inspect [command]` | 查看命令参数详情 |
253
+ | `doctor` | 当前 profile 只读诊断 |
254
+ | `inspect [command]` | 查看命令参数详情(如 `inspect workitem.create`) |
255
+ | `version` | 打印 CLI 版本号 |
232
256
  | `completion bash\|zsh\|fish` | 生成 Shell 补全脚本 |
233
257
  | `completion install` | 自动安装 Shell 补全 |
234
258
 
@@ -250,7 +274,6 @@ Agent 会参考 skill,必要时先跑 `meegle doctor`,再自动选择合适
250
274
  - `release deploy-task-prepare`
251
275
  - `release deploy-task-list`
252
276
  - `release deploy-task-inspect`
253
- - `integration kubelink-app-catalog-resolve`
254
277
 
255
278
  这些是 `verified`,可以作为默认安全的首选入口。
256
279
 
@@ -258,18 +281,13 @@ Agent 会参考 skill,必要时先跑 `meegle doctor`,再自动选择合适
258
281
  - `release deploy-task-execute`
259
282
  - `release deploy-task-apply-white-list`
260
283
  - `release deploy-task-verify`
261
- - `integration kubelink-deploy-task-create`
262
- - `integration kubelink-deploy-task-upgrade`
263
- - `integration kubelink-deploy-task-verify`
264
- - `integration kubelink-deploy-task-apply-white-list`
265
- - `integration kubelink-deploy-task-inspect`
266
284
 
267
285
  这些是 `conditional`。如果参数形状不明确,先执行 `meegle inspect <resource>.<method>`,不要在 Agent 场景里盲跑。
268
286
 
269
287
  高级降级入口:
270
288
 
271
- - 常规发布任务优先使用 `release` 资源组
272
- - 只有在你已经持有精确 Kubelink payload / record ID,或 release 层命令无法表达目标动作时,才退回 `integration`
289
+ - 发布相关动作统一走 `release` 资源组 —— 它已经覆盖完整的发布部署任务面
290
+ - 如果出现 release 层无法表达的后端 Kubelink 动作,应反馈给维护者而不是寻找未上线的 integration 命令
273
291
 
274
292
  ## 常用示例
275
293
 
@@ -282,7 +300,7 @@ meegle workitem get \
282
300
  --work-item-type-key WORK_ITEM_TYPE_KEY \
283
301
  --work-item-ids 12345
284
302
 
285
- # 查看工作项当前工作流状态、节点和可执行流转
303
+ # 查看工作流当前状态、节点、负责人和可执行流转
286
304
  meegle workflow list-state-transitions \
287
305
  --project-key PROJ \
288
306
  --work-item-type-key WORK_ITEM_TYPE_KEY \
@@ -326,31 +344,44 @@ meegle workitem +batch-get --project-key PROJ --work-item-ids "12345,12346" -o n
326
344
  ### 创建工作项
327
345
 
328
346
  ```bash
329
- # 通过 --params fields[]
330
- meegle workitem create --project-key PROJ --work-item-type story \
347
+ # 必填 flag + 通过 --params 追加 fields[]
348
+ meegle workitem create \
349
+ --project-key PROJ \
350
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
351
+ --name "优化登录流程" \
331
352
  --params '{"fields":[
332
- {"field_key":"name","field_value":"优化登录流程"},
333
353
  {"field_key":"priority","field_value":"P1"}
334
354
  ]}'
335
355
 
336
356
  # 复杂字段值(数组、嵌套 JSON)也走 --params
337
- meegle workitem create --project-key PROJ --work-item-type story \
357
+ meegle workitem create \
358
+ --project-key PROJ \
359
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
360
+ --name "排期任务" \
338
361
  --params '{"fields":[
339
- {"field_key":"name","field_value":"排期任务"},
340
362
  {"field_key":"schedule","field_value":[1722182400000,1722355199999]}
341
363
  ]}'
342
364
  ```
343
365
 
344
366
  ### 修改字段
345
367
 
368
+ `workitem update` 必填 `--work-item-id`、`--project-key`、`--work-item-type-key`。
369
+ 字段值通过 `--update-fields`(每条 `key=value`)或 `--params` 传复杂载荷。
370
+
346
371
  ```bash
347
- # 修改工作项名称
348
- meegle workitem update --work-item-id 12345 \
349
- --params '{"fields":[{"field_key":"name","field_value":"新标题"}]}'
372
+ # 通过 --update-fields 修改单个字段
373
+ meegle workitem update \
374
+ --project-key PROJ \
375
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
376
+ --work-item-id 12345 \
377
+ --update-fields 'name=新标题'
350
378
 
351
- # 同时修改多个字段
352
- meegle workitem update --work-item-id 12345 \
353
- --params '{"fields":[
379
+ # 通过 JSON 同时修改多个字段
380
+ meegle workitem update \
381
+ --project-key PROJ \
382
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
383
+ --work-item-id 12345 \
384
+ --params '{"update_fields":[
354
385
  {"field_key":"name","field_value":"新标题"},
355
386
  {"field_key":"priority","field_value":"P0"}
356
387
  ]}'
@@ -359,61 +390,61 @@ meegle workitem update --work-item-id 12345 \
359
390
  ### 工作项搜索
360
391
 
361
392
  ```bash
362
- # 按标题 / 名称过滤查询空间下的 P0 需求
363
- meegle workitem search-filter --project-key PROJ \
364
- --work-item-type-key STORY_TYPE_KEY \
365
- --name P0
366
- ```
367
-
368
- ### 查看排期
393
+ # 在空间内按名称过滤一个或多个工作项类型
394
+ meegle workitem search-filter \
395
+ --project-key PROJ \
396
+ --work-item-type-keys STORY_TYPE_KEY \
397
+ --work-item-name "登录"
369
398
 
370
- ```bash
371
- # 查看团队成员排期
372
- meegle workhour list-schedule --project-key PROJ \
373
- --start-time 2026-03-01 --end-time 2026-03-31 \
374
- --user-keys "张三,李四,王五"
399
+ # 按字段级条件做高级搜索
400
+ meegle workitem search-by-params \
401
+ --project-key PROJ \
402
+ --work-item-type-key STORY_TYPE_KEY \
403
+ --params '{"search_params":{"conditions":[
404
+ {"field_key":"priority","operator":"=","value":"P0"}
405
+ ]}}'
375
406
  ```
376
407
 
377
408
  ### 查看用户信息
378
409
 
379
410
  ```bash
380
- meegle user query --user-keys "张三,李四"
411
+ # 查看当前登录用户
412
+ meegle user query --user-keys "current_login_user()"
413
+
414
+ # 按邮箱查询
415
+ meegle user query --emails "alice@example.com,bob@example.com"
381
416
  ```
382
417
 
383
418
  ### 部署任务
384
419
 
385
420
  ```bash
386
- # 从发布单上下文准备 deploy-task payload
387
- meegle release deploy-task-prepare \
388
- --project-key PROJ \
389
- --release-id RELEASE_ID \
390
- --appName APP_NAME \
391
- --format json
421
+ # 1. 先验证运行时
422
+ meegle doctor --format json
392
423
 
393
- # 查看一个发布单下的 deploy tasks
424
+ # 2. 列出发布单下的 deploy tasks
394
425
  meegle release deploy-task-list \
395
426
  --project-key PROJ \
396
427
  --release-id RELEASE_ID \
397
428
  --format json
398
429
 
399
- # 结合发布单上下文检查单个 deploy task
430
+ # 3. 查看单个 deploy task 详情(含 pod 状态)
400
431
  meegle release deploy-task-inspect \
432
+ --recordID RECORD_ID \
433
+ --format json
434
+
435
+ # 4. 准备 deploy-task 创建载荷
436
+ meegle release deploy-task-prepare \
401
437
  --project-key PROJ \
402
438
  --release-id RELEASE_ID \
403
- --recordID RECORD_ID \
439
+ --appName APP_NAME \
404
440
  --format json
405
441
 
406
- # 用户确认后,从 release 层申请加白
442
+ # 5. 用户确认后申请加白
407
443
  meegle release deploy-task-apply-white-list \
408
444
  --project-key PROJ \
409
445
  --release-id RELEASE_ID \
410
446
  --recordIDs RECORD_ID \
411
447
  --format json
412
-
413
- # 在高级 Kubelink 层解析可部署应用和 chart
414
- meegle integration kubelink-app-catalog-resolve \
415
- --appName APP_NAME \
416
- --format json
417
448
  ```
418
449
 
419
450
  ## 参数传递
@@ -457,8 +488,11 @@ meegle workitem search-filter --set project_key=PROJ --set work_item_type_keys=W
457
488
  所有命令都支持 `--params` 传入完整 JSON 参数:
458
489
 
459
490
  ```bash
460
- meegle workitem create --project-key PROJ --work-item-type story \
461
- --params '{"fields":[{"field_key":"name","field_value":"标题"}]}'
491
+ meegle workitem create \
492
+ --project-key PROJ \
493
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
494
+ --name "标题" \
495
+ --params '{"fields":[{"field_key":"priority","field_value":"P1"}]}'
462
496
  ```
463
497
 
464
498
  ### 优先级
@@ -542,8 +576,12 @@ meegle workitem +batch-get --project-key PROJ --work-item-ids "12345,12346" \
542
576
  有副作用的命令先用 `--dry-run` 预览请求再执行:
543
577
 
544
578
  ```bash
545
- meegle workitem create --project-key PROJ --work-item-type story \
546
- --params '{"fields":[{"field_key":"name","field_value":"测试"}]}' --dry-run
579
+ meegle workitem create \
580
+ --project-key PROJ \
581
+ --work-item-type-key WORK_ITEM_TYPE_KEY \
582
+ --name "测试" \
583
+ --params '{"fields":[{"field_key":"priority","field_value":"P2"}]}' \
584
+ --dry-run
547
585
  ```
548
586
 
549
587
  ### 命令内省
@@ -566,7 +604,7 @@ MCP SSO 路径:
566
604
  - 执行 `meegle auth login`
567
605
  - 正式安装包默认使用内置的生产 MCP 地址
568
606
  - 仅本地调试或预发覆盖时使用 `meegle config set mcp_server_url ...`
569
- - 然后用 `meegle auth whoami` 查看当前身份和授权范围
607
+ - `meegle auth status` 查看当前会话状态
570
608
 
571
609
  完成登录后,先执行 `meegle doctor --format json`。如果 `doctor`
572
610
  没过,先修配置,再跑业务命令。
@@ -575,7 +613,7 @@ MCP SSO 路径:
575
613
 
576
614
  ```bash
577
615
  meegle auth login
578
- meegle auth whoami --format table
616
+ meegle auth status
579
617
  ```
580
618
 
581
619
  首次引导 / 单次覆盖示例:
@@ -586,7 +624,7 @@ meegle auth login
586
624
 
587
625
  # 或者仅单次覆盖 endpoint
588
626
  meegle auth login --mcp-server-url https://mcp.example.com/mcp
589
- meegle auth whoami --format table
627
+ meegle auth status
590
628
  ```
591
629
 
592
630
  ### 通用 OAuth / Device Code 流程
@@ -633,7 +671,7 @@ meegle config get host
633
671
  - 将 `internal/products/meegle/config.go` 里的 `DefaultRemoteMCPServerURL` 改为生产 `/mcp` 地址
634
672
  - 使用 `make meegle-cli` 构建 CLI 包
635
673
  - 在干净 shell 中安装 staged 或已发布包,执行 `meegle auth login`
636
- - 确认 `meegle auth whoami --format table` 展示正确账号、Meegle user key、项目和业务线
674
+ - 确认 `meegle auth status` 显示活跃会话和正确账号 / 范围
637
675
  - 普通用户侧保持 `mcp_server_url` 未配置;该配置只用于本地或预发覆盖
638
676
 
639
677
  ### 沙盒 / CI:直接注入环境变量
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tingwillforever/meegle-cli",
3
- "version": "1.0.0-dev.20260519131637322",
3
+ "version": "1.0.0",
4
4
  "description": "Agent-First CLI for Meegle (Lark Project)",
5
5
  "license": "MIT",
6
6
  "bin": {