@kolatts/pncli 2.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import {
9
9
  setRepoConfigValue,
10
10
  writeGlobalConfig,
11
11
  writeRepoConfig
12
- } from "./chunk-PXKUQPPF.js";
12
+ } from "./chunk-LH7WBP7W.js";
13
13
  export {
14
14
  getGlobalConfigPath,
15
15
  loadConfig,
@@ -21,4 +21,4 @@ export {
21
21
  writeGlobalConfig,
22
22
  writeRepoConfig
23
23
  };
24
- //# sourceMappingURL=config-YHYQTGKT.js.map
24
+ //# sourceMappingURL=config-JGBUUXQX.js.map
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  HttpClient,
4
4
  createHttpClient
5
- } from "./chunk-ZDJYOI3W.js";
5
+ } from "./chunk-7MFRRV5V.js";
6
6
  import "./chunk-HZF6WQPU.js";
7
7
  export {
8
8
  HttpClient,
9
9
  createHttpClient
10
10
  };
11
- //# sourceMappingURL=http-6QJU2SWP.js.map
11
+ //# sourceMappingURL=http-44W5CSDF.js.map
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@kolatts/pncli",
3
- "version": "2.0.0",
4
- "description": "The Paperwork Nightmare CLI — One command does what three meetings couldn't.",
3
+ "version": "4.0.0",
4
+ "description": "The Paperwork Nightmare CLI — structured JSON access to Jira, Bitbucket, GitHub, Confluence, Azure DevOps, SonarQube, Jenkins, and more, built for AI coding agents. One command does what three meetings couldn't.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "pncli": "./dist/cli.js"
8
8
  },
9
9
  "engines": {
10
- "node": ">=22.4"
10
+ "node": ">=22.19.0"
11
11
  },
12
12
  "scripts": {
13
13
  "build": "tsup",
@@ -16,7 +16,7 @@
16
16
  "typecheck": "tsc --noEmit",
17
17
  "test": "vitest run",
18
18
  "test:watch": "vitest",
19
- "prepare": "husky"
19
+ "sync-readme": "tsx scripts/sync-readme.ts"
20
20
  },
21
21
  "dependencies": {
22
22
  "@inquirer/checkbox": "^5.2.1",
@@ -25,14 +25,14 @@
25
25
  "@inquirer/password": "^5.0.13",
26
26
  "@inquirer/select": "^5.1.5",
27
27
  "chalk": "^5.4.1",
28
- "commander": "^13.1.0"
28
+ "commander": "^13.1.0",
29
+ "undici": "^8.10.1"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@types/node": "^22.15.3",
32
33
  "@typescript-eslint/eslint-plugin": "^8.31.0",
33
34
  "@typescript-eslint/parser": "^8.31.0",
34
35
  "eslint": "^9.25.1",
35
- "husky": "^9.1.7",
36
36
  "tsup": "^8.4.0",
37
37
  "tsx": "^4.19.3",
38
38
  "typescript": "^5.8.3",
@@ -45,8 +45,37 @@
45
45
  "developer-tools",
46
46
  "code-review",
47
47
  "agent",
48
- "automation"
48
+ "automation",
49
+ "ai-agent",
50
+ "agent-skills",
51
+ "skills",
52
+ "claude",
53
+ "claude-code",
54
+ "github-copilot",
55
+ "codex",
56
+ "github",
57
+ "confluence",
58
+ "azure-devops",
59
+ "sonarqube",
60
+ "jenkins",
61
+ "artifactory",
62
+ "checkmarx",
63
+ "servicenow",
64
+ "sdelements",
65
+ "sonatype",
66
+ "contrast-security",
67
+ "openshift",
68
+ "kubernetes",
69
+ "dynatrace",
70
+ "logscale",
71
+ "figma",
72
+ "enterprise",
73
+ "json-cli"
49
74
  ],
75
+ "homepage": "https://kolatts.github.io/pncli/",
76
+ "bugs": {
77
+ "url": "https://github.com/kolatts/pncli/issues"
78
+ },
50
79
  "repository": {
51
80
  "type": "git",
52
81
  "url": "https://github.com/kolatts/pncli"
@@ -57,7 +86,6 @@
57
86
  "skills",
58
87
  "LICENSE",
59
88
  "NOTICE",
60
- "README.md",
61
- "copilot-instructions.md"
89
+ "README.md"
62
90
  ]
63
91
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pncli
3
- description: Use when asked to set up pncli, configure a service, initialize a repo, or run pncli commands. Walks through identity, work item tracking, source control, and optional services. For any specific service, read the included <service>.md file.
3
+ description: Use when working with enterprise tools through pncli — querying or updating Jira issues, Bitbucket/GitHub/Azure DevOps pull requests, Confluence pages, SonarQube findings, Jenkins builds, ServiceNow records, and more — or when asked to set up pncli, configure a service, or initialize a repo. Walks through identity, work item tracking, source control, and optional services. For any specific service, read the included <service>.md file.
4
4
  compatibility: Designed for Claude Code. Requires pncli installed and accessible in PATH.
5
5
  user-invocable: true
6
6
  metadata:
@@ -9,10 +9,39 @@ metadata:
9
9
  services: config
10
10
  ---
11
11
 
12
- pncli gives AI agents and humans unified CLI access to enterprise tools: Jira, Bitbucket, Confluence, SonarQube, SDElements, Azure DevOps, Jenkins, Artifactory, Checkmarx, ServiceNow, Contrast Security IAST, Sonatype IQ Server, OpenShift / Kubernetes, Dynatrace, LogScale, and Figma.
12
+ pncli gives AI agents and humans unified CLI access to enterprise tools: Jira, Bitbucket, GitHub, Confluence, SonarQube, SDElements, Azure DevOps, Jenkins, Artifactory, Checkmarx, ServiceNow, Contrast Security IAST, Sonatype IQ Server, OpenShift / Kubernetes, Dynatrace, LogScale, Split.IO, and Figma.
13
13
 
14
14
  Every service authenticates the same way: a personal access token you generate in that tool's own UI and put in an env var or the config file. If a tool you need is missing from the table below, it is not out of scope by default — pncli covers enterprise tooling broadly, and the only hard requirement is personal-access-token auth.
15
15
 
16
+ ## Output and errors
17
+
18
+ All commands return JSON to stdout — parse it rather than scraping text.
19
+
20
+ - Success: `{ "ok": true, "data": { ... }, "meta": { "service": "...", "action": "...", "timestamp": "...", "duration_ms": N } }`
21
+ - Error: `{ "ok": false, "error": { "status": N, "message": "...", "url": "..." }, "meta": { ... } }` (`url` is null when the failure was not an HTTP call)
22
+
23
+ Always check `ok` before reading `data`. Errors are JSON too, so a non-zero exit still gives you a structured reason.
24
+
25
+ Run commands from the repository root — project and repo are auto-detected from git remotes.
26
+
27
+ ## Provider detection
28
+
29
+ Before running provider-specific commands, establish which tools the repo actually uses:
30
+
31
+ 1. **Work item tracking** — Jira or Azure DevOps? Determines `pncli jira ...` vs `pncli ado work ...`.
32
+ 2. **Source control** — GitHub, Bitbucket, or Azure DevOps? Determines `pncli github ...`, `pncli bitbucket ...`, or `pncli ado repo ...`.
33
+
34
+ Ask the user and cache the answers for the session. If they don't know, run `git remote -v`: a URL containing `/_git/` is Azure DevOps, `/scm/` is Bitbucket, `github.com` (or a GitHub Enterprise host) is GitHub.
35
+
36
+ ## Useful flags
37
+
38
+ - `--dry-run` — print the API request without executing it
39
+ - `--verbose` — extra progress detail on stderr (stdout stays pure JSON)
40
+ - `--debug` — trace every API call (method, URL, status) on stderr; never logs credentials
41
+ - `--pretty` — human-readable output when running by hand
42
+ - `--output-file <path>` — write JSON to a file instead of stdout; use it for large payloads (search, logs, `--all` pagination) so they don't flood agent context
43
+ - Defaults from `.pncli.json` are applied automatically — you rarely need `--project`, `--repo`, `--type`, or `--priority`
44
+
16
45
  ## Two config levels
17
46
 
18
47
  **Env vars** — ephemeral, per-session, override the config file. Set before running pncli:
@@ -30,13 +59,32 @@ Repo-level defaults (project key, target branch) are stored in `.pncli.json` in
30
59
  pncli config set --repo defaults.<service>.<key> <value>
31
60
  ```
32
61
 
62
+ ## Corporate proxies and TLS
63
+
64
+ pncli honours the standard proxy variables for every service. Set them before running:
65
+
66
+ ```
67
+ export HTTPS_PROXY=http://proxy.imagile.dev:8080
68
+ export HTTP_PROXY=http://proxy.imagile.dev:8080
69
+ export NO_PROXY=.imagile.dev,localhost,127.0.0.1
70
+ ```
71
+
72
+ `NO_PROXY` exclusions are respected, so self-hosted services on the internal
73
+ network stay direct while SaaS ones route out through the proxy. If a proxy
74
+ variable is set but the proxy cannot be configured, pncli warns on stderr rather
75
+ than silently bypassing it.
76
+
77
+ TLS verification is **off** by default, because most self-hosted enterprise
78
+ installs sit behind SSL-inspecting proxies that break the certificate chain.
79
+ Set `PNCLI_VERIFY_TLS=1` to turn it back on.
80
+
33
81
  ## Large text fields (descriptions, acceptance criteria)
34
82
 
35
83
  For commands with long rich-text fields (Jira `create-issue`/`update-issue`, ADO `work create`/`work update`), use `--input-file <path>` (`-` for stdin) instead of pasting a huge string inline — avoids hitting the shell's command-line length limit. The file is a JSON dictionary of field name/id → value; any string value may be `@path/to/file` to pull that field's content from a file instead. Run `pncli <service> schema` (e.g. `pncli jira schema`) to see the exact shape and a runnable example. Individual CLI flags still override matching keys from the file, and the override is reported. See `jira.md` / `ado.md` for details.
36
84
 
37
85
  ## Available services
38
86
 
39
- For detailed setup of any service, read the included file for that service.
87
+ Each service has its own file in this skill with the config keys and example values for it.
40
88
 
41
89
  | Service | File | Commands unlocked |
42
90
  |---------|------|-------------------|
@@ -52,7 +100,7 @@ For detailed setup of any service, read the included file for that service.
52
100
  | Jenkins | `jenkins.md` | Builds, job status |
53
101
  | Artifactory | `artifactory.md` | Packages, repos |
54
102
  | ServiceNow | `servicenow.md` | Change requests, incidents |
55
- | Contrast IAST | `contrast.md` | Runtime vulnerability findings |
103
+ | Contrast IAST | `contrast.md` | Runtime vulnerability findings, libraries |
56
104
  | Sonatype IQ | `sonatypeiq.md` | Dependency policy enforcement |
57
105
  | OpenShift / Kubernetes | `openshift.md` | Pod health, events, logs, metrics |
58
106
  | Dynatrace | `dynatrace.md` | Services, entities, problems, traces, Kubernetes workloads |
@@ -61,6 +109,14 @@ For detailed setup of any service, read the included file for that service.
61
109
  | Figma | `figma.md` | Design files, comments, version history |
62
110
  | Skills Marketplace | `marketplace.md` | Install org-internal skills |
63
111
 
112
+ ## Installing skills
113
+
114
+ The skills bundled with pncli install into a repo with `pncli skills install` (default target `.agents/skills/`, which GitHub Copilot and Codex both read; add `--agent claude-code` for `.claude/skills`, or `--all-agents` to cover every agent host in one run). Add `--scope user` to install them globally instead.
115
+
116
+ Installed skills are a copy — after upgrading pncli, re-run `pncli skills install` to refresh them. `skills list` and `skills status` warn when the installed copy came from a different pncli version.
117
+
118
+ Org-internal skills come from a git-hosted marketplace: `pncli skills marketplace setup <git-clone-url>` registers one, and `pncli skills marketplace sync` keeps everything installed from it current. `pncli skills status` and `pncli skills locations` show what is installed and where. The full workflow is in the `marketplace.md` file that ships inside the installed skill.
119
+
64
120
  ## Setup walkthrough
65
121
 
66
122
  **Step 1 — Identity**
@@ -102,3 +158,11 @@ Review results. If any service shows `ok: false`, help troubleshoot the URL or c
102
158
  ```
103
159
  pncli config show
104
160
  ```
161
+
162
+ **Troubleshooting** — when any command fails unexpectedly, run:
163
+
164
+ ```
165
+ pncli doctor
166
+ ```
167
+
168
+ It reports config-file health, credential validity per service, and skill install state (including stale skills) in one JSON envelope, with a `problems` array listing suggested fixes. Add `--offline` to skip the network checks.
@@ -1,6 +1,6 @@
1
1
  # Contrast Security IAST
2
2
 
3
- Enables: `pncli contrast apps`, `pncli contrast findings` — list applications and runtime vulnerability findings from Contrast Security.
3
+ Enables: `pncli contrast apps`, `pncli contrast findings`, `pncli contrast libraries` — list applications, runtime vulnerability findings, and software composition (library) data from Contrast Security.
4
4
 
5
5
  ## Required config
6
6
 
@@ -4,6 +4,8 @@ pncli uses Dynatrace's REST APIs directly; no Dynatrace CLI is required.
4
4
 
5
5
  ## Configuration
6
6
 
7
+ ### Single environment (legacy)
8
+
7
9
  | Key | Environment variable | Purpose |
8
10
  |---|---|---|
9
11
  | `dynatrace.baseUrl` | `PNCLI_DYNATRACE_BASE_URL` | Classic environment URL, such as `https://abc12345.live.dynatrace.com` |
@@ -27,8 +29,48 @@ pncli config test
27
29
  When platform credentials are present, `config test` and `config check` also run a minimal Grail
28
30
  spans query and report it separately as `dynatrace_platform`.
29
31
 
32
+ ### Multiple named environments
33
+
34
+ Dynatrace is commonly deployed per-environment (e.g. QA and PROD), each with its own base URL and
35
+ API token. pncli supports named environment profiles so you can switch between them with a flag rather
36
+ than rewriting `dynatrace.baseUrl` and `dynatrace.apiToken` before every command.
37
+
38
+ ```bash
39
+ # Set up named environments
40
+ pncli config set dynatrace.environments.qa.baseUrl https://abc11111.live.dynatrace.com
41
+ pncli config set dynatrace.environments.qa.apiToken dt0c01...
42
+ pncli config set dynatrace.environments.prod.baseUrl https://abc22222.live.dynatrace.com
43
+ pncli config set dynatrace.environments.prod.apiToken dt0c01...
44
+
45
+ # Optional: include Grail platform credentials per environment
46
+ pncli config set dynatrace.environments.prod.platformUrl https://abc22222.apps.dynatrace.com
47
+ pncli config set dynatrace.environments.prod.platformToken dt0s16...
48
+
49
+ # Optional: set a default named environment (used when --env is omitted)
50
+ pncli config set dynatrace.defaultEnvironment prod
51
+ ```
52
+
53
+ `config test` and `config check` report the connectivity status of each named environment
54
+ separately as `dynatrace.<name>` (and `dynatrace.<name>_platform` when platform credentials are set).
55
+
56
+ Environment variables (`PNCLI_DYNATRACE_BASE_URL`, etc.) continue to apply to the legacy flat config
57
+ and take precedence over stored values, but do not override named environments.
58
+
30
59
  ## Commands
31
60
 
61
+ ```bash
62
+ # Using the default (legacy flat config or defaultEnvironment)
63
+ pncli dynatrace services --from now-2h
64
+
65
+ # Targeting a named environment
66
+ pncli dynatrace --env qa services --from now-2h
67
+ pncli dynatrace --env prod problems list --from now-24h
68
+
69
+ # Compare QA and PROD in one session
70
+ pncli dynatrace --env qa entities list --selector 'type("SERVICE")'
71
+ pncli dynatrace --env prod entities list --selector 'type("SERVICE")'
72
+ ```
73
+
32
74
  ```bash
33
75
  pncli dynatrace services --from now-2h
34
76
  pncli dynatrace workloads --from now-2h
@@ -44,3 +86,7 @@ pncli dynatrace trace --id 0123456789abcdef0123456789abcdef
44
86
 
45
87
  Entity and problem list commands automatically follow Dynatrace pagination. Use Dynatrace selector
46
88
  syntax for advanced filtering.
89
+
90
+ The `--env <name>` option is available on the `dynatrace` parent command and applies to all
91
+ subcommands: `entities list`, `entities get`, `services`, `workloads`, `problems list`,
92
+ `problems get`, and `trace`.
@@ -55,5 +55,9 @@ pncli jira create-issue --input-file issue.json --priority Low # --priority wi
55
55
 
56
56
  ## Notes
57
57
 
58
- - Jira Cloud and Jira Data Center both work; token format differs (API token vs PAT)
58
+ - Targets **Jira Data Center / Server** (`/rest/api/2`). Jira Cloud is not supported: pncli
59
+ identifies users by username in the `name` field, where Cloud requires `accountId`. Use
60
+ Atlassian's own MCP server for Cloud.
61
+ - `--assignee` on `create-issue`, `update-issue`, and `assign` takes a **username**, as does
62
+ any `user`-typed custom field passed via `--field`
59
63
  - Custom fields discovered with `pncli jira fields --discover`
@@ -26,11 +26,11 @@ pncli skills marketplace list
26
26
  pncli skills marketplace plugins <name>
27
27
  ```
28
28
 
29
- `list` shows every registered marketplace. `plugins` shows the plugins available inside one of them, without installing anything.
29
+ `list` shows every registered marketplace, including `upstreamRemote` — the `origin` fetch URL read from the local clone, with any injected token scrubbed. It is `null` when the clone is missing or has no `origin`, which is the quickest way to spot a marketplace whose local path has drifted from the URL it was registered with. `plugins` shows the plugins available inside one of them, without installing anything.
30
30
 
31
31
  ## Sync (pull + install)
32
32
 
33
- Install to `~/.agents/skills` (GitHub Copilot / Codex):
33
+ Install to `~/.agents/skills` (Codex / GitHub Copilot — the default):
34
34
  ```
35
35
  pncli skills marketplace sync
36
36
  ```
@@ -64,6 +64,16 @@ pncli skills marketplace sync --marketplace all
64
64
 
65
65
  `sync` skips reinstalling when a marketplace has no new upstream changes (single-plugin and `all` installs alike). Pass `--force` to reinstall anyway.
66
66
 
67
+ ### Update what you already have, without picking up new plugins
68
+
69
+ By default an `all` sync installs every plugin the marketplace offers, including ones added upstream since you last synced. Pass `--installed-only` to update just the plugins already on disk:
70
+
71
+ ```
72
+ pncli skills marketplace sync --marketplace all --installed-only
73
+ ```
74
+
75
+ Plugins are matched by the marketplace name recorded at install time, falling back to the clone URL — so a marketplace you have since renamed still resolves. Disabled plugins count as installed and are refreshed in place, staying disabled. If a marketplace has no installed plugins at all, it is reported as `skipped` with `installedOnly: true` rather than silently installing everything.
76
+
67
77
  ## Enable / disable installed plugins
68
78
 
69
79
  Temporarily switch a plugin's skills off without deleting them (no re-download needed to switch back on):
@@ -93,6 +103,47 @@ It loops through a menu until you're done:
93
103
 
94
104
  Everything the session changed is emitted as one JSON summary at the end. Agents should use the scriptable equivalents instead: `enable`, `disable`, `add`, `remove`.
95
105
 
106
+ ## Where skills are installed
107
+
108
+ Every command that installs or reads skills takes `--agent` and `--scope`. Those resolve to:
109
+
110
+ | `--agent` | `--scope project` | `--scope user` |
111
+ |---|---|---|
112
+ | `codex` (default) | `.agents/skills` | `~/.agents/skills` |
113
+ | `github-copilot` | `.github/skills` | `~/.copilot/skills` |
114
+ | `claude-code` | `.claude/skills` | `~/.claude/skills` |
115
+
116
+ `.agents/skills` is the cross-tool convention — both Codex and GitHub Copilot read it — which is why it is the default. Use `--agent github-copilot` only when you specifically want Copilot's own directories, and `--agent claude-code` (or the `--claude` shorthand) for Claude Code.
117
+
118
+ Project-scope paths resolve against the repository root, so you get the same directory whichever subdirectory you run from. Outside a git repository they fall back to the current working directory.
119
+
120
+ `--target <dir>` overrides all of this and installs wherever you point it. `skills install --target` records the directory in your global config so it still shows up in the commands below; `pncli skills forget-target <dir>` stops tracking it (it deletes nothing).
121
+
122
+ ### List the install paths
123
+
124
+ ```
125
+ pncli skills locations
126
+ ```
127
+
128
+ Reports every path pncli knows about — each agent host at both scopes, plus any recorded custom targets — with whether the directory exists and how many skills are in it. The `marketplaceSkills`, `bundledSkills`, and `untrackedSkills` counts are mutually exclusive and always add up to `totalSkills`; anything in `untrackedSkills` was dropped in by hand or installed before pncli recorded provenance.
129
+
130
+ `disabledStashMissing` names disabled skills whose stashed copy has been deleted out from under pncli — those cannot be re-enabled and need a fresh `sync`.
131
+
132
+ ### Trace a skill back to its repository
133
+
134
+ ```
135
+ pncli skills status
136
+ ```
137
+
138
+ Walks every known location and emits one record per installed skill joining it to the plugin, marketplace, clone URL, and the live `origin` remote of the local clone. This is the command to reach for when you need to know where a skill actually came from rather than just where it sits.
139
+
140
+ Narrow it with `--marketplace <name-or-url>`, `--plugin <name>`, `--source marketplace|bundled|untracked`, `--agent`, or `--scope`:
141
+
142
+ ```
143
+ pncli skills status --source untracked
144
+ pncli skills status --marketplace internal-ai
145
+ ```
146
+
96
147
  ## Remove a marketplace
97
148
 
98
149
  ```
@@ -3,13 +3,54 @@
3
3
  pncli connects to the OpenShift / Kubernetes REST API using a service account bearer token.
4
4
  No `kubectl` or `oc` CLI is required.
5
5
 
6
- ## Required config keys
6
+ ## Configuration
7
+
8
+ pncli supports two configuration models for OpenShift clusters, which can be used together:
9
+
10
+ ### Legacy flat config (single cluster)
7
11
 
8
12
  | Key | Env var | Description |
9
13
  |-----|---------|-------------|
10
14
  | `openshift.baseUrl` | `PNCLI_OPENSHIFT_BASE_URL` | API server URL, e.g. `https://api.cluster.imagile.dev:6443` |
11
15
  | `openshift.token` | `PNCLI_OPENSHIFT_TOKEN` | Service account bearer token |
12
16
 
17
+ ### Named two-level config (multiple environments and instances)
18
+
19
+ | Key | Description |
20
+ |-----|-------------|
21
+ | `openshift.environments.<env>.instances.<instance>.baseUrl` | API server URL for this cluster |
22
+ | `openshift.environments.<env>.instances.<instance>.token` | Bearer token for this cluster |
23
+ | `openshift.defaultEnvironment` | Default environment name (used when `--env` is omitted) |
24
+ | `openshift.defaultInstance` | Default instance name (used when `--instance` is omitted) |
25
+
26
+ Example:
27
+
28
+ ```bash
29
+ pncli config set openshift.environments.non-prod.instances.us-east.baseUrl https://api.np-us-east.imagile.dev:6443
30
+ pncli config set openshift.environments.non-prod.instances.us-east.token eyJhbGciOiJSUzI1NiI...
31
+ pncli config set openshift.environments.non-prod.instances.eu-west.baseUrl https://api.np-eu-west.imagile.dev:6443
32
+ pncli config set openshift.environments.non-prod.instances.eu-west.token eyJhbGciOiJSUzI1NiI...
33
+ pncli config set openshift.environments.prod-us.instances.primary.baseUrl https://api.prod-us.imagile.dev:6443
34
+ pncli config set openshift.environments.prod-us.instances.primary.token eyJhbGciOiJSUzI1NiI...
35
+
36
+ # Set defaults so --env / --instance can be omitted
37
+ pncli config set openshift.defaultEnvironment non-prod
38
+ pncli config set openshift.defaultInstance us-east
39
+ ```
40
+
41
+ ## Selecting a target cluster
42
+
43
+ All `pncli openshift` subcommands accept `--env` and `--instance` to choose a named cluster:
44
+
45
+ ```bash
46
+ pncli openshift --env non-prod --instance us-east pods --namespace my-namespace
47
+ pncli openshift --env prod-us --instance primary events --namespace my-namespace
48
+ ```
49
+
50
+ If `--env`/`--instance` are omitted, pncli resolves the cluster in this order:
51
+ 1. `openshift.defaultEnvironment` + `openshift.defaultInstance`
52
+ 2. Legacy flat `openshift.baseUrl` / `openshift.token`
53
+
13
54
  ## Getting your service account token
14
55
 
15
56
  **Inside a pod** (recommended for CI):
@@ -46,11 +87,21 @@ pncli config init
46
87
 
47
88
  ## Commands
48
89
 
90
+ ### List configured clusters
91
+
92
+ ```bash
93
+ pncli openshift cluster list
94
+ ```
95
+
96
+ Returns all configured environments/instances and the flat legacy cluster (if set), plus the
97
+ configured defaults.
98
+
49
99
  ### List pod health summary
50
100
 
51
101
  ```bash
52
102
  pncli openshift pods --namespace my-namespace
53
103
  pncli openshift pods --namespace my-namespace --label-selector app=my-app
104
+ pncli openshift --env non-prod --instance us-east pods --namespace my-namespace
54
105
  ```
55
106
 
56
107
  Returns a pre-processed summary with phase counts (running/pending/failed), restart counts,
@@ -62,6 +113,7 @@ CrashLoopBackOff/OOMKilled/ImagePullBackOff indicators, and per-pod container st
62
113
  pncli openshift events --namespace my-namespace
63
114
  pncli openshift events --namespace my-namespace --field-selector involvedObject.name=my-pod
64
115
  pncli openshift events --namespace my-namespace --all # include Normal events
116
+ pncli openshift --env prod-us --instance primary events --namespace my-namespace
65
117
  ```
66
118
 
67
119
  Returns Warning events sorted by count (highest-frequency first), filtered to surface problems.
@@ -109,9 +161,12 @@ Requires the metrics-server (`GET /apis/metrics.k8s.io/v1beta1/...`) — same as
109
161
  ## Test connectivity
110
162
 
111
163
  ```bash
112
- pncli config test
164
+ pncli config test # tests flat config + all named clusters
165
+ pncli config check # structured status per cluster
113
166
  ```
114
167
 
168
+ Named clusters appear in `config check` output with keys like `openshift:non-prod/us-east`.
169
+
115
170
  ## Minimum RBAC permissions
116
171
 
117
172
  The service account needs read access to pods, events, logs, and metrics in the target namespace.