opctl 0.1.6 → 0.1.7
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 +55 -4
- package/dist/cli.js +640 -62
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# opctl
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/opctl)
|
|
4
|
+
|
|
3
5
|
`opctl` is a small local Node.js + TypeScript CLI bridge for OpenProject API v3. It uses the current user's personal API token and is read-only by default.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
Published package:
|
|
8
10
|
|
|
9
11
|
- npmjs.com: `opctl`
|
|
10
|
-
- current package: `opctl@0.1.
|
|
12
|
+
- current package: `opctl@0.1.7`
|
|
11
13
|
- binary: `opctl`
|
|
12
14
|
|
|
13
15
|
Install globally:
|
|
@@ -81,15 +83,21 @@ opctl wp get 123 --raw-json
|
|
|
81
83
|
opctl wp get 123 124 --table
|
|
82
84
|
opctl wp get --ids 123,124 --fields id,subject,status,assignee --table
|
|
83
85
|
opctl wp get --ids 123,124 --jsonl
|
|
86
|
+
opctl wp get --ids 123,124 --raw-json
|
|
84
87
|
```
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
`--raw-json` emits a single raw OpenProject object for one ID and JSONL for multiple IDs.
|
|
90
|
+
|
|
91
|
+
Field selection supports `id,subject,status,type,assignee,responsible,project,href,browserUrl,updatedAt,description,shortDescription,attachmentsCount,lockVersion,priority`; aliases: `title=subject`, `url=href`.
|
|
87
92
|
|
|
88
93
|
Search work packages:
|
|
89
94
|
|
|
90
95
|
```sh
|
|
91
96
|
opctl wp search --project my-project --subject "pump"
|
|
92
97
|
opctl wp search --project my-project --assignee-me --status open
|
|
98
|
+
opctl wp search --responsible-me --open
|
|
99
|
+
opctl wp search --responsible 18 --not-status "In Client Review"
|
|
100
|
+
opctl wp search --filter responsible=me --filter status=o --sort updated_at:desc
|
|
93
101
|
opctl wp search --open --subject "pump" --compact
|
|
94
102
|
opctl wp search --subject "pump" --fields id,subject,status --json
|
|
95
103
|
|
|
@@ -97,6 +105,15 @@ opctl wp search --subject "pump" --fields id,subject,status --json
|
|
|
97
105
|
|
|
98
106
|
If `--project` is omitted, `opctl wp search` uses `OPENPROJECT_DEFAULT_PROJECT` when set. Without either, it searches the instance-wide work package endpoint.
|
|
99
107
|
|
|
108
|
+
Lookup work package types, statuses, and priorities:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
opctl types --project my-project
|
|
112
|
+
opctl types --json
|
|
113
|
+
opctl statuses
|
|
114
|
+
opctl priorities
|
|
115
|
+
```
|
|
116
|
+
|
|
100
117
|
List work packages assigned to the authenticated user:
|
|
101
118
|
|
|
102
119
|
```sh
|
|
@@ -105,6 +122,13 @@ opctl wp mine --open --table
|
|
|
105
122
|
opctl wp mine --project my-project --page-size 50 --fields id,subject,status,updatedAt
|
|
106
123
|
```
|
|
107
124
|
|
|
125
|
+
List open work packages accountable/responsible to the authenticated user:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
opctl wp accountable
|
|
129
|
+
opctl wp accountable --table --fields id,subject,status,responsible,updatedAt
|
|
130
|
+
```
|
|
131
|
+
|
|
108
132
|
Triage a known list:
|
|
109
133
|
|
|
110
134
|
```sh
|
|
@@ -112,6 +136,22 @@ opctl wp check 123 124
|
|
|
112
136
|
opctl wp check --ids 123,124 --fields id,title,status,assignee,shortDescription,attachmentsCount --table
|
|
113
137
|
```
|
|
114
138
|
|
|
139
|
+
Inspect and download work package attachments:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
opctl wp attachments 123
|
|
143
|
+
opctl wp attachments 123 --json
|
|
144
|
+
opctl wp download-attachments 123 --dir /tmp/op-attachments
|
|
145
|
+
opctl wp download-attachments 123 --dir /tmp/op-attachments --overwrite --json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Show redacted diagnostics:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
opctl doctor
|
|
152
|
+
opctl doctor --json
|
|
153
|
+
```
|
|
154
|
+
|
|
115
155
|
Pull the OpenAPI spec (defaults to the public community instance):
|
|
116
156
|
|
|
117
157
|
```sh
|
|
@@ -120,14 +160,25 @@ opctl spec pull --output openapi/my-spec.json
|
|
|
120
160
|
opctl spec pull --url https://openproject.example.com
|
|
121
161
|
```
|
|
122
162
|
|
|
123
|
-
Write-capable
|
|
163
|
+
Write-capable commands:
|
|
124
164
|
|
|
125
165
|
```sh
|
|
166
|
+
# Comment on a work package
|
|
126
167
|
OPENPROJECT_ALLOW_WRITE=1 opctl wp comment 123 --dry-run "Investigating"
|
|
127
168
|
OPENPROJECT_ALLOW_WRITE=1 opctl wp comment 123 "Investigating"
|
|
169
|
+
|
|
170
|
+
# Create a work package (dry-run validates through /api/v3/work_packages/form)
|
|
171
|
+
OPENPROJECT_ALLOW_WRITE=1 opctl wp create --project alspc --type Feature --subject "Improve Ask NAVLIN Explore messaging experience" --description-file ticket.md --dry-run
|
|
172
|
+
OPENPROJECT_ALLOW_WRITE=1 opctl wp create --project alspc --type Feature --subject "S" --json < ticket.md
|
|
173
|
+
|
|
174
|
+
# Use a user-story template
|
|
175
|
+
opctl wp create --template user-story > ticket.md
|
|
176
|
+
OPENPROJECT_ALLOW_WRITE=1 opctl wp create --project alspc --type Feature --subject "New feature" --template user-story --dry-run
|
|
128
177
|
```
|
|
129
178
|
|
|
130
|
-
`wp comment`
|
|
179
|
+
`wp comment` and `wp create` both require `OPENPROJECT_ALLOW_WRITE=1`. `wp create --dry-run` validates through `/api/v3/work_packages/form` before any create call. Write-capable commands support `--dry-run` and avoid mutation in dry-run mode.
|
|
180
|
+
|
|
181
|
+
`wp create` resolves `--type`, `--status`, and `--priority` by name (case-insensitive exact match), numeric id, or full `/api/v3/...` href. Use `opctl types`, `opctl statuses`, or `opctl priorities` to list valid values. Description can come from `--description <text>`, `--description-file <path>` (use `-` for stdin), piped stdin, or `--template user-story`.
|
|
131
182
|
|
|
132
183
|
## OpenAPI
|
|
133
184
|
|