splunk-cli 0.0.3__tar.gz → 0.1.0__tar.gz

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.
Files changed (41) hide show
  1. splunk_cli-0.1.0/.github/actionlint.yaml +2 -0
  2. splunk_cli-0.1.0/.github/workflows/live.yml +33 -0
  3. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/.github/workflows/release.yml +4 -1
  4. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/CHANGELOG.md +20 -0
  5. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/Cargo.lock +1 -1
  6. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/Cargo.toml +1 -1
  7. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/Makefile +5 -1
  8. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/PKG-INFO +84 -9
  9. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/README.md +82 -7
  10. splunk_cli-0.1.0/docs/compatibility.md +74 -0
  11. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/docs/releases.md +6 -1
  12. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/pyproject.toml +1 -1
  13. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/scripts/test-live.sh +5 -1
  14. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/auth.rs +367 -31
  15. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/browser.rs +101 -47
  16. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/cli.rs +127 -0
  17. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/client.rs +58 -2
  18. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/config.rs +114 -4
  19. splunk_cli-0.1.0/src/continuation.rs +72 -0
  20. splunk_cli-0.1.0/src/export.rs +332 -0
  21. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/interrupt.rs +4 -1
  22. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/lib.rs +2 -0
  23. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/main.rs +6 -3
  24. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/output.rs +59 -10
  25. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/schema.rs +59 -9
  26. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/workflows.rs +91 -20
  27. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/cli.rs +1047 -4
  28. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/live/README.md +17 -3
  29. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/live/check.py +54 -0
  30. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/.dockerignore +0 -0
  31. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/.github/workflows/ci.yml +0 -0
  32. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/.gitignore +0 -0
  33. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/LICENSE +0 -0
  34. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/prek.toml +0 -0
  35. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/schemas/clispec-v0.3.json +0 -0
  36. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/scripts/score-clispec.py +0 -0
  37. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/src/error.rs +0 -0
  38. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/conformance.rs +0 -0
  39. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/live/Dockerfile +0 -0
  40. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/tests/live/entrypoint.sh +0 -0
  41. {splunk_cli-0.0.3 → splunk_cli-0.1.0}/vership.toml +0 -0
@@ -0,0 +1,2 @@
1
+ self-hosted-runner:
2
+ labels: [splunk-live]
@@ -0,0 +1,33 @@
1
+ name: Live Splunk compatibility
2
+ on:
3
+ schedule:
4
+ - cron: '17 4 * * 1'
5
+ workflow_dispatch:
6
+ workflow_call:
7
+ permissions:
8
+ contents: read
9
+ concurrency:
10
+ group: splunk-live-husker
11
+ cancel-in-progress: false
12
+ jobs:
13
+ live:
14
+ # Never execute PR or fork code on homelab infrastructure.
15
+ if: >-
16
+ github.repository == 'rvben/splunk-cli' &&
17
+ github.event_name != 'pull_request' &&
18
+ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
19
+ runs-on: [self-hosted, linux, x64, splunk-live]
20
+ timeout-minutes: 45
21
+ steps:
22
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
23
+ with:
24
+ fetch-depth: 0
25
+ persist-credentials: false
26
+ - name: Require integrated source
27
+ run: |
28
+ git fetch origin main
29
+ git merge-base --is-ancestor HEAD origin/main
30
+ - name: Run the pinned versions sequentially on the isolated Husker VM
31
+ env:
32
+ SPLUNK_ACCEPT_LICENSE: 'yes'
33
+ run: make test-live-matrix
@@ -14,6 +14,9 @@ concurrency:
14
14
  group: release-${{ github.ref }}
15
15
  cancel-in-progress: false
16
16
  jobs:
17
+ live:
18
+ name: Live compatibility gate
19
+ uses: ./.github/workflows/live.yml
17
20
  verify:
18
21
  name: Verify release
19
22
  runs-on: ubuntu-24.04
@@ -103,7 +106,7 @@ jobs:
103
106
  if-no-files-found: error
104
107
  publish-pypi:
105
108
  name: Publish to PyPI
106
- needs: [wheels, sdist]
109
+ needs: [wheels, sdist, live]
107
110
  if: ${{ github.ref_type == 'tag' && inputs.dry_run != true }}
108
111
  runs-on: ubuntu-24.04
109
112
  steps:
@@ -6,6 +6,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0](https://github.com/rvben/splunk-cli/compare/v0.0.3...v0.1.0) - 2026-11-04
10
+
11
+ ### Added
12
+
13
+ - Durable, page-bounded CSV/JSONL file exports with checkpoints, verified resume, and a single CSV header.
14
+ - Parse-only `search check` and credential-redacted `jobs logs` for investigation.
15
+ - Explicit `auth migrate`, deterministic saved-store selection, and unverified token-expiry diagnostics.
16
+ - Credential-preserving profile renaming and individual saved-setting resets.
17
+ - Command-specific help examples, actionable empty states, and display-truncation guidance.
18
+ - A documented 0.1.x compatibility policy for commands, JSON, errors, cursors, and checkpoints.
19
+ - Trusted weekly and release-gating live checks on isolated Husker infrastructure, with pinned Splunk versions and restricted-user coverage.
20
+
21
+ ### Fixed
22
+
23
+ - Bind new continuations to their server, namespace, and ordered field selection.
24
+ - Retry transient safe-read HTTP responses within a bounded budget; never replay dispatches.
25
+ - Clean up browser login on cancellation, including Windows CLI termination, enforce a full sign-in deadline, and keep browser debugging off HTTP proxies.
26
+ - Preserve streaming checkpoint recovery details on interruption and refuse incomplete finalized searches.
27
+ - Preserve logged-out state when stale credentials reappear, while allowing later cleanup.
28
+
9
29
  ## [0.0.3](https://github.com/rvben/splunk-cli/compare/v0.0.2...v0.0.3) - 2026-11-04
10
30
 
11
31
  ### Added
@@ -2366,7 +2366,7 @@ dependencies = [
2366
2366
 
2367
2367
  [[package]]
2368
2368
  name = "splunk-cli"
2369
- version = "0.0.3"
2369
+ version = "0.1.0"
2370
2370
  dependencies = [
2371
2371
  "base64 0.23.1",
2372
2372
  "clap",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "splunk-cli"
3
- version = "0.0.3"
3
+ version = "0.1.0"
4
4
  edition = "2024"
5
5
  rust-version = "1.90"
6
6
  description = "Search and manage Splunk from the terminal with structured, agent-friendly output"
@@ -1,4 +1,4 @@
1
- .PHONY: build release test test-live lint fmt check conformance clean install release-patch release-minor release-major update-deps
1
+ .PHONY: build release test test-live test-live-matrix lint fmt check conformance clean install release-patch release-minor release-major update-deps
2
2
 
3
3
  build:
4
4
  cargo build
@@ -13,6 +13,10 @@ test:
13
13
  test-live:
14
14
  bash scripts/test-live.sh
15
15
 
16
+ test-live-matrix:
17
+ SPLUNK_TEST_VERSION=10.6.1.1 bash scripts/test-live.sh
18
+ SPLUNK_TEST_VERSION=9.4.9 bash scripts/test-live.sh
19
+
16
20
  lint:
17
21
  cargo fmt -- --check
18
22
  cargo clippy --locked --all-targets -- -D warnings
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splunk-cli
3
- Version: 0.0.3
4
- Classifier: Development Status :: 3 - Alpha
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
7
7
  Classifier: License :: OSI Approved :: MIT License
@@ -65,9 +65,10 @@ against Splunk before saving in macOS Keychain, Windows Credential Manager, or
65
65
  Linux Secret Service. When no credential store is available (for example on
66
66
  WSL), an interactive login asks before saving to `credentials.json` next to the
67
67
  config file (mode 0600 on Unix); `--insecure-storage` selects that file without
68
- asking. Connection settings stay in the TOML config. If an old OS credential cannot
69
- be removed after saving a file login, a warning explains how to prevent it from
70
- overriding the new login when the OS store becomes available again.
68
+ asking. Connection settings and nonsecret store-selection metadata stay in the
69
+ TOML config. Each successful login pins its chosen store; an obsolete login in
70
+ another store cannot override it. An unavailable selected store produces a
71
+ recovery error instead of silently selecting different credentials.
71
72
  Login saves supplied connection settings, including flag/environment overrides.
72
73
 
73
74
  ```sh
@@ -76,6 +77,10 @@ splunk-cli auth login --profile work --method password --username myuser
76
77
  splunk-cli auth logout --profile work
77
78
  # For automation, read a token from stdin without putting it in shell history:
78
79
  secret-manager read splunk/token | splunk-cli auth login --profile work --token-stdin
80
+ # Move an existing saved login without contacting Splunk:
81
+ splunk-cli auth migrate --profile work --to keyring --dry-run
82
+ splunk-cli auth migrate --profile work --to keyring
83
+ splunk-cli auth migrate --profile work --to file --insecure-storage
79
84
  ```
80
85
 
81
86
  Saved credentials are scoped to the config file, profile, and management URL.
@@ -98,7 +103,11 @@ Use a least-privilege Splunk account; access follows that account's permissions.
98
103
  TLS certificates are verified by default. `--ca-cert /path/to/ca.pem` adds an
99
104
  internal certificate authority; `--insecure` disables verification for the current
100
105
  invocation. Sending credentials over plain HTTP to a remote host requires
101
- explicit `--allow-http` (loopback mock/development servers are exempt). HTTP redirects and automatic request retries are disabled.
106
+ explicit `--allow-http` (loopback mock/development servers are exempt). HTTP
107
+ redirects are disabled. Safe GET requests retry HTTP 429/502/503/504 at most twice,
108
+ using 250/500 ms backoff or a numeric `Retry-After` of at most two seconds.
109
+ Longer or date-based retry instructions are returned in the error for the caller
110
+ to schedule. Dispatches and other writes are never automatically retried.
102
111
 
103
112
  ### Browser sign-in (SSO)
104
113
 
@@ -125,6 +134,12 @@ with a temporary profile that is deleted afterwards. Sessions expire according
125
134
  to the server's session timeout; commands then fail with an `auth` error and a
126
135
  hint to log in again.
127
136
 
137
+ Ctrl-C returns exit 130; native browser processes and their private profiles are
138
+ cleaned up. The five-minute deadline includes browser protocol requests. The
139
+ localhost debugging channel bypasses HTTP proxies; management API calls use the
140
+ normal `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` environment settings. `--ca-cert`
141
+ configures API trust; the browser uses its own certificate trust settings.
142
+
128
143
  ## Search
129
144
 
130
145
  ```sh
@@ -133,10 +148,12 @@ splunk-cli search '| makeresults | eval message="hello"' --fields message
133
148
  splunk-cli search 'index=main' --limit 20 --output json
134
149
  splunk-cli search --file investigation.spl --earliest -7d
135
150
  cat investigation.spl | splunk-cli search --file -
151
+ splunk-cli search check --file investigation.spl
136
152
 
137
153
  # Long-running searches: submit once, then inspect and page the same job.
138
154
  splunk-cli jobs create 'index=main | stats count by sourcetype' --earliest -7d
139
155
  splunk-cli jobs show JOB_ID
156
+ splunk-cli jobs logs JOB_ID
140
157
  splunk-cli jobs watch JOB_ID --wait-timeout 600
141
158
  splunk-cli jobs wait JOB_ID --quiet
142
159
  splunk-cli jobs results JOB_ID --limit 100 --offset 0 --fields sourcetype,count
@@ -158,8 +175,42 @@ or dispatch can repeat those effects. There is no claimed idempotency key;
158
175
  inspect the existing job before resubmitting after an ambiguous failure.
159
176
  Use `jobs results JOB_ID` to continue paging rather than running `search` again.
160
177
 
178
+ `search check` uses the v2 parser with `parse_only=true`, lookup expansion
179
+ disabled, and macro reloading disabled. It checks syntax without submitting a
180
+ job. It does not establish that referenced indexes, macros, permissions, or
181
+ runtime lookups will succeed. `jobs logs` returns `{job_id, log}` with a bounded
182
+ UTF-8 search log and credential redaction.
183
+
161
184
  ## Export completed results
162
185
 
186
+ For large exports and interruption recovery, stream directly to a file:
187
+
188
+ ```sh
189
+ splunk-cli jobs export JOB_ID --stream --output-file events.jsonl --max-results 1000000
190
+ splunk-cli jobs export JOB_ID --stream --output-file events.jsonl --max-results 1000000 --resume
191
+ splunk-cli jobs export JOB_ID --stream --output-file events.csv \
192
+ --record-format csv --fields _time,host,_raw --page-size 500
193
+ ```
194
+
195
+ Streaming holds one bounded API page in memory and has no aggregate 32 MiB cap.
196
+ `--max-results` limits records written **per invocation**; the stdout summary
197
+ reports cumulative `exported`, current `written`, `has_more`, and `next_offset`.
198
+ Repeat with `--resume` until `has_more` is false. Use the same server, namespace,
199
+ job, fields, file, and record format. Page size and per-invocation bound may change.
200
+ CSV requires explicit fields for stable columns and writes its header exactly once.
201
+
202
+ The checkpoint defaults to `OUTPUT_FILE.checkpoint.json`; `--checkpoint PATH`
203
+ overrides it. Data is synced before atomically advancing the checkpoint. Resume
204
+ verifies the file's SHA-256 prefix and removes only bytes beyond the last durable
205
+ page, covering partial writes and a crash before checkpoint advancement. Edited
206
+ or shortened durable data is rejected. Output and checkpoints use private file
207
+ permissions on Unix; keep both files together, retain the original Splunk job,
208
+ and protect the export as you would its source data. A job that expires or loses
209
+ results cannot be reconstructed by a checkpoint. Existing files are never
210
+ overwritten by a new export. Only one writer may use an output or checkpoint.
211
+
212
+ For smaller exports, buffered output remains available:
213
+
163
214
  ```sh
164
215
  splunk-cli jobs export JOB_ID --fields _time,host,_raw --output jsonl > events.jsonl
165
216
  splunk-cli jobs export JOB_ID --max-results 50000 --page-size 1000 --output csv > results.csv
@@ -235,8 +286,12 @@ Explicit `--output json|text|csv|jsonl` always wins (`table` aliases `text`,
235
286
  ```
236
287
 
237
288
  Search results additionally include `job_id` and `next_cursor`.
238
- Pass that cursor to `splunk-cli search --cursor CURSOR` without a query to page
239
- the same job; this performs only GET requests and never resubmits SPL. Single-record commands return an
289
+ Pass that opaque cursor to `splunk-cli search --cursor CURSOR` without a query to page
290
+ the same job; this performs only GET requests and never resubmits SPL. New
291
+ continuations bind the server and app/owner namespace,
292
+ and carry the original field selection. Omit `--fields` to reuse that selection;
293
+ a conflicting selection or connection is rejected before HTTP. Legacy `SID:OFFSET`
294
+ cursors remain accepted during 0.1.x with a warning. Single-record commands return an
240
295
  object directly. `--fields` selects exact output keys, including dotted Splunk
241
296
  keys. SPL files/stdin must be UTF-8 and at most 1 MiB. Collection limits default to 100 and allow 1–10000; zero/unlimited is
242
297
  rejected. Unknown totals are `null`; a lookahead record determines `has_more`.
@@ -276,7 +331,8 @@ Only `init` and `auth login` prompt for input. Schema, help, version, and comple
276
331
  a connection or configuration. The schema is derived from the parser's actual
277
332
  arguments, and includes side effects, output shapes, pagination, and error codes.
278
333
  The v0.3 specification is a candidate; this repository vendors the version used
279
- by its conformance tests. The CLI and its output contract are experimental.
334
+ by its conformance tests. The [compatibility policy](docs/compatibility.md)
335
+ defines the 0.1.x command, JSON, error, cursor, and checkpoint guarantees.
280
336
 
281
337
  ## Profiles
282
338
 
@@ -309,6 +365,10 @@ paths supplied through `config set` are saved as absolute paths.
309
365
  ```sh
310
366
  splunk-cli profile list
311
367
  splunk-cli profile use work
368
+ splunk-cli profile rename work production --dry-run
369
+ splunk-cli profile rename work production
370
+ splunk-cli config unset timeout app --dry-run
371
+ splunk-cli config unset timeout app
312
372
  splunk-cli profile remove old --dry-run
313
373
  splunk-cli profile remove old --yes
314
374
  splunk-cli auth status --offline
@@ -334,6 +394,21 @@ indexes using read-only requests. It never submits SPL or tests write permission
334
394
  Failures use the normal exit code and error envelope, with completed and failed
335
395
  checks in `error.details.checks` and an actionable hint.
336
396
 
397
+ `profile rename` updates the saved active profile and moves saved credentials
398
+ for the configured URL and known login URLs. It rolls back copied credentials
399
+ if the settings update fails. `--keep-credentials` renames settings only and
400
+ requires a fresh login under the new name. Historical URLs used before 0.1.0
401
+ have no selection metadata and cannot be discovered automatically; log out of
402
+ those URLs under the old name before renaming. `config unset` removes selected
403
+ saved fields; flag and environment overrides still apply. Unsetting a URL does
404
+ not delete its saved credentials.
405
+
406
+ Offline credential metadata includes `selection`, `expires_at`, `expiry_status`,
407
+ and `expiry_source`. A JWT's `exp` is an **unverified diagnostic claim**, never
408
+ proof of validity. Opaque tokens, passwords, and browser sessions report unknown
409
+ expiry. Online authentication remains authoritative. `auth migrate` always
410
+ moves the saved credential, even when environment credentials override it.
411
+
337
412
  | Variable | Setting |
338
413
  |---|---|
339
414
  | `SPLUNK_URL` | Management base URL |
@@ -45,9 +45,10 @@ against Splunk before saving in macOS Keychain, Windows Credential Manager, or
45
45
  Linux Secret Service. When no credential store is available (for example on
46
46
  WSL), an interactive login asks before saving to `credentials.json` next to the
47
47
  config file (mode 0600 on Unix); `--insecure-storage` selects that file without
48
- asking. Connection settings stay in the TOML config. If an old OS credential cannot
49
- be removed after saving a file login, a warning explains how to prevent it from
50
- overriding the new login when the OS store becomes available again.
48
+ asking. Connection settings and nonsecret store-selection metadata stay in the
49
+ TOML config. Each successful login pins its chosen store; an obsolete login in
50
+ another store cannot override it. An unavailable selected store produces a
51
+ recovery error instead of silently selecting different credentials.
51
52
  Login saves supplied connection settings, including flag/environment overrides.
52
53
 
53
54
  ```sh
@@ -56,6 +57,10 @@ splunk-cli auth login --profile work --method password --username myuser
56
57
  splunk-cli auth logout --profile work
57
58
  # For automation, read a token from stdin without putting it in shell history:
58
59
  secret-manager read splunk/token | splunk-cli auth login --profile work --token-stdin
60
+ # Move an existing saved login without contacting Splunk:
61
+ splunk-cli auth migrate --profile work --to keyring --dry-run
62
+ splunk-cli auth migrate --profile work --to keyring
63
+ splunk-cli auth migrate --profile work --to file --insecure-storage
59
64
  ```
60
65
 
61
66
  Saved credentials are scoped to the config file, profile, and management URL.
@@ -78,7 +83,11 @@ Use a least-privilege Splunk account; access follows that account's permissions.
78
83
  TLS certificates are verified by default. `--ca-cert /path/to/ca.pem` adds an
79
84
  internal certificate authority; `--insecure` disables verification for the current
80
85
  invocation. Sending credentials over plain HTTP to a remote host requires
81
- explicit `--allow-http` (loopback mock/development servers are exempt). HTTP redirects and automatic request retries are disabled.
86
+ explicit `--allow-http` (loopback mock/development servers are exempt). HTTP
87
+ redirects are disabled. Safe GET requests retry HTTP 429/502/503/504 at most twice,
88
+ using 250/500 ms backoff or a numeric `Retry-After` of at most two seconds.
89
+ Longer or date-based retry instructions are returned in the error for the caller
90
+ to schedule. Dispatches and other writes are never automatically retried.
82
91
 
83
92
  ### Browser sign-in (SSO)
84
93
 
@@ -105,6 +114,12 @@ with a temporary profile that is deleted afterwards. Sessions expire according
105
114
  to the server's session timeout; commands then fail with an `auth` error and a
106
115
  hint to log in again.
107
116
 
117
+ Ctrl-C returns exit 130; native browser processes and their private profiles are
118
+ cleaned up. The five-minute deadline includes browser protocol requests. The
119
+ localhost debugging channel bypasses HTTP proxies; management API calls use the
120
+ normal `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` environment settings. `--ca-cert`
121
+ configures API trust; the browser uses its own certificate trust settings.
122
+
108
123
  ## Search
109
124
 
110
125
  ```sh
@@ -113,10 +128,12 @@ splunk-cli search '| makeresults | eval message="hello"' --fields message
113
128
  splunk-cli search 'index=main' --limit 20 --output json
114
129
  splunk-cli search --file investigation.spl --earliest -7d
115
130
  cat investigation.spl | splunk-cli search --file -
131
+ splunk-cli search check --file investigation.spl
116
132
 
117
133
  # Long-running searches: submit once, then inspect and page the same job.
118
134
  splunk-cli jobs create 'index=main | stats count by sourcetype' --earliest -7d
119
135
  splunk-cli jobs show JOB_ID
136
+ splunk-cli jobs logs JOB_ID
120
137
  splunk-cli jobs watch JOB_ID --wait-timeout 600
121
138
  splunk-cli jobs wait JOB_ID --quiet
122
139
  splunk-cli jobs results JOB_ID --limit 100 --offset 0 --fields sourcetype,count
@@ -138,8 +155,42 @@ or dispatch can repeat those effects. There is no claimed idempotency key;
138
155
  inspect the existing job before resubmitting after an ambiguous failure.
139
156
  Use `jobs results JOB_ID` to continue paging rather than running `search` again.
140
157
 
158
+ `search check` uses the v2 parser with `parse_only=true`, lookup expansion
159
+ disabled, and macro reloading disabled. It checks syntax without submitting a
160
+ job. It does not establish that referenced indexes, macros, permissions, or
161
+ runtime lookups will succeed. `jobs logs` returns `{job_id, log}` with a bounded
162
+ UTF-8 search log and credential redaction.
163
+
141
164
  ## Export completed results
142
165
 
166
+ For large exports and interruption recovery, stream directly to a file:
167
+
168
+ ```sh
169
+ splunk-cli jobs export JOB_ID --stream --output-file events.jsonl --max-results 1000000
170
+ splunk-cli jobs export JOB_ID --stream --output-file events.jsonl --max-results 1000000 --resume
171
+ splunk-cli jobs export JOB_ID --stream --output-file events.csv \
172
+ --record-format csv --fields _time,host,_raw --page-size 500
173
+ ```
174
+
175
+ Streaming holds one bounded API page in memory and has no aggregate 32 MiB cap.
176
+ `--max-results` limits records written **per invocation**; the stdout summary
177
+ reports cumulative `exported`, current `written`, `has_more`, and `next_offset`.
178
+ Repeat with `--resume` until `has_more` is false. Use the same server, namespace,
179
+ job, fields, file, and record format. Page size and per-invocation bound may change.
180
+ CSV requires explicit fields for stable columns and writes its header exactly once.
181
+
182
+ The checkpoint defaults to `OUTPUT_FILE.checkpoint.json`; `--checkpoint PATH`
183
+ overrides it. Data is synced before atomically advancing the checkpoint. Resume
184
+ verifies the file's SHA-256 prefix and removes only bytes beyond the last durable
185
+ page, covering partial writes and a crash before checkpoint advancement. Edited
186
+ or shortened durable data is rejected. Output and checkpoints use private file
187
+ permissions on Unix; keep both files together, retain the original Splunk job,
188
+ and protect the export as you would its source data. A job that expires or loses
189
+ results cannot be reconstructed by a checkpoint. Existing files are never
190
+ overwritten by a new export. Only one writer may use an output or checkpoint.
191
+
192
+ For smaller exports, buffered output remains available:
193
+
143
194
  ```sh
144
195
  splunk-cli jobs export JOB_ID --fields _time,host,_raw --output jsonl > events.jsonl
145
196
  splunk-cli jobs export JOB_ID --max-results 50000 --page-size 1000 --output csv > results.csv
@@ -215,8 +266,12 @@ Explicit `--output json|text|csv|jsonl` always wins (`table` aliases `text`,
215
266
  ```
216
267
 
217
268
  Search results additionally include `job_id` and `next_cursor`.
218
- Pass that cursor to `splunk-cli search --cursor CURSOR` without a query to page
219
- the same job; this performs only GET requests and never resubmits SPL. Single-record commands return an
269
+ Pass that opaque cursor to `splunk-cli search --cursor CURSOR` without a query to page
270
+ the same job; this performs only GET requests and never resubmits SPL. New
271
+ continuations bind the server and app/owner namespace,
272
+ and carry the original field selection. Omit `--fields` to reuse that selection;
273
+ a conflicting selection or connection is rejected before HTTP. Legacy `SID:OFFSET`
274
+ cursors remain accepted during 0.1.x with a warning. Single-record commands return an
220
275
  object directly. `--fields` selects exact output keys, including dotted Splunk
221
276
  keys. SPL files/stdin must be UTF-8 and at most 1 MiB. Collection limits default to 100 and allow 1–10000; zero/unlimited is
222
277
  rejected. Unknown totals are `null`; a lookahead record determines `has_more`.
@@ -256,7 +311,8 @@ Only `init` and `auth login` prompt for input. Schema, help, version, and comple
256
311
  a connection or configuration. The schema is derived from the parser's actual
257
312
  arguments, and includes side effects, output shapes, pagination, and error codes.
258
313
  The v0.3 specification is a candidate; this repository vendors the version used
259
- by its conformance tests. The CLI and its output contract are experimental.
314
+ by its conformance tests. The [compatibility policy](docs/compatibility.md)
315
+ defines the 0.1.x command, JSON, error, cursor, and checkpoint guarantees.
260
316
 
261
317
  ## Profiles
262
318
 
@@ -289,6 +345,10 @@ paths supplied through `config set` are saved as absolute paths.
289
345
  ```sh
290
346
  splunk-cli profile list
291
347
  splunk-cli profile use work
348
+ splunk-cli profile rename work production --dry-run
349
+ splunk-cli profile rename work production
350
+ splunk-cli config unset timeout app --dry-run
351
+ splunk-cli config unset timeout app
292
352
  splunk-cli profile remove old --dry-run
293
353
  splunk-cli profile remove old --yes
294
354
  splunk-cli auth status --offline
@@ -314,6 +374,21 @@ indexes using read-only requests. It never submits SPL or tests write permission
314
374
  Failures use the normal exit code and error envelope, with completed and failed
315
375
  checks in `error.details.checks` and an actionable hint.
316
376
 
377
+ `profile rename` updates the saved active profile and moves saved credentials
378
+ for the configured URL and known login URLs. It rolls back copied credentials
379
+ if the settings update fails. `--keep-credentials` renames settings only and
380
+ requires a fresh login under the new name. Historical URLs used before 0.1.0
381
+ have no selection metadata and cannot be discovered automatically; log out of
382
+ those URLs under the old name before renaming. `config unset` removes selected
383
+ saved fields; flag and environment overrides still apply. Unsetting a URL does
384
+ not delete its saved credentials.
385
+
386
+ Offline credential metadata includes `selection`, `expires_at`, `expiry_status`,
387
+ and `expiry_source`. A JWT's `exp` is an **unverified diagnostic claim**, never
388
+ proof of validity. Opaque tokens, passwords, and browser sessions report unknown
389
+ expiry. Online authentication remains authoritative. `auth migrate` always
390
+ moves the saved credential, even when environment credentials override it.
391
+
317
392
  | Variable | Setting |
318
393
  |---|---|
319
394
  | `SPLUNK_URL` | Management base URL |
@@ -0,0 +1,74 @@
1
+ # Compatibility policy
2
+
3
+ ## The 0.1.x contract
4
+
5
+ Patch releases preserve command names, flags, aliases, successful JSON field
6
+ types, error kinds, and exit codes documented by `splunk-cli schema`. New fields
7
+ and optional flags may be added; consumers should ignore unknown fields and
8
+ select exact keys rather than parsing terminal tables. Splunk-owned content
9
+ fields depend on the server and installed apps. `null` totals remain valid.
10
+ Human-readable text, progress timing, and error wording may improve in patches.
11
+ Breaking contract changes require a minor release while the project is below 1.0.
12
+
13
+ `table` continues to alias `text`, and `ndjson` aliases `jsonl`. JSON is the
14
+ automation format; CSV/JSONL record output deliberately omits collection
15
+ envelopes. Streaming file exports return a separate summary on stdout.
16
+
17
+ Continuation strings are opaque and versioned. New cursors bind the server,
18
+ app/owner namespace, and field selection. They contain no credentials or SPL.
19
+ Legacy `SID:OFFSET` strings remain accepted throughout 0.1.x, with a warning;
20
+ they cannot validate connection context. Cursors depend on the original job's
21
+ retention and permissions and are not portable to another Splunk installation.
22
+
23
+ Version 1 export checkpoints remain resumable throughout 0.1.x. Keep the output
24
+ and checkpoint together and use the original connection, job, fields and record
25
+ format. Resume verifies durable bytes before removing an incomplete tail. It
26
+ cannot recover deleted jobs, modified durable data, or changed server results.
27
+ Checkpoints are local recovery metadata, not authentication or authorization.
28
+
29
+ ## Upgrade from 0.0.x
30
+
31
+ Existing profiles and saved logins remain usable. The first successful login,
32
+ migration, rename or logout writes nonsecret credential-selection metadata to
33
+ the config. This prevents stale credentials from another store from taking over
34
+ and prevents a logged-out connection from reviving an old login.
35
+
36
+ **0.0.3 cannot read a config containing `credential_states`.** Back up the config
37
+ before upgrading if you may need to downgrade. Use a separate config path and a
38
+ fresh login with an older binary; copying only profile settings loses the new
39
+ selection and logout guarantees. Never remove the metadata merely to revive an
40
+ obsolete credential. A renamed profile moves known saved connections; historical
41
+ URLs used before selection metadata existed require explicit logout under the
42
+ old name.
43
+
44
+ ## Server and platform coverage
45
+
46
+ The v2 search API requires Splunk 9.0.1 or later. That API minimum is not a claim
47
+ that every intervening Splunk version has been tested. The live CI matrix uses
48
+ official digest-pinned Enterprise images, sequentially, on a dedicated x86_64
49
+ Husker VM. It covers the public CLI with administrator and restricted user roles,
50
+ hidden terminal login, Secret Service and file migration, real searches,
51
+ parse-only checks, logs, bounded and streaming exports, recovery, and cleanup.
52
+
53
+ | Environment | Validation |
54
+ |---|---|
55
+ | Enterprise 10.6.1.1, Linux x64 | Live public CLI suite |
56
+ | Enterprise 9.4.9, Linux x64 | Live CI matrix |
57
+ | Linux/macOS/Windows | CLI, HTTP fixture and schema regression tests in CI |
58
+ | Private CA TLS | Public CLI: untrusted connection rejected, explicit CA accepted |
59
+ | HTTP proxy with browser login | Localhost debugging bypasses the proxy |
60
+ | Native browser cancellation | Public CLI: exit 130, browser termination, profile removal |
61
+ | Windows browser cancellation | Public CLI: hard termination closes the browser and removes its profile |
62
+ | Chromium CDP, Firefox BiDi, WSL PowerShell | Protocol fixtures; no external identity provider in CI |
63
+
64
+ Cloud access policies, enterprise identity providers, browser management
65
+ policies, and WSL interop cleanup need deployment-specific validation.
66
+ Browser sign-in uses a private profile and validates its session with the API;
67
+ neither a browser cookie nor a token's unverified expiry claim proves API access.
68
+ The Windows bridge detects when the CLI stops waiting and cleans up its private
69
+ browser and profile. Avoid forcibly terminating PowerShell itself during sign-in;
70
+ if it is killed, close the private browser and remove its temporary profile manually.
71
+
72
+ PyPI ships native wheels for Linux x64/ARM64, macOS x64/ARM64, and Windows x64,
73
+ plus an sdist. Builds from source require Rust 1.90+. The native live Splunk suite
74
+ requires x86_64 with AVX2; Apple Silicon emulation is not part of this matrix.
@@ -20,6 +20,10 @@ external contributors. The repository owner can integrate directly on main.
20
20
  from the current remote default branch.
21
21
  2. Run `vership status`, `vership config show`, and the relevant commands' `--help`.
22
22
  3. Run `make check`, `make conformance`, the Rust 1.90 check, and `actionlint`.
23
+ Run `SPLUNK_ACCEPT_LICENSE=yes make test-live-matrix` on the trusted x86
24
+ homelab runner. The release workflow repeats this matrix on the exact tag
25
+ and blocks PyPI publication on either version failing. The live workflow
26
+ also runs weekly and supports a manual pre-release dispatch on main.
23
27
  Build a local wheel/sdist, run `twine check --strict`, and install the wheel
24
28
  into a clean environment to exercise `--version` and `schema`.
25
29
  4. For a new version, run `vership bump patch --prepare` (or minor/major).
@@ -28,7 +32,8 @@ external contributors. The repository owner can integrate directly on main.
28
32
  5. Once the user approves pushing and publishing that release, run
29
33
  `vership release`. The tag starts the PyPI workflow. A workflow dispatch
30
34
  with `dry_run` builds and validates without publishing.
31
- 6. Wait for every release job, then run `vership verify VERSION --targets tag,pypi`.
35
+ 6. Wait for every release job, including the Husker live compatibility gate,
36
+ then run `vership verify VERSION --targets tag,pypi`.
32
37
  Confirm all five wheels and the sdist on PyPI. Install from the published
33
38
  index, verify the version/schema, and reconcile the primary checkout with
34
39
  the remote default branch before reporting completion.
@@ -11,7 +11,7 @@ requires-python = ">=3.8"
11
11
  license = { text = "MIT" }
12
12
  authors = [{ name = "Ruben J. Jongejan" }]
13
13
  classifiers = [
14
- "Development Status :: 3 - Alpha",
14
+ "Development Status :: 4 - Beta",
15
15
  "Environment :: Console",
16
16
  "Intended Audience :: Developers",
17
17
  "License :: OSI Approved :: MIT License",
@@ -11,7 +11,11 @@ if [[ $architecture != x86_64 ]]; then
11
11
  printf '%s\n' 'Live tests require a native x86_64 Docker daemon; select an x86 homelab Docker context.' >&2
12
12
  exit 2
13
13
  fi
14
- image=splunk/splunk@sha256:6d5227ed82bceaa277d79b1b3e97d8bd460ac6cf0f5df6c1cec95559284a796e
14
+ case ${SPLUNK_TEST_VERSION:-10.6.1.1} in
15
+ 10.6.1.1) image=splunk/splunk@sha256:6d5227ed82bceaa277d79b1b3e97d8bd460ac6cf0f5df6c1cec95559284a796e ;;
16
+ 9.4.9) image=splunk/splunk@sha256:203b430ac01d251fd8b4797ae7986a0cdb004fd8807ab54c887d2892642c2695 ;;
17
+ *) printf '%s\n' 'Unsupported SPLUNK_TEST_VERSION; choose 10.6.1.1 or 9.4.9.' >&2; exit 2 ;;
18
+ esac
15
19
  id="splunk-cli-live-$(python3 -c 'import secrets; print(secrets.token_hex(6))')"
16
20
  runner="$id-runner"
17
21
  server="$id-server"