A simple, interactive installer for tar archives (.tar.gz, .tar.xz, .tar.bz2, etc.) that automates the installation process for Linux applications distributed as compressed archives.
- 🎯 Smart Detection: Automatically detects the extracted directory and application name
- 📦 Multiple Formats: Supports
.tar.gz,.tar.xz,.tar.bz2,.tar.zst, and uncompressed.tarfiles - 🖥️ Installation Types: Choose between user-level (
~/.local/tarsmith) or system-wide (/opt) installation - 🎨 Desktop Integration: Optionally create desktop entries for GUI applications
- 🔗 PATH Management: Automatically adds selected executables to your PATH
- 🛠️ Multiple Executables: Select which binaries to add to PATH (useful for tools like Node.js with
node,npm,npx, etc.) - 🐚 Shell Detection: Automatically configures PATH for bash, zsh, or fish shells
- ✨ Zero Configuration: Sensible defaults - just press Enter to accept
- 🚀 Non-Interactive Mode: Use command-line flags for automated installations
Watch TarSmith in action:
2025-11-13.17-20-39.mp4
tarcommand-line tool (usually pre-installed on Linux)
Pre-built binaries are available in the Releases section.
- Download the binary
- Make it executable:
chmod +x tarsmith
- Move it to a directory in your PATH (optional):
Or for user-level installation:
sudo mv tarsmith /usr/local/bin/tarsmith
mkdir -p ~/.local/bin mv tarsmith ~/.local/bin/tarsmith
If you prefer to build from source, you'll need:
- Rust (latest stable version)
git clone https://github.com/sharifmdathar/tarsmith
cd tarsmith
cargo build --releaseThe binary will be available at target/release/tarsmith.
sudo cp target/release/tarsmith /usr/local/bin/tarsmith <archive-file>-s, --system: Install system-wide to/opt(non-interactive)-u, --user: Install user-level to~/.local/tarsmith(non-interactive)-d, --no-desktop: Skip desktop entry creation-p, --no-path: Skip adding executables to PATH-h, --help: Print help information-V, --version: Print version information
tarsmith node-v24.11.1-linux-x64.tar.xzWhen prompted:
- Installation type: Press Enter (defaults to user-level)
- Desktop entry: Press Enter (skip, since Node.js is CLI-only)
- Add to PATH: Press Enter (defaults to all executables:
node,npm,npx,corepack)
After installation, restart your terminal or run source ~/.bashrc (or your shell's config file) to use the commands.
tarsmith android-studio-2025.2.1.7-linux.tar.gzWhen prompted:
- Installation type: Press Enter (user-level)
- Desktop entry: Select
2forstudioexecutable - Add to PATH: Select
2forstudioexecutable (orallfor all executables)
tarsmith myapp-1.0.0-linux.tar.gz- Desktop entry: Select
1for the main executable - Add to PATH: Enter
1 3 5to add specific executables (space-separated), orallfor all
Install without prompts using command-line flags:
# User-level installation (non-interactive)
tarsmith node-v24.11.1-linux-x64.tar.xz -u
# or: tarsmith node-v24.11.1-linux-x64.tar.xz --user
# System-wide installation (non-interactive)
sudo tarsmith android-studio.tar.gz -s
# or: sudo tarsmith android-studio.tar.gz --system
# Skip desktop entry creation
tarsmith app.tar.gz -u -d
# or: tarsmith app.tar.gz --user --no-desktop
# Skip PATH symlinks
tarsmith app.tar.gz -u -p
# or: tarsmith app.tar.gz --user --no-path
# Full non-interactive installation (using shorthand)
sudo tarsmith app.tar.gz -s -d -p
# or: sudo tarsmith app.tar.gz --system --no-desktop --no-pathNon-interactive mode defaults:
- When
--systemor--useris specified:- Desktop entry: Uses the first executable found (unless
--no-desktop) - PATH: Adds all executables to PATH (unless
--no-path)
- Desktop entry: Uses the first executable found (unless
- Extraction: Detects compression format and extracts the archive to the chosen directory
- Detection: Finds the main extracted folder by matching archive name and checking for
bin/directories - Name Inference: Extracts a clean app name (removes version numbers and platform suffixes)
- Executable Discovery: Scans the
bin/directory for executable files - Desktop Entry: Optionally creates a
.desktopfile for GUI applications - PATH Setup: Creates symlinks in
~/.local/bin(user-level) or/usr/local/bin(system-wide) - Shell Configuration: Automatically adds
~/.local/binto PATH in your shell config file
- Installation:
~/.local/tarsmith/<app-name>/ - Desktop Entry:
~/.local/share/applications/<app-name>.desktop - PATH Symlinks:
~/.local/bin/ - No sudo required
- Installation:
/opt/<app-name>/ - Desktop Entry:
/usr/share/applications/<app-name>.desktop - PATH Symlinks:
/usr/local/bin/ - Requires sudo for desktop entries
.tar.gz/.tgz- Gzip compression.tar.xz/.txz- XZ compression.tar.bz2- Bzip2 compression.tar.zst- Zstandard compression.tar- Uncompressed
TarSmith uses multiple strategies to find the correct extracted directory:
- Exact match with archive name
- Name variations (handles hyphens/underscores)
- Directories containing
bin/folder (sorted by modification time) - Newest directory as fallback
This ensures it finds the right folder even if the archive structure is unexpected.
When multiple executables are found, you can:
- Select one for desktop entry (GUI launcher)
- Select multiple for PATH (space-separated:
1 2 3or typeall)
Perfect for tools like Node.js where you want node, npm, npx, and corepack all available.
For user-level installations, TarSmith automatically:
- Checks if
~/.local/binis already in PATH - Detects your shell (bash/zsh/fish)
- Adds the appropriate export statement to your shell config
- Avoids duplicate entries
Restart your terminal or run:
source ~/.bashrc # for bash
source ~/.zshrc # for zshTarSmith prioritizes directories with bin/ folders and sorts by modification time. If it picks the wrong one:
- Ensure the archive extracts to a directory with a
bin/subdirectory - The directory name should match or be similar to the archive name
- For user-level installation: Ensure you have write permissions to
~/.local/ - For system-wide installation: Run with
sudofor desktop entries in/usr/share/applications/
- Rust: 1.70+ (for edition 2024)
- Dependencies:
dirscrate (for home directory detection)
- System: Linux (uses Unix-specific features)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Created to simplify the installation of Linux applications distributed as tar archives.