A curated collection of production shell scripts I use daily for AI API interaction, system administration, and hardware firmware management. Each script is self-contained, tested, and documented — grab them, modify them, use them however you need.
1. Enhanced Chat Script for Artemis API
File: chat-script (344 lines)
A complete CLI client for interacting with any OpenAI-compatible chat completions API. I built this to talk to my self-hosted Artemis inference platform running vLLM, but it works with any endpoint that speaks the OpenAI chat format.
Features
- Full argument parsing — model selection, system prompts, temperature, max tokens, output format
- Conversation continuity — save and load conversation state to/from JSON files for multi-turn chats
- Streaming support —
--streamflag for real-time token output - Multiple output formats — pretty-printed JSON, raw response, or content-only for piping into other tools
- File input — read prompts from files with
-f - Config file support — sources
~/.chat-script.conffor persistent API URL/key defaults - Color output — ANSI color-coded errors, warnings, and verbose logging
Usage Examples
# Simple query with default model
./chat-script -u "Explain quantum computing in 3 sentences"
# Custom model with system prompt
./chat-script -m "gpt-4" -s "You are a Python expert" -u "How do I use asyncio?"
# Continue a saved conversation
./chat-script -c conversation.json -u "Tell me more about that"
# Pipe-friendly: just the content, no formatting
./chat-script -u "What is the capital of France?" -o content-only
Why This Exists
curl works fine for one-off API calls, but once you need conversation history, streaming, config management, and pretty output, you end up writing this script. I got tired of re-typing long curl commands and built this to make LLM access feel native in the terminal.
2. AMD GPU Firmware Update Script
File: update_amd_firmware (39 lines)
Updates AMD RDNA3 (RX 7900 XTX) GPU firmware on Debian/Ubuntu systems by pulling the latest firmware blobs directly from the kernel.org linux-firmware repository.
What It Does
- Installs base firmware packages via apt
- Clones
git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git - Copies all RDNA3 (Navi31 / GC 11.0.0) firmware files to
/lib/firmware/amdgpu/:- Graphics Core (GC) 11.0.0
- Platform Security Processor (PSP) 13.0.0
- System Management Unit (SMU) 13.0.0
- System DMA (SDMA) 6.0.0
- Video Core Next (VCN) 4.0.0
- Display Core Next (DCN) 3.2.0
- Rebuilds initramfs
- Checks for conflicting module blacklisting
When to Use This
Distro-packaged firmware often lags months behind the kernel.org releases. If you're on a bleeding-edge kernel and your RX 7900 XTX is showing artifacts, hangs, or fails to initialize correctly, the first fix to try is updating the firmware directly from source. This script automates that entire process in one command.
3. Open WebUI Build & Deploy Script
File: open-webui (32 lines)
Automates the build and deployment of Open WebUI and LiteLLM proxy containers. Used in my self-hosted AI stack to keep the web interface and API proxy in sync with upstream changes.
What It Does
- Pulls latest LiteLLM source and rebuilds Docker image
- Pulls latest OpenAPI-Server tools and rebuilds
- Brings up OpenAPI-Server containers
- Brings up Open WebUI container with updated images
Simple but essential — this runs as part of my maintenance routine whenever upstream releases drop. Keeps the entire self-hosted AI stack current with a single command.
Installation
All scripts are self-contained bash files. Clone or download them directly:
# Clone the entire collection
git clone https://github.com/SolidRusT/suparious.github.io.git
cd suparious.github.io/shell-scripts
# Make executable
chmod +x chat-script open-webui update_amd_firmware
# For the chat script, create a config file
cat > ~/.chat-script.conf << 'EOF'
ARTEMIS_API_URL="https://your-api-endpoint/v1/chat/completions"
ARTEMIS_API_KEY="your-api-key"
EOF
Why Shell Scripts?
These could be Python, Go, or Rust. But shell scripts have zero dependencies beyond bash, curl, and jq — tools that ship with (or are trivially installed on) every Linux distribution. They're portable, inspectable, and work the same on my desktop, my servers, and inside Docker containers. No virtualenv, no pip install, no cargo build. Just chmod +x and run.
The chat script in particular represents something I believe in strongly: the Unix philosophy of composable tools. It reads from files, writes to stdout, respects config files, and can be piped into jq, grep, or any other tool in the chain. An LLM becomes just another command-line utility.
Use These Scripts
All scripts in this collection are MIT licensed. Grab them from the repository, modify them for your environment, and let me know if you build something cool on top of them.
View on GitHub
Comments
Comments are powered by Disqus. Enable JavaScript to view comments.