- Crystal 75.6%
- Roff 13%
- Makefile 5%
- Nix 3.8%
- HTML 2.6%
Exfetch
a shell-extensible fetching utility aiming to be a spiritual successor to crfetch, written in crystal
https://ci.codeberg.org/api/badges/14871/status.svg https://img.shields.io/badge/license-ISC-blue.svg https://img.shields.io/badge/PRs-welcome-brightgreen.svg https://img.shields.io/badge/docs-contributing-purple.svg
Screenshot of Exfetch with default settingsFeatures
- Predictable, consistent output across systems
- Extensible via shell scripting and flags
- No auto-detection "magic" - you control the output
Supported Operating Systems
- Linux
- FreeBSD
- GhostBSD
- OpenBSD
- NetBSD
Motivation
Why Replicate Cr(y)fetch?
-
I wanted crfetch's simplicity with more customization:
- Custom label ordering
- Custom ASCII selection from file descriptors
- Even more shell-script composability
Why the Name "Exfetch"?
- "Ex" stands for extensible - modify behavior through flags/shell
- (The accidental name stuck! Retroactively became "ex"-tended crfetch.)
Philosophy
- Predictability: Same defaults everywhere. No assumptions about your OS/distro.
- Composability: Pipe, script, or alias to create your ideal fetch.
- No Auto-Detection: Unlike neofetch, ASCII art never changes unless you specify it.
Example: Shell Composability
Create dynamic configurations with shell features:
# Lowercase labels + purple text + cowsay fortune ASCII
alias exfetch="exfetch -l -c 5 -a <(cowsay $(fortune -o))"
# Random ASCII art from a directory
alias exfetch-random="exfetch -a \"$(ls ~/ascii_arts/* | shuf -n 1)\""
Note: <(command) requires Bash/Zsh. For other shells, use temporary files.
Installation
Dependencies
- Crystal >= 1.17.1 https://crystal-lang.org/install/
- Shards >= 0.19.1 (usually included with Crystal)
- A POSIX
make
Build from Source
$ git clone --recurse-submodules https://codeberg.org/izder456/exfetch
$ cd exfetch
$ make
OPTIONAL: you can set environment variables to change how it builds:
$ make STATIC=on # build with static compilation using crystal's --static (default is "off")
$ make MULTITHREADED=on # build with multithreading using crystal's -Dpreview_mt (default is "off")
$ make HARDENING=on # build with RELRO hardening (default is "off")
$ make STATIC=on MULTITHREADED=on # build with both multithreading *and* static compilation
Run without installing
$ make run
Install Binary
# make install
Usage
Usage: exfetch [options]
-l, --lowercase Use lowercase labels
-n, --nerd-icons Use Nerd Font icons
-r, --right-justify Right justify labels
-s SEP, --separator=SEP Separator between labels and values
-o ORDER, --order=ORDER Specify label order (comma-separated)
-O, --list-labels List available labels for ordering
-c COLOR, --color=COLOR Text color name or code (0-15)
-C, --list-colors List available colors
-a ASCII, --ascii=ASCII ASCII art name or file path
-A, --list-ascii List built-in ASCII art
-P NAME, --preview-ascii=NAME Preview ASCII art
-p PADDING, --padding=PADDING Padding around ASCII art (left and right) (only last digit used)
-h, --help Show help
nix flake support
The flake.nix file in the project root provides support for the nix package manager.
Some things that can be done with this, assuming nix is installed and current directory is the root of the checked-out repo following the "Build from Source" section of this file:
nix build: build a nix packaging from the repo checkout
$ nix build
$ readlink ./result
$ tree ./result/
$ ./result/bin/exfetch
nix shell: enter a bash shell with the nix packaged built and "installed"(in $PATH)
$ nix shell
$$ exfetch
nix develop: enter a bash shell with the build environment available(build dependencies, nix packaging phases):
$ nix develop
$$ echo $unpackPhase $buildPhase $installPhase $checkPhase
$$ crystal ...
$$ shards ...
With only nix in hand, also possible to do any of these "remotely" without ever cloning the repo, by specifying git+https://codeberg.org/Izder456/exfetch?ref=main as the argument to those commands:
# fetch, build and execute exfetch using the nix interface
$ nix run 'git+https://codeberg.org/Izder456/exfetch?ref=main'
# enter a shell with `exfetch` executable available, built from source from current state of repo main branch
$ nix shell 'git+https://codeberg.org/Izder456/exfetch?ref=main'
# same but for some other git ref
$ nix shell 'git+https://codeberg.org/Izder456/exfetch?ref=some-branch'
(削除) Note that (not yet), but the package is maintained by someone else and built from semantic version bumps, while this flake provides a nix build for each commit (i.e. is not semantically versioned).exfetch is also available in nixpkgs (削除ここまで)
Contributing
- Report issues: https://codeberg.org/izder456/exfetch/issues
- Submit ASCII art: https://codeberg.org/izder456/exfetch/pulls
- Feature requests welcome!
Got an idea?
License
ISC Licensed. See full text below:
ISC License
Copyright 2025 izzy Meyer <izder456@disroot.org>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.