Vlsh
Interactive Unix shell written in V — simple, fast, and hackable. Includes pipes/redirection, history + completion, aliases, plugins, theming, and a built-in terminal multiplexer (mux).
Install / Use
/learn @vlshcc/VlshREADME
vlsh
vlsh is an interactive Unix shell written in V. It is designed to be simple, fast, and hackable — with a clean codebase that is easy to read, modify, and extend.
Features at a glance
- Pipes, redirection, and command chaining —
cmd1 | cmd2,> file,>> file,< file; AND-chains (&&), OR-chains (||), and unconditional sequences (;) - Glob expansion —
*.v,./*.deb,~/docs/**expanded before execution - Tilde and environment-variable expansion —
~/path,$VAR,VAR=val cmd - Command history — up/down arrow browsing and
Ctrl+Rincremental search; shared across all sessions (last 5000 entries in~/.vlsh_history) - Tab completion — files and directories;
cdcompletes only directories; plugins can register custom completions (e.g. SSH hostname completion) - Inline autosuggestions — as you type, the most recent matching history
entry is shown as dimmed ghost text;
cdsuggestions are validated against the current filesystem and fall back to live directory listing when no valid history match exists; press→orEndto accept - Aliases — defined in
~/.vlshrcor managed live withaliases add/remove - Plugin system — plugins are installed from the official remote repository
into versioned directories under
~/.vlsh/plugins/<name>/<version>/; vlsh compiles them automatically. Plugins can add commands, decorate the prompt, run pre/post hooks around every command, capture command output via theoutput_hookcapability, provide custom tab completions, contribute live text to the mux status bar (mux_statuscapability), and expose their own help text via thehelpcapability (surfaced through the built-inhelpcommand). Search plugins by name or description withplugins search, install the latest version withplugins install, keep them up to date withplugins update, and remove them withplugins delete. The official repository is at https://github.com/vlshcc/plugins. - Terminal multiplexer — built-in
muxcommand splits the terminal into resizable panes, each running its own shell. Supports mouse selection, copy/paste, a status bar, per-pane scrollback history (up to 1000 lines, scrollable via mouse wheel orCtrl+V+PageUp/PageDown), and all common VT100 sequences so editors likevimandnanowork correctly inside panes. - Native
.vshscript support — execute V shell scripts directly without invokingv runmanually - POSIX environment variables —
export,unset, andVAR=val cmdprefix - Theming — prompt and UI colours configurable via
style setand~/.vlshrc
INSTALL
Pre-built packages (recommended)
The latest release is v1.1.7.1. Pre-built packages for 64-bit Linux are available on the releases page.
Debian / Ubuntu — install via .deb:
curl -LO https://github.com/vlshcc/vlsh/releases/download/v1.1.7.1/vlsh_1.1.7.1_amd64.deb
sudo dpkg -i vlsh_1.1.7.1_amd64.deb
The package installs the binary to /usr/bin/vlsh and automatically adds it
to /etc/shells via the postinst script.
Fedora / RHEL — install via .rpm:
curl -LO https://github.com/vlshcc/vlsh/releases/download/v1.1.7.1/vlsh-1.1.7.1-1.x86_64.rpm
sudo rpm -U vlsh-1.1.7.1-1.x86_64.rpm
Other Linux — standalone binary:
curl -LO https://github.com/vlshcc/vlsh/releases/download/v1.1.7.1/vlsh_1.1.7.1_amd64_linux
chmod +x vlsh_1.1.7.1_amd64_linux
sudo mv vlsh_1.1.7.1_amd64_linux /usr/local/bin/vlsh
Prerequisites (from source)
- V — install with
v upor from https://github.com/vlang/v
Build and run (try it out)
git clone https://github.com/vlshcc/vlsh.git
cd vlsh
v .
./vlsh
Or run directly without compiling first:
v run .
System-wide install
After building, copy the binary to a directory on your system PATH:
sudo cp vlsh /usr/local/bin/vlsh
Verify it is accessible:
which vlsh # should print /usr/local/bin/vlsh
vlsh --version 2>/dev/null || vlsh -c 'version'
Set vlsh as your default login shell
-
Add vlsh to the list of approved shells:
echo /usr/local/bin/vlsh | sudo tee -a /etc/shells -
Change your login shell:
chsh -s /usr/local/bin/vlsh -
Log out and back in (or open a new terminal). Your session should now start in vlsh.
To revert at any time:
chsh -s /bin/bash # or /bin/zsh, etc.
USE
I'm using vlsh as my daily shell. That does not mean you should be. It is likely that you will run into bugs when using vlsh.
CONFIG
vlsh will look for the configuration file $HOME/.vlshrc.
Here's an example -file:
# Environment
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
# Aliases
alias gs=git status
alias gps=git push
alias gpl=git pull
alias gd=git diff
alias gc=git commit -sa
alias gl=git log
alias vim=nvim
# Style (define in RGB colors)
#style_git_bg=44,59,71
#style_git_fg=251,255,234
#style_debug_bg=255,255,255
#style_debug_fb=251,255,234
DOCUMENTATION
Architecture overview
vlsh.v – main entry point, prompt rendering, read-eval loop
cfg/cfg.v – config file (~/.vlshrc) parsing, aliases, paths, style
cmds/cmds.v – built-in commands: help, cd
cmds/ls.v – built-in colorised ls
cmds/cp.v – built-in overwrite-copy (ocp)
exec/exec.v – external-command execution, pipe chains, I/O redirection
mux/mux.v – terminal multiplexer entry point and event loop
mux/pane.v – per-pane VT100 parser and cell grid
mux/layout.v – binary-tree layout engine (splits/resize/navigation)
mux/render.v – grid-to-terminal renderer
mux/input.v – key-sequence parser for mux prefix bindings
mux/pty.v – PTY helpers (thin wrappers around C functions)
mux/pty_helpers.h – C helpers: raw mode, winsize, select, forkpty, exec
utils/utils.v – shared helpers: parse_args, fail/warn/ok/debug
plugins/ – plugin loader and hook dispatcher
Config file (~/.vlshrc)
A plain-text file sourced at startup. Lines beginning with # are comments.
export and unset lines are executed as shell commands; alias and style
lines use the config syntax below.
| Directive | Example | Meaning |
|-----------|---------|---------|
| export KEY=VALUE | export PATH="/opt/bin:$PATH" | Set an environment variable ($VAR is expanded) |
| alias <name>=<cmd> | alias gs=git status | Define a command alias |
| style_git_bg=r,g,b | style_git_bg=44,59,71 | Git-branch prompt background colour |
| style_git_fg=r,g,b | style_git_fg=251,255,234 | Git-branch prompt foreground colour |
| style_debug_bg=r,g,b | | Debug-output background (when VLSHDEBUG=true) |
| style_debug_fg=r,g,b | | Debug-output foreground |
Built-in commands
| Command | Description |
|---------|-------------|
| aliases list | List all defined aliases |
| aliases add <name>=<cmd> | Add or update an alias |
| aliases remove <name> | Remove an alias |
| cd [dir] | Change directory; ~ and ~/path expand to $HOME; home if omitted; cd - returns to the previous directory |
| echo [args…] | Print arguments; expands $VAR and $0; supports > / >> |
| exit [N] | Exit the shell with optional status code (default 0) |
| export [NAME=value …] | Set environment variables; with no args, lists all exported variables |
| help [cmd] | Show command list, or detailed help for a specific command |
| ls [dir] | Colorised directory listing (falls through to system ls when flags are passed) |
| mux | Enter terminal multiplexer mode |
| ocp <src> <dst> | Copy file, overwriting destination |
| plugins list | List locally installed plugins with version and status |
| plugins enable <name> | Enable a disabled plugin by name |
| plugins enable all | Enable every plugin at once |
| plugins disable <name> | Disable a plugin by name |
| plugins disable all | Disable every plugin at once |
| plugins reload | Hot-reload all plugins |
| plugins remote | List remote plugins; shows installed version and available updates |
| plugins search <query> | Search remote plugins by name or description |
| plugins install <name> | Download and install the latest version of a plugin |
| plugins update [name] | Update one or all installed plugins to their latest version |
| plugins delete <name> | Delete an installed plugin |
| source <file> / . <file> | Execute a script in the current shell context (respects # comments and blank lines) |
| style list | Show current style/colour settings |
| style set <key> <r> <g> <b> | Set a prompt colour (RGB 0–255) |
| unset <NAME> … | Remove one or more environment variables |
| version | Print the vlsh version |
Shell features
Pipes – chain commands with |:
ls | grep .v | wc -l
Output redirection – write or append stdout to a file:
echo "hello" > file.txt
echo "world" >> file.txt
Input redirection – feed a file into a command's stdin with <:
wc -l < report.txt
grep error < app.log | wc -l
AND-chains – run the next command only if the previous one succeeds (exit 0):
touch /tmp/x && echo "file created"
OR-chains – run the next command only if the previous one fails (exit non-0):
ping -c1 host || echo "host unreachable"
Unconditional sequences – run commands one after another regardless of exit status:
echo hello ; echo world
make ; make install
Tilde expansion – ~ and ~/path are expanded to $HOME in both commands and arguments:
vi ~/.config/nvim/init.vim
Environment-variable prefix – set variables only for the duration of one command:
FIELD_LIST='used,avail' df -h --no-sync .
Variable expansion in echo – $VAR expands to the environment variable value; $0 expands to vlsh.
Last exit status – $? holds
