SFC is a high-performance, lightweight suite of core system utilities and an interactive command-line shell written from scratch in Rust. It is designed to minimize process-spawning latency and optimize disk footprint.
SFC is a complete replacement for GNU Coreutils. It provides the same command-line interface and behavior, but is written in Rust for better performance and memory safety.
A custom interactive command-line shell built on top of rustyline, optimized for development and system administration:
-
TrueColor Predictions: Unobtrusive autocomplete suggestions rendered in an elegant, dim dark-gray color (
#5a5a5avia ANSI TrueColor) that do not interfere with typing. -
Robust Multiline Parsing: Full support for multiline copy-pasting (Paste) that correctly handles lines starting with
#comments without discarding or skipping subsequent statements. -
Process Group Isolation & SIGHUP Management: Background tasks (
&) are spawned in their own separate process groups (process_group(0)). Foreground tasks receive standard keyboard interrupts (SIGINT), while background tasks are safely tracked in a selectiveSIGHUPregistry. On shell exit, untracked/disowned tasks survive as clean system daemons, whereas normal background tasks receive proper termination signals. -
Context-Aware Tab Completion:
- Detects command modifiers (such as
sudo,doas,stdbuf,nohup) and automatically suggests system executables instead of local files, even when typed at secondary argument positions. - Smart relative and absolute path completion, dynamically appending trailing slashes
/for directories to allow continuous tab navigation.
- Detects command modifiers (such as
-
don't worry, you can use it even without sfshell
fsearch(Micro-Ripgrep): Recursively searches for substrings in text files, automatically ignoring heavy compilation and version control directories (.git,target,node_modules) to maintain extreme speeds, with matched patterns highlighted in pink.fsize(Interactivedureplacement): Scans directories recursively, automatically sorting all contents by size in descending order and displaying them in a clean, color-coded, human-readable format.hex(Colorized Hexdump): A specialized viewer for binary dumps. It dims out zero bytes (00) to increase visibility, prints readable ASCII sequences in green, and highlights typical binary markers (like55 AA) in pink.clip(Unified Clipboard Bridge): Automatically directs data towl-copy/wl-pastein Wayland orxclipin X11. When running on remote servers (SSH, tmux), it utilizes the OSC 52 protocol to encode clipboard data in Base64 and pipe it back to your local machine.port(lsof -i replacement): Instantly resolves which PID is listening on a specific TCP/UDP port. It parses/proc/net/tables and matches socket inodes against/proc/*/fd/descriptors in microseconds, without external dependencies.fasterfetch: A systems-query fetch tool supporting Kitty terminal graphics protocol to render Base64 images, and performing hardware queries directly via the PCI bus (/sys/bus/pci/devices/) to identify discrete GPUs without relying on DRM.cbench: simple command benching tool just for comparing GNUcoreutils with mine
The build profile is optimized for minimal binary size and optimal execution speed (LTO, opt-level "z", stripped debug symbols, and panic abort configuration):
cargo build --releaseAfter a successful compilation, all binaries will be placed in the target/release/ directory.
SFC completely replaces the system coreutils. The installation scripts remove the original GNU coreutils package and install SFC binaries to /usr/bin.
Warning: This is a destructive operation. Make sure SFC passes all compatibility tests on your system before proceeding.
SFC integrates into NixOS using package priority overrides (lib.hiPrio), allowing your custom utilities to safely shadow standard binaries in the global environment path:
scripts/install_nixos.shOr manually add to your configuration.nix:
let
sfc = pkgs.callPackage /path/to/sfc/package.nix {};
in
{
environment.systemPackages = with pkgs; [
(lib.hiPrio sfc)
];
}Then rebuild:
sudo nixos-rebuild switchscripts/install_arch.shThis script:
- Installs build dependencies (
base-devel,rust,cargo) - Builds SFC from source
- Removes the system
coreutilspackage - Installs SFC binaries to
/usr/bin
scripts/install_fedora.shThis script:
- Installs build dependencies (
gcc,cargo,rust) - Builds SFC from source
- Removes the system
coreutilspackage - Installs SFC binaries to
/usr/bin
scripts/build.shThis builds SFC and creates necessary symlinks in target/release/.
To restore the original GNU coreutils:
sudo pacman -S coreutilssudo dnf install coreutilsRemove sfc from configuration.nix and run sudo nixos-rebuild switch.