Skip to content
El Houssein Hajjani edited this page Sep 12, 2026 · 3 revisions

AllTool-Linux — Wiki

What it is

AllTool-Linux (currently at version 2.0.0) is a modular, multi-utility command-line toolkit built for Linux. Instead of installing a dozen separate little programs for everyday system chores, you install one tool and get 20+ utilities behind a single entry-point command: alltool <command> [args]. It covers file and disk management, audio/video playback, network diagnostics, power management, polyglot script running, password and hash security helpers, web search, weather, a Pomodoro productivity timer, self-updating, and self-uninstallation. Everything is wrapped in a friendly, emoji-heavy CLI style (🔍 ✅ ❌ ⚠️ 🚀) with interactive confirmation prompts before destructive operations like formatting a disk or uninstalling the tool.

How you install it

Installation is a one-liner piped from GitHub:

curl -fsSL https://raw.githubusercontent.com/Hajjani/AllTool-Linux/refs/heads/Stable/installer.sh | bash

The installer.sh script (about 350 lines of Bash) does the following, in order:

  1. Detects your distribution by reading /etc/os-release and supports four families: Debian/Ubuntu (apt), Arch (pacman), Fedora (dnf), and openSUSE (zypper). Unknown distros gracefully skip system-package installation instead of failing.
  2. Installs required core packages automatically — the build toolchain and Python stack the tool cannot run without (make, git, gcc, pkg-config, python3, python3-pip, python3-requests, python3-bs4/beautifulsoup4, python3-packaging).
  3. Asks you about every optional package, one by one, each with a short explanation of which command needs it. There are currently 10 optionals across four groups: media (mpv, ffmpeg), network/system (speedtest-cli, inxi, power-profiles-daemon), and language runtimes (nodejs, ruby, php, default-jre/jre-openjdk/java-latest-openjdk depending on distro, and g++/gcc-c++). Nothing optional is installed without your consent. For automation it also accepts flags: -y/--yes to take everything, --no-optional/--minimal to skip everything, -h/--help for usage — and if stdin isn't a terminal (CI pipelines, pipes) it auto-skips rather than hanging on input.
  4. Detects your power-management backend (powerprofilesctl, tlp, auto-cpufreq, cpupower, or raw sysfs governors), records the backend plus available profiles into .confs.json, and offers to install power-profiles-daemon if nothing compatible is found.
  5. Warns about any still-missing optional commands, builds the native C components via make install, copies the script, entry point, and Tools/ package into ~/bin, adds ~/bin to your PATH in .bashrc, cleans up the cloned repo, and finally deletes itself.

Architecture: Python modules + native C core

The project is mid-migration from a 1000+ line monolithic AllTools.py (kept as a legacy fallback) to a clean modular package under Tools/, imported by a tiny alltool entry script. The design centers on three Python foundation pieces plus a compiled C layer:

  • Tools/base.py — the framework everything plugs into: a ToolBase class with shared helpers (run_cmd, get_output, has_command, interactive confirm, sudo_run with optional cached credentials) and a CommandRegistry with a @command(name, aliases, help_text) decorator. Each utility module simply decorates handler functions, and Tools/__init__.py imports all modules and exposes main(), which dispatches sys.argv[1] through the registry, handles KeyboardInterrupt (exit 130) cleanly, and prints "Unknown command" otherwise.
  • Tools/bindings.py — a ctypes bridge that loads the compiled shared libraries (liballtool_sudo, liballtool_compiler, plus shared-memory support) and exposes them as Python classes (AllToolSudo, compiler access), along with config/help JSON loading from ~/.config/alltool/.
  • Tools/c_src/ — the native C core, built by its own Makefile (and a meson.build alternative) with -Wall -Wextra:
    • alltool_sudo.c — credential prompting (with terminal echo disabled), XOR-based password caching with random salts from /dev/urandom, and alltool_sudo_run_with_creds, which runs commands as another user by exec-ing sudo -S directly with an argv array — no shell involved. The command line is split by a quote-aware tokenizer that performs zero expansions, usernames from the config file are validated against a strict allowlist, the password travels to sudo over a stdin pipe, and sudo itself is resolved only via fixed paths (/usr/bin/sudo, /bin/sudo). This was a deliberate, tested fix for a former shell-injection vulnerability where password/username/command were interpolated into an sh -c string.
    • alltool_compiler.c / alltool_runner.c — compile-and-run pipeline powering the run command, with shared-memory (alltool_shm) process-chain coordination, plus sudo-cache / sudo-clear credential management commands.

The command suite, module by module

  • file_ops.pycreate (makes a file plus any missing parent folders) and format (formats a block device as NTFS/EXT4/VFAT with an explicit typed-yes confirmation guard).
  • media.pysound (plays audio files or .txt playlists via mpv, validating supported extensions) and video (plays video via ffplay with auto-exit).
  • network.pynetspeed (measures bandwidth via speedtest-cli), sr (AI-assisted web search using requests + beautifulsoup4), and wea (weather lookup for a city).
  • system.pyrefresh (repairs setup/permissions/PATH), sf (lists directory contents), sif (rich system report via inxi), up (checks for distro updates using the native package manager), cl (clears the terminal), and requirement/req (audits every external dependency, prints ✅/❌ status per tool with the exact install command for your distro).
  • power.pypower with a full subcommand set: pws/pwn/pwp (power-saver/balanced/performance profiles), pwst (status), and system actions pwo (shutdown), pwr (reboot), pwl (logout), pwsu (suspend), pwh (hibernate), pwlo (lock screen).
  • script_runner.pyrun, the polyglot star of the suite: detects a script's language and executes Python, Bash, JavaScript, Perl, Ruby, PHP, Java, and C/C++ (compiled on the fly with caching and a -t temp mode), reporting compile and execution times.
  • security.pypsg (cryptographically-flavored password generator with toggles like nose/nos/not/nol to exclude character classes) and hs (file hashing across md5, sha1, sha256, sha512, blake2b, blake2s).
  • pomodoro.pypr, a persistent Pomodoro timer with configurable session counts, background operation, stop/st controls, and activity logging to ~/.alltool_pomodoro.log.
  • updater.pyupa, which self-updates AllTool to the latest stable (st) or preview (pv) release.
  • uninstaller.pyun, which removes the installed files, config directory, and PATH entries after confirmation.
  • help.pyhelp, serving command documentation in four languages (English, French, Arabic, German) sourced from .help.json, so the entire tool is usable by non-English speakers.

Configuration, state, and conventions

Runtime state lives under ~/.config/alltool/: .confs.json (version, directory layout, power-backend config, cached sudo credentials, compiler flags, installed-file manifest, per-tool settings) and .help.json (the multilingual help database). Long-lived build artifacts (the .so libraries and alltool_runner binary) live in ~/.config/alltool/bin, while the user-facing alltool launcher sits in ~/bin. House style throughout is emoji-rich status output, defensive which-based dependency checks in every command (each failure tells you exactly how to install what's missing), and graceful degradation — missing optionals disable only their own commands, never the whole tool.

Development, testing, and CI

There is no formal unit-test suite yet (the project notes recommend pytest with mocked external binaries like mpv and powerprofilesctl when one is added), but there is a test_integration.sh script exercising help, file creation, listing, C compilation via run, password generation, hashing, and power status end-to-end, plus a GitHub Actions workflow (.github/workflows/testdepl.yml) that installs system dependencies on Ubuntu, lints with flake8, attempts pytest, and gates deploys from the Stable branch. The Makefile at the repo root ties the Python and C worlds together for install/uninstall. Known quirks documented for contributors include a singular/plural AllTools.py path inconsistency, hardcoded paths (/tmp/pomodoro_timer.py, ~/bin/), password-less sudo assumptions, and the absence of a __version__ string the updater's regex expects — all honest markers of a young, fast-moving hobby project transitioning from a single script into a real modular system with native-code acceleration.