Skip to content

feat(cli): add progress spinner during instance creation#60

Merged
jmgilman merged 1 commit intomasterfrom
feat/progress-spinner
Jan 5, 2026
Merged

feat(cli): add progress spinner during instance creation#60
jmgilman merged 1 commit intomasterfrom
feat/progress-spinner

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 5, 2026

Summary

  • Adds a ticker-style progress spinner during instance creation that shows the latest log line from docker/devcontainer CLI
  • In verbose mode (-v), streams full CLI output directly to stderr instead
  • Keeps stdout clean by outputting spinner/progress to stderr

Changes

File Change
internal/container/container.go Added Stderr io.Writer field to RunConfig
internal/container/common.go Passes cfg.Stderr to executor
internal/devcontainer/runtime.go Passes cfg.Stderr to executor
internal/instance/instance.go Added Stderr io.Writer field to CreateConfig
internal/instance/manager.go Passes cfg.Stderr through to runtime
internal/spinner/spinner.go NEW - Ticker spinner using bubbletea
internal/cmd/run.go Integrates spinner based on verbosity

Visual Example

Default mode:

⠋ Downloading layer sha256:abc123def456...
⠙ Extracting layer 3/5...
⠹ Running postCreateCommand: npm install...

Verbose mode (hjk run -v):
Full docker/devcontainer output streams to stderr.

Test plan

  • Manual test: hjk run on a repo without cached image - spinner should show pull progress
  • Manual test: hjk run -v on same repo - should stream full output
  • Manual test: hjk run on devcontainer repo - spinner should show build progress
  • Verify integration tests still pass (no TTY = no spinner interference)

🤖 Generated with Claude Code

Current behavior:
When creating an instance for the first time, the CLI shows no output
while images are pulled or devcontainers are built, making it appear
frozen during long operations.

New behavior:
- Default mode: Shows a ticker-style spinner that displays the latest
  log line from docker/devcontainer CLI, updating in place without
  polluting the terminal buffer.
- Verbose mode (-v): Streams full CLI output directly to stderr.

The spinner uses charmbracelet/bubbletea with an io.Pipe to capture
subprocess stderr and display progress in real-time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
headjack 1025938 Commit Preview URL

Branch Preview URL
Jan 05 2026, 09:32 PM

@jmgilman jmgilman merged commit b3d64f4 into master Jan 5, 2026
4 checks passed
@jmgilman jmgilman deleted the feat/progress-spinner branch January 5, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant