bitbucketdc-cli 1.0.6 → 1.0.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/dist/index.js +962 -34
- package/package.json +5 -4
- package/dist/commands/commit/changes.d.ts +0 -3
- package/dist/commands/commit/changes.d.ts.map +0 -1
- package/dist/commands/commit/changes.js +0 -27
- package/dist/commands/commit/changes.js.map +0 -1
- package/dist/commands/commit/diff.d.ts +0 -3
- package/dist/commands/commit/diff.d.ts.map +0 -1
- package/dist/commands/commit/diff.js +0 -38
- package/dist/commands/commit/diff.js.map +0 -1
- package/dist/commands/commit/index.d.ts +0 -3
- package/dist/commands/commit/index.d.ts.map +0 -1
- package/dist/commands/commit/index.js +0 -16
- package/dist/commands/commit/index.js.map +0 -1
- package/dist/commands/compare/changes.d.ts +0 -3
- package/dist/commands/compare/changes.d.ts.map +0 -1
- package/dist/commands/compare/changes.js +0 -30
- package/dist/commands/compare/changes.js.map +0 -1
- package/dist/commands/compare/diff.d.ts +0 -3
- package/dist/commands/compare/diff.d.ts.map +0 -1
- package/dist/commands/compare/diff.js +0 -32
- package/dist/commands/compare/diff.js.map +0 -1
- package/dist/commands/compare/index.d.ts +0 -3
- package/dist/commands/compare/index.d.ts.map +0 -1
- package/dist/commands/compare/index.js +0 -16
- package/dist/commands/compare/index.js.map +0 -1
- package/dist/commands/file/index.d.ts +0 -3
- package/dist/commands/file/index.d.ts.map +0 -1
- package/dist/commands/file/index.js +0 -16
- package/dist/commands/file/index.js.map +0 -1
- package/dist/commands/file/list.d.ts +0 -3
- package/dist/commands/file/list.d.ts.map +0 -1
- package/dist/commands/file/list.js +0 -30
- package/dist/commands/file/list.js.map +0 -1
- package/dist/commands/file/show.d.ts +0 -3
- package/dist/commands/file/show.d.ts.map +0 -1
- package/dist/commands/file/show.js +0 -24
- package/dist/commands/file/show.js.map +0 -1
- package/dist/commands/pr/activities.d.ts +0 -3
- package/dist/commands/pr/activities.d.ts.map +0 -1
- package/dist/commands/pr/activities.js +0 -37
- package/dist/commands/pr/activities.js.map +0 -1
- package/dist/commands/pr/can-merge.d.ts +0 -3
- package/dist/commands/pr/can-merge.d.ts.map +0 -1
- package/dist/commands/pr/can-merge.js +0 -21
- package/dist/commands/pr/can-merge.js.map +0 -1
- package/dist/commands/pr/changes.d.ts +0 -3
- package/dist/commands/pr/changes.d.ts.map +0 -1
- package/dist/commands/pr/changes.js +0 -23
- package/dist/commands/pr/changes.js.map +0 -1
- package/dist/commands/pr/comment.d.ts +0 -3
- package/dist/commands/pr/comment.d.ts.map +0 -1
- package/dist/commands/pr/comment.js +0 -27
- package/dist/commands/pr/comment.js.map +0 -1
- package/dist/commands/pr/create.d.ts +0 -3
- package/dist/commands/pr/create.d.ts.map +0 -1
- package/dist/commands/pr/create.js +0 -50
- package/dist/commands/pr/create.js.map +0 -1
- package/dist/commands/pr/decline.d.ts +0 -3
- package/dist/commands/pr/decline.d.ts.map +0 -1
- package/dist/commands/pr/decline.js +0 -21
- package/dist/commands/pr/decline.js.map +0 -1
- package/dist/commands/pr/delete-comment.d.ts +0 -3
- package/dist/commands/pr/delete-comment.d.ts.map +0 -1
- package/dist/commands/pr/delete-comment.js +0 -31
- package/dist/commands/pr/delete-comment.js.map +0 -1
- package/dist/commands/pr/delete.d.ts +0 -3
- package/dist/commands/pr/delete.d.ts.map +0 -1
- package/dist/commands/pr/delete.js +0 -21
- package/dist/commands/pr/delete.js.map +0 -1
- package/dist/commands/pr/diff.d.ts +0 -3
- package/dist/commands/pr/diff.d.ts.map +0 -1
- package/dist/commands/pr/diff.js +0 -43
- package/dist/commands/pr/diff.js.map +0 -1
- package/dist/commands/pr/edit-comment.d.ts +0 -3
- package/dist/commands/pr/edit-comment.d.ts.map +0 -1
- package/dist/commands/pr/edit-comment.js +0 -33
- package/dist/commands/pr/edit-comment.js.map +0 -1
- package/dist/commands/pr/file-comment.d.ts +0 -3
- package/dist/commands/pr/file-comment.d.ts.map +0 -1
- package/dist/commands/pr/file-comment.js +0 -25
- package/dist/commands/pr/file-comment.js.map +0 -1
- package/dist/commands/pr/file-diff.d.ts +0 -3
- package/dist/commands/pr/file-diff.d.ts.map +0 -1
- package/dist/commands/pr/file-diff.js +0 -25
- package/dist/commands/pr/file-diff.js.map +0 -1
- package/dist/commands/pr/get.d.ts +0 -3
- package/dist/commands/pr/get.d.ts.map +0 -1
- package/dist/commands/pr/get.js +0 -21
- package/dist/commands/pr/get.js.map +0 -1
- package/dist/commands/pr/inbox.d.ts +0 -3
- package/dist/commands/pr/inbox.d.ts.map +0 -1
- package/dist/commands/pr/inbox.js +0 -19
- package/dist/commands/pr/inbox.js.map +0 -1
- package/dist/commands/pr/index.d.ts +0 -3
- package/dist/commands/pr/index.d.ts.map +0 -1
- package/dist/commands/pr/index.js +0 -61
- package/dist/commands/pr/index.js.map +0 -1
- package/dist/commands/pr/line-comment.d.ts +0 -3
- package/dist/commands/pr/line-comment.d.ts.map +0 -1
- package/dist/commands/pr/line-comment.js +0 -36
- package/dist/commands/pr/line-comment.js.map +0 -1
- package/dist/commands/pr/merge.d.ts +0 -3
- package/dist/commands/pr/merge.d.ts.map +0 -1
- package/dist/commands/pr/merge.js +0 -28
- package/dist/commands/pr/merge.js.map +0 -1
- package/dist/commands/pr/reaction-add.d.ts +0 -3
- package/dist/commands/pr/reaction-add.d.ts.map +0 -1
- package/dist/commands/pr/reaction-add.js +0 -30
- package/dist/commands/pr/reaction-add.js.map +0 -1
- package/dist/commands/pr/reaction-remove.d.ts +0 -3
- package/dist/commands/pr/reaction-remove.d.ts.map +0 -1
- package/dist/commands/pr/reaction-remove.js +0 -29
- package/dist/commands/pr/reaction-remove.js.map +0 -1
- package/dist/commands/pr/review.d.ts +0 -3
- package/dist/commands/pr/review.d.ts.map +0 -1
- package/dist/commands/pr/review.js +0 -29
- package/dist/commands/pr/review.js.map +0 -1
- package/dist/commands/pr/update.d.ts +0 -3
- package/dist/commands/pr/update.d.ts.map +0 -1
- package/dist/commands/pr/update.js +0 -32
- package/dist/commands/pr/update.js.map +0 -1
- package/dist/commands/project/index.d.ts +0 -3
- package/dist/commands/project/index.d.ts.map +0 -1
- package/dist/commands/project/index.js +0 -13
- package/dist/commands/project/index.js.map +0 -1
- package/dist/commands/project/list.d.ts +0 -3
- package/dist/commands/project/list.d.ts.map +0 -1
- package/dist/commands/project/list.js +0 -23
- package/dist/commands/project/list.js.map +0 -1
- package/dist/commands/repo/attachment/download.d.ts +0 -3
- package/dist/commands/repo/attachment/download.d.ts.map +0 -1
- package/dist/commands/repo/attachment/download.js +0 -23
- package/dist/commands/repo/attachment/download.js.map +0 -1
- package/dist/commands/repo/attachment/index.d.ts +0 -3
- package/dist/commands/repo/attachment/index.d.ts.map +0 -1
- package/dist/commands/repo/attachment/index.js +0 -15
- package/dist/commands/repo/attachment/index.js.map +0 -1
- package/dist/commands/repo/attachment/upload.d.ts +0 -3
- package/dist/commands/repo/attachment/upload.d.ts.map +0 -1
- package/dist/commands/repo/attachment/upload.js +0 -41
- package/dist/commands/repo/attachment/upload.js.map +0 -1
- package/dist/commands/repo/index.d.ts +0 -3
- package/dist/commands/repo/index.d.ts.map +0 -1
- package/dist/commands/repo/index.js +0 -15
- package/dist/commands/repo/index.js.map +0 -1
- package/dist/commands/repo/list.d.ts +0 -3
- package/dist/commands/repo/list.d.ts.map +0 -1
- package/dist/commands/repo/list.js +0 -14
- package/dist/commands/repo/list.js.map +0 -1
- package/dist/commands/user/index.d.ts +0 -3
- package/dist/commands/user/index.d.ts.map +0 -1
- package/dist/commands/user/index.js +0 -15
- package/dist/commands/user/index.js.map +0 -1
- package/dist/commands/user/list.d.ts +0 -3
- package/dist/commands/user/list.d.ts.map +0 -1
- package/dist/commands/user/list.js +0 -15
- package/dist/commands/user/list.js.map +0 -1
- package/dist/commands/user/profile.d.ts +0 -3
- package/dist/commands/user/profile.d.ts.map +0 -1
- package/dist/commands/user/profile.js +0 -14
- package/dist/commands/user/profile.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/client.d.ts +0 -3
- package/dist/utils/client.d.ts.map +0 -1
- package/dist/utils/client.js +0 -19
- package/dist/utils/client.js.map +0 -1
- package/dist/utils/output.d.ts +0 -3
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -48
- package/dist/utils/output.js.map +0 -1
- package/dist/utils/strip-response.d.ts +0 -6
- package/dist/utils/strip-response.d.ts.map +0 -1
- package/dist/utils/strip-response.js +0 -30
- package/dist/utils/strip-response.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,42 +1,972 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { styleText } from "util";
|
|
5
|
+
import { Command as Command8 } from "commander";
|
|
6
|
+
|
|
7
|
+
// src/utils/client.ts
|
|
8
|
+
import { BitbucketClient } from "bitbucket-data-center-client";
|
|
9
|
+
function getClient() {
|
|
10
|
+
const baseUrl = process.env.BITBUCKET_URL;
|
|
11
|
+
const token = process.env.BITBUCKET_TOKEN;
|
|
12
|
+
if (!baseUrl || !token) {
|
|
13
|
+
const missing = [...!baseUrl ? ["BITBUCKET_URL"] : [], ...!token ? ["BITBUCKET_TOKEN"] : []];
|
|
14
|
+
process.stderr.write(
|
|
15
|
+
`${JSON.stringify({
|
|
16
|
+
error: `Missing required environment variables: ${missing.join(", ")}`,
|
|
17
|
+
setup: {
|
|
18
|
+
BITBUCKET_URL: "Your Bitbucket Server base URL (e.g., https://bitbucket.example.com)",
|
|
19
|
+
BITBUCKET_TOKEN: "Personal Access Token \u2014 generate in Bitbucket > Profile > Personal Access Tokens"
|
|
20
|
+
},
|
|
21
|
+
hint: "Export these in your shell profile (e.g., ~/.zshrc)."
|
|
22
|
+
})}
|
|
23
|
+
`
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
return new BitbucketClient({ baseUrl, token });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/utils/strip-response.ts
|
|
31
|
+
function stripResponse(obj) {
|
|
32
|
+
if (Array.isArray(obj)) {
|
|
33
|
+
return obj.map(stripResponse);
|
|
34
|
+
}
|
|
35
|
+
if (obj === null || typeof obj !== "object") {
|
|
36
|
+
return obj;
|
|
37
|
+
}
|
|
38
|
+
const record = obj;
|
|
39
|
+
const result = {};
|
|
40
|
+
for (const [key, value] of Object.entries(record)) {
|
|
41
|
+
if (key === "self" || key === "links" || key === "_links" || key === "_expandable" || key === "expand" || key === "avatarUrls" || key === "avatarId" || key === "iconUrl") {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
result[key] = stripResponse(value);
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/utils/output.ts
|
|
50
|
+
function output(data) {
|
|
51
|
+
process.stdout.write(`${JSON.stringify(stripResponse(data), null, 2)}
|
|
52
|
+
`);
|
|
53
|
+
}
|
|
54
|
+
function handleError(err) {
|
|
55
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
56
|
+
const axiosStatus = err?.response?.status;
|
|
57
|
+
if (axiosStatus === 400) {
|
|
58
|
+
const responseData = err?.response?.data;
|
|
59
|
+
const apiErrors = responseData && typeof responseData === "object" ? responseData : void 0;
|
|
60
|
+
process.stderr.write(
|
|
61
|
+
`${JSON.stringify({
|
|
62
|
+
error: "Bad request (HTTP 400)",
|
|
63
|
+
detail: apiErrors ?? message,
|
|
64
|
+
hint: "Check that all parameters are valid (project keys, repository slugs, branch names, etc.)."
|
|
65
|
+
})}
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
} else if (axiosStatus === 401) {
|
|
69
|
+
process.stderr.write(
|
|
70
|
+
`${JSON.stringify({
|
|
71
|
+
error: "Authentication failed (HTTP 401)",
|
|
72
|
+
hint: "Verify that BITBUCKET_URL and BITBUCKET_TOKEN are set correctly. The token may be expired or invalid."
|
|
73
|
+
})}
|
|
74
|
+
`
|
|
75
|
+
);
|
|
76
|
+
} else if (axiosStatus === 403) {
|
|
77
|
+
const responseData = err?.response?.data;
|
|
78
|
+
process.stderr.write(
|
|
79
|
+
`${JSON.stringify({
|
|
80
|
+
error: "Forbidden (HTTP 403)",
|
|
81
|
+
detail: responseData && typeof responseData === "object" ? responseData : message,
|
|
82
|
+
hint: "Your account does not have permission for this operation. Check repository permissions and token scope."
|
|
83
|
+
})}
|
|
84
|
+
`
|
|
85
|
+
);
|
|
86
|
+
} else if (message.includes("ENOTFOUND") || message.includes("ECONNREFUSED") || message.includes("ECONNRESET")) {
|
|
87
|
+
process.stderr.write(
|
|
88
|
+
`${JSON.stringify({
|
|
89
|
+
error: `Cannot connect to Bitbucket server: ${message}`,
|
|
90
|
+
hint: "Verify that BITBUCKET_URL is correct and the server is reachable."
|
|
91
|
+
})}
|
|
92
|
+
`
|
|
93
|
+
);
|
|
94
|
+
} else if (axiosStatus === 500) {
|
|
95
|
+
process.stderr.write(
|
|
96
|
+
`${JSON.stringify({
|
|
97
|
+
error: `Server error (HTTP 500): ${message}`,
|
|
98
|
+
hint: "The server returned an internal error. Check that all parameters are valid (project keys, repository slugs, branch names, IDs)."
|
|
99
|
+
})}
|
|
100
|
+
`
|
|
101
|
+
);
|
|
102
|
+
} else {
|
|
103
|
+
process.stderr.write(`${JSON.stringify({ error: message })}
|
|
104
|
+
`);
|
|
105
|
+
}
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/commands/commit/changes.ts
|
|
110
|
+
function changes(parent) {
|
|
111
|
+
parent.command("changes").description("List files changed in a specific commit").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--commit <hash>", "Commit hash").option("--limit <n>", "Number of items to return (default: 25)", parseInt).option("--start <n>", "Start index for pagination (default: 0)", parseInt).addHelpText(
|
|
112
|
+
"after",
|
|
113
|
+
`
|
|
114
|
+
Examples:
|
|
115
|
+
bitbucketdc commit changes --project AI --repo my-app --commit abc123
|
|
116
|
+
bitbucketdc commit changes --project AI --repo my-app --commit abc123 --limit 100`
|
|
117
|
+
).action(async (opts) => {
|
|
118
|
+
const client = getClient();
|
|
119
|
+
const result = await client.repositories.getCommitChanges({
|
|
120
|
+
projectKey: opts.project,
|
|
121
|
+
repositorySlug: opts.repo,
|
|
122
|
+
commitId: opts.commit,
|
|
123
|
+
limit: opts.limit,
|
|
124
|
+
start: opts.start
|
|
125
|
+
});
|
|
126
|
+
output(result);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/commands/commit/diff.ts
|
|
131
|
+
import { Option } from "commander";
|
|
132
|
+
function diff(parent) {
|
|
133
|
+
parent.command("diff").description("Get diff for a specific commit").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--commit <hash>", "Commit hash").option("--path <path>", "Scope diff to a single file").option("--context <n>", "Number of context lines around changes", parseInt).addOption(new Option("--whitespace <mode>", "Whitespace handling").choices(["show", "ignore-all"])).addOption(new Option("--format <fmt>", "Response format (default: text)").choices(["text", "json"])).addHelpText(
|
|
134
|
+
"after",
|
|
135
|
+
`
|
|
136
|
+
Examples:
|
|
137
|
+
bitbucketdc commit diff --project AI --repo my-app --commit abc123
|
|
138
|
+
bitbucketdc commit diff --project AI --repo my-app --commit abc123 --path src/main.ts
|
|
139
|
+
bitbucketdc commit diff --project AI --repo my-app --commit abc123 --format json`
|
|
140
|
+
).action(
|
|
141
|
+
async (opts) => {
|
|
142
|
+
const client = getClient();
|
|
143
|
+
const result = await client.repositories.getCommitDiff({
|
|
144
|
+
projectKey: opts.project,
|
|
145
|
+
repositorySlug: opts.repo,
|
|
146
|
+
commitId: opts.commit,
|
|
147
|
+
path: opts.path,
|
|
148
|
+
contextLines: opts.context,
|
|
149
|
+
whitespace: opts.whitespace,
|
|
150
|
+
format: opts.format || "text"
|
|
151
|
+
});
|
|
152
|
+
if (typeof result === "string") {
|
|
153
|
+
process.stdout.write(result);
|
|
154
|
+
} else {
|
|
155
|
+
output(result);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/commands/commit/index.ts
|
|
162
|
+
function registerCommitCommands(program2) {
|
|
163
|
+
const commit = program2.command("commit").description("Commit inspection operations").addHelpText(
|
|
164
|
+
"after",
|
|
165
|
+
`
|
|
166
|
+
Examples:
|
|
167
|
+
$ bitbucketdc commit changes --project AI --repo my-app --commit abc123
|
|
168
|
+
$ bitbucketdc commit diff --project AI --repo my-app --commit abc123
|
|
169
|
+
$ bitbucketdc commit diff --project AI --repo my-app --commit abc123 --path src/main.ts
|
|
170
|
+
`
|
|
171
|
+
);
|
|
172
|
+
changes(commit);
|
|
173
|
+
diff(commit);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/commands/compare/changes.ts
|
|
177
|
+
function changes2(parent) {
|
|
178
|
+
parent.command("changes").description("List files that differ between two refs").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--from <ref>", "Source ref (branch, tag, or commit)").requiredOption("--to <ref>", "Target ref (branch, tag, or commit)").option("--limit <n>", "Number of items to return (default: 25)", parseInt).option("--start <n>", "Start index for pagination (default: 0)", parseInt).addHelpText(
|
|
179
|
+
"after",
|
|
180
|
+
`
|
|
181
|
+
Examples:
|
|
182
|
+
bitbucketdc compare changes --project AI --repo my-app --from develop --to main
|
|
183
|
+
bitbucketdc compare changes --project AI --repo my-app --from feature/x --to main --limit 100
|
|
184
|
+
bitbucketdc compare changes --project AI --repo my-app --from develop --to main --start 25`
|
|
185
|
+
).action(
|
|
186
|
+
async (opts) => {
|
|
187
|
+
const client = getClient();
|
|
188
|
+
const result = await client.repositories.getCompareChanges({
|
|
189
|
+
projectKey: opts.project,
|
|
190
|
+
repositorySlug: opts.repo,
|
|
191
|
+
from: opts.from,
|
|
192
|
+
to: opts.to,
|
|
193
|
+
limit: opts.limit,
|
|
194
|
+
start: opts.start
|
|
195
|
+
});
|
|
196
|
+
output(result);
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// src/commands/compare/diff.ts
|
|
202
|
+
import { Option as Option2 } from "commander";
|
|
203
|
+
function diff2(parent) {
|
|
204
|
+
parent.command("diff").description("Get diff between two refs (structured JSON)").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--from <ref>", "Source ref (branch, tag, or commit)").requiredOption("--to <ref>", "Target ref (branch, tag, or commit)").option("--path <path>", "Scope diff to a single file").option("--context <n>", "Number of context lines around changes", parseInt).addOption(new Option2("--whitespace <mode>", "Whitespace handling").choices(["show", "ignore-all"])).addHelpText(
|
|
205
|
+
"after",
|
|
206
|
+
`
|
|
207
|
+
Examples:
|
|
208
|
+
bitbucketdc compare diff --project AI --repo my-app --from develop --to main
|
|
209
|
+
bitbucketdc compare diff --project AI --repo my-app --from develop --to main --path src/main.ts`
|
|
210
|
+
).action(
|
|
211
|
+
async (opts) => {
|
|
212
|
+
const client = getClient();
|
|
213
|
+
const result = await client.repositories.getCompareDiff({
|
|
214
|
+
projectKey: opts.project,
|
|
215
|
+
repositorySlug: opts.repo,
|
|
216
|
+
from: opts.from,
|
|
217
|
+
to: opts.to,
|
|
218
|
+
path: opts.path,
|
|
219
|
+
contextLines: opts.context,
|
|
220
|
+
whitespace: opts.whitespace
|
|
221
|
+
});
|
|
222
|
+
output(result);
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/commands/compare/index.ts
|
|
228
|
+
function registerCompareCommands(program2) {
|
|
229
|
+
const compare = program2.command("compare").description("Compare refs (branches, tags, commits)").addHelpText(
|
|
230
|
+
"after",
|
|
231
|
+
`
|
|
232
|
+
Examples:
|
|
233
|
+
$ bitbucketdc compare changes --project AI --repo my-app --from develop --to main
|
|
234
|
+
$ bitbucketdc compare diff --project AI --repo my-app --from develop --to main
|
|
235
|
+
$ bitbucketdc compare diff --project AI --repo my-app --from develop --to main --path src/main.ts
|
|
236
|
+
`
|
|
237
|
+
);
|
|
238
|
+
changes2(compare);
|
|
239
|
+
diff2(compare);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// src/commands/file/list.ts
|
|
243
|
+
function list(parent) {
|
|
244
|
+
parent.command("list").description("List directory contents in a repository").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").option("--path <path>", "Directory path (defaults to root)").option("--at <ref>", "Branch, tag, or commit hash").option("--limit <n>", "Number of items to return (default: 500)", parseInt).option("--start <n>", "Start index for pagination (default: 0)", parseInt).addHelpText(
|
|
245
|
+
"after",
|
|
246
|
+
`
|
|
247
|
+
Examples:
|
|
248
|
+
bitbucketdc file list --project PROJ --repo my-app
|
|
249
|
+
bitbucketdc file list --project PROJ --repo my-app --path src/
|
|
250
|
+
bitbucketdc file list --project PROJ --repo my-app --path src/ --at develop`
|
|
251
|
+
).action(
|
|
252
|
+
async (opts) => {
|
|
253
|
+
const client = getClient();
|
|
254
|
+
const result = await client.repositories.browse({
|
|
255
|
+
projectKey: opts.project,
|
|
256
|
+
repositorySlug: opts.repo,
|
|
257
|
+
path: opts.path,
|
|
258
|
+
at: opts.at,
|
|
259
|
+
limit: opts.limit,
|
|
260
|
+
start: opts.start
|
|
261
|
+
});
|
|
262
|
+
output(result);
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// src/commands/file/show.ts
|
|
268
|
+
function show(parent) {
|
|
269
|
+
parent.command("show").description("Show raw file content from a repository").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--path <path>", "File path").option("--at <ref>", "Branch, tag, or commit hash").addHelpText(
|
|
270
|
+
"after",
|
|
271
|
+
`
|
|
272
|
+
Examples:
|
|
273
|
+
bitbucketdc file show --project PROJ --repo my-app --path README.md
|
|
274
|
+
bitbucketdc file show --project PROJ --repo my-app --path config/settings.yaml --at release/2.0`
|
|
275
|
+
).action(async (opts) => {
|
|
276
|
+
const client = getClient();
|
|
277
|
+
const result = await client.repositories.getRawContent({
|
|
278
|
+
projectKey: opts.project,
|
|
279
|
+
repositorySlug: opts.repo,
|
|
280
|
+
path: opts.path,
|
|
281
|
+
at: opts.at
|
|
282
|
+
});
|
|
283
|
+
process.stdout.write(result);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// src/commands/file/index.ts
|
|
288
|
+
function registerFileCommands(program2) {
|
|
289
|
+
const file = program2.command("file").description("File and directory operations").addHelpText(
|
|
290
|
+
"after",
|
|
291
|
+
`
|
|
292
|
+
Examples:
|
|
293
|
+
$ bitbucketdc file list --project PROJ --repo my-app
|
|
294
|
+
$ bitbucketdc file list --project PROJ --repo my-app --path src/ --at develop
|
|
295
|
+
$ bitbucketdc file show --project PROJ --repo my-app --path README.md
|
|
296
|
+
`
|
|
297
|
+
);
|
|
298
|
+
list(file);
|
|
299
|
+
show(file);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// src/commands/pr/activities.ts
|
|
303
|
+
function activities(parent) {
|
|
304
|
+
parent.command("activities").description("Get activity on a pull request (comments, approvals, merges, etc.)").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").option(
|
|
305
|
+
"--types <types>",
|
|
306
|
+
"Comma-separated activity types (APPROVED, COMMENTED, DECLINED, MERGED, OPENED, REOPENED, RESCOPED, REVIEW_COMMENTED, REVIEW_DISCARDED, REVIEW_FINISHED, REVIEWED, UNAPPROVED, UPDATED)"
|
|
307
|
+
).option("--start <n>", "Starting index for pagination (default: 0)", parseInt).option("--limit <n>", "Maximum number of items to return (default: 25)", parseInt).addHelpText(
|
|
308
|
+
"after",
|
|
309
|
+
`
|
|
310
|
+
Examples:
|
|
311
|
+
bitbucketdc pr activities --project PROJ --repo my-repo --id 42
|
|
312
|
+
bitbucketdc pr activities --project PROJ --repo my-repo --id 42 --types COMMENTED,REVIEW_COMMENTED
|
|
313
|
+
bitbucketdc pr activities --project PROJ --repo my-repo --id 42 --types APPROVED,UNAPPROVED --limit 50`
|
|
314
|
+
).action(
|
|
315
|
+
async (opts) => {
|
|
316
|
+
const client = getClient();
|
|
317
|
+
const result = await client.pullRequests.getActivities({
|
|
318
|
+
projectKey: opts.project,
|
|
319
|
+
repositorySlug: opts.repo,
|
|
320
|
+
pullRequestId: parseInt(opts.id),
|
|
321
|
+
start: opts.start,
|
|
322
|
+
limit: opts.limit
|
|
323
|
+
});
|
|
324
|
+
if (opts.types) {
|
|
325
|
+
const types = opts.types.split(",").map((t) => t.trim());
|
|
326
|
+
const filtered = result.values.filter((a) => types.includes(a.action));
|
|
327
|
+
output({ ...result, values: filtered, size: filtered.length });
|
|
328
|
+
} else {
|
|
329
|
+
output(result);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/commands/pr/can-merge.ts
|
|
336
|
+
function canMerge(parent) {
|
|
337
|
+
parent.command("can-merge").description("Check if a pull request can be merged").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).addHelpText("after", "\nExamples:\n bitbucketdc pr can-merge --project PROJ --repo my-repo --id 42").action(async (opts) => {
|
|
338
|
+
const client = getClient();
|
|
339
|
+
const result = await client.pullRequests.canMerge({
|
|
340
|
+
projectKey: opts.project,
|
|
341
|
+
repositorySlug: opts.repo,
|
|
342
|
+
pullRequestId: opts.id
|
|
343
|
+
});
|
|
344
|
+
output(result);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// src/commands/pr/changes.ts
|
|
349
|
+
function changes3(parent) {
|
|
350
|
+
parent.command("changes").description("List changed files in a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").option("--limit <n>", "Number of items to return (default: 25)", parseInt).addHelpText(
|
|
351
|
+
"after",
|
|
352
|
+
"\nExamples:\n bitbucketdc pr changes --project PROJ --repo my-repo --id 42\n bitbucketdc pr changes --project PROJ --repo my-repo --id 42 --limit 100"
|
|
353
|
+
).action(async (opts) => {
|
|
354
|
+
const client = getClient();
|
|
355
|
+
const result = await client.pullRequests.getChanges({
|
|
356
|
+
projectKey: opts.project,
|
|
357
|
+
repositorySlug: opts.repo,
|
|
358
|
+
pullRequestId: parseInt(opts.id),
|
|
359
|
+
limit: opts.limit
|
|
360
|
+
});
|
|
361
|
+
output(result);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/commands/pr/comment.ts
|
|
366
|
+
function comment(parent) {
|
|
367
|
+
parent.command("comment").description("Add a general comment to a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--text <text>", "Comment text").option("--parent <n>", "Parent comment ID to reply to").addHelpText(
|
|
368
|
+
"after",
|
|
369
|
+
`
|
|
370
|
+
Examples:
|
|
371
|
+
bitbucketdc pr comment --project PROJ --repo my-repo --id 42 --text "Looks good!"
|
|
372
|
+
bitbucketdc pr comment --project PROJ --repo my-repo --id 42 --text "I agree" --parent 123`
|
|
373
|
+
).action(async (opts) => {
|
|
374
|
+
const client = getClient();
|
|
375
|
+
const result = await client.pullRequests.addComment({
|
|
376
|
+
projectKey: opts.project,
|
|
377
|
+
repositorySlug: opts.repo,
|
|
378
|
+
pullRequestId: parseInt(opts.id),
|
|
379
|
+
text: opts.text,
|
|
380
|
+
parentId: opts.parent ? parseInt(opts.parent) : void 0
|
|
381
|
+
});
|
|
382
|
+
output(result);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// src/commands/pr/create.ts
|
|
387
|
+
function create(parent) {
|
|
388
|
+
parent.command("create").description("Create a new pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--from <branch>", "Source branch name (e.g., feature-x)").requiredOption("--to <branch>", "Target branch name (e.g., main)").requiredOption("--title <text>", "Pull request title").option("--description <text>", "Pull request description in markdown").option("--reviewers <usernames>", "Comma-separated reviewer usernames").option("--draft", "Create as draft pull request").addHelpText(
|
|
389
|
+
"after",
|
|
390
|
+
`
|
|
391
|
+
Examples:
|
|
392
|
+
bitbucketdc pr create --project PROJ --repo my-repo --from feature-x --to main --title "Add feature"
|
|
393
|
+
bitbucketdc pr create --project PROJ --repo my-repo --from fix/bug --to develop --title "Fix bug" --reviewers jsmith,jdoe
|
|
394
|
+
bitbucketdc pr create --project PROJ --repo my-repo --from wip --to main --title "WIP" --draft`
|
|
395
|
+
).action(
|
|
396
|
+
async (opts) => {
|
|
397
|
+
const client = getClient();
|
|
398
|
+
let reviewers = opts.reviewers?.split(",").map((r) => r.trim());
|
|
399
|
+
if (!reviewers || reviewers.length === 0) {
|
|
400
|
+
const repo = await client.repositories.get({
|
|
401
|
+
projectKey: opts.project,
|
|
402
|
+
repositorySlug: opts.repo
|
|
403
|
+
});
|
|
404
|
+
const defaultReviewers = await client.pullRequests.getRequiredReviewers({
|
|
405
|
+
projectKey: opts.project,
|
|
406
|
+
repositorySlug: opts.repo,
|
|
407
|
+
repositoryId: repo.id,
|
|
408
|
+
sourceBranch: opts.from,
|
|
409
|
+
targetBranch: opts.to
|
|
410
|
+
});
|
|
411
|
+
reviewers = defaultReviewers.map((r) => r.name);
|
|
412
|
+
}
|
|
413
|
+
const result = await client.pullRequests.create({
|
|
414
|
+
projectKey: opts.project,
|
|
415
|
+
repositorySlug: opts.repo,
|
|
416
|
+
fromBranch: opts.from,
|
|
417
|
+
toBranch: opts.to,
|
|
418
|
+
title: opts.title,
|
|
419
|
+
description: opts.description,
|
|
420
|
+
reviewers,
|
|
421
|
+
draft: opts.draft
|
|
422
|
+
});
|
|
423
|
+
output(result);
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/commands/pr/decline.ts
|
|
429
|
+
function decline(parent) {
|
|
430
|
+
parent.command("decline").description("Decline a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).addHelpText("after", "\nExamples:\n bitbucketdc pr decline --project PROJ --repo my-repo --id 42").action(async (opts) => {
|
|
431
|
+
const client = getClient();
|
|
432
|
+
const result = await client.pullRequests.decline({
|
|
433
|
+
projectKey: opts.project,
|
|
434
|
+
repositorySlug: opts.repo,
|
|
435
|
+
pullRequestId: opts.id
|
|
436
|
+
});
|
|
437
|
+
output(result);
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// src/commands/pr/delete-comment.ts
|
|
442
|
+
function deleteComment(parent) {
|
|
443
|
+
parent.command("delete-comment").description("Delete a pull request comment").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).requiredOption("--comment-id <n>", "Comment ID to delete", parseInt).addHelpText(
|
|
444
|
+
"after",
|
|
445
|
+
"\nExamples:\n bitbucketdc pr delete-comment --project PROJ --repo my-repo --id 42 --comment-id 123"
|
|
446
|
+
).action(async (opts) => {
|
|
447
|
+
const client = getClient();
|
|
448
|
+
const comment2 = await client.pullRequests.getComment({
|
|
449
|
+
projectKey: opts.project,
|
|
450
|
+
repositorySlug: opts.repo,
|
|
451
|
+
pullRequestId: opts.id,
|
|
452
|
+
commentId: opts.commentId
|
|
453
|
+
});
|
|
454
|
+
await client.pullRequests.deleteComment({
|
|
455
|
+
projectKey: opts.project,
|
|
456
|
+
repositorySlug: opts.repo,
|
|
457
|
+
pullRequestId: opts.id,
|
|
458
|
+
commentId: opts.commentId,
|
|
459
|
+
version: comment2.version
|
|
460
|
+
});
|
|
461
|
+
output({ deleted: true, commentId: opts.commentId });
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// src/commands/pr/delete.ts
|
|
466
|
+
function deletePr(parent) {
|
|
467
|
+
parent.command("delete").description("Delete a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).addHelpText("after", "\nExamples:\n bitbucketdc pr delete --project PROJ --repo my-repo --id 42").action(async (opts) => {
|
|
468
|
+
const client = getClient();
|
|
469
|
+
await client.pullRequests.deletePullRequest({
|
|
470
|
+
projectKey: opts.project,
|
|
471
|
+
repositorySlug: opts.repo,
|
|
472
|
+
pullRequestId: opts.id
|
|
473
|
+
});
|
|
474
|
+
output({ deleted: true, pullRequestId: opts.id });
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/commands/pr/diff.ts
|
|
479
|
+
import { Option as Option3 } from "commander";
|
|
480
|
+
function diff3(parent) {
|
|
481
|
+
parent.command("diff").description("Get diff for a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").option("--path <path>", "File path (omit for full PR diff)").option("--since <hash>", "Since commit hash").option("--until <hash>", "Until commit hash").option("--context <n>", "Number of context lines around changes (default: 10)", parseInt).addOption(new Option3("--whitespace <mode>", "Whitespace handling (default: show)").choices(["show", "ignore-all"])).addOption(new Option3("--format <fmt>", "Response format (default: text)").choices(["text", "json"])).addHelpText(
|
|
482
|
+
"after",
|
|
483
|
+
`
|
|
484
|
+
Examples:
|
|
485
|
+
bitbucketdc pr diff --project PROJ --repo my-repo --id 42
|
|
486
|
+
bitbucketdc pr diff --project PROJ --repo my-repo --id 42 --path src/main.ts
|
|
487
|
+
bitbucketdc pr diff --project PROJ --repo my-repo --id 42 --format json
|
|
488
|
+
bitbucketdc pr diff --project PROJ --repo my-repo --id 42 --context 5 --whitespace ignore-all`
|
|
489
|
+
).action(
|
|
490
|
+
async (opts) => {
|
|
491
|
+
const client = getClient();
|
|
492
|
+
const result = await client.pullRequests.getDiff({
|
|
493
|
+
projectKey: opts.project,
|
|
494
|
+
repositorySlug: opts.repo,
|
|
495
|
+
pullRequestId: parseInt(opts.id),
|
|
496
|
+
path: opts.path,
|
|
497
|
+
sinceId: opts.since,
|
|
498
|
+
untilId: opts.until,
|
|
499
|
+
contextLines: opts.context,
|
|
500
|
+
whitespace: opts.whitespace,
|
|
501
|
+
format: opts.format || "text"
|
|
502
|
+
});
|
|
503
|
+
if (typeof result === "string") {
|
|
504
|
+
process.stdout.write(result);
|
|
505
|
+
} else {
|
|
506
|
+
output(result);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// src/commands/pr/edit-comment.ts
|
|
513
|
+
function editComment(parent) {
|
|
514
|
+
parent.command("edit-comment").description("Edit a pull request comment").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).requiredOption("--comment-id <n>", "Comment ID to edit", parseInt).requiredOption("--text <content>", "New comment text").addHelpText(
|
|
515
|
+
"after",
|
|
516
|
+
'\nExamples:\n bitbucketdc pr edit-comment --project PROJ --repo my-repo --id 42 --comment-id 123 --text "Updated text"'
|
|
517
|
+
).action(async (opts) => {
|
|
518
|
+
const client = getClient();
|
|
519
|
+
const comment2 = await client.pullRequests.getComment({
|
|
520
|
+
projectKey: opts.project,
|
|
521
|
+
repositorySlug: opts.repo,
|
|
522
|
+
pullRequestId: opts.id,
|
|
523
|
+
commentId: opts.commentId
|
|
524
|
+
});
|
|
525
|
+
const result = await client.pullRequests.editComment({
|
|
526
|
+
projectKey: opts.project,
|
|
527
|
+
repositorySlug: opts.repo,
|
|
528
|
+
pullRequestId: opts.id,
|
|
529
|
+
commentId: opts.commentId,
|
|
530
|
+
text: opts.text,
|
|
531
|
+
version: comment2.version
|
|
532
|
+
});
|
|
533
|
+
output(result);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// src/commands/pr/file-comment.ts
|
|
538
|
+
function fileComment(parent) {
|
|
539
|
+
parent.command("file-comment").description("Add a file-level comment to a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--text <text>", "Comment text").requiredOption("--path <path>", "File path to attach comment to (e.g., src/main.ts)").addHelpText(
|
|
540
|
+
"after",
|
|
541
|
+
'\nExamples:\n bitbucketdc pr file-comment --project PROJ --repo my-repo --id 42 --text "This file needs refactoring" --path src/main.ts'
|
|
542
|
+
).action(async (opts) => {
|
|
543
|
+
const client = getClient();
|
|
544
|
+
const result = await client.pullRequests.addComment({
|
|
545
|
+
projectKey: opts.project,
|
|
546
|
+
repositorySlug: opts.repo,
|
|
547
|
+
pullRequestId: parseInt(opts.id),
|
|
548
|
+
text: opts.text,
|
|
549
|
+
path: opts.path
|
|
550
|
+
});
|
|
551
|
+
output(result);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// src/commands/pr/file-diff.ts
|
|
556
|
+
function fileDiff(parent) {
|
|
557
|
+
parent.command("file-diff").description("Get structured line-by-line diff for a specific file").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--path <path>", "File path (e.g., src/main.ts)").option("--context <n>", "Number of context lines around changes (default: 10)", parseInt).addHelpText(
|
|
558
|
+
"after",
|
|
559
|
+
"\nExamples:\n bitbucketdc pr file-diff --project PROJ --repo my-repo --id 42 --path src/main.ts\n bitbucketdc pr file-diff --project PROJ --repo my-repo --id 42 --path src/main.ts --context 5"
|
|
560
|
+
).action(async (opts) => {
|
|
561
|
+
const client = getClient();
|
|
562
|
+
const result = await client.pullRequests.getFileDiff({
|
|
563
|
+
projectKey: opts.project,
|
|
564
|
+
repositorySlug: opts.repo,
|
|
565
|
+
pullRequestId: parseInt(opts.id),
|
|
566
|
+
path: opts.path,
|
|
567
|
+
contextLines: opts.context
|
|
568
|
+
});
|
|
569
|
+
output(result);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// src/commands/pr/get.ts
|
|
574
|
+
function get(parent) {
|
|
575
|
+
parent.command("get").description("Get pull request details").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").addHelpText("after", "\nExamples:\n bitbucketdc pr get --project PROJ --repo my-repo --id 42").action(async (opts) => {
|
|
576
|
+
const client = getClient();
|
|
577
|
+
const result = await client.pullRequests.get({
|
|
578
|
+
projectKey: opts.project,
|
|
579
|
+
repositorySlug: opts.repo,
|
|
580
|
+
pullRequestId: parseInt(opts.id)
|
|
581
|
+
});
|
|
582
|
+
output(result);
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/commands/pr/inbox.ts
|
|
587
|
+
function inbox(parent) {
|
|
588
|
+
parent.command("inbox").description("List pull requests in your reviewer inbox").option("--start <n>", "Starting index for pagination (default: 0)", parseInt).option("--limit <n>", "Maximum number of pull requests to return (default: 25)", parseInt).addHelpText(
|
|
589
|
+
"after",
|
|
590
|
+
"\nExamples:\n bitbucketdc pr inbox\n bitbucketdc pr inbox --limit 10\n bitbucketdc pr inbox --start 25 --limit 25"
|
|
591
|
+
).action(async (opts) => {
|
|
592
|
+
const client = getClient();
|
|
593
|
+
const result = await client.pullRequests.getInbox({
|
|
594
|
+
start: opts.start,
|
|
595
|
+
limit: opts.limit
|
|
596
|
+
});
|
|
597
|
+
output(result);
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/commands/pr/line-comment.ts
|
|
602
|
+
import { Option as Option4 } from "commander";
|
|
603
|
+
function lineComment(parent) {
|
|
604
|
+
parent.command("line-comment").description("Add an inline comment to a specific line in a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--text <text>", "Comment text").requiredOption("--path <path>", "File path (e.g., src/main.ts)").requiredOption("--line <n>", "Line number to comment on").addOption(
|
|
605
|
+
new Option4("--line-type <type>", "Type of line").choices(["ADDED", "REMOVED", "CONTEXT"]).makeOptionMandatory()
|
|
606
|
+
).addOption(
|
|
607
|
+
new Option4("--file-type <type>", "Side of diff: FROM (source/old) or TO (destination/new)").choices(["FROM", "TO"]).makeOptionMandatory()
|
|
608
|
+
).addHelpText(
|
|
609
|
+
"after",
|
|
610
|
+
`
|
|
611
|
+
Examples:
|
|
612
|
+
bitbucketdc pr line-comment --project PROJ --repo my-repo --id 42 --text "Use const here" --path src/main.ts --line 15 --line-type ADDED --file-type TO
|
|
613
|
+
bitbucketdc pr line-comment --project PROJ --repo my-repo --id 42 --text "Was this intentional?" --path src/old.ts --line 8 --line-type REMOVED --file-type FROM`
|
|
614
|
+
).action(
|
|
615
|
+
async (opts) => {
|
|
616
|
+
const client = getClient();
|
|
617
|
+
const result = await client.pullRequests.addComment({
|
|
618
|
+
projectKey: opts.project,
|
|
619
|
+
repositorySlug: opts.repo,
|
|
620
|
+
pullRequestId: parseInt(opts.id),
|
|
621
|
+
text: opts.text,
|
|
622
|
+
path: opts.path,
|
|
623
|
+
line: parseInt(opts.line),
|
|
624
|
+
lineType: opts.lineType,
|
|
625
|
+
fileType: opts.fileType
|
|
626
|
+
});
|
|
627
|
+
output(result);
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/commands/pr/merge.ts
|
|
633
|
+
function merge(parent) {
|
|
634
|
+
parent.command("merge").description("Merge a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).option("--strategy <id>", "Merge strategy (e.g., squash, no-ff, ff, ff-only, rebase-no-ff, rebase-ff-only)").option("--message <text>", "Custom merge commit message").addHelpText(
|
|
635
|
+
"after",
|
|
636
|
+
`
|
|
637
|
+
Examples:
|
|
638
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42
|
|
639
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42 --strategy squash
|
|
640
|
+
bitbucketdc pr merge --project PROJ --repo my-repo --id 42 --message "Merge feature X"`
|
|
641
|
+
).action(async (opts) => {
|
|
642
|
+
const client = getClient();
|
|
643
|
+
const result = await client.pullRequests.merge({
|
|
644
|
+
projectKey: opts.project,
|
|
645
|
+
repositorySlug: opts.repo,
|
|
646
|
+
pullRequestId: opts.id,
|
|
647
|
+
strategyId: opts.strategy,
|
|
648
|
+
message: opts.message
|
|
649
|
+
});
|
|
650
|
+
output(result);
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/commands/pr/reaction-add.ts
|
|
655
|
+
import { Option as Option5 } from "commander";
|
|
656
|
+
function reactionAdd(parent) {
|
|
657
|
+
parent.command("reaction-add").description("Add an emoticon reaction to a PR comment").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--comment-id <n>", "Comment ID").addOption(
|
|
658
|
+
new Option5("--emoticon <name>", "Emoticon to react with").choices(["thumbsup", "thumbsdown", "heart", "thinking_face", "laughing"]).makeOptionMandatory()
|
|
659
|
+
).addHelpText(
|
|
660
|
+
"after",
|
|
661
|
+
`
|
|
662
|
+
Examples:
|
|
663
|
+
bitbucketdc pr reaction-add --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon thumbsup
|
|
664
|
+
bitbucketdc pr reaction-add --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon heart`
|
|
665
|
+
).action(async (opts) => {
|
|
666
|
+
const client = getClient();
|
|
667
|
+
const result = await client.pullRequests.addReaction({
|
|
668
|
+
projectKey: opts.project,
|
|
669
|
+
repositorySlug: opts.repo,
|
|
670
|
+
pullRequestId: parseInt(opts.id),
|
|
671
|
+
commentId: parseInt(opts.commentId),
|
|
672
|
+
emoticon: opts.emoticon
|
|
673
|
+
});
|
|
674
|
+
output(result);
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// src/commands/pr/reaction-remove.ts
|
|
679
|
+
import { Option as Option6 } from "commander";
|
|
680
|
+
function reactionRemove(parent) {
|
|
681
|
+
parent.command("reaction-remove").description("Remove an emoticon reaction from a PR comment").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").requiredOption("--comment-id <n>", "Comment ID").addOption(
|
|
682
|
+
new Option6("--emoticon <name>", "Emoticon to remove").choices(["thumbsup", "thumbsdown", "heart", "thinking_face", "laughing"]).makeOptionMandatory()
|
|
683
|
+
).addHelpText(
|
|
684
|
+
"after",
|
|
685
|
+
`
|
|
686
|
+
Examples:
|
|
687
|
+
bitbucketdc pr reaction-remove --project PROJ --repo my-repo --id 42 --comment-id 123 --emoticon thumbsup`
|
|
688
|
+
).action(async (opts) => {
|
|
689
|
+
const client = getClient();
|
|
690
|
+
await client.pullRequests.removeReaction({
|
|
691
|
+
projectKey: opts.project,
|
|
692
|
+
repositorySlug: opts.repo,
|
|
693
|
+
pullRequestId: parseInt(opts.id),
|
|
694
|
+
commentId: parseInt(opts.commentId),
|
|
695
|
+
emoticon: opts.emoticon
|
|
696
|
+
});
|
|
697
|
+
output({ removed: true, emoticon: opts.emoticon });
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// src/commands/pr/review.ts
|
|
702
|
+
import { Option as Option7 } from "commander";
|
|
703
|
+
function review(parent) {
|
|
704
|
+
parent.command("review").description("Update review status for a pull request").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID").addOption(
|
|
705
|
+
new Option7("--status <status>", "Review status").choices(["APPROVED", "NEEDS_WORK", "UNAPPROVED"]).makeOptionMandatory()
|
|
706
|
+
).addHelpText(
|
|
707
|
+
"after",
|
|
708
|
+
`
|
|
709
|
+
Examples:
|
|
710
|
+
bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status APPROVED
|
|
711
|
+
bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status NEEDS_WORK
|
|
712
|
+
bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status UNAPPROVED`
|
|
713
|
+
).action(async (opts) => {
|
|
714
|
+
const client = getClient();
|
|
715
|
+
const result = await client.pullRequests.updateReviewStatus({
|
|
716
|
+
projectKey: opts.project,
|
|
717
|
+
repositorySlug: opts.repo,
|
|
718
|
+
pullRequestId: parseInt(opts.id),
|
|
719
|
+
status: opts.status
|
|
720
|
+
});
|
|
721
|
+
output(result);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// src/commands/pr/update.ts
|
|
726
|
+
function update(parent) {
|
|
727
|
+
parent.command("update").description("Update a pull request title and/or description").requiredOption("--project <key>", "Bitbucket project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <n>", "Pull request ID", parseInt).option("--title <title>", "New pull request title").option("--description <text>", "New pull request description").addHelpText(
|
|
728
|
+
"after",
|
|
729
|
+
`
|
|
730
|
+
Examples:
|
|
731
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New title"
|
|
732
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --description "Updated description"
|
|
733
|
+
bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New" --description "Both"`
|
|
734
|
+
).action(async (opts) => {
|
|
735
|
+
if (!opts.title && !opts.description) {
|
|
736
|
+
process.stderr.write(`${JSON.stringify({ error: "At least one of --title or --description is required" })}
|
|
737
|
+
`);
|
|
738
|
+
process.exit(1);
|
|
739
|
+
}
|
|
740
|
+
const client = getClient();
|
|
741
|
+
const result = await client.pullRequests.update({
|
|
742
|
+
projectKey: opts.project,
|
|
743
|
+
repositorySlug: opts.repo,
|
|
744
|
+
pullRequestId: opts.id,
|
|
745
|
+
title: opts.title,
|
|
746
|
+
description: opts.description
|
|
747
|
+
});
|
|
748
|
+
output(result);
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// src/commands/pr/index.ts
|
|
753
|
+
function registerPrCommands(program2) {
|
|
754
|
+
const pr = program2.command("pr").description("Pull request operations").addHelpText(
|
|
755
|
+
"after",
|
|
756
|
+
`
|
|
757
|
+
Examples:
|
|
758
|
+
$ bitbucketdc pr inbox
|
|
759
|
+
$ bitbucketdc pr get --project PROJ --repo my-repo --id 42
|
|
760
|
+
$ bitbucketdc pr changes --project PROJ --repo my-repo --id 42
|
|
761
|
+
$ bitbucketdc pr diff --project PROJ --repo my-repo --id 42
|
|
762
|
+
$ bitbucketdc pr create --project PROJ --repo my-repo --from feature-x --to main --title "Add feature"
|
|
763
|
+
$ bitbucketdc pr comment --project PROJ --repo my-repo --id 42 --text "Looks good!"
|
|
764
|
+
$ bitbucketdc pr review --project PROJ --repo my-repo --id 42 --status APPROVED
|
|
765
|
+
$ bitbucketdc pr update --project PROJ --repo my-repo --id 42 --title "New title"
|
|
766
|
+
$ bitbucketdc pr can-merge --project PROJ --repo my-repo --id 42
|
|
767
|
+
$ bitbucketdc pr merge --project PROJ --repo my-repo --id 42
|
|
768
|
+
$ bitbucketdc pr decline --project PROJ --repo my-repo --id 42
|
|
769
|
+
$ bitbucketdc pr delete --project PROJ --repo my-repo --id 42
|
|
770
|
+
`
|
|
771
|
+
);
|
|
772
|
+
inbox(pr);
|
|
773
|
+
get(pr);
|
|
774
|
+
changes3(pr);
|
|
775
|
+
diff3(pr);
|
|
776
|
+
fileDiff(pr);
|
|
777
|
+
activities(pr);
|
|
778
|
+
create(pr);
|
|
779
|
+
comment(pr);
|
|
780
|
+
fileComment(pr);
|
|
781
|
+
lineComment(pr);
|
|
782
|
+
deleteComment(pr);
|
|
783
|
+
editComment(pr);
|
|
784
|
+
reactionAdd(pr);
|
|
785
|
+
reactionRemove(pr);
|
|
786
|
+
review(pr);
|
|
787
|
+
update(pr);
|
|
788
|
+
canMerge(pr);
|
|
789
|
+
merge(pr);
|
|
790
|
+
decline(pr);
|
|
791
|
+
deletePr(pr);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// src/commands/project/list.ts
|
|
795
|
+
function list2(parent) {
|
|
796
|
+
parent.command("list").description("List projects").option("--name <name>", "Filter projects by name (partial match)").option("--permission <permission>", "Filter by permission (e.g., PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN)").option("--start <start>", "Starting index for pagination", parseInt).option("--limit <limit>", "Maximum number of projects to return", parseInt).addHelpText(
|
|
797
|
+
"after",
|
|
798
|
+
'\nExamples:\n bitbucketdc project list\n bitbucketdc project list --name "My Project"\n bitbucketdc project list --permission PROJECT_READ --limit 10'
|
|
799
|
+
).action(async (opts) => {
|
|
800
|
+
const client = getClient();
|
|
801
|
+
const result = await client.projects.list({
|
|
802
|
+
name: opts.name,
|
|
803
|
+
permission: opts.permission,
|
|
804
|
+
start: opts.start,
|
|
805
|
+
limit: opts.limit
|
|
806
|
+
});
|
|
807
|
+
output(result);
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// src/commands/project/index.ts
|
|
812
|
+
function registerProjectCommands(program2) {
|
|
813
|
+
const project = program2.command("project").description("Project operations").addHelpText(
|
|
814
|
+
"after",
|
|
815
|
+
`
|
|
816
|
+
Examples:
|
|
817
|
+
$ bitbucketdc project list
|
|
818
|
+
$ bitbucketdc project list --name "My Project" --limit 10
|
|
819
|
+
`
|
|
820
|
+
);
|
|
821
|
+
list2(project);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// src/commands/repo/attachment/download.ts
|
|
825
|
+
function download(parent) {
|
|
826
|
+
parent.command("download").description("Download a repository attachment to disk").requiredOption("--project <key>", "Project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--id <attachmentId>", "Attachment ID").requiredOption("--output <path>", "Destination file path").addHelpText(
|
|
827
|
+
"after",
|
|
828
|
+
"\nExamples:\n bitbucketdc repo attachment download --project PROJ --repo my-repo --id abc123 --output ./file.png"
|
|
829
|
+
).action(async (opts) => {
|
|
830
|
+
const client = getClient();
|
|
831
|
+
await client.repositories.downloadAttachment({
|
|
832
|
+
projectKey: opts.project,
|
|
833
|
+
repositorySlug: opts.repo,
|
|
834
|
+
attachmentId: opts.id,
|
|
835
|
+
destinationPath: opts.output
|
|
836
|
+
});
|
|
837
|
+
output({ downloaded: true, path: opts.output, attachmentId: opts.id });
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// src/commands/repo/attachment/upload.ts
|
|
842
|
+
function upload(parent) {
|
|
843
|
+
parent.command("upload").description("Upload file attachments to a repository").requiredOption("--project <key>", "Project key").requiredOption("--repo <slug>", "Repository slug").requiredOption("--files <paths>", "Comma-separated local file paths").addHelpText(
|
|
844
|
+
"after",
|
|
845
|
+
"\nExamples:\n bitbucketdc repo attachment upload --project PROJ --repo my-repo --files screenshot.png\n bitbucketdc repo attachment upload --project PROJ --repo my-repo --files file1.png,file2.pdf"
|
|
846
|
+
).action(async (opts) => {
|
|
847
|
+
const client = getClient();
|
|
848
|
+
const filePaths = opts.files.split(",").map((p) => p.trim()).filter(Boolean);
|
|
849
|
+
const results = [];
|
|
850
|
+
const failed = [];
|
|
851
|
+
for (const filePath of filePaths) {
|
|
852
|
+
try {
|
|
853
|
+
const result = await client.repositories.uploadAttachment({
|
|
854
|
+
projectKey: opts.project,
|
|
855
|
+
repositorySlug: opts.repo,
|
|
856
|
+
filePath
|
|
857
|
+
});
|
|
858
|
+
results.push({ id: result.id, url: result.url });
|
|
859
|
+
} catch (err) {
|
|
860
|
+
failed.push({ filePath, error: err instanceof Error ? err.message : String(err) });
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
output({
|
|
864
|
+
project: opts.project,
|
|
865
|
+
repo: opts.repo,
|
|
866
|
+
uploaded: results.length,
|
|
867
|
+
attachments: results,
|
|
868
|
+
...failed.length > 0 && { failed }
|
|
869
|
+
});
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// src/commands/repo/attachment/index.ts
|
|
874
|
+
function registerAttachmentCommands(parent) {
|
|
875
|
+
const attachment = parent.command("attachment").description("Attachment operations").addHelpText(
|
|
876
|
+
"after",
|
|
877
|
+
`
|
|
878
|
+
Examples:
|
|
879
|
+
$ bitbucketdc repo attachment download --project PROJ --repo my-repo --id 706 --output ./image.png
|
|
880
|
+
$ bitbucketdc repo attachment upload --project PROJ --repo my-repo --files screenshot.png,report.pdf
|
|
881
|
+
`
|
|
882
|
+
);
|
|
883
|
+
download(attachment);
|
|
884
|
+
upload(attachment);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
// src/commands/repo/list.ts
|
|
888
|
+
function list3(parent) {
|
|
889
|
+
parent.command("list <projectKey>").description("List repositories in a project").addHelpText("after", "\nExamples:\n bitbucketdc repo list PROJ\n bitbucketdc repo list MYPROJ").action(async (projectKey) => {
|
|
890
|
+
const client = getClient();
|
|
891
|
+
const result = await client.repositories.list({ projectKey });
|
|
892
|
+
output(result);
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// src/commands/repo/index.ts
|
|
897
|
+
function registerRepoCommands(program2) {
|
|
898
|
+
const repo = program2.command("repo").description("Repository operations").addHelpText(
|
|
899
|
+
"after",
|
|
900
|
+
`
|
|
901
|
+
Examples:
|
|
902
|
+
$ bitbucketdc repo list PROJ
|
|
903
|
+
$ bitbucketdc repo attachment download --project PROJ --repo my-repo --id abc123 --output ./file.png
|
|
904
|
+
`
|
|
905
|
+
);
|
|
906
|
+
list3(repo);
|
|
907
|
+
registerAttachmentCommands(repo);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// src/commands/user/list.ts
|
|
911
|
+
function list4(parent) {
|
|
912
|
+
parent.command("list").description("List all users").option("--filter <filter>", "Filter users by username, name or email (partial match)").addHelpText("after", "\nExamples:\n bitbucketdc user list\n bitbucketdc user list --filter john").action(async (opts) => {
|
|
913
|
+
const client = getClient();
|
|
914
|
+
const result = await client.users.getAll(opts.filter ? { filter: opts.filter } : void 0);
|
|
915
|
+
output(result);
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// src/commands/user/profile.ts
|
|
920
|
+
function profile(parent) {
|
|
921
|
+
parent.command("profile <username>").description("Get a user profile by username").addHelpText("after", "\nExamples:\n bitbucketdc user profile jsmith\n bitbucketdc user profile admin").action(async (username) => {
|
|
922
|
+
const client = getClient();
|
|
923
|
+
const result = await client.users.getProfile({ username });
|
|
924
|
+
output(result);
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// src/commands/user/index.ts
|
|
929
|
+
function registerUserCommands(program2) {
|
|
930
|
+
const user = program2.command("user").description("User operations").addHelpText(
|
|
931
|
+
"after",
|
|
932
|
+
`
|
|
933
|
+
Examples:
|
|
934
|
+
$ bitbucketdc user profile jsmith
|
|
935
|
+
$ bitbucketdc user list --filter john
|
|
936
|
+
`
|
|
937
|
+
);
|
|
938
|
+
profile(user);
|
|
939
|
+
list4(user);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// src/index.ts
|
|
943
|
+
var DIM = "\x1B[2m";
|
|
944
|
+
var RESET = "\x1B[0m";
|
|
945
|
+
var program = new Command8();
|
|
946
|
+
program.name("bitbucketdc").description("Bitbucket Data Center CLI").version("1.0.0").configureHelp({
|
|
947
|
+
styleTitle: (str) => styleText("bold", str),
|
|
948
|
+
styleUsage: (str) => styleText("dim", str),
|
|
949
|
+
styleCommandDescription: (str) => styleText("dim", str),
|
|
950
|
+
styleOptionDescription: (str) => styleText("dim", str),
|
|
951
|
+
styleSubcommandDescription: (str) => styleText("dim", str)
|
|
952
|
+
}).addHelpText("beforeAll", `
|
|
953
|
+
${styleText("bold", "bitbucketdc")} ${DIM}\u2014 Bitbucket Data Center CLI${RESET}
|
|
954
|
+
`).addHelpText(
|
|
955
|
+
"after",
|
|
956
|
+
`
|
|
957
|
+
${styleText("bold", "Environment:")}
|
|
29
958
|
BITBUCKET_URL Bitbucket Server base URL ${DIM}(e.g., https://bitbucket.example.com)${RESET}
|
|
30
959
|
BITBUCKET_TOKEN Personal Access Token ${DIM}(generate in Bitbucket > Profile > Personal Access Tokens)${RESET}
|
|
31
960
|
|
|
32
|
-
${styleText(
|
|
961
|
+
${styleText("bold", "Examples:")}
|
|
33
962
|
${DIM}$${RESET} bitbucketdc user profile jsmith
|
|
34
963
|
${DIM}$${RESET} bitbucketdc user list --filter john
|
|
35
964
|
${DIM}$${RESET} bitbucketdc project list --name "My Project"
|
|
36
965
|
${DIM}$${RESET} bitbucketdc repo list PROJ
|
|
37
966
|
${DIM}$${RESET} bitbucketdc pr inbox
|
|
38
967
|
${DIM}$${RESET} bitbucketdc pr get --project PROJ --repo my-repo --pr 42
|
|
39
|
-
`
|
|
968
|
+
`
|
|
969
|
+
);
|
|
40
970
|
registerUserCommands(program);
|
|
41
971
|
registerProjectCommands(program);
|
|
42
972
|
registerRepoCommands(program);
|
|
@@ -45,9 +975,7 @@ registerCommitCommands(program);
|
|
|
45
975
|
registerCompareCommands(program);
|
|
46
976
|
registerPrCommands(program);
|
|
47
977
|
try {
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
handleError(err);
|
|
978
|
+
await program.parseAsync();
|
|
979
|
+
} catch (err) {
|
|
980
|
+
handleError(err);
|
|
52
981
|
}
|
|
53
|
-
//# sourceMappingURL=index.js.map
|