Repository navigation
Description
Description
Two improvements to the workspace initialization experience:
-
Global
justcommand for workspace init — A global justfile (~/.config/just/justfile) that providesjust -g init-workspace <path>to initialize any project with the devcontainer template from anywhere on the host system. Theinstall.shscript offers to install this global justfile as a post-init step on first run, so users discover it naturally. -
Improved error message when workspace is not empty — When
init-workspace.shdetects a non-empty workspace and--forceis not passed, the current error message is vague ("Workspace is not empty. Use --force to overwrite existing files."). The improved version shows exactly which files would be overwritten and which would be added, so the user can make an informed decision.
Problem Statement
- Installing the devcontainer into an existing project currently requires remembering the full
curlURL or thepodman runcommand with the correct image path and volume mount. A globaljustcommand makes this a simple, memorable invocation — and offering it during the first install ensures discoverability. - The current non-force error gives no visibility into what
--forcewould actually do, making users hesitant to proceed.
Proposed Solution
- Add a global justfile at
~/.config/just/justfilewith aninit-workspacerecipe that auto-detects the container runtime, pulls the latest image, and runsinit-workspace.sh. - At the end of
install.sh, after the existing post-init steps, detect whetherjustis installed and the global justfile is absent. If so, offer to install it (interactive prompt, skip in--no-promptsmode). - Update
assets/init-workspace.shto show a file-by-file breakdown (overwritten vs. added) when the workspace is non-empty and--forceis not passed.
Acceptance Criteria
- Global justfile template exists in
assets/global-justfile(source of truth in the repo) -
install.shoffers to install the global justfile whenjustis available and~/.config/just/justfiledoes not exist -
just -g init-workspace <path>pulls the latest image and initializes the target workspace -
just -g init-workspace <path> --forcepasses--forcethrough toinit-workspace.sh - Non-empty workspace error in
init-workspace.shlists files that would be overwritten and files that would be added - Existing
install.shtests still pass; new behavior is covered
Implementation Notes
- The global justfile template should live in
assets/global-justfileso it is versioned and can be updated on--forceupgrades. - The post-init prompt in
install.shshould be skipped when--no-promptsis set (CI/automation). - The global justfile uses
ghcr.io/vig-os/devcontainer:latestas the default image — no repo-local variables.
Impact
- Who benefits: developers initializing or upgrading projects with the devcontainer.
- Backward compatible: the global justfile is opt-in (offered, not forced); the error message change is purely informational.
Changelog Category
Added
Activity
test: add BATS tests for init-workspace non-empty detection
c-vigo commentedon Jun 23, 2026
Same install/init entrypoint as #641 (part of #625), which adds a
devcontainer | direnv | bothmode picker. Land the mode picker and these init UX improvements together.feat(scripts): install/init delivery-mode picker — devcontainer|diren…
c-vigo commentedon Jul 8, 2026
Closing as part of an agreed backlog cleanup (with @gerchowl) — valid but dormant, no work in progress since the Nix migration. Reopen or refile fresh if picked up.