The Bash Language Server provides an IDE-like experience for Bash scripts by implementing the Language Server Protocol. It leverages Tree Sitter for parsing, and integrates with external tools like ShellCheck for linting, shfmt for formatting, and explainshell for documentation. The current stable version is 5.6.0. It follows a frequent release cadence, indicated by multiple minor and patch releases within short periods. A key differentiator is its comprehensive integration with established Bash tooling, offering features such as jump to definition, find references, code completion, diagnostics, and formatting. It requires Node.js version 16 or newer to run, and ships with TypeScript types, allowing for type-safe client development or custom integrations. Primarily used as a standalone server, it's typically invoked by editor clients rather than imported as a library.
npm install bash-language-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates global installation verification and clarifies how the Bash Language Server is typically used via editor integrations rather than direct programmatic imports.
Install shellcheck (e.g., 'sudo apt install shellcheck') and shfmt (e.g., 'go install mvdan.cc/sh/cmd/shfmt@latest') via your system's package manager or appropriate installation method.
Upgrade your Node.js installation to version 16 or later (e.g., using nvm: 'nvm install 18 && nvm use 18').
Upgrade to bash-language-server version 5.5.0 or newer to resolve the `shfmt` environment variable deprecation warning.
Install globally using `npm install -g bash-language-server` or ensure your PATH includes the npm global bins (e.g., `export PATH="$(npm config get prefix)/bin:$PATH"`).
Upgrade Node.js to version 16 or higher. Using `nvm` is recommended: `nvm install 18 && nvm use 18`.
Verify global installation with `bash-language-server --help` in your terminal and ensure the npm global bin directory is correctly configured in your system's PATH, especially for the environment your editor runs in.