Repository navigation
Releases: ChenPi11/cmd
Releases · ChenPi11/cmd
Release list
cmd v0.1.0
cmd v0.1.0
Highlights
- A faithful reimplementation of Windows
cmd.exefor Unix-like systems, written in C89 with no dependencies beyond a POSIX.1 libc. - Runs everywhere — verified on GNU/Linux, System V, Haiku, OpenBSD, NetBSD, FreeBSD, GNU/Hurd, macOS, PureDarwin, and MSYS2.
- Two personalities — the standard
cmd.exeinterpreter, plus a classicCOMMAND.COMwith MS-DOS AutoExec behaviour.
Features
- 40+ builtin commands — ASSOC, BREAK, CALL, CD, CLS, COLOR, COPY, DATE, DEL, DIR, DOSKEY, ECHO, ENDLOCAL, EXIT, FOR, FTYPE, GOTO, IF, MD, MKLINK, MOVE, PATH, PAUSE, POPD, PROMPT, PUSHD, RD, REM, REN, SET, SETLOCAL, SHIFT, START, TIME, TITLE, TYPE, VER, VERIFY, VOL.
- Full batch scripting —
CALL,GOTO,IF,FOR,SHIFT,%0..%9expansion,SETLOCAL/ENDLOCALscoping, and labels. - Pipes & redirection with
cmd.exeprecedence —|,<,>,>>,2>. - Windows-style environment semantics — case-insensitive
%VAR%,%CD%,%DATE%,%TIME%,%ERRORLEVEL%,%CMDCMDLINE%, and delayed expansion (/v:on). - Bundled line editing — linenoise with Emacs key bindings, persistent history (
~/.cmd_history), and TAB file/directory completion. - AutoRun support — init scripts from
$PREFIX/etc/cmd/AutoRun/, plusAUTOEXEC.BATforCOMMAND.COM. - Localised UI in four languages — English, Simplified Chinese, Microsoft-style Chinese, and Classical Chinese.
- No external dependencies — pure C89 + POSIX.1 libc, with a portability layer for System V (
lsysport.c).
Build
# GNU/Linux
make
make install PREFIX=/usr/local
# Generic Unix / System V
sh tbuild.shLicense
GNU General Public License, version 3 or later.
Full Changelog: https://github.com/ChenPi11/cmd/commits/0.1.0