Krusty is a modern, feature-rich shell built with TypeScript and Bun. It provides a familiar shell experience with enhanced features, extensibility, and developer-friendly tooling.
- 🚀 Performance: Built on Bun
- 🧠 Smart completion: Context-aware command/file completions
- 🧩 Aliases & functions: Powerful aliasing and shell functions
- 🧵 Pipelines & redirections: Full
|
,>
,>>
,2>&1
, here-strings, etc. - 🧭 Job control:
jobs
,bg
,fg
,kill
,wait
with proper signal handling - 📜 Scripting: if/then/else, for/while/until, case/esac, functions, and more
- 🎨 Themes: Configurable prompt with Git integration
- 🔌 Plugins: Extend functionality cleanly
- 🧪 Tested: Comprehensive test suite for reliability
# Install Krusty globally
bun add -g krusty
npm install -g krusty
yarn global add krusty
pnpm global add krusty
# Start the shell
krusty
Krusty ships with a comprehensive set of built-ins. Run help
for details.
-
alias
,unalias
— manage aliases -
type
,which
,hash
— identify commands and hash lookups -
help
,history
— builtin help and command history -
set
,export
,unset
,umask
— shell/options and environment -
source
,eval
,exec
,read
— script and execution helpers -
printf
,echo
,test
,true
,false
— basic utilities -
time
,times
,trap
,timeout
,getopts
— timing, signals, option parsing -
command
— run a command bypassing functions/aliases -
exit
,pwd
,cd
,dirs
,pushd
,popd
— navigation and exit -
env
,clear
— environment display and screen clear
-
jobs
— list jobs -
bg
— resume a job in background -
fg
— bring a job to foreground -
kill
— send signals to jobs/processes -
disown
— remove jobs from job table -
wait
— wait for jobs to complete
-
reload
— reload configuration -
library
— manage/inspect libraries -
show
— display information/details -
script-builtins
— scripting helpers (internal)
-
bookmark
— manage bookmarks/paths -
copyssh
— copy SSH public key -
dotfiles
— dotfiles helper -
emptytrash
— empty system trash -
ft
— quick fuzzy file helper -
hide
— hide/show files -
pstorm
— open in PhpStorm -
code
— open in VS Code -
shrug
— print ¯\(ツ)/¯ -
web
— open URLs/web helpers -
wip
— work-in-progress helper
Note: A few items are convenience helpers specific to Krusty and not POSIX/Bash standard.
- Execute external commands and pipelines:
echo hi | tr a-z A-Z
- Redirect output and duplicate FDs:
sh -c 'echo out; echo err 1>&2' 2>&1 | wc -l
- Backgrounding and job control:
sleep 5 &
→jobs
→fg %1
Create command aliases in your krusty.config.ts
file:
export default {
// ... other config
aliases: {
ll: 'ls -la',
gs: 'git status',
},
// ... other config
}
Theme configuration powers prompt styling and Git status:
export default {
theme: {
prompt: {
left: '{cwd} ❯ ',
right: '',
},
git: { enabled: true },
},
}
Set environment variables in your krusty.config.ts
file:
export default {
// ... other config
env: {
EDITOR: 'code',
PATH: `${process.env.HOME}/.local/bin:${process.env.PATH}`,
},
// ... other config
}
Krusty includes a script engine with:
- Control flow:
if/then/else/fi
,for/while/until
,case/esac
- Functions:
name() { … }
andfunction name { … }
- Built-ins:
source
,test
,true/false
,local/declare/readonly
,return/break/continue
See test/scripting.test.ts
for examples.
- Ctrl+Z suspends the foreground job (SIGTSTP),
bg
resumes in background,fg
brings it back - Ctrl+C sends SIGINT to the foreground job
-
kill -SIGNAL %n
sends signals to a job;wait %n
awaits completion
# Clone the repository
git clone https://github.com/stacksjs/krusty.git
cd krusty
# Install dependencies
bun install
# Build the project
bun run build
bun test
Please see our releases page for more information on what has changed recently.
Please see CONTRIBUTING for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
The MIT License (MIT). Please see LICENSE for more information.
Made with 💙