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 aliasestype
,which
,hash
β identify commands and hash lookupshelp
,history
β builtin help and command historyset
,export
,unset
,umask
β shell/options and environmentsource
,eval
,exec
,read
β script and execution helpersprintf
,echo
,test
,true
,false
β basic utilitiestime
,times
,trap
,timeout
,getopts
β timing, signals, option parsingcommand
β run a command bypassing functions/aliasesexit
,pwd
,cd
,dirs
,pushd
,popd
β navigation and exitenv
,clear
β environment display and screen clear
jobs
β list jobsbg
β resume a job in backgroundfg
β bring a job to foregroundkill
β send signals to jobs/processesdisown
β remove jobs from job tablewait
β wait for jobs to complete
reload
β reload configurationlibrary
β manage/inspect librariesshow
β display information/detailsscript-builtins
β scripting helpers (internal)
bookmark
β manage bookmarks/pathscopyssh
β copy SSH public keydotfiles
β dotfiles helperemptytrash
β empty system trashft
β quick fuzzy file helperhide
β hide/show filespstorm
β open in PhpStormcode
β open in VS Codeshrug
β print Β―\(γ)/Β―web
β open URLs/web helperswip
β 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 π