feat(cli): smooth path 1a — non-interactive init + better docker errors#41
Closed
VarunGitGood wants to merge 1 commit into
Closed
feat(cli): smooth path 1a — non-interactive init + better docker errors#41VarunGitGood wants to merge 1 commit into
VarunGitGood wants to merge 1 commit into
Conversation
…error
Three rough edges discovered during a clean-clone walk of path 1a
(uv sync → repi init --with-docker → repi serve → repi ui):
1. repi init was prompt-only
No way to drive it from a script or CI. Adds three new flags:
--provider <name> Pre-select the LLM provider, skip the prompt.
--api-key <key> Pre-supply the key, skip the prompt.
--api-key-stdin Read the key from stdin's first line — for
piping from a secrets manager.
Interactive prompts remain the default when no flags are passed.
--api-key and --api-key-stdin are mutually exclusive (exit 2). An
invalid --provider exits 2 with the allowed values listed. Ollama
correctly skips the key prompt entirely (no key required).
Six new tests in tests/test_cli_init_flags.py cover all paths.
2. "docker compose failed" hid a daemon-down problem
When Docker Desktop isn't running but the CLI is installed, the previous
flow surfaced "docker compose failed" with no hint at the actual cause.
Splits the probe into _docker_compose_cmd() (CLI presence) and
_docker_daemon_up() (daemon reachable, via `docker info`). Each emits a
distinct actionable message — install Docker / start Docker — so the
user knows which knob to turn.
3. repi ui's first run looked frozen
The first run of `repi ui` runs `npm install` (~10–30s on cold cache).
The previous "node_modules missing — running npm install..." line was
easy to read as "it's hanging." Now prints a clearer one-liner that
sets expectations on duration and clarifies it's a one-time cost.
Tests: 80 pass (was 74; +6 init flag tests).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Three rough edges discovered during a clean-clone walk of path 1a (uv sync → `repi init --with-docker` → `repi serve` → `repi ui`):
`repi init` was prompt-only — no way to drive it from a script or CI. Adds `--provider `, `--api-key `, and `--api-key-stdin` flags. Interactive prompts remain the default. Two failure modes get explicit exit codes:
Ollama correctly skips the key prompt entirely.
"docker compose failed" hid a daemon-down problem. When Docker Desktop isn't running but the CLI is installed, the previous flow surfaced an unactionable error. Split the probe into `_docker_compose_cmd()` (CLI presence) and `_docker_daemon_up()` (daemon reachable, via `docker info`). Each emits a distinct message pointing at the right fix.
`repi ui`'s first run looked frozen. The first run does `npm install` (~10–30s cold cache). The previous "node_modules missing — running npm install..." line was easy to read as "it's hanging." Updated to set duration expectations and clarify it's a one-time cost.
Usage examples
Test plan