Skip to content

feat: add kiqr status command#21

Merged
kjellberg merged 1 commit into
kiqr:mainfrom
kjellbergzoey:feat/status-command
Jun 7, 2026
Merged

feat: add kiqr status command#21
kjellberg merged 1 commit into
kiqr:mainfrom
kjellbergzoey:feat/status-command

Conversation

@kjellbergzoey

Copy link
Copy Markdown
Contributor

What

Adds kiqr status — a live project status dashboard that answers the
single most common question during local theme dev: "is my site up,
and where do I reach it?"
— at a glance, without digging through
docker ps or remembering the per-project hostname scheme.

Running kiqr status shows:

  • whether the project is initialized (kiqr.yaml present),
  • an overall running / stopped state (green / red),
  • the per-service container state (wordpress, mariadb, phpmyadmin),
    so a partial or stuck start is immediately visible,
  • the URLs (site, admin, phpMyAdmin) — only when the site is up.
Status: running

Services
 ● wordpress  running
 ● mariadb    running
 ● phpmyadmin running

URLs
 Site: http://acme.<machine>.lvh.me:5477
 Admin: http://acme.<machine>.lvh.me:5477/wp-admin
 phpMyAdmin: http://phpmyadmin.acme.<machine>.lvh.me:5477

When stopped it nudges you toward kiqr up; when uninitialized it
points 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 isContainerRunning from src/lib/docker.ts, injected
    as a dependency
    so it is fully mockable. URLs are computed with
    buildProjectHostname and the exact :5477 scheme used by
    info.tsx / open.tsx. The overall running state keys off the
    WordPress front-end container.
  • src/commands/status.tsx — a thin Ink renderer mirroring the style of
    info.tsx (Pastel auto-discovers it; no index.tsx edit needed).
  • tests/lib/status.test.ts — injects a mock container-check fn and a
    temp kiqr.yaml; asserts not-initialized / running-with-URLs /
    stopped / partial-start states, URL computation, and the container
    name filtering.

Verification

  • npm run lint (Biome) — pass
  • npm run typecheck — pass
  • npm test — pass (120 tests, 9 new)
  • npm run build — pass
  • Smoke-tested node dist/cli.js status end-to-end in initialized
    (stopped) and uninitialized project dirs; output as shown above.

🤖 Generated with Claude Code

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>
@kjellberg
kjellberg merged commit e9a5eb2 into kiqr:main Jun 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants