feat: add kiqr status command#21
Merged
Merged
Conversation
Add a `kiqr status` dashboard that answers "is my site up and where is it" at a glance: whether the project is initialized, an overall green/red running state, the per-service container state, and the live URLs when the site is up. Generation/logic lives in a pure, unit-tested src/lib/status.ts. The container check (isContainerRunning) and config read are injected as dependencies so the logic is fully mockable; the .tsx is a thin Ink renderer mirroring info.tsx. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds
kiqr status— a live project status dashboard that answers thesingle most common question during local theme dev: "is my site up,
and where do I reach it?" — at a glance, without digging through
docker psor remembering the per-project hostname scheme.Running
kiqr statusshows:kiqr.yamlpresent),so a partial or stuck start is immediately visible,
When stopped it nudges you toward
kiqr up; when uninitialized itpoints at
kiqr init.How
src/lib/status.ts— pure, unit-tested logic.getProjectStatus(deps)reads the project config and resolves each service's running state via
the existing
isContainerRunningfromsrc/lib/docker.ts, injectedas a dependency so it is fully mockable. URLs are computed with
buildProjectHostnameand the exact:5477scheme used byinfo.tsx/open.tsx. The overall running state keys off theWordPress front-end container.
src/commands/status.tsx— a thin Ink renderer mirroring the style ofinfo.tsx(Pastel auto-discovers it; noindex.tsxedit needed).tests/lib/status.test.ts— injects a mock container-check fn and atemp
kiqr.yaml; asserts not-initialized / running-with-URLs /stopped / partial-start states, URL computation, and the container
name filtering.
Verification
npm run lint(Biome) — passnpm run typecheck— passnpm test— pass (120 tests, 9 new)npm run build— passnode dist/cli.js statusend-to-end in initialized(stopped) and uninitialized project dirs; output as shown above.
🤖 Generated with Claude Code