swagsh, ~

you@arch ~ $ exec swagsh

swagsh

// a shell, the way i want it

a fast, minimal, modern linux shell built in rust. real shell grammar, full expansions, job control, tab completion and a customisable prompt. the name is swag, for stylish flair.

swagsh, session

~ $ for i in 1 2 3; do echo "line $i"; done

line 1

line 2

line 3

~ $ name=takashi; echo "hi, ${name}"

hi, takashi

~ $ cat log | grep err | wc -l

7

~ $

features

## a real shell. no surprises.

๐Ÿงฉ

shell grammar

pipelines, redirections, control flow, functions, subshells and here-documents.

๐Ÿ”ค

expansions

variable, parameter, tilde, glob and command substitution.

โŒจ

tab completion

completes builtins, aliases, executables and filenames out of the box.

๐Ÿงต

job control

background jobs, foreground and background switching, stopping and signalling.

๐ŸŽ›

prompt

a customisable $PS1 with escape sequences for the working directory, user, host and more.

๐Ÿ•˜

history

persistent history that respects $HISTFILE and $HISTSIZE, with a private mode.

performance

## fast where it counts

measured with hyperfine --shell=none on linux x86-64.

dash-class

across builtins, variable expansion, conditionals, loops and function calls, swagsh delivers dash-class performance.

~40% faster than bash

on those same workloads, swagsh is about 40% faster than bash.

~25% faster on pipelines

on pipelines, where process-spawn overhead dominates and the shell layer matters less, it's about 25% faster than bash.

installation

## pick your platform

cargo (all platforms)

cargo install swagsh

# requires rust (edition 2024)

aur (arch linux)

paru -S swagsh

# or yay

from source

git clone https://github.com/takashialpha/swagshcd swagsh && cargo build --release

# binary at target/release/swagsh

run swagsh --help for the full option set.