nosh is a modern, security-focused shell designed with both usability and security in mind. It provides enhanced command-line functionality, network security features, and secure credential management.
Builds are available for and automatically tested on:
- Linux (x86_64)
- macOS (x86_64 built on macOS 13)
- macOS (arm64 built on the latest macOS)
- Windows (x86_64)
Artifacts (executables) are uploaded for each successful build. You can find them in the "Actions" tab of the GitHub repository.
- Command history with persistent storage
- Command aliases with persistent configuration
- Environment variable management
- Wildcard expansion for filenames
- Background process execution
- Command substitution
- XNU Hardened Mode for sensitive operations
- Secure file wiping with zero-fill overwriting
- Encrypted password manager (Citrus)
- Network security monitoring and analysis
- Command sanitization to prevent injection attacks
- Support for
.noshrcconfiguration files - Environment variable persistence
- Path management
- GCC or compatible C compiler (Clang, MSVC with MinGW on Windows).
- GNU Readline library (required for command line editing and history).
- mbed TLS (for the password manager encryption).
- Argon2 (for key derivation).
- pkg-config (for finding libraries, particularly on macOS).
- CMake (for building the project).
On Debian/Ubuntu:
sudo apt-get update
sudo apt-get install -y build-essential libreadline-dev libmbedtls-dev libargon2-dev pkg-config cmakeOn macOS (using Homebrew):
brew install readline openssl mbedtls argon2 pkg-config cmakeOn Windows (using MSYS2):
-
Install MSYS2 from https://www.msys2.org/.
-
Open the MSYS2 MinGW 64-bit shell.
-
Run the following commands:
pacman -Syu # Update package database and base packages pacman -Su # Update system packages pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-mbedtls mingw-w64-x86_64-argon2 mingw-w64-x86_64-pkgconf mingw-w64-x86_64-readline mingw-w64-x86_64-windows-default-manifest mingw-w64-x86_64-ncurses mingw-w64-x86_64-pdcurses git
-
Clone the repository:
git clone https://github.com/Dynamicaaa/nosh.git
-
Build from source:
cd nosh mkdir build cd build
On Linux, macOS, and Windows (MSYS2 MinGW):
cmake .. -DCMAKE_BUILD_TYPE=Release make
On macOS, you might need to provide additional hints to CMake:
cmake .. -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="$(brew --prefix)" \ -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) \ -DMBEDTLS_ROOT_DIR=$(brew --prefix mbedtls) \ -DARGON2_ROOT_DIR=$(brew --prefix argon2) \ -DCMAKE_FIND_FRAMEWORK=LAST \ -DCMAKE_INSTALL_NAME_DIR=@executable_path/../lib \ -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON \ -DCMAKE_LIBRARY_PATH="$(brew --prefix mbedtls)/lib;$(brew --prefix argon2)/lib" \ -DCMAKE_INCLUDE_PATH="$(brew --prefix mbedtls)/include;$(brew --prefix argon2)/include" \ -DCMAKE_C_FLAGS="-I$(brew --prefix mbedtls)/include -I$(brew --prefix argon2)/include"If building for a specific architecture on macOS (e.g., arm64), also add:
-DCMAKE_OSX_ARCHITECTURES=arm64(replacearm64withx86_64if needed).On Windows (MSYS2 MinGW), a specific configuration is required:
cmake .. -G "MinGW Makefiles" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=/mingw64/bin/gcc.exe \ -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make.exe \ -DCMAKE_C_FLAGS="-D_GNU_SOURCE -D_WIN32 -DWIN32_LEAN_AND_MEAN" \ -DCMAKE_PREFIX_PATH=/mingw64 \ -DCMAKE_LIBRARY_PATH=/mingw64/lib \ -DCMAKE_INCLUDE_PATH="/mingw64/include;/mingw64/include/readline" \ -DREADLINE_ROOT=/mingw64 \ -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++ -Wl,-Bstatic -lpdcurses -lreadline -lmbedtls -lmbedcrypto -lmbedx509 -largon2 -Wl,-Bdynamic -lws2_32 -liphlpapi -lbcrypt"
Then build:
make
-
Install (optional): This step is optional but places the
noshexecutable in a standard system location.On Linux/macOS:
sudo make install # Installs to /usr/local/bin by defaultOn Windows, manual copying of the
nosh.exeto a directory in yourPATHis recommended. There isn't a standard "install" process withmingw32-make.
# Start nosh
./nosh
# Start nosh in XNU (hardened) mode
./nosh --xnucd [dir]- Change directorypwd- Print working directoryclear- Clear terminal screen
ls,cp,mv, etc. - Standard file operationswipe <file>- Securely erase and delete sensitive files
history- View command historyclear-history- Clear command history
alias [name] [cmd]- Create or list aliasesunalias [name]- Remove an alias
export VAR=VALUE- Set environment variableexport VAR- Display variable valueenv- List all environment variablesecho [args...]- Displays arguments, and it now supports wildcard and environment variable expansion
xnu- Toggle XNU hardened security modecitrus init- Initialize password managercitrus add <service> <username>- Add a passwordcitrus get <service> <username>- Retrieve a passwordcitrus list- List stored passwords
network ports- List open portsnetwork connections- Show active connectionsnetwork suspicious- Check for suspicious activitynetwork interfaces- Show network interface detailsnetwork firewall- Check firewall statusnetwork scan- Run a basic security scan
The shell supports standard glob patterns:
*- Matches any sequence of characters?- Matches any single character[...]- Matches any character in brackets~- Expands to HOME directory
Examples:
ls *.txt
cat ~/README*
echo /etc/*.confXNU mode provides enhanced security for sensitive operations:
- Disables command history
- Disables aliases
- Sanitizes commands to prevent injection
- Clears terminal on exit
Enable with the xnu command or start with ./nosh --xnu.
The integrated Citrus password manager securely stores credentials using AES-256-GCM encryption with Argon2id key derivation:
# Initialize (first time only)
citrus init
# Add a password
citrus add github myusername
# Retrieve a password
citrus get github myusername
# List all stored services
citrus listYou can customize nosh by creating a .noshrc file in your home directory:
# Example .noshrc
export PATH=$PATH:/usr/local/bin
export EDITOR=vim
alias ll="ls -la"
alias gs="git status"- Use XNU mode when handling sensitive information.
- Use the
wipecommand instead ofrmfor sensitive files. - Regularly check your network security with
network scan. - Store important credentials in the password manager.
- Run
clear-historyafter sensitive operations.
This software is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. Before submitting, please make sure your code builds cleanly on all supported platforms (Linux, macOS, and Windows) and passes the automated tests.
