Skip to content

Releases: ChenPi11/cmd

Release list

cmd v0.1.0

Choose a tag to compare

@ChenPi11 ChenPi11 released this 05 Aug 11:44

cmd v0.1.0

Highlights

  • A faithful reimplementation of Windows cmd.exe for 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.exe interpreter, plus a classic COMMAND.COM with 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..%9 expansion, SETLOCAL/ENDLOCAL scoping, and labels.
  • Pipes & redirection with cmd.exe precedence — |, <, >, >>, 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/, plus AUTOEXEC.BAT for COMMAND.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.sh

License

GNU General Public License, version 3 or later.

Full Changelog: https://github.com/ChenPi11/cmd/commits/0.1.0