You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should ccas (the CLI) stay a JVM binary, or be reimplemented as a lightweight non-JVM client? Settle this before further CLI-v0 investment (it reshapes #70, #43, #67).
Context
The CLI is a thin HTTP client to a local CcasServer: parse args → POST/GET → stream logs → print. It has zero domain logic. Yet every ccas <cmd> boots a JVM (~1s + startup noise — the noise is addressed in #79, the ~1s cold start is not). Booting a JVM to make a localhost HTTP call is the same category of cost we just removed from completion (JVM-per-<TAB> → pure-shell, #49/#78).
Crucially, the server's value is not "reuse the JVM for the CLI." It is:
one ChessComClient = one adaptive rate limiter (two ZIOAppDefault apps at once = two limiters hammering Chess.com — the original epic Epic: CLI v0 (Phase 1) #40 driver),
the background scheduler,
the Phase-2 foundation (OAuth bearer, hosted, multi-device).
JVM reuse helps the work (jobs run in the warm server). The CLI front-end being a cold JVM is pure overhead that none of the above needs.
Options
Keep the JVM CLI (status quo).
Pros: shares the private[ccas] wire DTOs (type-safe), reuses zio-cli parsing/help (CLI subcommand tree via decline #46), one language/build.
Cons: ~1s cold start on every command; heavyweight for a localhost HTTP call; completion already had to go pure-shell to escape it.
Lightweight non-JVM CLI (shell / Go / Rust).
Pros: instant commands; no JVM; consistent with "server is the one warm worker"; completion is already pure-shell; the standalone ZIOAppDefault apps stay for IntelliJ dev so the JVM dev path isn't lost.
Cons: reimplement arg parsing + help; hardcode the JSON DTO shapes (small/stable, but a drift risk — mitigable via a generated schema or a contract test); possibly a new toolchain in the repo (Go/Rust) — or pure-shell with curl/jq (no new toolchain, clunkier streaming/JSON).
Native-image the JVM CLI (GraalVM).
Pros: near-instant start, keep Scala + DTOs.
Cons: zio-http/netty under native-image is painful (reflection/JNI config); high effort/risk for a thin client. Likely not worth it.
Avoid piling more onto the JVM-CLI assumption before the target is set.
Recommendation
Lean toward Option 2 (lightweight client) as the end-state — it matches the server-as-warm-worker model and the pure-shell-completion precedent — but validate the DTO-drift and parsing/help trade-offs first. Don't pivot mid-epic; decide the target so the remaining CLI-v0 sub-issues build toward it rather than away from it.
Decision needed
Should
ccas(the CLI) stay a JVM binary, or be reimplemented as a lightweight non-JVM client? Settle this before further CLI-v0 investment (it reshapes #70, #43, #67).Context
The CLI is a thin HTTP client to a local
CcasServer: parse args → POST/GET → stream logs → print. It has zero domain logic. Yet everyccas <cmd>boots a JVM (~1s + startup noise — the noise is addressed in #79, the ~1s cold start is not). Booting a JVM to make a localhost HTTP call is the same category of cost we just removed from completion (JVM-per-<TAB>→ pure-shell, #49/#78).Crucially, the server's value is not "reuse the JVM for the CLI." It is:
ChessComClient= one adaptive rate limiter (twoZIOAppDefaultapps at once = two limiters hammering Chess.com — the original epic Epic: CLI v0 (Phase 1) #40 driver),JVM reuse helps the work (jobs run in the warm server). The CLI front-end being a cold JVM is pure overhead that none of the above needs.
Options
Keep the JVM CLI (status quo).
private[ccas]wire DTOs (type-safe), reuses zio-cli parsing/help (CLI subcommand tree via decline #46), one language/build.Lightweight non-JVM CLI (shell / Go / Rust).
ZIOAppDefaultapps stay for IntelliJ dev so the JVM dev path isn't lost.curl/jq(no new toolchain, clunkier streaming/JSON).Native-image the JVM CLI (GraalVM).
Why decide now
ccas configcommand to manage CCAS settings (DB connection, contact email, …) #67 (ccas config+servereads the file): the config file is the contract either way, but who writes/reads it differs (a non-JVM CLI writes a file the JVM server reads — a clean split).Recommendation
Lean toward Option 2 (lightweight client) as the end-state — it matches the server-as-warm-worker model and the pure-shell-completion precedent — but validate the DTO-drift and parsing/help trade-offs first. Don't pivot mid-epic; decide the target so the remaining CLI-v0 sub-issues build toward it rather than away from it.
References
ccas configcommand to manage CCAS settings (DB connection, contact email, …) #67, app_setting table for DB-owned app settings (start with cache_retention_days) #57.