v1.0.0 — Written in C11

The cFd Terminal

A fully custom shell built from scratch in C. No bash. No PowerShell. No wrappers. Just pure C.

⬇ Download v1.0.0 View on GitHub Build from Source
cfd — ~/projects
saar@machine ~/projects > ls -la
src/        include/    tests/     cfd.exe    Makefile  
saar@machine ~/projects > cat notes.txt | grep -i "todo" | sort
TODO: finish the parser TODO: write tests
saar@machine ~/projects > calc sqrt(2) * pi
4.4428829
saar@machine ~/projects > pkg install git
Searching for git... Installing Git.Git via winget...
saar@machine ~/projects >

Get cFd v1.0.0

Pick your platform and get running in seconds.

🪟
Windows MSI
cFd-v1.0.0-windows.msi
Windows 10/11 x64
⬇ Download .msi
Silent MSI — adds cfd to PATH automatically
🪟
Windows Setup
cFd-v1.0.0-setup.exe
Windows 10/11 x64
⬇ Download .exe
Classic wizard — Start Menu & desktop shortcut
macOS
cFd-v1.0.0-macos.dmg
macOS 10.13+ · Intel & Apple Silicon
⬇ Download .dmg
Drag cFd.app to /Applications
🐧
Linux
cFd-v1.0.0-linux-x86_64.tar.gz
x86_64 · any distro
⬇ Download .tar.gz
chmod +x cfd && ./cfd

Or view all releases on GitHub  ·  build from source

150+
Source Files
70+
Built-in Commands
0
External Dependencies
C11
Language Standard

Everything built from scratch

Every subsystem — the lexer, parser, line editor, scripting engine, and all 70+ commands — is written in C with zero external libraries.

✏️

Syntax Highlighting

Commands, strings, pipes, variables, and flags are colorized in real time as you type.

💡

Auto-suggest

Ghost-text completion from history appears after the cursor. Press → to accept instantly.

🔍

Ctrl+R Search

Incremental reverse history search. Type to filter, Enter to accept, Ctrl+G to cancel.

⌨️

Full Line Editor

Arrow keys, Home/End, Ctrl+A/E/K/U/W/Y, word-kill, kill-ring. Works exactly as expected.

|

Real Pipes

cmd1 | cmd2 | cmd3 uses real dup2 pipe chaining — no temp files, no workarounds.

📜

Scripting Engine

Variables, if/elif/else, while, for, functions, and source — a complete mini-language.

🧮

Built-in Calculator

calc sqrt(2) * pi — expression parser with trig, log, sqrt, and constants.

📦

Package Manager

pkg install git auto-detects winget, scoop, choco, apt, or brew and installs.

📝

Built-in Editor

nano file.txt opens a full terminal text editor with search, cut/paste, and save.

🌐

HTTP Client

curl and wget built in using WinHTTP (Windows) or BSD sockets (Unix).

🔐

Crypto Hashing

md5 and sha256 implemented from scratch — RFC 1321 and FIPS 180-4.

🎨

Themes

Three built-in themes: default, dark, and minimal. Configurable prompt format.

70+ built-in commands

Every command is a native C function — no forking to an external tool.

CommandDescription
ls [-la] [path]List directory with color-coded entries
cd [path]Change directory; cd - goes back
pwdPrint working directory
mkdir [-p] <dir>Create directory, -p creates parents
rm [-rf] <path>Remove files or directories
cp [-r] <src> <dst>Copy files or directories
mv <src> <dst>Move or rename
cat [file...]Print file contents
find [dir] [-name pat]Find files matching pattern
tree [-L n] [path]Visual directory tree with box-drawing chars
du [-sh] [path]Disk usage, -h for human-readable
df [-h]Disk free space for all volumes
ln [-s] <target> <link>Create hard or symbolic link
stat <file>File metadata (size, dates, permissions)
realpath <path>Resolve to absolute path
chmod <mode> <file>Change file permissions
CommandDescription
grep [-rni] <pat>Search text with regex
sort [-rnu]Sort lines alphabetically or numerically
wc [-lwc]Count words, lines, and characters
head / tail [-n N]Show first or last N lines
cut -d <d> -f <n>Extract delimited fields
tr <set1> <set2>Translate characters
uniq [-cd]Filter adjacent duplicate lines
diff [-u] <f1> <f2>Colorized file diff
tee [-a] <file>Write stdin to stdout and file
base64 [-d]Encode or decode base64
xargs [-n N] <cmd>Build command from stdin args
column [-t]Format text into aligned columns
fold [-w N]Wrap long lines at width
CommandDescription
help [cmd]Show all commands or detail on one
versioncFd version and platform info
clearClear terminal screen
dateCurrent date and time
uname [-a]OS name, version, architecture
whoamiCurrent username
hostnameSystem hostname
uptimeSystem uptime in days/hours/minutes
envList all environment variables
export [name=val]Export variable to environment
set / unsetSet or unset shell variables
alias / unaliasDefine and list aliases
source <file>Execute script in current session
history [n]Show command history
which <cmd>Find command in PATH
sleep <secs>Sleep for N seconds (supports decimals)
watch [-n s] <cmd>Repeat command every N seconds
test <expr>Evaluate file/string/integer test
read [-p prompt] <var>Read line from stdin into variable
CommandDescription
curl [-o file] <url>HTTP/HTTPS client (GET, POST, headers)
wget [-O file] <url>Download file with progress indicator
ping [-c n] <host>Send ICMP echo requests
netstatShow active network connections
ipconfig / ifconfigNetwork interface configuration
CommandDescription
calc <expr>Evaluate: +−×÷%, ^, sin, cos, tan, sqrt, log, floor, ceil, pi, e, ans
expr <a> <op> <b>Integer and string expressions (POSIX expr)
seq [first [inc]] lastGenerate number sequence with optional format
md5 [-s str] [file]MD5 hash (RFC 1321, implemented from scratch)
sha256 [-s str] [file]SHA-256 hash (FIPS 180-4, implemented from scratch)
CommandDescription
psList running processes
kill [-s sig] <pid>Send signal to process
jobsList background jobs
bg / fg [job]Resume job in background or foreground
exec <cmd>Replace shell with command
wait [pid]Wait for process or all jobs

A complete scripting language

Write scripts in cFd's own language. Variables, control flow, functions, and pipelines all work together.

cFd script
# ~/.cfdrc — loaded on startup
alias ll="ls -la"
alias gs="git status"
export EDITOR=nano

# Function with arguments
function mkcd
  mkdir -p $1
  cd $1
end

# If / elif / else
if test -f config.json
  echo "Config found"
elif test -d config/
  echo "Config directory found"
else
  echo "No config"
fi

# Pipeline + redirection
ls -la | grep ".c" | sort | head -10 > sources.txt

# For loop over glob
for f in *.c
  echo "  $f"
done

Built from first principles

Every layer is custom. The pipeline from keypress to result is entirely hand-written C.

Source / Input
Lexer
Tokens
Parser
AST
Dispatcher
Built-in / External
utils/

Memory, strings, hash table, linked list, paths, logging

platform/

Win32 + POSIX abstraction for raw mode, processes, I/O

ui/

ANSI colors, themes, display helpers, prompt builder

parser/

Lexer, token types, recursive descent parser, AST nodes

input/

Line editor, key bindings, history, tab completion

io/

Streams, real pipe chains, I/O redirection via dup2

scripting/

Variables, control flow, user functions, script runner

commands/

Command registry, dispatcher, 70+ built-in commands

core/

Session state, REPL loop, config loader, terminal init

Build and run

All you need is GCC and Make. No external libraries.

1

Clone the repository

git clone https://github.com/saarors/cFd.git
cd cFd
2

Build

make

Outputs cfd.exe on Windows, cfd on Linux/macOS.

3

Run

# Windows
.\cfd.exe

# Linux / macOS
./cfd
4

Optional: create a startup file

# ~/.cfdrc
alias ll="ls -la"
export EDITOR=nano
theme=dark