Skip to content

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 5, 2026

Summary

  • Add progressive fallback when devcontainer CLI is not found:
    1. Check if devcontainer is in PATH
    2. Check if devcontainer.path is set in config and binary exists
    3. If npm is available, prompt user to install CLI locally
    4. Install to ~/.local/share/headjack/devcontainer-cli/ and save path to config
  • Extract shared Prompter interface from internal/auth into new internal/prompt package
  • Add Confirm method to prompter for yes/no dialogs
  • Add devcontainer.path config field for persisting local CLI path

Test plan

  • Run hjk run <branch> on a repo with devcontainer.json when CLI is not in PATH
  • Verify npm installation prompt appears
  • Confirm CLI is installed to ~/.local/share/headjack/devcontainer-cli/
  • Verify devcontainer.path is saved to config after installation
  • Run hjk run <branch> again and verify it uses the saved path
  • Test declining the installation prompt shows helpful error message
  • Test when npm is not available shows appropriate error message

🤖 Generated with Claude Code

Current behavior:
When devcontainer CLI is not found in PATH, the command fails with an error
message telling users to install it manually.

New behavior:
The CLI resolution now follows a progressive fallback:
1. Check if devcontainer is in PATH
2. Check if devcontainer.path is set in config and binary exists
3. If npm is available, prompt user to install CLI locally
4. Install to ~/.local/share/headjack/devcontainer-cli/ and save path to config

Also extracts the huh-based prompter from internal/auth into a shared
internal/prompt package for reuse across the codebase.

🤖 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 8c0f9ab Commit Preview URL

Branch Preview URL
Jan 05 2026, 05:03 AM

@jmgilman jmgilman merged commit 9261530 into master Jan 5, 2026
4 checks passed
@jmgilman jmgilman deleted the feat/devcontainer-cli-fallback branch January 5, 2026 05:06
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.

2 participants