Skip to main content

Plan: Create install-dev-bash.sh

Status: Complete​

Goal: Add Bash development tools (shellcheck, shfmt, VS Code extensions) as an installable dev environment

Last Updated: 2026-01-15

Priority: Medium


Problem Summary​

  • dev-test lint requires ShellCheck but it's not installed in base container
  • No bash development tools available via dev-setup
  • Contributors need to manually install shellcheck to run linting
  • Other dev languages (python, golang, rust, etc.) have install scripts, but bash doesn't

What to Install​

ToolPurposeInstall Method
shellcheckStatic analysis / lintingapt-get
shfmtCode formatterapt-get or binary
bash-language-serverAutocomplete, go-to-definition, hover docsnpm (Node.js already in base)
VS Code extension: timonwong.shellcheckInline shellcheck warningsVS Code
VS Code extension: foxundermoon.shell-formatFormat on saveVS Code
VS Code extension: mads-hartmann.bash-ide-vscodeLanguage server integrationVS Code

Phase 1: Create the Script — ✅ DONE​

Tasks​

  • Create .devcontainer/additions/install-dev-bash.sh
  • Add required metadata (SCRIPT_ID, SCRIPT_NAME, etc.)
  • Use category: LANGUAGE_DEV
  • Implement --help flag
  • Implement --uninstall flag
  • Install shellcheck via apt-get
  • Install shfmt via apt-get (or download binary if not available)
  • Install bash-language-server via npm
  • Install VS Code extensions (shellcheck, shell-format, bash-ide)
  • Add auto-enable/auto-disable support
  • Set SCRIPT_CHECK_COMMAND to shellcheck --version

Validation​

Run in devcontainer:

.devcontainer/additions/install-dev-bash.sh
shellcheck --version
shfmt --version
bash-language-server --version

Phase 2: Test — ✅ DONE​

Tasks​

  • Run dev-test lint and verify shellcheck works
  • Run dev-test to ensure all tests pass
  • Test --uninstall removes the tools
  • Test auto-enable persists across container rebuild (skipped - requires container rebuild)

Validation​

.devcontainer/additions/install-dev-bash.sh --uninstall
# Verify tools removed
.devcontainer/additions/install-dev-bash.sh
# Verify tools installed again

Phase 3: Documentation — ✅ DONE​

Tasks​

  • Run dev-docs to regenerate documentation
  • Verify bash appears in tools.md
  • Verify bash appears in tools-details.md
  • Commit all changes (will do after Phase 4)

Validation​

Check that docs/tools.md lists "Bash" under Development Tools.


Phase 4: Clean Up Investigation Files — ✅ DONE​

Tasks​

  • Delete INVESTIGATE-shellcheck-in-devcontainer.md (resolved by this plan)
  • Update dev-test.sh message if shellcheck not installed to suggest install-dev-bash.sh

Files to Create/Modify​

FileAction
.devcontainer/additions/install-dev-bash.shCreate
.devcontainer/manage/dev-test.shUpdate message
docs/tools.mdAuto-generated
docs/tools-details.mdAuto-generated
docs/commands.mdAuto-generated

Reference: Similar Script​

Use install-dev-python.sh as a template - it's one of the simpler install scripts.

cat .devcontainer/additions/install-dev-python.sh

Notes​

  • ShellCheck is ~5MB, shfmt is ~3MB - acceptable for optional install
  • apt-get packages: shellcheck, shfmt (Ubuntu 22.04+)
  • If shfmt not in apt, download from: https://github.com/mvdan/sh/releases
  • bash-language-server: npm install -g bash-language-server (Node.js 22 already in base container)
  • For uninstall: npm uninstall -g bash-language-server