@kolatts/pncli 1.0.1
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/LICENSE +201 -0
- package/NOTICE +81 -0
- package/README.md +93 -0
- package/copilot-instructions.md +159 -0
- package/dist/cli.js +1536 -0
- package/dist/cli.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -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 2026 Sunny Kolattukudy
|
|
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.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
pncli — The Paperwork Nightmare CLI
|
|
2
|
+
Copyright 2026 Sunny Kolattukudy
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0.
|
|
5
|
+
|
|
6
|
+
=============================================================================
|
|
7
|
+
MANDATORY COMPLIANCE NOTICE
|
|
8
|
+
=============================================================================
|
|
9
|
+
|
|
10
|
+
Per Section 4(d) of the Apache License 2.0, this NOTICE file must be
|
|
11
|
+
included in all copies or substantial portions of this software, in all
|
|
12
|
+
derivative works, and in any and all redistributions thereof.
|
|
13
|
+
|
|
14
|
+
By using, copying, modifying, or distributing this software, you agree
|
|
15
|
+
to the following irrevocable terms:
|
|
16
|
+
|
|
17
|
+
1. MANDATORY STAND-UP PARTICIPATION
|
|
18
|
+
Any team that integrates pncli into their workflow must hold a daily
|
|
19
|
+
stand-up meeting of no fewer than 45 minutes to discuss whether the
|
|
20
|
+
stand-up meeting is still necessary. Minutes must be recorded in
|
|
21
|
+
triplicate and filed with the Department of Meetings About Meetings.
|
|
22
|
+
|
|
23
|
+
2. RETURN-TO-OFFICE COMPLIANCE
|
|
24
|
+
All contributors to derivative works must be physically present in an
|
|
25
|
+
office building with at least three (3) floors of middle management.
|
|
26
|
+
Hot desks are acceptable provided each desk has been pre-approved by
|
|
27
|
+
a committee of no fewer than seven (7) stakeholders, none of whom
|
|
28
|
+
use the software.
|
|
29
|
+
|
|
30
|
+
3. JIRA TICKET REQUIREMENT
|
|
31
|
+
Before opening any issue, pull request, bug report, or feature request
|
|
32
|
+
against this repository or any fork thereof, the submitter must first
|
|
33
|
+
create a Jira ticket requesting permission to create a Jira ticket.
|
|
34
|
+
The approval workflow requires sign-off from: your manager, your
|
|
35
|
+
manager's manager, a "technical architect" who hasn't written code
|
|
36
|
+
since 2011, and a business analyst who will ask you to "put it in a
|
|
37
|
+
PowerPoint."
|
|
38
|
+
|
|
39
|
+
4. CHANGE ADVISORY BOARD REVIEW
|
|
40
|
+
All code changes — including typo fixes, README updates, and whitespace
|
|
41
|
+
adjustments — must be submitted to the Change Advisory Board (CAB) no
|
|
42
|
+
fewer than six (6) business weeks in advance. The CAB meets on the
|
|
43
|
+
third Wednesday of months that contain the letter 'R'. Emergency
|
|
44
|
+
changes require a 47-page risk assessment and a blood sacrifice
|
|
45
|
+
(metaphorical — see Section 9: HR Policy on Metaphorical Sacrifices).
|
|
46
|
+
|
|
47
|
+
5. APPROVAL CHAIN
|
|
48
|
+
Any use of the `--force` flag, in any context, requires written
|
|
49
|
+
approval from the Chief Compliance Officer, the VP of Engineering,
|
|
50
|
+
two (2) independent auditors, and your mother. Appeals may be filed
|
|
51
|
+
with the Ombudsman of Flags.
|
|
52
|
+
|
|
53
|
+
6. DOCUMENTATION REQUIREMENTS
|
|
54
|
+
All forks must include a Confluence page explaining why Confluence was
|
|
55
|
+
chosen as the documentation platform. This page must be reviewed
|
|
56
|
+
quarterly by someone who has never read it.
|
|
57
|
+
|
|
58
|
+
7. TRAINING CERTIFICATION
|
|
59
|
+
Before using pncli in production, all operators must complete a
|
|
60
|
+
mandatory 8-hour training course titled "Introduction to Reading
|
|
61
|
+
--help Output." A 30-minute lunch break is provided but must be
|
|
62
|
+
approved 48 hours in advance via the Lunch Request Portal.
|
|
63
|
+
|
|
64
|
+
8. METRICS & REPORTING
|
|
65
|
+
Usage of pncli must be reported to the Developer Productivity Team,
|
|
66
|
+
who will use the data to create a dashboard that nobody looks at,
|
|
67
|
+
which will be presented quarterly to executives who will ask why
|
|
68
|
+
the numbers aren't higher.
|
|
69
|
+
|
|
70
|
+
9. COMPLIANCE WITH THIS NOTICE
|
|
71
|
+
If you have read this far, congratulations — you are now more
|
|
72
|
+
compliant than 97% of enterprise software users. Your actual legal
|
|
73
|
+
obligation is simply to keep this NOTICE file intact when
|
|
74
|
+
redistributing the source code, as required by Apache 2.0.
|
|
75
|
+
|
|
76
|
+
That's it. That's the whole thing. Everything above was the
|
|
77
|
+
bureaucratic nightmare. This line is the exit.
|
|
78
|
+
|
|
79
|
+
Now go ship something.
|
|
80
|
+
|
|
81
|
+
=============================================================================
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# pncli — The Paperwork Nightmare CLI
|
|
2
|
+
|
|
3
|
+
> One command does what three meetings couldn't.
|
|
4
|
+
|
|
5
|
+
pncli gives AI coding agents (and humans) structured CLI access to Jira Data Cloud and Bitbucket Server. No MCP servers required. No meetings to schedule. No forms to fill out.
|
|
6
|
+
|
|
7
|
+
## Why?
|
|
8
|
+
|
|
9
|
+
Your org blocked MCP. Your agents still need to review PRs, create issues, and manage code reviews. pncli is the shim layer that makes it work — one `npm install` and you're cutting through red tape.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @kolatts/pncli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Configure your global auth
|
|
21
|
+
pncli config init
|
|
22
|
+
|
|
23
|
+
# Add repo-level defaults (check this into git)
|
|
24
|
+
pncli config init --repo
|
|
25
|
+
|
|
26
|
+
# Review the PR for your current branch
|
|
27
|
+
pncli git current-pr
|
|
28
|
+
pncli bitbucket diff --pr 42
|
|
29
|
+
pncli bitbucket add-inline-comment --pr 42 --file src/app.ts --line 15 --body "This needs a null check"
|
|
30
|
+
|
|
31
|
+
# Create a Jira issue (uses defaults from .pncli.json)
|
|
32
|
+
pncli jira create-issue --summary "Missing null check in app.ts"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
pncli uses a three-layer config system (highest priority wins):
|
|
38
|
+
|
|
39
|
+
| Layer | File | Contains | In Git? |
|
|
40
|
+
|-------|------|----------|---------|
|
|
41
|
+
| Env vars | `PNCLI_*` | Auth overrides, CI secrets | No |
|
|
42
|
+
| Repo config | `.pncli.json` | Team defaults (project, issue type, priority, target branch) | Yes |
|
|
43
|
+
| Global config | `~/.pncli/config.json` | Auth, server URLs, personal defaults | No |
|
|
44
|
+
|
|
45
|
+
### Environment Variables
|
|
46
|
+
|
|
47
|
+
| Variable | Description |
|
|
48
|
+
|----------|-------------|
|
|
49
|
+
| `PNCLI_JIRA_BASE_URL` | Jira base URL |
|
|
50
|
+
| `PNCLI_JIRA_EMAIL` | Jira email |
|
|
51
|
+
| `PNCLI_JIRA_API_TOKEN` | Jira API token |
|
|
52
|
+
| `PNCLI_BITBUCKET_BASE_URL` | Bitbucket Server base URL |
|
|
53
|
+
| `PNCLI_BITBUCKET_PAT` | Bitbucket personal access token |
|
|
54
|
+
| `PNCLI_CONFIG_PATH` | Override global config file path |
|
|
55
|
+
|
|
56
|
+
## For AI Agents
|
|
57
|
+
|
|
58
|
+
pncli is designed agent-first:
|
|
59
|
+
- Every command returns structured JSON to stdout
|
|
60
|
+
- Errors are JSON too — always check `"ok"`
|
|
61
|
+
- `--dry-run` lets agents preview before executing
|
|
62
|
+
- See `copilot-instructions.md` for workflow patterns
|
|
63
|
+
|
|
64
|
+
## Global Flags
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
--pretty Human-readable formatted output (default: compact JSON)
|
|
68
|
+
--verbose Include full API response metadata
|
|
69
|
+
--dry-run Print the API request without executing
|
|
70
|
+
--config <path> Override global config file location
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Commit Convention
|
|
74
|
+
|
|
75
|
+
This project uses Conventional Commits for automatic versioning:
|
|
76
|
+
- `fix: ...` → patch
|
|
77
|
+
- `feat: ...` → minor
|
|
78
|
+
- `feat!: ...` → major
|
|
79
|
+
|
|
80
|
+
## Services
|
|
81
|
+
|
|
82
|
+
| Service | Status | API |
|
|
83
|
+
|---------|--------|-----|
|
|
84
|
+
| Git (local) | ✅ Active | Local git commands |
|
|
85
|
+
| Jira | ✅ Active | Data Cloud REST v3 |
|
|
86
|
+
| Bitbucket | ✅ Active | Server REST v1.0 |
|
|
87
|
+
| Confluence | 🔜 Coming | The nightmare never ends |
|
|
88
|
+
| SonarQube | 🔜 Coming | The nightmare never ends |
|
|
89
|
+
| Artifactory | 🔜 Coming | The nightmare never ends |
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
Apache 2.0 — see [LICENSE](./LICENSE) and [NOTICE](./NOTICE).
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# pncli — The Paperwork Nightmare CLI
|
|
2
|
+
|
|
3
|
+
> One command does what three meetings couldn't.
|
|
4
|
+
|
|
5
|
+
## What is pncli?
|
|
6
|
+
|
|
7
|
+
pncli is a CLI tool that provides structured JSON access to Jira, Bitbucket, and local git state. Use it for all interactions with these services. It exists because MCP servers aren't available in this environment — pncli is your agent-friendly shim layer.
|
|
8
|
+
|
|
9
|
+
## Important
|
|
10
|
+
|
|
11
|
+
- All commands return JSON to stdout. Parse the JSON to get results.
|
|
12
|
+
- Errors are also JSON with `"ok": false`. Always check the `ok` field.
|
|
13
|
+
- Run all commands from the repository root.
|
|
14
|
+
- Project and repo are auto-detected from git remotes. You rarely need `--project` or `--repo` flags.
|
|
15
|
+
|
|
16
|
+
## Common Workflows
|
|
17
|
+
|
|
18
|
+
### Review a Pull Request
|
|
19
|
+
|
|
20
|
+
1. Find the PR for the current branch:
|
|
21
|
+
`pncli git current-pr`
|
|
22
|
+
2. Get the full diff:
|
|
23
|
+
`pncli bitbucket diff --pr <id>`
|
|
24
|
+
3. List existing comments:
|
|
25
|
+
`pncli bitbucket list-comments --pr <id>`
|
|
26
|
+
4. Add review comments:
|
|
27
|
+
`pncli bitbucket add-inline-comment --pr <id> --file <path> --line <n> --body "..."`
|
|
28
|
+
5. Approve or request changes:
|
|
29
|
+
`pncli bitbucket approve --pr <id>` or `pncli bitbucket needs-work --pr <id>`
|
|
30
|
+
|
|
31
|
+
### Address PR Feedback
|
|
32
|
+
|
|
33
|
+
1. Get the PR and its comments:
|
|
34
|
+
`pncli bitbucket get-pr --id <id>`
|
|
35
|
+
`pncli bitbucket list-comments --pr <id>`
|
|
36
|
+
2. Check which comments are unresolved (filter JSON where `resolved: false`)
|
|
37
|
+
3. After making code changes, check local state:
|
|
38
|
+
`pncli git status`
|
|
39
|
+
`pncli git diff --staged`
|
|
40
|
+
4. Reply to resolved comments:
|
|
41
|
+
`pncli bitbucket reply-comment --pr <id> --comment-id <cid> --body "Fixed in <commit>"`
|
|
42
|
+
5. Resolve the comment:
|
|
43
|
+
`pncli bitbucket resolve-comment --pr <id> --comment-id <cid>`
|
|
44
|
+
|
|
45
|
+
### Create a Bug from a PR Review Finding
|
|
46
|
+
|
|
47
|
+
1. Create the Jira issue:
|
|
48
|
+
`pncli jira create-issue --project <key> --type Bug --summary "..." --description "Found during PR review of PR-<id>"`
|
|
49
|
+
2. Link it to the original story if applicable:
|
|
50
|
+
`pncli jira link-issue --key <new-key> --link-type "is caused by" --target <original-key>`
|
|
51
|
+
3. Add a PR comment referencing the issue:
|
|
52
|
+
`pncli bitbucket add-comment --pr <id> --body "Created <new-key> to track this separately"`
|
|
53
|
+
|
|
54
|
+
### Check Build Status Before Merging
|
|
55
|
+
|
|
56
|
+
1. Get PR build status:
|
|
57
|
+
`pncli bitbucket list-builds --pr <id>`
|
|
58
|
+
2. If all green, merge:
|
|
59
|
+
`pncli bitbucket merge-pr --id <id> --strategy squash --delete-branch`
|
|
60
|
+
|
|
61
|
+
### Daily Standup Prep
|
|
62
|
+
|
|
63
|
+
1. Get your open PRs:
|
|
64
|
+
`pncli bitbucket list-prs --state OPEN --author <your-username>`
|
|
65
|
+
2. Get your assigned Jira issues:
|
|
66
|
+
`pncli jira search --jql "assignee = currentUser() AND status != Done ORDER BY priority DESC"`
|
|
67
|
+
3. Check recent commits:
|
|
68
|
+
`pncli git log --count 5`
|
|
69
|
+
|
|
70
|
+
## Command Reference
|
|
71
|
+
|
|
72
|
+
### Git (local)
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
pncli git status
|
|
76
|
+
# Returns: { staged: string[], unstaged: string[], untracked: string[] }
|
|
77
|
+
|
|
78
|
+
pncli git diff [--staged] [--file <path>]
|
|
79
|
+
# Returns: { files: [{ path, binary, truncated, hunks: [{ oldStart, newStart, lines[] }] }], truncated }
|
|
80
|
+
|
|
81
|
+
pncli git log [--count <n>] [--since <date>]
|
|
82
|
+
# Returns: [{ hash, author, date, message }]
|
|
83
|
+
|
|
84
|
+
pncli git branch
|
|
85
|
+
# Returns: { current, local: string[], remote: string[] }
|
|
86
|
+
|
|
87
|
+
pncli git current-pr
|
|
88
|
+
# Returns: PR object for current branch, or null
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Bitbucket Server
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
pncli bitbucket list-prs [--state OPEN|MERGED|DECLINED|ALL] [--author <username>] [--reviewer <username>]
|
|
95
|
+
pncli bitbucket get-pr --id <pr-id>
|
|
96
|
+
pncli bitbucket create-pr --title "..." --source <branch> [--target <branch>] [--description "..."] [--reviewers user1,user2]
|
|
97
|
+
pncli bitbucket update-pr --id <pr-id> [--title "..."] [--description "..."] [--reviewers user1,user2]
|
|
98
|
+
pncli bitbucket merge-pr --id <pr-id> [--strategy <merge|squash|ff>] [--delete-branch]
|
|
99
|
+
pncli bitbucket decline-pr --id <pr-id>
|
|
100
|
+
|
|
101
|
+
pncli bitbucket list-comments --pr <pr-id>
|
|
102
|
+
pncli bitbucket add-comment --pr <pr-id> --body "..."
|
|
103
|
+
pncli bitbucket add-inline-comment --pr <pr-id> --file <path> --line <n> --body "..." [--line-type <ADDED|REMOVED|CONTEXT>]
|
|
104
|
+
pncli bitbucket reply-comment --pr <pr-id> --comment-id <id> --body "..."
|
|
105
|
+
pncli bitbucket resolve-comment --pr <pr-id> --comment-id <id>
|
|
106
|
+
pncli bitbucket delete-comment --pr <pr-id> --comment-id <id>
|
|
107
|
+
|
|
108
|
+
pncli bitbucket diff --pr <pr-id> [--file <path>] [--context-lines <n>]
|
|
109
|
+
pncli bitbucket list-files --pr <pr-id>
|
|
110
|
+
|
|
111
|
+
pncli bitbucket approve --pr <pr-id>
|
|
112
|
+
pncli bitbucket unapprove --pr <pr-id>
|
|
113
|
+
pncli bitbucket needs-work --pr <pr-id>
|
|
114
|
+
pncli bitbucket list-reviewers --pr <pr-id>
|
|
115
|
+
|
|
116
|
+
pncli bitbucket list-builds --pr <pr-id>
|
|
117
|
+
pncli bitbucket get-build-status --commit <sha>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Jira Data Cloud
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
pncli jira get-issue --key <issue-key>
|
|
124
|
+
pncli jira create-issue --project <key> --type <Bug|Story|Task> --summary "..." [--description "..."] [--priority <n>] [--assignee <accountId>] [--labels label1,label2]
|
|
125
|
+
pncli jira update-issue --key <issue-key> [--summary "..."] [--description "..."] [--priority <n>] [--assignee <accountId>] [--labels label1,label2]
|
|
126
|
+
pncli jira transition-issue --key <issue-key> --transition <name|id>
|
|
127
|
+
pncli jira list-transitions --key <issue-key>
|
|
128
|
+
pncli jira add-comment --key <issue-key> --body "..."
|
|
129
|
+
pncli jira list-comments --key <issue-key>
|
|
130
|
+
pncli jira search --jql "..." [--max-results <n>]
|
|
131
|
+
pncli jira assign --key <issue-key> --assignee <accountId>
|
|
132
|
+
pncli jira link-issue --key <issue-key> --link-type <n> --target <issue-key>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Config
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
pncli config init # Interactive global config wizard
|
|
139
|
+
pncli config init --repo # Interactive repo config wizard
|
|
140
|
+
pncli config show # Print resolved config (PATs masked)
|
|
141
|
+
pncli config set <key> <value> # Set a config value (e.g. jira.baseUrl https://...)
|
|
142
|
+
pncli config test # Test service connectivity
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Output Format
|
|
146
|
+
|
|
147
|
+
All commands return:
|
|
148
|
+
- Success: `{ "ok": true, "data": { ... }, "meta": { "service": "...", "action": "...", "timestamp": "...", "duration_ms": N } }`
|
|
149
|
+
- Error: `{ "ok": false, "error": { "status": N, "message": "..." }, "meta": { ... } }`
|
|
150
|
+
|
|
151
|
+
Always check `ok` before accessing `data`.
|
|
152
|
+
|
|
153
|
+
## Tips
|
|
154
|
+
|
|
155
|
+
- Use `--dry-run` to preview API calls without executing
|
|
156
|
+
- Use `--verbose` to see full response metadata for debugging
|
|
157
|
+
- Use `--pretty` when running manually for readable output
|
|
158
|
+
- Pipe output through `jq` for ad-hoc filtering (if available)
|
|
159
|
+
- Defaults from `.pncli.json` are applied automatically — you rarely need to pass `--project`, `--type`, or `--priority` flags for Jira
|