vosh (Very Optimized Shell) is a fast, minimal, and smart POSIX-compatible shell written in C with advanced features for both beginners and power users.
- Fast execution - Lightweight C implementation with minimal overhead
- POSIX compatibility - Standard shell syntax and command execution
- Pipeline support - Full support for pipes and command chaining
- Job control - Background jobs, fg/bg commands, and job management
- Smart timing - Automatic execution time display for slow commands
- History management - Persistent command history with deduplication options
- Beginner mode - Friendly command hints and explanations in English/Russian
- Custom prompts - Highly configurable prompt with Git integration
- Right prompt - Optional right-side prompt with contextual information
- Auto-cd - Navigate to directories without typing
cd - Smart aliases - Define custom command shortcuts
- Functions - Shell scripting with custom functions in
.voshrc
- Git branch display with dirty status detection
- Background jobs counter
- Current time display
- Username display
- Path truncation and customization
- Execution time for commands
- Customizable colors and symbols
- GCC compiler
- GNU Readline library
- ncurses library
On Debian/Ubuntu:
sudo apt-get install gcc libreadline-dev libncurses-devOn Fedora/RHEL:
sudo dnf install gcc readline-devel ncurses-develmakeThis will create the vosh executable in the current directory.
sudo cp vosh /usr/local/bin/vosh # Start with default settings
vosh --beginner # Start in beginner mode (with hints)
vosh --pro # Start in pro mode (minimal output)
vosh --help # Show help message| Command | Description |
|---|---|
cd [dir] |
Change directory (supports - for previous, no args for $HOME) |
.. |
Go up one directory |
... |
Go up two directories |
export VAR=value |
Set environment variables |
reload |
Reload ~/.voshrc configuration |
help |
Show help message |
exit |
Exit vosh |
jobs |
List background jobs |
fg [%n] |
Bring job to foreground |
bg [%n] |
Resume job in background |
kill [-SIG] %n|pid |
Send signal to job or process |
config |
Show current configuration |
explain ls # Get explanation of 'ls' command
friendly help # Show English/Russian command aliasesvosh reads configuration from ~/.voshrc on startup.
# Timing settings
set timer_threshold=0.05
set show_exec_time=threshold
# Prompt settings
set prompt_symbol=❖
set minimal_mode=false
set show_git_branch=true
set show_jobs_count=true
set show_username=false
set show_time=false
set path_max_len=0
set path_show_full=false
# Colors
set color_success=magenta
set color_error=red
set color_path=gray
set color_git=cyan
set color_jobs=yellow
set color_time=gray
set color_user=gray
set color_exec_time=yellow
# History
set history_size=5000
set history_dedup=sequential
# Behavior
set auto_cd=false
set bell=false
set beginner_mode=false
# Right prompt
set rprompt=true
set rprompt_segments=git,node,time
# Aliases
alias ll="ls -lah"
alias gs="git status"
alias gp="git pull"
# Custom functions
func hello {
echo "Hello, $1!"
echo "Args count: $#"
}
# Environment variables
export MY_VAR="test value"timer_threshold- Minimum execution time (seconds) to display (default: 0.05)show_exec_time- When to show execution time:always,never,threshold(default: threshold)
prompt_symbol- Symbol shown in prompt (default: ❖)prompt_format- Custom prompt format string (empty = built-in)minimal_mode- Simplified prompt (default: false)show_git_branch- Display Git branch in prompt (default: false)show_jobs_count- Display background jobs count (default: true)show_username- Display username in prompt (default: false)show_time- Display current time in prompt (default: false)path_max_len- Maximum path length (0 = unlimited)path_show_full- Show full path instead of truncated (default: false)
Available colors: green, red, blue, cyan, yellow, magenta, gray, white, black
color_success- Color for successful command promptcolor_error- Color for failed command promptcolor_path- Color for current pathcolor_git- Color for Git branchcolor_jobs- Color for jobs countercolor_time- Color for time displaycolor_user- Color for usernamecolor_exec_time- Color for execution time
history_size- Maximum history entries (-1 = unlimited, default: 5000)history_dedup- Deduplication mode:off,sequential,global(default: sequential)
auto_cd- Navigate to directories withoutcdcommand (default: false)bell- Enable terminal bell (default: false)beginner_mode- Enable beginner-friendly hints (default: false)
rprompt- Enable right-side prompt (default: true)rprompt_segments- Comma-separated segments:git,node,python,time,jobs(default: git,node,time)
Define reusable shell functions in .voshrc:
func greet {
echo "Hello, $1!"
echo "You passed $# arguments"
}
func mkcd {
mkdir -p "$1"
cd "$1"
}Call them like regular commands:
greet World
mkcd new-projectPlace plugin files in ~/.config/vosh/plugins/ with .plugin extension. Plugins use the same syntax as .voshrc.
Example plugin (~/.config/vosh/plugins/git.plugin):
alias gst="git status"
alias gco="git checkout"
alias gcm="git commit -m"
alias glog="git log --oneline --graph"
func gac {
git add .
git commit -m "$1"
}ls -la | grep vosh | wc -l
cat file.txt | sort | uniq > output.txtsleep 100 & # Run in background
jobs # List jobs
fg %1 # Bring job 1 to foreground
bg %1 # Resume job 1 in background
kill -9 %1 # Kill job 1kill -TERM %1 # Terminate gracefully
kill -KILL %1 # Force kill
kill -STOP %1 # Pause job
kill -CONT %1 # Resume jobWhen using custom prompt_format, these variables are available:
{user}- Current username{host}- Hostname{path}- Current directory path{git}- Git branch (if in repo){jobs}- Background jobs count{time}- Current time{status}- Last command exit status
.
├── src/ # Source files
│ ├── main.c # Main entry point
│ ├── builtin.c # Built-in commands
│ ├── config.c # Configuration parser
│ ├── exec.c # Command execution
│ ├── friendly.c # Beginner mode features
│ ├── jobs.c # Job control
│ ├── parser.c # Command parsing
│ ├── prompt.c # Prompt generation
│ └── timer.c # Execution timing
├── include/ # Header files
├── obj/ # Object files (generated)
├── Makefile # Build configuration
└── README.md # This file
make # Build vosh
make clean # Remove build artifacts-Wall -Wextra- Enable all warnings-O2- Optimization level 2-lreadline -lncurses- Link required libraries
Make sure vosh is in your PATH:
export PATH=$PATH:/usr/local/binCheck that ~/.vosh_history is writable:
touch ~/.vosh_history
chmod 644 ~/.vosh_historyEnsure you're in a Git repository and show_git_branch=true in .voshrc.
If you experience input problems, try rebuilding with:
make clean && makeThis project is open source. Feel free to use, modify, and distribute.
Contributions are welcome! Please ensure code follows the existing style and passes compilation without warnings.
Current version: 0.1.0
vosh - A minimal, fast, and smart shell for modern developers.