Skip to content

thereisnotime/xxToolbelt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Organize your scripts


Lint Bash GitHub License GitHub commit activity stable

🛠 Powered by Bash 🛠

xxToolbelt

✨ Description

The xxToolbelt is a simple yet powerful system for organizing scripts and tools in various programming and scripting languages entirely written in Bash. It aims to provide a cleaner and more efficient alternative to the traditional giant rc (.bashrc, .zshrc etc.) files that many of us rely on. This tool allows you to manage your custom commands and scripts effortlessly, making your development workflow more streamlined and organized. Remember when you had to write this small script that does X and then you forgot about it? With the xxToolbelt, you can easily manage and share your scripts with others so you won't lose them or forget about them anymore.

xxToolbelt uses symlinks in ~/.local/bin instead of shell aliases, which means your scripts work everywhere — interactive shells, scripts, AI tools (Claude CLI, Copilot, etc.), cron jobs, and any process that uses PATH.

Some of the key features of the xxToolbelt include:

  • Works everywhere — not just interactive shells, but AI tools, scripts, cron, etc.
  • Zero shell startup overhead — no scanning on every terminal open.
  • Support for multiple programming and scripting languages (not limited to bash).
  • Easy to extend and customize.
  • Mechanism to share snippets with others.
  • Adaptability to different shells (bash, zsh, fish, etc.).
  • Centralized requirements for all your tools/scripts (e.g., Python requirements.txt).

Check out the demos:

📝 Table of Contents

👍 Pros

  • No dependencies except Bash;
  • Works with AI tools (Claude CLI, Copilot, etc.) — not just interactive shells;
  • Zero shell startup overhead — scripts are synced once, not on every terminal;
  • Can be included in every shell (bash, zsh, fish etc.);
  • Support multiple programming and scripting languages (everything, as long as you can create a shebang for it);
  • Really easily extendible and customizable;
  • You can write and reuse scripts using wide variety of languages;
  • Works really well with interpreted languages;
  • You can use centralized requirements for all your tools/scripts - ex. Python requirements.txt to save storage;
  • Portability - its one file and your scripts folder (optional);
  • Easy version control;

👎 Cons

  • Must maintain a lot of separate files instead of one big rc (might as well be a pro);
  • Loading time of compiled languages will be slow and some functionality limited (but still better than the standard way);

🛠️ Installation

Install with git

In your terminal as the current user type:

cd /tmp; git clone git@github.com:thereisnotime/xxToolbelt.git && mkdir "$HOME/.xxtoolbelt" && mv ./xxToolbelt/* "$HOME/.xxtoolbelt" && echo -ne "# START xxToolbelt\nsource \"$HOME/.xxtoolbelt/xxtoolbelt.sh\"\n# END xxToolbelt" >> "$HOME/.$(ps -p $$ -ocomm=)rc" && source "$HOME/.$(ps -p $$ -ocomm=)rc" && xxtb --sync && echo -ne "\n\e[1;32m======= xxToolbelt was installed. Try 'xxtb'\e[m\n"

Manual install

In your ~/.bashrc or ~/.zshrc or whatever rc file you use paste (prefably in the end of the file):

# START xxToolbelt
source "$HOME/.xxtoobelt/xxtoolbelt.sh"
# END xxToolbelt

Clone (or symlink) the repository folder to your home directory (or wherever you want). Example:

git clone git@github.com:thereisnotime/xxToolbelt.git
cp -r ./xxToolbelt ~/.xxtoolbelt

Reload your terminal.

Install with wget

wget -O xxToolbelt.tar.gz https://github.com/thereisnotime/xxToolbelt/archive/main.tar.gz && tar -xf xxToolbelt.tar.gz && mkdir "$HOME/.xxtoolbelt" && mv ./xxToolbelt-main/* "$HOME/.xxtoolbelt" && echo -ne "# START xxToolbelt\nsource \"$HOME/.xxtoolbelt/xxtoolbelt.sh\"\n# END xxToolbelt" >> "$HOME/.$(ps -p $$ -ocomm=)rc" && source "$HOME/.$(ps -p $$ -ocomm=)rc" && xxtb --sync && echo -ne "\n\e[1;32m======= xxToolbelt was installed. Try 'xxtb'\e[m\n"

🗑️ Uninstall

  1. Remove the lines from your rc file.
  2. Remove symlinks: find ~/.local/bin -lname '*/.xxtoolbelt/*' -delete
  3. (optional) Remove the folder for your scripts rm -rf ~/.xxtoolbelt.

📚 Usage

The main configuration is located in xxtoobelt.sh

TUI

You can start TUI with:

xxtb

TUI

CLI

You can view CLI help with:

xxtb -h

CLI

Adding new scripts

  1. Add the new script with the proper extension to the correct language folder (or create one). It is recommended to use the templates and have the requirements (README.md in the language folder) because the shebang is important.
  2. Sync scripts:
xxtb --sync

Example:

Adding Scripts

Exporting scripts

You can export your scripts to a snippet with:

xxtb -e [scriptname]

Example:

Export a Script

NOTE: After syncing, you don't need to reload the shell or re-sync when you modify a script — just run it. Re-sync only when adding or removing scripts.

Adding new languages

  1. Create the appropriate folder in /.xxtoolbelt/scripts/
  2. Whitelist its extension in your RC file in the XXTOOLBELT_SCRIPTS_WHITELIST array.
  3. Make sure that the shebang you are using works (test with bash ./yourscript.yourlanguage).
  4. Reload your shell or open a new terminal.

Change default script editor

Edit XXTOOLBELT_SCRIPTS_EDITOR in your RC file.

Change scripts folder

Edit XXTOOLBELT_SCRIPTS_FOLDER in your RC file.

Private scripts

If you have any sensitive information in your scripts and use git, you can add ".private" before the script extension to ignore it for the git repository. Example xxmyscript.sh -> xxmyscript.private.sh. This will not affect the command, you will still call it with xxmyscript.

Belts (External Toolbelts)

Belts allow you to manage external toolbelt repositories — either git repos or local folders — and have their scripts automatically synced alongside your core xxToolbelt scripts. This is useful for:

  • Organization-specific toolbelts — share scripts across your team
  • Project-specific scripts — keep them in the project repo, register as a belt
  • Separating concerns — personal scripts vs work scripts vs hobby projects

Adding a Belt

From a git repository:

xxtb -a mytools git@github.com:myorg/my-toolbelt.git

This clones the repo to ~/.xxtoolbelt/belts/mytools/ and syncs all scripts.

From a local folder:

xxtb -a localtools /path/to/my/scripts

This registers the local path (no cloning) and syncs scripts from there.

Listing Belts

xxtb -r

Shows all registered belts with their folders:

work (local) -> /home/user/projects/work-toolbelt
  └─ work-bash
  └─ work-python
team (git) -> git@github.com:myorg/team-toolbelt.git
  └─ team-bash
  └─ team-node

Enable/Disable Belts

Temporarily disable a belt without removing it:

xxtb --disable-belt mytools
xxtb --enable-belt mytools

Disabled belts are skipped during sync and update but remain registered.

Removing a Belt

xxtb --remove-belt mytools

This removes the registration, cleans up symlinks, and (for git belts) deletes the cloned directory.

Updating Belts

When you run xxtb -u, xxToolbelt updates itself and runs git pull on all git-based belts, then re-syncs everything.

Belt Structure

A belt repository should have folders containing scripts:

my-toolbelt/
├── bash/
│   ├── xxmy-script.sh
│   └── xxanother.sh
├── python/
│   └── xxpytool.py
└── README.md

Scripts are synced with the belt name as prefix: mytools-bash/xxmy-script.sh becomes available as xxmy-script in your PATH.

Interactive Management

You can also manage belts through the TUI menu:

xxtb  # then select option 9) Manage belts

Change script scanning depth

By default it is 2 levels (so you can use nested folders for your script's libraries). You can edit XXTOOLBELT_SCANNING_DEPTH in your RC file.

Using with AI Tools

xxToolbelt v2.0+ uses symlinks in ~/.local/bin instead of shell aliases. This is critical because AI tools don't load .bashrc or .profile — they inherit the PATH environment variable from the terminal session that launched them.

How it works:

  1. You open a terminal → .bashrc sources xxtoolbelt.sh~/.local/bin is added to PATH
  2. You run an AI tool from that terminal → it inherits PATH → your scripts are available
  3. The AI tool runs xxmyscript → finds the symlink in ~/.local/bin → executes your script

Claude Code (CLI)

Add to ~/.claude/settings.json:

{
  "env": {
    "PATH": "${HOME}/.local/bin:${PATH}"
  },
  "permissions": {
    "allow": [
      "Bash(xx*:*)"
    ]
  }
}

Claude Code Settings Docs

OpenAI Codex CLI

Add to ~/.codex/config.toml:

[shell_environment_policy]
set = { PATH = "/home/youruser/.local/bin:/usr/bin:/bin" }

Codex Config Reference

Aider

Add to ~/.aider.conf.yml:

set-env:
  - PATH=/home/youruser/.local/bin:$PATH

Aider Config Docs

Cursor / VS Code

Add to settings.json:

{
  "terminal.integrated.env.linux": {
    "PATH": "${env:HOME}/.local/bin:${env:PATH}"
  },
  "terminal.integrated.env.osx": {
    "PATH": "${env:HOME}/.local/bin:${env:PATH}"
  }
}

Cron / Systemd

# crontab
PATH=/home/youruser/.local/bin:/usr/bin:/bin
* * * * * xxmyscript

# systemd unit
[Service]
Environment="PATH=/home/youruser/.local/bin:/usr/bin:/bin"
ExecStart=/home/youruser/.local/bin/xxmyscript

⚙️ Compatability

Should work fine with all POSIX compliant shells (and some of the not fully compliant ones). Tested with:

  • Debian/Ubuntu/Arch/Manjaro
  • bash/zsh

🚀 Roadmap

  • Create oneliner for the installation of xxToolbelt.
  • Add Julia.
  • Add Kotlin.
  • Add Haskell.
  • Add Swift.
  • Add Nim.
  • Add Fortran.
  • Add COBOL.
  • Add Clojure.
  • Add Scala.
  • Add Dart.
  • Add Delphi.
  • Create dependency examples where they are missing.
  • Test on macOS.
  • Test on BSD.
  • Add support for PowerShell Core.
  • Implement architecture that allows easy installation of "script modules" from git repositories by URL (Belts).
  • Add examples for .env secrets management for private scripts.
  • Create a management menu for managing installed scripts.
  • Create a mechanism for easily exchanging scripts with peers.

🔍 Examples in Various Languages

Here you can find examples of scripts in various languages that you can use with the xxToolbelt:

Python

Check the Python README for more information.

Ruby

Check the Ruby README for more information.

Rust

Check the Rust README for more information.

R

Check the R README for more information.

PowerShell Core

Check the PowerShell README for more information.

Perl

Check the Perl README for more information.

Nodejs

Check the Nodejs README for more information.

Lua

Check the Lua README for more information.

Groovy

Check the Groovy README for more information.

Java

Check the Java README for more information.

Golang

Check the Golang README for more information.

Erlang

Check the Erlang README for more information.

Elixir

Check the Elixir README for more information.

Dlang

Check the Dlang README for more information.

CSharp

Check the CSharp README for more information.

Cpp

Check the Cpp README for more information.

Bash

Check the Bash README for more information.

TypeScript

Check the TypeScript README for more information.

Janet

Check the Janet README for more information.

Zig

Check the Zig README for more information.

V

Check the V README for more information.

🤝 Contributing

We welcome contributions from everyone! See CONTRIBUTING.md for guidelines.

Quick ways to contribute:

  • Add scripts in your favorite language
  • Test on different shells, terminals, or operating systems
  • Improve documentation
  • Report bugs or suggest features
  • Create and share your own belts

📜 License

Check the LICENSE file for more information.

🙏 Acknowledgements

About

Manage your scripts and snippets, share them and run programming languages as scripts

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors