Conversation
Introduces src/local_output.rs with serializable output types for all local commands (list, which, install, use, remove, init, server *). Each type implements both Serialize (for --json) and Display (for human-readable output). Includes 34 unit tests covering JSON serialization and Display formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds LocalArgs wrapper struct with global --json flag (matching the CloudArgs pattern) and threads it through every local command handler. Each handler now builds a structured output type and uses print_output() to emit either JSON or human-readable text. Closes #81 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moves local command code into src/local/ (cli.rs, mod.rs, output.rs, server.rs) and cloud CLI types into src/cloud/cli.rs. Root cli.rs is now a thin shell (~136 lines) with just Cli, Commands, SkillsArgs, and re-exports. Local changes no longer require touching shared files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows starting a server with a specific ClickHouse version without changing the default version. The flag accepts the same version specs as install/use (stable, lts, latest, 25.12, etc.) and installs the version if needed. Closes #83 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n name collision - Add `ensure_installed()` that returns existing version instead of erroring when already installed (unlike `install_resolved` which is meant for the explicit `install` command) - Move server name collision check before version resolution so we don't download a version only to fail on a name conflict Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The GitHub matching-refs fallback in find_version_by_refs only accepted tags with -stable or -lts suffixes. Newer versions (e.g. 26.4) may only have tags like -new, causing "No matching version found" errors even though the version exists. Now falls back to any tagged version when no stable/lts tag is found. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract parse_version_refs() and parse_exact_channel() from their network-dependent callers so the ref-parsing logic can be tested in isolation. Adds 13 tests covering: - Stable/LTS tag matching - Fallback to unknown suffixes (e.g. -new) - Preference ordering (stable > unknown) - Edge cases: empty refs, missing dashes, non-tag refs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These flags are mutually exclusive — foreground streams server output directly while --json expects structured output on completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace plain-text list formatting with tabled tables (rounded style) for all list commands: local list, local list --remote, local server list, cloud org list, cloud service list, cloud backup list, cloud member list, cloud invitation list, cloud key list, cloud activity list, and cloud org usage. Closes #87 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The async file handle from tokio::fs::File was not explicitly flushed or closed before returning from download_url. On macOS, this could leave the file descriptor open for writing when detect_binary_version tried to exec the binary, causing "Text file busy" (ETXTBSY / os error 26). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test was matching "^ [0-9]" which assumed the old indented list format. With tabled output, version numbers are inside table cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…output Use tabled for human-readable list output
iskakaushik
approved these changes
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--json output for local commands (closes #81)
--jsonflag to alllocalsubcommands (list, which, install, use, remove, init, server start/list/stop/stop-all/remove)Serialize(for JSON) andDisplay(for human-readable text)--jsonpattern used by cloud commands (LocalArgswrapper withglobal = true)local clientis excluded since it exec()s into clickhouse-client--jsonand--foregroundare mutually exclusive onserver startRestructure CLI into local/ and cloud/ modules (closes #86)
src/cli.rsandsrc/main.rsintosrc/local/cli.rsandsrc/local/mod.rssrc/cloud/cli.rssrc/local_output.rstosrc/local/output.rsandsrc/server.rstosrc/local/server.rssrc/main.rsnow just dispatches tolocal::run()andcloud::run()--versionflag forlocal server start(closes #83)--version(-v) flag accepting the same version specs asinstall/use(stable, lts, latest, 25.12, etc.)ensure_installed()returns existing versions silently instead of erroringVersion resolution fix
find_version_by_refsnow falls back to any tagged version (e.g.-new) when no-stableor-ltstag exists, fixing resolution of newer versions like 26.4Table output for list commands (closes #87)
tabledcrate for formatted table output (rounded style) in all list commandslocal list,local list --remote,local server listcloud org list,cloud service list,cloud backup list,cloud member list,cloud invitation list,cloud key list,cloud activity list,cloud org usageFix ETXTBSY on version install
Test plan
--jsonand--foregroundmutual exclusivitycargo clippycleanlocal server start --version stablestarts server without changing defaultlocal server start --version 26.4resolves and starts correctlylocal --json server start --foregrounderrors immediatelylocal server listrenders as a table with columnsCloses #81, closes #83, closes #87, closes #86
🤖 Generated with Claude Code