@maxiaochao/pi-toolkit 0.7.0 → 0.7.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2026-09-24 - v0.7.2
2
+
3
+ - bundle the calldiff skill (copied verbatim from tanishqkancharla/calldiff, MIT, pinned to a main commit since upstream has no release tags) for call-stack diffs across git commits; the previous v0.7.1 tarball was briefly unavailable on the registry right after publish and is now served normally
4
+
5
+ ## 2026-09-24 - v0.7.1
6
+
7
+ - bundle the herdr skill (copied verbatim from herdrdev/herdr v0.9.1, Apache-2.0) for driving the Herdr terminal multiplexer from inside a pane; move the tapd CLI skill from .claude/skills into skills/ so it ships with the package
8
+
1
9
  ## 2026-09-23 - v0.7.0
2
10
 
3
11
  - bundle the pi-worktree skill documenting the CLI for agents (the isolation loop, and which commands need an interactive terminal); fix pi-worktree: the .gitignore check tested a path form that never matched the directory-only .worktrees/ pattern, so the rule was re-appended on the first run in every repo and that self-inflicted edit then triggered the uncommitted-changes prompt
package/README.md CHANGED
@@ -85,6 +85,12 @@ The bundled `show-me` skill (derived from [humanlayer/skills](https://github.com
85
85
 
86
86
  The bundled `pdlog` skill decompresses and reads Pudu `.pdlog` proprietary log files, which are binary gibberish when opened directly. It ships a self-contained `ppmd` decompressor (`skills/pdlog/tools/ppmd`, Linux x86-64) and triggers automatically on `.pdlog` files, Pudu logs, ppmd decompression, or logs that open as binary gibberish.
87
87
 
88
+ The bundled `herdr` skill (copied verbatim from [herdrdev/herdr](https://github.com/herdrdev/herdr) at tag `v0.9.1`, Apache-2.0) drives Herdr, a terminal multiplexer for coding agents: inspecting workspaces, tabs, and panes, starting and prompting other agents, running commands in background panes without stealing focus, reading pane output, and waiting on agent lifecycle states. It activates only when you explicitly mention Herdr, and only when the agent itself runs inside a Herdr pane (`HERDR_ENV=1`); outside a pane it refuses to control the session and stops.
89
+
90
+ The bundled `tapd` skill documents the third-party `tapd` CLI ([studyzy/tapd-ai-cli](https://github.com/studyzy/tapd-ai-cli)) for TAPD: requirements, defects, tasks, iterations, wikis, comments, attachments, timesheets, and workflow status maps, including the `--filter` advanced query syntax. It is the CLI's own command reference, so refresh the file with `tapd skill init` when the CLI changes.
91
+
92
+ The bundled `calldiff` skill (copied verbatim from [tanishqkancharla/calldiff](https://github.com/tanishqkancharla/calldiff), MIT, pinned to a `main` commit because upstream has no release tags) teaches call-stack diffs across git commits: `diff` shows which callees appeared, disappeared, or moved under an entrypoint, `tree` prints one call tree, and `reach` finds call paths between two symbols, all with `--entry`/`--file` entrypoint selection, `--locs` source locations, and `--format json` for agents.
93
+
88
94
  ## Tiny Subagent
89
95
 
90
96
  The tiny subagent is a separate npm package. Install it independently when you want the `tiny_subagents` tool:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxiaochao/pi-toolkit",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Personal pi coding agent toolkit: /todos, /btw, /cache_export extensions, browser automation, and bundled theme/skills.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tanishq Kancharla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,19 @@
1
+ calldiff Skill
2
+
3
+ This directory is copied verbatim from the calldiff repository:
4
+ https://github.com/tanishqkancharla/calldiff
5
+ skills/calldiff/SKILL.md at commit 2086f6e4e9ed3c410bba7c94ca3dde77791b1956 (main)
6
+
7
+ The upstream repository is licensed under the MIT License. A copy of that
8
+ license is included in LICENSE.
9
+
10
+ Upstream publishes no release tags, so this file is pinned to a main commit
11
+ instead of a tag. The CLI can also write its own copy with `calldiff skills
12
+ add` (to ~/.agents/skills/calldiff/SKILL.md), but that generated file is terser
13
+ than the committed one — it leaves the --entry/--file descriptions empty and
14
+ says 22 languages — so pi-toolkit ships the committed file.
15
+
16
+ To refresh, copy skills/calldiff/SKILL.md and LICENSE from a newer upstream
17
+ commit and update the commit above. The bundled commands were smoke-tested
18
+ against calldiff 0.5.0 (`diff`, `tree`, `reach`, `--entry`, `--file`,
19
+ `--maxDepth`/`--max-depth`, `--locs`, `--format json`).
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: calldiff
3
+ description: Diff call stacks across git commits — like git diff, but for who-calls-whom. Shows which callees appeared, disappeared, or moved under an entrypoint across 23 languages (diff, tree, and reach). Use for agentic code review when call flow changed and line diffs bury the shape of the change.
4
+ requires_bin: calldiff
5
+ command: calldiff
6
+ ---
7
+
8
+ # calldiff diff
9
+
10
+ Diff call stacks between two git trees
11
+
12
+ ## Arguments
13
+
14
+ | Name | Type | Required | Description |
15
+ |------|------|----------|-------------|
16
+ | `from` | `string` | no | Before ref (default: HEAD) |
17
+ | `to` | `string` | no | After ref (default: working tree) |
18
+ | `paths` | `array` | no | Limit to these path prefixes |
19
+
20
+ ## Options
21
+
22
+ | Flag | Type | Default | Description |
23
+ |------|------|---------|-------------|
24
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
25
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
26
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
27
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
28
+ | `--from` | `string` | | Left / "before" tree |
29
+ | `--to` | `string` | | Right / "after" tree |
30
+
31
+ ## Examples
32
+
33
+ ```sh
34
+ # HEAD vs working tree
35
+ calldiff diff
36
+
37
+ # One ref vs working tree
38
+ calldiff diff main
39
+
40
+ # Two commits / branches
41
+ calldiff diff abc123 def456
42
+
43
+ # Force entrypoints
44
+ calldiff diff main feature --entry createAgentSession
45
+
46
+ # File expands to that file's exports
47
+ calldiff diff main feature --file src/routes.ts
48
+ ```
49
+
50
+ > Semantics match git diff: no refs → HEAD vs worktree; one ref → that vs worktree; two refs → compare those trees.
51
+
52
+ ---
53
+
54
+ # calldiff reach
55
+
56
+ Find all call paths from an entrypoint to a target symbol
57
+
58
+ ## Arguments
59
+
60
+ | Name | Type | Required | Description |
61
+ |------|------|----------|-------------|
62
+ | `ref` | `string` | no | Git ref (default: working tree) |
63
+ | `paths` | `array` | no | Limit to these path prefixes |
64
+
65
+ ## Options
66
+
67
+ | Flag | Type | Default | Description |
68
+ |------|------|---------|-------------|
69
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
70
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
71
+ | `--to` | `string` | | Target symbol to reach (functionName or ClassName.method) |
72
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
73
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
74
+
75
+ ## Examples
76
+
77
+ ```sh
78
+ # Paths in the working tree
79
+ calldiff reach --entry runCheckout --to sendEmail
80
+
81
+ # Paths at a commit, limited to a directory
82
+ calldiff reach HEAD examples/checkout --entry runCheckout --to sendEmail
83
+
84
+ # Paths from every export in a file
85
+ calldiff reach --file packages/api/src/flow.ts --to notify
86
+ ```
87
+
88
+ ---
89
+
90
+ # calldiff tree
91
+
92
+ View a call tree (no diff) for one or more entrypoints
93
+
94
+ ## Arguments
95
+
96
+ | Name | Type | Required | Description |
97
+ |------|------|----------|-------------|
98
+ | `ref` | `string` | no | Git ref (default: working tree) |
99
+ | `paths` | `array` | no | Limit to these path prefixes |
100
+
101
+ ## Options
102
+
103
+ | Flag | Type | Default | Description |
104
+ |------|------|---------|-------------|
105
+ | `--entry` | `unknown` | | Entrypoint symbol(s): functionName or ClassName.method |
106
+ | `--file` | `unknown` | | Entrypoint file(s): indexed source path; expands to that file's exports |
107
+ | `--maxDepth` | `number` | `12` | Max call-tree depth |
108
+ | `--locs` | `boolean` | `false` | Show call-site source locations (file:line) |
109
+
110
+ ## Examples
111
+
112
+ ```sh
113
+ # Tree from working tree
114
+ calldiff tree --entry createAgentSession
115
+
116
+ # Tree from a commit
117
+ calldiff tree HEAD --entry PiService.createAgentSession
118
+
119
+ # Every export in a file
120
+ calldiff tree --file packages/api/src/routes.ts
121
+ ```
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,12 @@
1
+ Herdr Skill
2
+
3
+ This directory is copied verbatim from the Herdr repository:
4
+ https://github.com/herdrdev/herdr (skills/herdr/SKILL.md, tag v0.9.1)
5
+
6
+ The upstream repository is licensed under Apache License 2.0. A copy of that
7
+ license is included in LICENSE.
8
+
9
+ pi-toolkit ships the file unchanged, so the installed skill always matches the
10
+ stable Herdr release it was taken from. Upstream updates SKILL.md only on stable
11
+ releases; to refresh it, copy skills/herdr/SKILL.md and LICENSE from a newer
12
+ Herdr tag and update the tag above.
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: herdr
3
+ description: "Control Herdr, a terminal multiplexer for coding agents. Use only when the user explicitly mentions Herdr or asks to use Herdr to inspect or control panes, tabs, workspaces, commands, or another agent. Do not use merely because a task could benefit from a background terminal, delegation, or parallel work. Requires HERDR_ENV=1."
4
+ ---
5
+
6
+ # Herdr
7
+
8
+ Herdr organizes terminals into workspaces, tabs, and panes, recognizes coding agents running inside panes, and exposes the current session through the `herdr` CLI.
9
+
10
+ Before issuing any control command, verify that this agent is running inside a Herdr-managed pane:
11
+
12
+ ```bash
13
+ test "${HERDR_ENV:-}" = 1
14
+ ```
15
+
16
+ If the check fails, say that you are not running inside Herdr and stop. Do not inspect or control the focused Herdr session from outside Herdr.
17
+
18
+ When the check passes, the `herdr` binary in `PATH` talks to the current session. Use it to inspect neighboring work, create terminal layout, start agents and commands, read output, and wait for state changes.
19
+
20
+ ## Learn the current CLI
21
+
22
+ The installed binary is the authority for command syntax. Start with:
23
+
24
+ ```bash
25
+ herdr --help
26
+ ```
27
+
28
+ Then print the relevant command group by running the group without a subcommand:
29
+
30
+ ```bash
31
+ herdr agent
32
+ herdr pane
33
+ herdr workspace
34
+ herdr tab
35
+ herdr worktree
36
+ herdr terminal
37
+ herdr notification
38
+ herdr integration
39
+ herdr session
40
+ herdr machine
41
+ ```
42
+
43
+ Do not run bare `herdr` for discovery; it launches or attaches the TUI. Do not probe a mutating nested command by omitting arguments. Commands such as `herdr workspace create` are valid with defaults and will execute.
44
+
45
+ Most control commands return JSON. Read identifiers and state from those responses instead of predicting them.
46
+
47
+ ## Understand layout, panes, and agents
48
+
49
+ Choose the primitive that matches the job:
50
+
51
+ - Workspace, tab, and pane topology organize terminal locations.
52
+ - Pane commands control raw terminals, shells, tests, servers, input, and output.
53
+ - Agent commands control the recognized coding agent currently occupying a pane.
54
+
55
+ A pane exists whether or not it contains an agent. `agent start` requires an existing available shell pane and never creates, splits, or moves layout. Use pane commands for ordinary processes. Use agent commands when Herdr must validate agent identity or interpret `idle`, `working`, `blocked`, `done`, and `unknown` lifecycle states.
56
+
57
+ Agent commands accept either a unique live agent name or the pane ID currently hosting that agent. They do not accept terminal IDs or bare agent-kind labels. Names must match `[a-z][a-z0-9_-]{0,31}` and be unique among live agents. A name follows the current pane occupant and is cleared when that agent exits, is released, or is replaced.
58
+
59
+ `idle` and `done` both mean the agent is ready for input. The CLI/API uses the server's seen state to distinguish them; explicit focus commands mark the target seen, while reads do not. Each TUI client tracks viewed completions independently, so its Done badge can differ from the CLI or another client's badge. `blocked` means Herdr recognized an approval or question UI. `unknown` means an agent is present but Herdr cannot classify it confidently; it does not prove completion.
60
+
61
+ ## Use IDs and caller context
62
+
63
+ Public IDs are opaque stable handles:
64
+
65
+ - workspace: `w1`
66
+ - tab: `w1:t1`
67
+ - pane: `w1:p1`
68
+
69
+ Closed tab and pane IDs are not reused. A pane moved into another workspace receives a new workspace-qualified pane ID. After `pane move`, continue with `.result.move_result.pane.pane_id` or the live agent name. The old value is reported as `.result.move_result.previous_pane_id`; only the moved process's inherited caller context keeps resolving that old ID, so do not use it as a general agent target.
70
+
71
+ Herdr injects the caller's context into each managed pane:
72
+
73
+ ```bash
74
+ printf '%s\n' "$HERDR_WORKSPACE_ID" "$HERDR_TAB_ID" "$HERDR_PANE_ID"
75
+ ```
76
+
77
+ Prefer `--current` when a pane command should target the calling pane. An omitted `pane split` target uses the calling pane when `HERDR_PANE_ID` is available, otherwise the focused pane. Other commands may use the UI-focused pane, which can belong to the user or another client.
78
+
79
+ Discover live state with:
80
+
81
+ ```bash
82
+ herdr workspace list
83
+ herdr tab list --workspace "$HERDR_WORKSPACE_ID"
84
+ herdr pane current --current
85
+ herdr pane list --workspace "$HERDR_WORKSPACE_ID"
86
+ herdr agent list
87
+ ```
88
+
89
+ Creation responses expose the IDs to use next. `workspace create` returns `.result.workspace`, `.result.tab`, and `.result.root_pane`. `tab create` returns `.result.tab` and `.result.root_pane`. `pane split` returns the new pane as `.result.pane`.
90
+
91
+ IDs and live agent names are scoped to one server. Two saved SSH machines can both have `w1:p1` or an agent named `reviewer`. Selecting a machine in the TUI does not retarget commands running in your pane: without `--machine`, they still use the inherited session and socket context.
92
+
93
+ To control a saved SSH machine, use the same global prefix for discovery and every later command:
94
+
95
+ ```bash
96
+ herdr --machine <label-or-id> agent list
97
+ herdr --machine <label-or-id> pane list
98
+ herdr --machine <label-or-id> agent prompt <remote-agent-name> "Reply with your current status." --wait --timeout 120000
99
+ ```
100
+
101
+ The selector must be an enabled saved profile ID or a unique, case-sensitive label, not an arbitrary SSH hostname. Commands use that profile's remote session without an open TUI. Do not combine `--machine` with `--session` or `--remote`. Discover IDs on that machine; inherited local IDs and `--current` do not identify remote panes.
102
+
103
+ Both installations must support machine API forwarding, and the remote server must already be running and API-compatible. Forwarding never installs, starts, or restarts a server and never falls back to Local. Local configuration, session management, installation commands, and interactive attachment are not forwarded. Remote worktree paths must be absolute, `~`, or start with `~/`; plugin link paths must be absolute. A connection failure does not prove a mutation was not applied: inspect remote state before retrying.
104
+
105
+ `herdr machine list` lists saved connection profiles, not a cross-machine pane inventory; add `--json` for scripts. Only add, remove, enable, or disable profiles when the user asks. Removing a profile disconnects the client but does not stop remote sessions. Adding a machine uses the remote default session unless `--remote-session` is explicitly supplied. Setup asks before stopping an incompatible server and defaults to No; do not approve replacement without the user's consent. Experimental handoff is not part of `machine add`.
106
+
107
+ ## Start and coordinate an agent
108
+
109
+ Default to a sibling pane in the current tab and the current working directory. Do not create a workspace, tab, worktree, or different cwd unless the user explicitly requests that topology or location.
110
+
111
+ Honor a direction requested by the user. Otherwise inspect the caller pane:
112
+
113
+ ```bash
114
+ herdr pane layout --pane "$HERDR_PANE_ID"
115
+ ```
116
+
117
+ Split a wide pane to the right and a narrow or tall pane down. Avoid repeated same-direction splits that create unusably narrow columns or short rows. Keep the user's focus in the calling pane and explicitly preserve the caller's working directory:
118
+
119
+ ```bash
120
+ herdr pane split --current --direction right --cwd "$PWD" --no-focus
121
+ ```
122
+
123
+ Replace `right` with `down` when appropriate. Read the new pane ID from `.result.pane.pane_id`.
124
+
125
+ An available shell pane must be at its interactive prompt, with the shell itself in the foreground and no foreground command, editor, or agent running. Start a supported agent in that pane with a useful unique name:
126
+
127
+ ```bash
128
+ herdr agent start reviewer --kind codex --pane <returned-pane-id>
129
+ ```
130
+
131
+ Use the kind requested by the user. Run `herdr agent` to inspect the installed kind list and options. Pass native agent arguments only after `--`:
132
+
133
+ ```bash
134
+ herdr agent start reviewer --kind codex --pane <returned-pane-id> -- <agent-args...>
135
+ ```
136
+
137
+ A successful `agent start` returns only after Herdr detects the expected agent in the same pane and considers it ready for interactive input. If the agent is blocked during startup, the command returns `agent_not_ready` immediately but keeps the name available for `agent read` and `agent send-keys`. Wait until the agent becomes idle before prompting it. Startup defaults to a 30-second timeout.
138
+
139
+ Submit work through the agent surface:
140
+
141
+ ```bash
142
+ herdr agent prompt reviewer "Review the current diff and report only actionable findings." --wait --timeout 120000
143
+ ```
144
+
145
+ `agent prompt` honors the pane's live bracketed-paste mode and sends text followed by encoded Enter as one ordered submission. It reports successful submission only after both have been written; that alone does not prove the agent started a turn. For Codex on Windows, Herdr sends a paste boundary before Enter so submission does not depend on prompt size. It rejects an agent already waiting at an approval or question dialog with `agent_blocked` before sending any input. Inspect the blocked UI and ask the user before answering it. For normal agent work, `--wait` is enough: it waits for the first settled `idle`, `done`, or `blocked` state. Do not repeat those defaults with `--until`.
146
+
147
+ With `--wait`, a prompt sent from a non-working state must produce observed `working` or `blocked` activity. After submission, Herdr waits up to five seconds for that activity; unrelated `idle`, `done`, or session changes do not satisfy this gate. It returns `agent_prompt_stalled` if no activity is observed, or `timeout` if the caller's timeout expires first. The caller timeout includes submission time. Without a timeout, the settled-state wait is indefinite after activity is observed. This wait tracks lifecycle state, not an individual turn; if the agent is already working, completion of the active turn may satisfy it.
148
+
149
+ Use `--until` only for a state-specific workflow, such as waiting for an already-running agent to request input:
150
+
151
+ ```bash
152
+ herdr agent wait reviewer --until blocked --timeout 120000
153
+ ```
154
+
155
+ Without `--until`, standalone `agent wait` uses the same settled-state defaults as `agent prompt --wait`.
156
+
157
+ Use logical keys for interactive agent UI controls:
158
+
159
+ ```bash
160
+ herdr agent send-keys reviewer esc
161
+ herdr agent send-keys reviewer ctrl+c
162
+ ```
163
+
164
+ Herdr validates all keys before writing any bytes. Read the result through the resolved agent:
165
+
166
+ ```bash
167
+ herdr agent get reviewer
168
+ herdr agent read reviewer --source recent-unwrapped --lines 120
169
+ ```
170
+
171
+ If a wait fails or returns `blocked`, inspect `agent get` and `agent read` before deciding what input to send. A timeout or stalled response does not prove the prompt was never delivered; do not blindly submit it again. Use the pane surface only when raw terminal control is intentional.
172
+
173
+ ## Run an ordinary command in another pane
174
+
175
+ Create a sibling pane with the same geometry rule, preserve the caller's working directory, and keep user focus unchanged:
176
+
177
+ ```bash
178
+ herdr pane split --current --direction right --cwd "$PWD" --no-focus
179
+ ```
180
+
181
+ Read the new pane ID from `.result.pane.pane_id`, then run and inspect the command:
182
+
183
+ ```bash
184
+ herdr pane run <returned-pane-id> "just test"
185
+ herdr pane wait-output <returned-pane-id> --match "test result" --timeout 120000
186
+ herdr pane read <returned-pane-id> --source recent-unwrapped --lines 120
187
+ ```
188
+
189
+ `pane run` atomically sends command text and Enter. `pane wait-output` searches the selected snapshot immediately, so output that already exists can match. Use `--match <text>` for a literal substring or `--regex <pattern>` for a Rust regular expression. Omitting `--timeout` allows an indefinite wait.
190
+
191
+ Use the read source that matches the task:
192
+
193
+ - `visible`: the currently rendered viewport.
194
+ - `recent`: recent rendered output, including soft wraps.
195
+ - `recent-unwrapped`: recent output with soft wraps joined; prefer it for logs and transcripts.
196
+ - `detection`: the plain-text bottom-buffer snapshot used for agent detection.
197
+
198
+ Use `--format ansi` when colors and terminal styling are evidence. Otherwise use text.
199
+
200
+ `--lines` asks Herdr for more rows from the pane's available screen and host scrollback. Alternate-screen rows do not enter ordinary host scrollback. For supported idle agents, Herdr can collect application-owned history and restore the viewport afterward, but not every application or response can be recovered this way.
201
+
202
+ If a larger recent read still does not reveal the completed response, ask the agent to write it as Markdown in a temporary directory and reply only with the file path, then read that file on the same machine. Use this only as a fallback; do not request file output in the initial prompt.
203
+
204
+ ## Safety and coordination rules
205
+
206
+ - Use `--no-focus` for background work unless the user asked to switch context.
207
+ - Use `--current`, an explicit pane ID, or a unique agent name. Do not rely on another client's focused pane.
208
+ - Parse IDs from JSON responses. Do not derive them from sidebar order or examples.
209
+ - Do not close workspaces, tabs, panes, or sessions you did not create unless the user explicitly asked. `workspace close --group` closes the primary workspace and its linked worktree workspaces; never add it merely to bypass `workspace_group_close_required`.
210
+ - Use `--trust-repository` only after the user has verified the repository. It grants per-request Git trust; it is not a routine retry for a failed worktree command.
211
+ - Client and server versions can differ after an update. Check `herdr status` before relying on new server features. A missing method is not permission to stop or upgrade a server.
212
+ - Never run `herdr server stop` from an active session unless the user explicitly intends to stop the server and its pane processes.
213
+ - Never kill the main Herdr process. Use named test sessions for experiments that need an isolated server.
214
+ - CLI server errors are JSON on stderr with exit status 1. CLI syntax errors exit with status 2.
@@ -0,0 +1,487 @@
1
+ ---
2
+ name: tapd
3
+ description: TAPD操作,涉及需求,缺陷,任务,Wiki等。tapd.cn快捷查询:tapd url <url>
4
+ ---
5
+
6
+ 面向 AI Agent 的 TAPD 命令行工具。通过 `tapd` 命令与 TAPD 平台交互,所有输出针对最小 token 消耗优化。
7
+
8
+ ## 安装
9
+
10
+ ```bash
11
+ go install github.com/studyzy/tapd-ai-cli/cmd/tapd@latest
12
+ ```
13
+
14
+ ## 认证
15
+
16
+ ```bash
17
+ # Access Token(推荐)
18
+ export TAPD_ACCESS_TOKEN=<your_token>
19
+
20
+ # 或交互式登录持久化凭据
21
+ tapd auth login
22
+ ```
23
+
24
+ 凭据优先级:CLI flags > 环境变量 > `./.tapd.json` > `~/.tapd.json`
25
+
26
+ ## 高级过滤(--filter)
27
+
28
+ 所有 `list` 命令均支持 `--filter` 标志,可重复使用,直接透传 TAPD OpenAPI 的高级查询语法:
29
+
30
+ ```bash
31
+ tapd story list --filter "name=LIKE<登录>" --filter "status=EQ<已实现>"
32
+ tapd bug list --filter "created=>2024-01-01" --filter "custom_field_one=EQ<高优先级>"
33
+ tapd task list --filter "owner=USER_OR<张三|李四>"
34
+ ```
35
+
36
+ ### 支持的操作符
37
+
38
+ | 操作符 | 含义 | 示例 |
39
+ |--------|------|------|
40
+ | `LIKE<value>` | 模糊匹配 | `name=LIKE<登录>` |
41
+ | `EQ<value>` | 精确匹配 | `status=EQ<已实现>` |
42
+ | `NOT_EQ<value>` | 不等于 | `status=NOT_EQ<已关闭>` |
43
+ | `LIKE_OR<v1\|v2>` | 模糊匹配多个值(OR) | `name=LIKE_OR<登录\|注册>` |
44
+ | `CONTAINS<v1\|v2>` | 包含所有值(AND) | `label=CONTAINS<前端\|高优>` |
45
+ | `CONTAINS_OR<v1\|v2\|v3>` | 包含任一值(OR) | `status=CONTAINS_OR<开发中\|测试中>` |
46
+ | `USER_OR<u1\|u2>` | 多人查询(OR) | `owner=USER_OR<张三\|李四>` |
47
+ | `>` / `<` | 大于/小于(时间/数值) | `created=>2024-01-01` |
48
+ | `~` | 时间范围 | `created=2024-01-01~2024-12-31` |
49
+ | `\|` | 多值 OR | `status=开发中\|测试中` |
50
+ | `<>` | 不等于(简写) | `status=<>已关闭` |
51
+
52
+ ### 适用字段
53
+
54
+ - 标准字段(name/title/status/owner/created 等)
55
+ - 自定义字段(custom_field_one、custom_field_two 等,用 `custom-field list --entity-type stories` 查看可用字段)
56
+
57
+ `--filter` 与已有标志(`--status`、`--owner` 等)可组合使用,参数会合并传递给 API。
58
+
59
+ ## 命令参考
60
+
61
+ ### url — 根据 TAPD URL 查询对应条目详情(支持需求、缺陷、任务、Wiki)
62
+
63
+ ```bash
64
+ tapd url <url> # 根据 TAPD URL 查询对应条目详情(支持需求、缺陷、任务、Wiki)
65
+ ```
66
+
67
+ ### story — 需求管理
68
+
69
+ ```bash
70
+ tapd story count [--status=<用 workflow status-map 查询可用值>] # 查询需求数量
71
+ tapd story create [--begin=<格式:2006-01-02>] [--category-id] [--cc] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--developer] [--due=<格式:2006-01-02>] [--iteration-id] [--label=<多个以竖线分隔>] --name=<必需> [--owner] [--parent-id=<创建子需求时使用>] [--priority=<High/Middle/Low/Nice To Have>] # 创建需求
72
+ tapd story list [--category-id] [--fields=<逗号分隔,如 "id,name,status,module">] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--iteration-id] [--label] [--limit=10] [--name] [--order=<如 "created desc">] [--owner] [--page=1] [--priority] [--status=<用 workflow status-map 查询可用值>] # 查询需求列表
73
+ tapd story show <story_id> # 查看需求详情
74
+ tapd story todo [--limit=10] [--page=1] # 查询当前用户待办需求
75
+ tapd story update <story_id> [--begin=<格式:2006-01-02>] [--category-id] [--cc] [--current-user] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--developer] [--due=<格式:2006-01-02>] [--iteration-id] [--label=<多个以竖线分隔>] [--name] [--owner] [--priority=<High/Middle/Low/Nice To Have>] [--status=<用 workflow status-map 查询可用值>] # 更新需求
76
+ ```
77
+
78
+ ### comment — 评论管理
79
+
80
+ ```bash
81
+ tapd comment add [--author=<可选,默认使用当前登录用户>] [--description=<text>|--file=<path>|stdin] --entry-id=<必需> --entry-type=<stories|bug|bug_remark|tasks|wiki> [--reply-id=<可选>] # 添加评论
82
+ tapd comment count [--entry-id] [--entry-type=<stories|bug|bug_remark|tasks|wiki>] # 查询评论数量
83
+ tapd comment list [--author] [--entry-id] [--entry-type=<stories|bug|bug_remark|tasks|wiki>] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--order=<如 created desc>] [--page=1] # 查询评论列表
84
+ tapd comment update <comment_id> [--description=<text>|--file=<path>|stdin] # 更新评论
85
+ ```
86
+
87
+ ### task — 任务管理
88
+
89
+ ```bash
90
+ tapd task count [--status=<open/progressing/done>] # 查询任务数量
91
+ tapd task create [--begin=<格式:2006-01-02>] [--cc] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--due=<格式:2006-01-02>] [--effort] [--iteration-id] [--label=<多个以竖线分隔>] --name=<必需> [--owner] [--priority=<High/Middle/Low/Nice To Have>] [--story-id] # 创建任务
92
+ tapd task list [--fields=<逗号分隔,如 "id,name,status,module">] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--iteration-id] [--label] [--limit=10] [--name] [--order=<如 "created desc">] [--owner] [--page=1] [--priority] [--status=<open/progressing/done>] [--story-id] # 查询任务列表
93
+ tapd task show <task_id> # 查看任务详情
94
+ tapd task todo [--limit=10] [--page=1] # 查询当前用户待办任务
95
+ tapd task update <task_id> [--begin=<格式:2006-01-02>] [--cc] [--current-user] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--due=<格式:2006-01-02>] [--effort] [--iteration-id] [--label=<多个以竖线分隔>] [--name] [--owner] [--priority=<High/Middle/Low/Nice To Have>] [--status=<open/progressing/done>] [--story-id] # 更新任务
96
+ ```
97
+
98
+ ### bug — 缺陷管理
99
+
100
+ ```bash
101
+ tapd bug count [--status=<用 workflow status-map 查询可用值>] # 查询缺陷数量
102
+ tapd bug create [--begin=<格式:2006-01-02>] [--cc] [--current-owner] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--due=<格式:2006-01-02>] [--iteration-id] [--label=<多个以竖线分隔>] [--module] [--priority=<urgent/high/medium/low/insignificant>] [--severity=<fatal/serious/normal/prompt/advice>] --title=<必需> # 创建缺陷
103
+ tapd bug list [--fields=<逗号分隔,如 "id,title,status,module">] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--iteration-id] [--label] [--limit=10] [--module] [--order=<如 "created desc">] [--owner] [--page=1] [--priority=<urgent/high/medium/low/insignificant>] [--reporter] [--severity=<fatal/serious/normal/prompt/advice>] [--status=<用 workflow status-map 查询可用值>] [--title] # 查询缺陷列表
104
+ tapd bug show <bug_id> # 查看缺陷详情
105
+ tapd bug todo [--limit=10] [--page=1] # 查询当前用户待办缺陷
106
+ tapd bug update <bug_id> [--begin=<格式:2006-01-02>] [--cc] [--current-user] [--custom-field=<可重复,格式:key=value>] [--description=<text>|--file=<path>|stdin] [--due=<格式:2006-01-02>] [--label=<多个以竖线分隔>] [--module] [--owner=<current_owner>] [--priority=<urgent/high/medium/low/insignificant>] [--resolution] [--severity=<fatal/serious/normal/prompt/advice>] [--status=<用 workflow status-map 查询可用值>] [--title] # 更新缺陷
107
+ ```
108
+
109
+ ### attachment — 附件管理
110
+
111
+ ```bash
112
+ tapd attachment list --entry-id=<必需> [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--page=1] [--type=<story|bug|task>] # 查询条目的附件列表
113
+ ```
114
+
115
+ ### auth — 认证管理
116
+
117
+ ```bash
118
+ tapd auth login [--local] # 登录并持久化凭据到配置文件
119
+ ```
120
+
121
+ ### category — 需求分类管理
122
+
123
+ ```bash
124
+ tapd category list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--name=<支持模糊匹配,如 %搜索词%>] # 查询需求分类列表
125
+ ```
126
+
127
+ ### commit-msg — 源码提交关键字管理
128
+
129
+ ```bash
130
+ tapd commit-msg get --object-id=<必需> [--type=<story|task|bug>] # 获取源码提交关键字(用于关联 git commit 到 TAPD 条目)
131
+ ```
132
+
133
+ ### custom-field — 自定义字段管理
134
+
135
+ ```bash
136
+ tapd custom-field list --entity-type=<stories|tasks|iterations|tcases> [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] # 获取自定义字段配置
137
+ ```
138
+
139
+ ### image — 图片管理
140
+
141
+ ```bash
142
+ tapd image get --image-path=<必需,从条目描述中获取> # 获取图片下载链接
143
+ ```
144
+
145
+ ### iteration — 迭代管理
146
+
147
+ ```bash
148
+ tapd iteration count [--status=<open/done>] # 查询迭代数量
149
+ tapd iteration create --creator=<必需> [--description] --enddate=<必需,格式:2006-01-02> [--label=<多个以竖线分隔>] --name=<必需> [--parent-id] --startdate=<必需,格式:2006-01-02> [--status=<open/done,默认 open>] # 创建迭代
150
+ tapd iteration list [--creator] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--name] [--order=<如 "created desc">] [--page=1] [--status=<open/done>] # 查询迭代列表
151
+ tapd iteration update <iteration_id> --current-user=<必需> [--description] [--enddate=<格式:2006-01-02>] [--name] [--startdate=<格式:2006-01-02>] [--status=<open/done>] # 更新迭代
152
+ ```
153
+
154
+ ### qiwei — 企业微信消息管理
155
+
156
+ ```bash
157
+ tapd qiwei send --msg=<Markdown 格式> --webhook=<必需,也可通过 BOT_URL 环境变量设置> # 发送消息到企业微信群(通过机器人 Webhook)
158
+ ```
159
+
160
+ ### relation — 关联关系管理
161
+
162
+ ```bash
163
+ tapd relation bugs --story-id=<必需> # 查询需求关联的缺陷
164
+ tapd relation create --source-id=<必需> --source-type=<story|bug|task> --target-id=<必需> --target-type=<story|bug|task> # 创建实体关联关系
165
+ ```
166
+
167
+ ### release — 发布计划管理
168
+
169
+ ```bash
170
+ tapd release list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] # 查询发布计划列表
171
+ ```
172
+
173
+ ### skill — AI Coding 工具 Skill 管理
174
+
175
+ ```bash
176
+ tapd skill init # 为 AI Coding 工具生成 TAPD CLI 的 SKILL.md
177
+ ```
178
+
179
+ ### story-field — 需求字段信息
180
+
181
+ ```bash
182
+ tapd story-field info # 获取需求字段及候选值
183
+ tapd story-field label # 获取需求字段中英文名
184
+ ```
185
+
186
+ ### tcase — 测试用例管理
187
+
188
+ ```bash
189
+ tapd tcase batch-create --tcases=<必需> # 批量创建测试用例
190
+ tapd tcase create [--creator] [--expectation] [--id=<有值时为更新,无值时为创建>] --name=<创建时必需> [--precondition] [--priority=<high/medium/low>] [--status=<updating|abandon|normal>] [--steps] [--type=<functional/performance/other>] # 创建或更新测试用例
191
+ tapd tcase list [--creator] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--page=1] [--priority=<high/medium/low>] [--status=<updating|abandon|normal>] # 查询测试用例列表
192
+ ```
193
+
194
+ ### timesheet — 花费工时管理
195
+
196
+ ```bash
197
+ tapd timesheet add --entity-id=<必需> --entity-type=<story|task|bug> [--memo=<可选>] [--owner=<可选,默认当前用户>] [--spentdate=<可选>] [--timeremain=<可选>] --timespent=<必需> # 填写花费工时
198
+ tapd timesheet list [--entity-id] [--entity-type=<story|task|bug>] [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--owner] [--page=1] # 查询花费工时列表
199
+ tapd timesheet update <timesheet_id> [--memo] [--timeremain] [--timespent] # 更新花费工时
200
+ ```
201
+
202
+ ### wiki — Wiki 文档管理
203
+
204
+ ```bash
205
+ tapd wiki create [--content=<Markdown 格式>] --creator=<必需> [--file] --name=<必需> [--note] [--parent-wiki-id] # 创建 Wiki 文档
206
+ tapd wiki list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--name] [--page=1] # 查询 Wiki 文档列表
207
+ tapd wiki show <wiki_id> # 查看 Wiki 文档详情
208
+ tapd wiki update <wiki_id> [--content=<Markdown 格式>] [--file] [--name] [--note] [--parent-wiki-id] # 更新 Wiki 文档
209
+ ```
210
+
211
+ ### workflow — 工作流状态管理
212
+
213
+ ```bash
214
+ tapd workflow last-steps --system=<story|bug> [--workitem-type-id] # 获取结束状态
215
+ tapd workflow status-map --system=<story|bug> --workitem-type-id=<必需> # 获取状态中英文映射
216
+ tapd workflow transitions --system=<story|bug> --workitem-type-id=<必需> # 获取状态流转规则
217
+ ```
218
+
219
+ ### workitem-type — 需求类别管理
220
+
221
+ ```bash
222
+ tapd workitem-type list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=30] [--name] [--page=1] # 获取需求类别列表
223
+ ```
224
+
225
+ ### workspace — 工作区管理
226
+
227
+ ```bash
228
+ tapd workspace info # 查看当前工作区详情
229
+ tapd workspace list # 列出参与的项目
230
+ tapd workspace switch <workspace_id> # 切换当前工作区(写入当前目录 .tapd.json)
231
+ ```
232
+
233
+ ### story — 需求管理
234
+
235
+ ```bash
236
+ tapd story batch-update [--current-user] --ids=<逗号分隔> [--owner] [--priority] [--status] # 批量更新需求
237
+ tapd story copy <story_id> [--current-user] # 复制需求
238
+ tapd story link add --story-id=<必需> --target-id=<必需> # 创建需求关联关系
239
+ tapd story link list --story-id=<必需> # 查询需求关联关系
240
+ tapd story link remove --story-id=<必需> --target-id=<必需> # 解除需求关联关系
241
+ tapd story removed [--limit=<默认 30,最大 200>] [--page] # 查询回收站中的需求
242
+ tapd story template list [--workitem-type-id] # 查询需求模板列表
243
+ tapd story time-relation delete --current-user=<必需> --related-id=<必需> --story-id=<必需> # 删除需求前后置关系
244
+ tapd story time-relation list --story-id=<必需> # 查询需求前后置关系
245
+ ```
246
+
247
+ ### task — 任务管理
248
+
249
+ ```bash
250
+ tapd task batch-update [--current-user] --ids=<逗号分隔> [--owner] [--status] # 批量更新任务
251
+ tapd task removed [--limit=<默认 30,最大 200>] [--page] # 查询回收站中的任务
252
+ ```
253
+
254
+ ### bug — 缺陷管理
255
+
256
+ ```bash
257
+ tapd bug batch-update [--current-user] --ids=<逗号分隔> [--owner] [--status] # 批量更新缺陷
258
+ tapd bug copy <bug_id> [--current-user] # 复制缺陷
259
+ tapd bug link add --bug-id=<必需> --target-bug-ids=<多个以逗号分隔> # 创建缺陷关联关系
260
+ tapd bug link list --bug-id=<必需> # 查询缺陷关联关系
261
+ tapd bug link remove --bug-id=<必需> --link-ids=<多个以逗号分隔> # 取消缺陷关联关系
262
+ tapd bug related-stories --bug-id=<必需> # 查询缺陷关联的需求
263
+ tapd bug removed [--limit=<默认 30,最大 200>] [--page] # 查询回收站中的缺陷
264
+ tapd bug template list # 查询缺陷模板列表
265
+ ```
266
+
267
+ ### app-version — 版本管理
268
+
269
+ ```bash
270
+ tapd app-version count # 查询版本数量
271
+ tapd app-version create --creator=<必需> [--description] --name=<必需> # 创建版本
272
+ tapd app-version list [--limit=30] [--name] [--page=1] [--status=<Closed/Unclosed>] # 查询版本列表
273
+ tapd app-version update <version_id> [--description] --modifier=<必需> [--name] # 更新版本
274
+ ```
275
+
276
+ ### attachment — 附件管理
277
+
278
+ ```bash
279
+ tapd attachment download --id=<必需> # 获取附件下载链接
280
+ tapd attachment upload --custom-field=<必需> --entry-id=<必需> --file=<必需> --type=<如 story_custom_field> # 上传附件
281
+ ```
282
+
283
+ ### baseline — 基线管理
284
+
285
+ ```bash
286
+ tapd baseline count # 查询基线数量
287
+ tapd baseline create [--description] [--name] [--version-id] # 创建基线
288
+ tapd baseline list [--limit=30] [--name] [--page=1] # 查询基线列表
289
+ tapd baseline update <baseline_id> [--description] [--name] # 更新基线
290
+ ```
291
+
292
+ ### category — 需求分类管理
293
+
294
+ ```bash
295
+ tapd category count # 查询需求分类数量
296
+ tapd category create [--description] --name=<必需> [--parent-id] # 创建需求分类
297
+ tapd category update <category_id> [--description] [--name] # 更新需求分类
298
+ ```
299
+
300
+ ### change — 变更历史管理
301
+
302
+ ```bash
303
+ tapd change count [--entity-id] --type=<story|bug|task> # 查询变更数量
304
+ tapd change list --entity-id=<迭代变更时必需> [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--page=1] --type=<story|bug|task|iteration> # 查询变更历史
305
+ ```
306
+
307
+ ### feature — 特性管理
308
+
309
+ ```bash
310
+ tapd feature count # 查询特性数量
311
+ tapd feature create [--description] --name=<必需> # 创建特性
312
+ tapd feature list [--limit=30] [--name] [--page=1] # 查询特性列表
313
+ tapd feature update <feature_id> [--description] [--name] [--owner] # 更新特性
314
+ ```
315
+
316
+ ### image — 图片管理
317
+
318
+ ```bash
319
+ tapd image upload --custom-field=<必需> --entry-id=<必需> --file=<必需,≤15MB> # 以 base64 方式上传图片
320
+ ```
321
+
322
+ ### iteration — 迭代管理
323
+
324
+ ```bash
325
+ tapd iteration lock <iteration_id> [--lock-types=<__ALL_STORY__/__ALL_BUG__,多个以逗号分隔>] # 锁定迭代
326
+ tapd iteration unlock <iteration_id> # 解锁迭代
327
+ ```
328
+
329
+ ### label — 标签管理
330
+
331
+ ```bash
332
+ tapd label add [--color=<1|2|3|4>] --name=<必需,不能包含英文竖线> # 创建标签
333
+ tapd label count [--name=<支持模糊匹配>] # 查询标签数量
334
+ tapd label list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=<最大 200>] [--name=<支持模糊匹配>] [--page=1] # 查询标签列表
335
+ tapd label update <label_id> [--color=<1|2|3|4>] # 更新标签
336
+ ```
337
+
338
+ ### launch — 发布评审管理
339
+
340
+ ```bash
341
+ tapd launch count [--creator] [--id] [--release-type] [--status=<initial/auditing/signing/sign_completed/finished;初始化/评审中/待签发/签发结束/发布结束>] [--title] # 查询发布评审数量
342
+ tapd launch create [--alias-field=[]] [--archived-by] [--baseline] [--cc] [--creator=<默认当前用户>] [--custom-field=[]] [--release-model] [--release-type] [--roadmap-version] [--signed-by] --template-id=<必需> [--title] [--version-type] # 创建发布评审
343
+ tapd launch fields # 查询发布评审自定义字段配置
344
+ tapd launch list [--creator] [--fields=<逗号分隔>] [--id] [--limit=10] [--page=1] [--release-type] [--status=<initial/auditing/signing/sign_completed/finished;初始化/评审中/待签发/签发结束/发布结束>] [--title] # 查询发布评审列表
345
+ tapd launch logs --id=<必需> # 查询发布评审活动日志
346
+ tapd launch templates # 查询发布评审模板
347
+ tapd launch update <launch_form_id> [--alias-field=[]] [--archived-by] [--baseline] [--cc] [--change-notifier] [--change-type] [--custom-field=[]] [--release-comment] [--release-model] [--release-result=<release_success/release_fail>] [--release-type] [--remark] [--roadmap-version] [--signed-by] [--signer-comment] [--status=<initial/auditing/signing/sign_completed/finished;初始化/评审中/待签发/签发结束/发布结束>] [--title] [--version-type] # 更新发布评审
348
+ ```
349
+
350
+ ### module — 模块管理
351
+
352
+ ```bash
353
+ tapd module count # 查询模块数量
354
+ tapd module create [--description] --name=<必需> [--owner] # 创建模块
355
+ tapd module list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=30] [--name] [--page=1] # 查询模块列表
356
+ tapd module update <module_id> [--description] [--name] [--owner] # 更新模块
357
+ ```
358
+
359
+ ### release — 发布计划管理
360
+
361
+ ```bash
362
+ tapd release count # 查询发布计划数量
363
+ tapd release create [--description] --enddate=<格式:2006-01-02> --name=<必需> --startdate=<格式:2006-01-02> # 创建发布计划
364
+ tapd release update <release_id> [--enddate=<格式:2006-01-02>] [--name] [--startdate=<格式:2006-01-02>] [--status] # 更新发布计划
365
+ ```
366
+
367
+ ### report — 项目报告管理
368
+
369
+ ```bash
370
+ tapd report list [--limit=30] [--page=1] # 查询项目报告列表
371
+ ```
372
+
373
+ ### source — 源码提交关联管理
374
+
375
+ ```bash
376
+ tapd source add [--author] [--commit-id] [--commit-time] [--commit-url] [--files=<逗号分隔>] --message=<必需> [--repo] [--repo-id] [--web-url] # 保存 Commit 提交数据
377
+ tapd source list --object-id=<必需> --type=<必需> # 获取 GIT 关联提交数据
378
+ tapd source objects --commit-id=<必需,支持逗号分隔多个> --type=<必需> # 获取指定 commit 关联的 TAPD 业务对象
379
+ ```
380
+
381
+ ### tcase — 测试用例管理
382
+
383
+ ```bash
384
+ tapd tcase update <tcase_id> [--expectation] [--name] [--precondition] [--priority=<high/medium/low>] [--status=<updating|abandon|normal>] [--steps] # 更新测试用例
385
+ ```
386
+
387
+ ### test-plan — 测试计划管理
388
+
389
+ ```bash
390
+ tapd test-plan bugs --id=<必需> # 查询测试计划关联的缺陷
391
+ tapd test-plan count [--status] # 查询测试计划数量
392
+ tapd test-plan create [--description] [--end-date] [--iteration-id] --name=<必需> [--owner] [--start-date] # 创建测试计划
393
+ tapd test-plan list [--filter=<可重复,格式:field=OP<value>,支持 LIKE/EQ/CONTAINS 等 OpenAPI 特殊查询语法>] [--limit=10] [--name] [--page=1] [--status] # 查询测试计划列表
394
+ tapd test-plan progress --id=<必需> # 查询测试计划执行进度
395
+ tapd test-plan tcases --id=<必需> [--limit=30] [--page=1] # 查询测试计划关联的测试用例
396
+ tapd test-plan update <test_plan_id> [--description] [--name] [--owner] [--status] # 更新测试计划
397
+ ```
398
+
399
+ ### testx — TAPD testx 模块(用例/计划/报告/设计)
400
+
401
+ ```bash
402
+ tapd testx case batch-bind-bug --case-uid=<必填> [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 批量关联 Bug
403
+ tapd testx case batch-create [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 批量创建用例
404
+ tapd testx case batch-unbind-bug --case-uid=<必填> [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 批量解绑 Bug
405
+ tapd testx case batch-update [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 批量更新用例
406
+ tapd testx case create [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 创建用例
407
+ tapd testx case folder-create [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 创建用例目录
408
+ tapd testx case folder-update [--data=<用于填充 body 字段>] --folder-uid=<必填> --repo-uid=<必填> --repo-version-uid=<必填> # 更新用例目录
409
+ tapd testx case list-bug --case-uid=<必填> [--data=<用于填充 body 字段>] [--handler] [--limit] [--name] [--offset] [--priority] --repo-uid=<必填> --repo-version-uid=<必填> [--status] # 用例关联缺陷列表
410
+ tapd testx case list-execution --case-uid=<必填> [--data=<用于填充 body 字段>] [--limit] [--offset] [--ordering] --repo-uid=<必填> --repo-version-uid=<必填> # 用例执行记录
411
+ tapd testx case list-history --case-uid=<必填> [--data=<用于填充 body 字段>] [--limit] [--offset] --repo-uid=<必填> --repo-version-uid=<必填> # 用例变更历史
412
+ tapd testx case list-review --case-uid=<必填> [--data=<用于填充 body 字段>] [--is-last-review] [--limit] [--main-uid] [--offset] --repo-uid=<必填> --repo-version-uid=<必填> [--source] [--source-kind] [--source-uid] # 用例评审记录
413
+ tapd testx case list-template [--data=<用于填充 body 字段>] # 用例模板列表
414
+ tapd testx case repo-create [--data=<用于填充 body 字段>] # 创建用例仓库
415
+ tapd testx case repo-get [--data=<用于填充 body 字段>] --repo-uid=<必填> # 获取用例仓库
416
+ tapd testx case repo-list [--data=<用于填充 body 字段>] [--limit] [--offset] [--reverse] [--search] # 获取用例仓库列表
417
+ tapd testx case repo-update [--data=<用于填充 body 字段>] --repo-uid=<必填> # 更新用例仓库
418
+ tapd testx case search [--data=<用于填充 body 字段>] [--limit] [--offset] --repo-uid=<必填> --repo-version-uid=<必填> # 搜索用例
419
+ tapd testx case update --case-uid=<必填> [--data=<用于填充 body 字段>] --repo-uid=<必填> --repo-version-uid=<必填> # 更新用例
420
+ tapd testx design list-labels [--design-uid] [--kind] [--name] # 测试设计标签
421
+ tapd testx design list-stat [--data=<用于填充 body 字段>] # 测试设计统计
422
+ tapd testx design search [--data=<用于填充 body 字段>] # 搜索测试设计
423
+ tapd testx plan batch-archive [--data=<用于填充 body 字段>] # 批量归档计划
424
+ tapd testx plan batch-update-case [--data=<用于填充 body 字段>] --plan-uid=<必填> # 批量更新计划用例
425
+ tapd testx plan bind-bug [--data=<用于填充 body 字段>] --plan-uid=<必填> # 计划用例批量关联缺陷
426
+ tapd testx plan bug-statistics [--data=<用于填充 body 字段>] # 计划关联缺陷统计
427
+ tapd testx plan create [--data=<用于填充 body 字段>] # 创建计划
428
+ tapd testx plan folder-children [--data=<用于填充 body 字段>] [--item-type] [--name] [--plan-archive] [--plan-states=<可重复>] --uid=<必填> [--with-ancestor] [--with-descendant] # 获取目录子信息
429
+ tapd testx plan folder-create [--data=<用于填充 body 字段>] # 创建计划目录
430
+ tapd testx plan folder-update [--data=<用于填充 body 字段>] --folder-uid=<必填> # 更新计划目录
431
+ tapd testx plan get [--data=<用于填充 body 字段>] --uid=<必填> [--with-detail] [--with-statistic] # 获取计划详情
432
+ tapd testx plan list [--data=<用于填充 body 字段>] --folder-uid=<必填> # 目录下计划列表
433
+ tapd testx plan list-bugs [--bug-id] [--data=<用于填充 body 字段>] [--limit] [--offset] --plan-uid=<必填> [--related-types=<多个用逗号分隔>] [--status] [--summary] # 计划关联缺陷列表
434
+ tapd testx plan list-case-events --case-uid=<必填> [--data=<用于填充 body 字段>] [--limit] [--offset] --plan-uid=<必填> # 计划下用例事件
435
+ tapd testx plan list-case-issues --case-uid=<必填> [--data=<用于填充 body 字段>] --issue-type=<必填> [--limit] [--offset] --plan-uid=<必填> # 计划下用例关联缺陷
436
+ tapd testx plan list-cases [--data=<用于填充 body 字段>] --uid=<必填> # 计划下用例列表
437
+ tapd testx plan list-history [--data=<用于填充 body 字段>] [--limit] [--offset] --plan-uid=<必填> # 计划变更历史
438
+ tapd testx plan list-stories [--data=<用于填充 body 字段>] [--limit] [--offset] --plan-uid=<必填> # 计划关联需求列表
439
+ tapd testx plan list-templates [--data=<用于填充 body 字段>] [--limit] [--offset] # 计划模板列表
440
+ tapd testx plan statistics [--data=<用于填充 body 字段>] # 计划统计信息
441
+ tapd testx plan unbind-bug --case-uid=<必填> [--data=<用于填充 body 字段>] --issue-uid=<必填> --plan-uid=<必填> # 移除计划用例关联缺陷
442
+ tapd testx plan update [--data=<用于填充 body 字段>] --uid=<必填> # 更新计划
443
+ tapd testx plan update-target-scope [--data=<用于填充 body 字段>] --uid=<必填> # 更新计划范围目标
444
+ tapd testx report get --uid=<必填> # 报告详情
445
+ tapd testx report get-data --report-uid=<必填> --template-uid=<必填> # 报告详情数据
446
+ tapd testx report list [--creators=<逗号分隔>] [--end-at] [--limit] [--offset] [--plan-uids=<逗号分隔>] [--search] [--source] [--sources=<逗号分隔>] [--start-at] [--template-uid] [--with-associated] # 报告列表
447
+ tapd testx report list-templates [--limit] [--offset] # 报告模板列表
448
+ ```
449
+
450
+ ### timesheet — 花费工时管理
451
+
452
+ ```bash
453
+ tapd timesheet count [--entity-id] [--entity-type=<story|task|bug>] [--owner] # 查询花费工时数量
454
+ tapd timesheet delete --cost-ids=<多个以逗号分隔> --entity-id=<必需> --entity-type=<story|task|bug> # 删除花费工时
455
+ ```
456
+
457
+ ### user — 用户信息管理
458
+
459
+ ```bash
460
+ tapd user info # 获取当前用户信息
461
+ tapd user views [--type=<目前只支持 story>] # 获取用户视图列表
462
+ ```
463
+
464
+ ### wiki — Wiki 文档管理
465
+
466
+ ```bash
467
+ tapd wiki count # 查询 Wiki 文档数量
468
+ ```
469
+
470
+ ### workflow — 工作流状态管理
471
+
472
+ ```bash
473
+ tapd workflow first-step --system=<story|bug> [--workitem-type-id] # 获取工作流起始状态
474
+ tapd workflow list --system=<story|bug> [--workitem-type-id] # 获取工作流列表
475
+ ```
476
+
477
+ ### workspace — 工作区管理
478
+
479
+ ```bash
480
+ tapd workspace documents [--limit=<默认 30,最大 200>] [--page] # 获取项目文档列表
481
+ tapd workspace members add --nick=<必需> [--role-ids=<逗号分隔>] # 添加项目成员
482
+ tapd workspace roles # 查看用户组 ID 对照关系
483
+ tapd workspace settings --type=<必需,如 is_enabled_story_category / workspace_metrology> # 获取项目配置开关
484
+ tapd workspace sub-workspaces # 获取子项目信息
485
+ tapd workspace users # 查看项目成员列表
486
+ ```
487
+