{"slug": "show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in", "title": "Show HN: Kosh – Bash shell runtime with 100x faster Shellcheck and LSP built-in", "summary": "Kosh 0.1.0, a Bash-compatible shell runtime with built-in linting and a language server, claims to run ShellCheck diagnostics roughly 100x faster and execute scripts 5x faster than Bash. The project, renamed from 'shit' to 'kosh' in version 0.2.0, includes about 300 built-in diagnostics and supports Windows, Linux, and macOS.", "body_md": "0.1.0 has been released! See the [Release Blog Post](https://fennec.support/scribbles/shell-release).\n\n**The project was renamed in 0.2.0.** The `shit`\n\nis now `kosh`\n\n, `shitbox`\n\nis\n`koshkit`\n\n, and every prefix is changed to `kosh`\n\nor `KOSH_`\n\n. I got over the\nfunny name. Thanks.\n\n**Koshka** is the Russian word for a cat.\n\n**Koshka** is an interpreter, interactive shell, formatter and a language\nserver, with first tier support for Windows, Linux and macOS, fully compatible\nwith Bash 5.3 and Dash.\n\nKoshka contains ~300 built-in shellcheck diagnostics. It is usually 5x faster than bash, or ~100x+ faster than shellcheck, which makes it exceptionally friendly to coding agents or strict environments where Bash is still used.\n\n| Koshka analyzing 20K-line shell script in ~0.05s |\n|---|\n\n`kosh`\n\nis the **koshka**'s binary.\n\n**Koshka** aims to be a complete, faster and portable Shellcheck and Bash\nreplacement. The shell guarantees first tier support for Linux, macOS and\nWindows, preserving equivalent behavior on either of these systems.\n\nThe shell is designed to work without absolutely no config whatsoever.\n**Koshka**'s Linux binary is static and it does not use C++'s STL. **Koshka**\nalso can work without coreutils, using it's own utilities.\n\n**The project is in early stage**. There's no guarantee that it will not blow\nyour computer up. Bug reports are greatly appreciated.\n\n[See the manual page](/toiletbril/kosh/blob/master/docs/kosh.1) for a fuller explanation:\n\n``` bash\n$ man docs/kosh.1\n```\n\n**Koshka** runs in four modes, called moods, across three shell identities. ZSH\nhas similar idea behind it's `emulate`\n\nbuiltin.\n\nThe default `kosh`\n\nmood is a strict superset of Bash with analysis and\noptimization enabled. The other moods are `bash`\n\n, `bash-posix`\n\n, and `sh`\n\n. The\n`bash-posix`\n\nmood provides Bash behavior with its POSIX mode enabled.\n\nBefore it runs a command, **Koshka** analyzes and optimizes the complete script.\nThe catalog includes about 100 checks derived from ShellCheck and about a dozen\nnative analysis checks.\n\n`kosh --lint`\n\nbehaves like shellcheck, but several magnitudes faster.\n\n`kosh --format`\n\nformats the code. There's no customization as of now.\n\n`kosh --language-server`\n\nlaunches language server on stdin.\n\nThe `--mood`\n\noption, or `-M`\n\n, selects `kosh`\n\n, `bash`\n\n, `bash-posix`\n\n, or `sh`\n\n.\nThe default is `kosh`\n\n. A binary symlinked as `sh`\n\n, `dash`\n\n, or `bash`\n\nselects\nthe matching mood and disables diagnostics. `set --mood`\n\nchanges the mood at\nruntime. In the default mood, `-W`\n\nretains the default severities, `-WW`\n\ndemotes lenient errors to warnings, and `-WWW`\n\nalso demotes strict errors. In\nother moods, `-W`\n\nenables strict warnings, `-WW`\n\nalso enables lenient warnings,\nand `-WWW`\n\nalso enables annoying warnings.\n\nThe `-I`\n\noption enables mimicry. **Koshka** detects `sh`\n\n, `dash`\n\n, and `bash`\n\nshebangs and runs each script in the matching mood. The current diagnostics\nsetting is preserved.\n\nThe `--init-moods`\n\noption, or `-L`\n\n, accepts a comma-separated list of moods whose\nstartup files will be used. Its default value is the selected mood.\n\nThe `KOSH_FLAGS`\n\nenvironment variable specifies default flags. A flag on the\ncommand line still wins.\n\nWhen `KOSH_FLAGS`\n\nor the command line contains an invalid flag or argument, a\nlogin shell skips its startup files and opens a rescue session.\n\nThe interactive mode is inspired by\n[fish](https://github.com/fish-shell/fish-shell). Shell provides syntax\nhighlighting, word movement, editing controls, UTF-8 support, display-width\nhandling for wide characters, multiline editing, history search, and persistent\nhistory. `kosh`\n\ndoes not depend on readline, so it's config is not used.\n\n**Koshka** has more than 50 builtins, and each builtin supports `--help`\n\n. These\ninclude Bash and POSIX builtins. The additional builtins include the following\ncommands.\n\n`z`\n\nis a port of[zoxide](https://github.com/ajeetdsouza/zoxide).`bench`\n\nprovides built-in benchmark infrastructure inspired by Performance Optimizer Observation Platform ([poop](https://github.com/andrewrk/poop)).`assimilate`\n\nprovides transactional installation on an SSH target.\n\nThe `koshkit`\n\nbuiltin bundles a BusyBox-style set of small core utilities.\n\n- File utilities include\n`cp`\n\n,`mv`\n\n,`ln`\n\n, and`rm`\n\n. - Search utilities include\n`find`\n\nand`grep`\n\n. - Process utilities include\n`killall`\n\n,`pkill`\n\n,`ps`\n\n,`timeout`\n\n, and`nproc`\n\n. - Minimal implementations of\n`calc`\n\nand`make`\n\nare included.\n\n`koshkit cat --syntax-highlighting`\n\ncolors shell files when standard output is\na terminal. Shell extensions and known shell shebangs select the source. The\noutput omits underline attributes.\n\nThis software began as a late April Fools' joke. It is written from scratch in a\nmacro-heavy C++23 dialect and is compiled with `-nostdlib++`\n\n. The executable\nlinks only to the C library.\n\nDevelopment occurs on `staging`\n\n, and the branch may be broken. The `master`\n\nbranch should pass all tests.\n\nA native build needs the following tools.\n\n- Install GNU Make, Clang 18 or later with C++23 support, libc development files, and headers for the target platform. Linux builds also need Linux kernel headers.\n- The default debug build needs the AddressSanitizer and\nUndefinedBehaviorSanitizer runtimes from\n`compiler-rt`\n\n. - The test suite needs Bash 5.3, Dash, and Python 3.\n- The build and test scripts need\n`mkdir`\n\n,`rm`\n\n,`cp`\n\n, and`printf`\n\nfrom the host. - The full test suite needs\n`cat`\n\n,`cmp`\n\n,`diff`\n\n,`find`\n\n,`grep`\n\n,`head`\n\n,`sed`\n\n, and`strings`\n\n. Interactive tests also need`script`\n\nand`stty`\n\n. Process supervision needs`setsid`\n\nor Perl.\n\nA complete Alpine setup can be installed with the following package set.\n\n```\napk add --no-cache \\\n  git git-doc make build-base musl-dev linux-headers clang llvm lld \\\n  compiler-rt bash dash zsh yash busybox coreutils mandoc python3\n```\n\nThe benchmark needs Bash, Dash, and Python 3. Zsh, Yash, and BusyBox ash provide\noptional comparison rows. The coverage report needs `llvm-profdata`\n\nand\n`llvm-cov`\n\nfrom the matching LLVM installation. Documentation checks use\n`mandoc`\n\n. Formatting and static checks use `clang-format`\n\nand `clang-tidy`\n\nfrom\nClang 18 or later.\n\nEach cross-compilation target needs its matching toolchain. Zig builds the Zig\ntargets and cross-compiles release binaries to Linux. MinGW-w64 targets Windows,\nosxcross with a macOS SDK targets Darwin arm64, and `cosmoc++`\n\nbuilds the\nCosmopolitan modes.\n\nThe `MODE`\n\nvariable controls the build type.\n\n`rel`\n\nis an optimized build.`prof`\n\nis an optimized build with debug symbols for profiling.`cov`\n\nis an optimized build with debug symbols for collecting coverage.`dbg`\n\nincludes all symbols, AddressSanitizer, and UndefinedBehaviorSanitizer.`cosmo`\n\nis an optimized build that uses`cosmoc++`\n\nfrom the Cosmopolitan toolchain.`cosmo_dbg`\n\nis a debug Cosmopolitan build.\n\n`TARGET`\n\ndefaults to the host platform and accepts `Linux`\n\n, `Windows_NT`\n\n, or\n`Darwin`\n\n.\nA non-Windows host cross-compiles `TARGET=Windows_NT`\n\nwith MinGW. A non-Darwin\nhost cross-compiles `TARGET=Darwin ARCH=arm64`\n\nwith osxcross. Linux is a native\ntarget.\n\nThe `$CXXFLAGS`\n\nenvironment variable appends flags to the build commands.\n\nBuild with GNU Make as shown below. Make uses every available logical CPU and shares its bounded job pool with recursive builds.\n\n``` bash\n$ make MODE=<rel/prof/dbg/cov/cosmo/cosmo_dbg>\n$ make MODE=rel TARGET=Windows_NT\n$ make MODE=rel TARGET=Darwin ARCH=arm64\n$ ./kosh --help\n```\n\nZig can also build the `dbg`\n\nand `rel`\n\nmodes.\n\n``` bash\n$ zig build --release=fast\n$ ./zig-out/bin/kosh --help\n```\n\nInstall or uninstall the selected build with the following commands.\n\n``` bash\n$ export PREFIX=/usr/local\n$ make install\n$ make uninstall\n```\n\nThe running binary can install itself on an SSH target with `assimilate user@host`\n\n.\n\nIs it usable?\n\n- Programs run.\n- Linux and Windows are supported.\n- Logical sequences are supported with\n`&&`\n\n,`||`\n\n, and`;`\n\n. - Pipes are supported.\n- Redirections are supported with\n`>`\n\nand`<`\n\n. - Shell expansions are supported with\n`?`\n\n,`[...]`\n\n,`*`\n\n, and`~`\n\n. - Escapes are supported.\n- Environment variables are supported.\n- Numeric expressions are supported.\n\nIs it good?\n\n- Background jobs are supported.\n- Scripting constructs include flow-control keywords.\n- Blocks and functions are supported.\n- The shell supports\n`sh`\n\nscripts.\n\nIs it exceptional?\n\n- The shell supports Bash scripts.\n- ShellCheck-style warnings are built in.\n- Koshkit replaces common Unix programs that are absent from Windows.\n- Arbitrary-precision numeric expressions are planned.", "url": "https://wpnews.pro/news/show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in", "canonical_source": "https://github.com/toiletbril/kosh", "published_at": "2026-08-28 20:58:32+00:00", "updated_at": "2026-08-28 21:18:44.376035+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Kosh", "Koshka", "ShellCheck", "Bash", "Dash", "fish", "zoxide"], "alternates": {"html": "https://wpnews.pro/news/show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in", "markdown": "https://wpnews.pro/news/show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in.md", "text": "https://wpnews.pro/news/show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in.txt", "jsonld": "https://wpnews.pro/news/show-hn-kosh-bash-shell-runtime-with-100x-faster-shellcheck-and-lsp-built-in.jsonld"}}