{"id":50504288,"url":"https://github.com/k8s-1/bashls","last_synced_at":"2026-06-02T14:30:30.474Z","repository":{"id":359977796,"uuid":"1248157460","full_name":"k8s-1/bashls","owner":"k8s-1","description":"Bash language server (LSP) written in Rust","archived":false,"fork":false,"pushed_at":"2026-06-02T06:26:51.000Z","size":2525,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T08:19:25.483Z","etag":null,"topics":["bash","bash-lsp","bash-script","language-server","language-server-protocol","lsp","lsp-server","rust","shellcheck","shfmt","tree-si"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k8s-1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T09:04:00.000Z","updated_at":"2026-06-02T06:26:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/k8s-1/bashls","commit_stats":null,"previous_names":["k8s-1/bashls"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/k8s-1/bashls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8s-1%2Fbashls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8s-1%2Fbashls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8s-1%2Fbashls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8s-1%2Fbashls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k8s-1","download_url":"https://codeload.github.com/k8s-1/bashls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8s-1%2Fbashls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33827062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-lsp","bash-script","language-server","language-server-protocol","lsp","lsp-server","rust","shellcheck","shfmt","tree-si"],"created_at":"2026-06-02T14:30:29.441Z","updated_at":"2026-06-02T14:30:30.469Z","avatar_url":"https://github.com/k8s-1.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bashls\n\n[![CI](https://github.com/k8s-1/bashls/actions/workflows/ci.yml/badge.svg)](https://github.com/k8s-1/bashls/actions/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/bashls.svg)](https://crates.io/crates/bashls)\n\nA Bash language server (LSP) written in Rust. Provides IDE features — completions, hover, diagnostics, formatting, rename, and go-to-definition — for shell scripts in any LSP-compatible editor (Neovim, Helix, Zed, Emacs).\n\n![bashls bash language server demo](assets/demo.gif)\n\n## Motivation\n\n[bash-language-server](https://github.com/bash-lsp/bash-language-server) errors had pushed my logs past 1 GB. My editor was slowing down. I wanted something self-contained.\n\n## Features\n\n- Hover documentation\n- Completions (variables, functions, executables, builtins, snippets)\n- Jump to definition\n- Find references\n- Rename\n- Document and workspace symbols\n- Diagnostics via [shellcheck](https://github.com/koalaman/shellcheck)\n- Formatting via [shfmt](https://github.com/mvdan/sh)\n\n## Installation\n\nDiagnostics and formatting require additional tools:\n\n- [shellcheck](https://github.com/koalaman/shellcheck)\n- [shfmt](https://github.com/mvdan/sh)\n\n#### Binary\nDownload from [releases page](https://github.com/k8s-1/bashls/releases), extract, and place `bashls` somewhere on your `$PATH`.\n\n#### Cargo\n```\ncargo install bashls\n```\n\n#### From source\n```\ngit clone https://github.com/k8s-1/bashls\ncd bashls\ncargo build --release\n```\n\n## Editor support\n\nbashls works with any editor that supports LSP.\n\n### Neovim\n\n```lua\nvim.lsp.config('bashls', {\n  cmd = { 'bashls' },\n  filetypes = { 'sh' },\n  root_markers = { '.git' },\n  -- init_options = {\n  --   bashIde = { shellcheckPath = '/usr/bin/shellcheck' },\n  -- },\n})\nvim.lsp.enable('bashls')\n```\n\n### Helix\n\n```toml\n[[language]]\nname = \"bash\"\nlanguage-servers = [\"bashls\"]\n\n[language-server.bashls]\ncommand = \"bashls\"\n```\n\n### Zed\n\n```json\n{\n  \"lsp\": {\n    \"bash-language-server\": {\n      \"binary\": {\n        \"path\": \"bashls\",\n      }\n    }\n  }\n}\n```\n\n### Emacs\n\n```elisp\n(add-to-list 'eglot-server-programs\n             '(sh-mode . (\"bashls\")))\n```\n\n## Configuration\n\nSettings can be provided as LSP initialization options (under `bashIde`) or as environment variables (e.g. `bashIde.shellcheckPath` → `SHELLCHECK_PATH`).\n\n| Setting (`bashIde.*`) | Default | Description |\n|---|---|---|\n| `shellcheckPath` | `shellcheck` | Path to shellcheck binary. |\n| `shellcheckArguments` | `[]` | Additional arguments passed to [shellcheck](https://github.com/koalaman/shellcheck). |\n| `shfmt.path` | `shfmt` | Path to shfmt binary. |\n| `shfmt.*` | | See [shfmt](https://github.com/mvdan/sh) for remaining options. |\n| `globPattern` | `**/*@(.sh\\|.inc\\|.bash\\|.command)` | Files the server treats as bash. |\n| `backgroundAnalysisMaxFiles` | `500` | Max files to analyse in background for workspace-wide features. |\n| `includeAllWorkspaceSymbols` | `false` | Return functions and variables from all workspace files in symbol search, not just open files. |\n| `enableSourceErrorDiagnostics` | `false` | Show diagnostics when a `source`/`.` command cannot be resolved. |\n\n## Limitations\n\n- **No [explainshell](https://explainshell.com) integration.** Supporting this would require pulling in an HTTP/TLS stack (~50 crates); skipped intentionally to keep the dependency footprint small.\n- **Linux and macOS only.** This is a bash language server — if you're on Windows, use WSL.\n\n## Benchmarks\n\nMeasured against [bash-language-server](https://github.com/bash-lsp/bash-language-server) 5.6.0 using 50 `.sh` files from [oh-my-bash](https://github.com/ohmybash/oh-my-bash) as a corpus. Startup is measured cold (no prior Node.js activity); 1500 ms is a typical cold-start. See [examples/lsp_bench.rs](examples/lsp_bench.rs) for the full methodology and instructions to reproduce.\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture align=\"center\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/k8s-1/bashls/main/assets/benchmark-dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/k8s-1/bashls/main/assets/benchmark-light.svg\"\u003e\n    \u003cimg alt=\"Benchmark results comparing bashls to bash-language-server.\" src=\"https://raw.githubusercontent.com/k8s-1/bashls/main/assets/benchmark-dark.svg\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n## License\n\nThis project is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8s-1%2Fbashls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk8s-1%2Fbashls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8s-1%2Fbashls/lists"}