Commit bd0997a
feat(cli): reframe skardi CLI as thin HTTP client for skardi-server (#170)
* docs: add CLI reframe design spec (thin HTTP client)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: spec update — skardi run accepts JSON request body via -d/--data
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: add CLI reframe implementation plan
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: plan without inline Rust code — behavior and interface specs only
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor(cli): strip local engine, aliases, and features to thin-client skeleton
* feat(cli): add ClientConfig resolution (flag > env > file > default)
* feat(cli): add JSON-first param parsing and -d/--data body building
* feat(cli): add JSON/table output rendering with stderr truncation notice
* feat(cli): add ApiClient with bearer auth and uniform error mapping
* feat(cli): skardi query posts SQL to the server /query endpoint
* feat(cli): skardi run executes named server pipelines (replaces aliases)
* feat(cli): add pipeline/schema/health discovery commands
* feat(cli): port job commands onto shared ApiClient with global connection flags
* feat(cli): add e2e smoke test and rewrite CLI docs for thin-client surface
* fix(cli): usage errors exit 1 per exit-code contract; update jobs param docs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: migrate per-source docs and demo READMEs to server-based CLI workflow
All docs that taught the old local-engine CLI (query --ctx, --schema,
aliases, CLI feature flags, NAME:TYPE=VALUE params) now describe the
thin-client flow: start skardi-server with --ctx/--semantics/--pipeline,
then use skardi query / run / schema / pipeline against it. Demo READMEs
(llm_wiki, rag) rewritten around real pipeline names; embedding docs
point features at the server build; broken 'cargo install -p skardi-cli
--features' commands removed. Every new example verified against the
actual CLI/server flags and pipeline YAML params.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(cli): sort table columns explicitly — map order is feature-dependent
CI runs the workspace with --all-features, which pulls in bson (mongo
provider) and its serde_json/preserve_order feature; Cargo feature
unification then makes serde_json::Map insertion-ordered for every crate
in the build, flipping render_table's column order and failing its
exact-string test. Sorting the first row's keys explicitly keeps column
order alphabetical and deterministic regardless of feature unification.
Reproduced locally by enabling preserve_order on the CLI's serde_json:
test fails without the sort, passes with it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ci: start skardi-server before integration tests for CLI e2e smoke tests
The integration step runs every #[ignore] test in the workspace; the
CLI's e2e_smoke tests are ignored because their backing service is
skardi-server itself, which CI never started — so they failed with
connection errors. Provision it like the other integration services:
launch the already-built server binary and wait for /health before the
--ignored pass. Verified locally: both smoke tests pass against a bare
server (SELECT 1 needs no sources; the 404 path needs no pipelines).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(cli): address PR review — encode URL components, warn on cleartext token, cap response bodies
- Percent-encode user-supplied path segments and query values (pipeline/
job names, run ids) at all seven interpolation sites via a shared
encode_component helper (percent-encoding crate, RFC 3986 unreserved
set); a name like 'a/b' can no longer change the request route. The
hand-rolled 3-character urlencode in jobs.rs is deleted in its favor.
- Warn on stderr when a bearer token is configured together with a plain
http:// URL to a non-loopback host (cleartext credential travel).
- Cap buffered response bodies at 256 MiB, enforced while streaming
chunks so chunked responses without Content-Length are covered too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(cli): treat empty config values as unset; align tables by char count
- An exported-but-empty SKARDI_SERVER_URL/SKARDI_API_TOKEN (or empty
--server/--token/file value) now falls through the precedence chain
instead of producing an empty base URL or an empty Bearer header.
- Table column widths are measured in characters, matching the unit
format! pads by, so non-ASCII cells no longer shift the separators.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(cli): trim kept config values; recognize more loopback forms in cleartext check
- non_empty now trims the value it keeps, so a padded
SKARDI_SERVER_URL=" http://x " resolves to a clean URL instead of a
malformed one.
- The cleartext-token warning no longer misfires on IPv4-mapped IPv6
loopback ([::ffff:127.0.0.1]) or the unspecified addresses
(0.0.0.0 / [::]), which route to localhost as connect targets.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent f41664f commit bd0997a
38 files changed
Lines changed: 3825 additions & 5411 deletions
File tree
- .github/workflows
- crates/cli
- src
- commands
- tests
- demo
- llm_wiki
- rag
- docs
- basic
- clickhouse
- embeddings
- candle
- gguf
- remote
- lance
- sqlite
- superpowers
- plans
- specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
557 | 572 | | |
558 | 573 | | |
559 | 574 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
185 | 187 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 188 | + | |
192 | 189 | | |
193 | 190 | | |
194 | 191 | | |
| |||
209 | 206 | | |
210 | 207 | | |
211 | 208 | | |
212 | | - | |
| 209 | + | |
213 | 210 | | |
214 | 211 | | |
215 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 | | |
217 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| |||
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
260 | 266 | | |
261 | 267 | | |
262 | 268 | | |
| |||
272 | 278 | | |
273 | 279 | | |
274 | 280 | | |
275 | | - | |
| 281 | + | |
276 | 282 | | |
277 | 283 | | |
278 | 284 | | |
| |||
439 | 445 | | |
440 | 446 | | |
441 | 447 | | |
442 | | - | |
443 | | - | |
| 448 | + | |
| 449 | + | |
444 | 450 | | |
445 | 451 | | |
446 | 452 | | |
| |||
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
454 | | - | |
| 460 | + | |
455 | 461 | | |
456 | 462 | | |
457 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 15 | | |
30 | 16 | | |
31 | | - | |
32 | | - | |
33 | 17 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 18 | | |
38 | | - | |
39 | | - | |
| 19 | + | |
40 | 20 | | |
41 | 21 | | |
42 | 22 | | |
43 | 23 | | |
44 | | - | |
45 | 24 | | |
46 | | - | |
47 | 25 | | |
48 | 26 | | |
49 | 27 | | |
| 28 | + | |
50 | 29 | | |
51 | 30 | | |
52 | 31 | | |
0 commit comments