Posted on
Artificial Intelligence

Artificial Intelligence Bash Portfolio Projects

Author
  • User
    linuxbash
    Posts by this author
    Posts by this author

Artificial Intelligence Bash Portfolio Projects: Ship Real-World AI From Your Terminal

AI portfolios often stop at notebooks and demos. That’s a missed opportunity. Bash lets you turn models into reliable, automatable tools that run anywhere Linux does. If you can wire AI into cron jobs, logs, media pipelines, and CLI UX, you’ll stand out to hiring managers who care about reproducibility and systems thinking.

This article shows you how to build practical, resume-ready AI utilities with Bash. You’ll get why Bash is a strong fit for AI orchestration, how to install the essentials, and 3–5 actionable projects you can clone, adapt, and publish today.

Why Bash + AI is a power combo

  • Composability: Bash glues models to real data sources (files, logs, network, audio, images) in minutes.

  • Portability: Scripts survive across machines, clouds, and containers with minimal dependencies.

  • Automation-native: Cron, systemd timers, and pipelines make AI useful on a schedule, not just as a demo.

  • Observability: stdout/stderr, exit codes, and logs make behavior transparent and debuggable.

Prerequisites: install the essentials

You’ll need curl, jq, Python, and ffmpeg. Commands for apt, dnf, and zypper are included below.

  • Debian/Ubuntu (apt):
sudo apt update
sudo apt install -y curl jq ffmpeg python3 python3-venv python3-pip
  • Fedora/RHEL/CentOS (dnf):
sudo dnf install -y curl jq python3 python3-pip python3-virtualenv
# ffmpeg may require RPM Fusion on some Fedora/RHEL variants:
sudo dnf install -y ffmpeg || {
  sudo dnf install -y "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
  sudo dnf install -y ffmpeg
}
  • openSUSE (zypper):
sudo zypper refresh
sudo zypper install -y curl jq ffmpeg python3 python3-pip python3-virtualenv

Local LLM runtime (recommended): Ollama (runs models locally and exposes a simple HTTP API).

curl -fsSL https://ollama.com/install.sh | sh
# Start service (systemd):
sudo systemctl enable --now ollama
# Pull models you'll use:
ollama pull llama3
ollama pull llava

Note: If you prefer a remote provider with an OpenAI-compatible API, you can adapt the scripts by swapping the endpoint and adding your API key.


Project 1: ai – a one-file CLI for local LLMs

Build a universal “ai” command to query a local model (via Ollama) from anywhere in your shell workflow.

  • Skills demonstrated: HTTP APIs from Bash, JSON handling with jq, CLI UX.

  • Dependencies: curl, jq, Ollama.

Create ai and make it executable:

#!/usr/bin/env bash
set -euo pipefail

MODEL="${OLLAMA_MODEL:-llama3}"
HOST="${OLLAMA_HOST:-http://localhost:11434}"

PROMPT="${*:-}"
if [ -z "$PROMPT" ]; then
  # Allow piping: echo "Explain..." | ai
  PROMPT="$(cat)"
fi

payload="$(jq -n --arg model "$MODEL" --arg prompt "$PROMPT" '{model:$model, prompt:$prompt, stream:false}')"
curl -s "$HOST/api/generate" -d "$payload" | jq -r '.response'

Usage:

chmod +x ai
./ai "Give me three ways to harden SSH on Linux."
echo "Summarize this README:" && cat README.md | ./ai

Optional (use an OpenAI-compatible endpoint instead of Ollama):

  • Export these before running:
export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.openai.com/v1"
  • Then adjust the curl call to POST to $OPENAI_BASE_URL/chat/completions with your payload.

What to add to your portfolio:

  • A README with examples, env vars (OLLAMA_MODEL, OLLAMA_HOST), and a short design note on JSON escaping via jq.

Project 2: log-summarizer – hourly system log insights

Turn a wall of logs into signal. This script pulls the last hour of system logs and summarizes key events.

  • Skills: journald/log parsing, prompt engineering, scheduling via cron, artifacts.

  • Dependencies: journalctl or syslog, curl, jq, Ollama.

Create log-summarizer.sh:

#!/usr/bin/env bash
set -euo pipefail

MODEL="${OLLAMA_MODEL:-llama3}"
HOST="${OLLAMA_HOST:-http://localhost:11434}"
OUTDIR="${OUTDIR:-summaries}"
mkdir -p "$OUTDIR"

# Prefer journald; fall back to /var/log/syslog
if command -v journalctl >/dev/null 2>&1; then
  LOGS="$(journalctl -S -1hour -o short-iso --no-pager | tail -n 400)"
else
  LOGFILE="/var/log/syslog"
  [ -r "$LOGFILE" ] || { echo "No journalctl and cannot read $LOGFILE"; exit 1; }
  LOGS="$(tail -n 400 "$LOGFILE")"
fi

PROMPT=$'Summarize the following Linux logs from the last hour into:\n- 3–7 bullet points of notable events\n- A count of ERROR/WARN occurrences\n- Any actionable follow-ups in 1–2 lines\n\nLogs:\n'${LOGS}

payload="$(jq -n --arg model "$MODEL" --arg prompt "$PROMPT" '{model:$model, prompt:$prompt, stream:false}')"
RESP="$(curl -s "$HOST/api/generate" -d "$payload" | jq -r '.response')"

STAMP="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
FILE="$OUTDIR/log-summary-$STAMP.txt"
printf "%s\n" "$RESP" | tee "$FILE" >/dev/null
echo "Wrote $FILE"

Set it to run hourly with cron:

crontab -e
# Add:
0 * * * * /path/to/log-summarizer.sh >> /path/to/summaries/cron.log 2>&1

What to add to your portfolio:

  • Example outputs, a screenshot of a terminal summary, and a section on prompt constraints (keeping logs to ~400 lines to fit context).

Project 3: voice-notes – speech-to-text with Whisper CLI

Create a transcription pipeline for recorded meetings or voice notes. This is useful, tangible, and showcases audio tooling.

  • Skills: Python venvs, ffmpeg, CLI orchestration.

  • Dependencies: ffmpeg, Python 3, pip/venv.

Install Whisper (CPU-friendly):

python3 -m venv .venv
. .venv/bin/activate
pip install -U openai-whisper
# Optional: install CPU-only PyTorch to speed up on some systems
pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision torchaudio || true

Script voice-notes.sh:

#!/usr/bin/env bash
set -euo pipefail

VENV="${VENV:-.venv}"
NOTES_DIR="${NOTES_DIR:-notes}"
OUT_DIR="${OUT_DIR:-transcripts}"
MODEL="${WHISPER_MODEL:-base}"   # tiny, base, small, medium, large

[ -d "$VENV" ] || { echo "Missing venv at $VENV. Run: python3 -m venv .venv && . .venv/bin/activate && pip install -U openai-whisper"; exit 1; }
. "$VENV/bin/activate"

mkdir -p "$OUT_DIR"
shopt -s nullglob
for f in "$NOTES_DIR"/*.{wav,mp3,m4a,flac,ogg}; do
  echo "Transcribing: $f"
  whisper "$f" --model "$MODEL" --device cpu --output_dir "$OUT_DIR" --fp16 False --verbose False
done
echo "Done. Transcripts in $OUT_DIR"

Usage:

mkdir -p notes
# Drop audio files into notes/, then:
bash voice-notes.sh

What to add to your portfolio:

  • Before/after examples, WER notes, and a design doc on CPU vs. GPU trade-offs.

Project 4: img-alt – batch-generate accessible alt text

Generate alt text for images at scale using a multimodal model (LLaVA via Ollama). Great for static sites, product catalogs, or documentation.

  • Skills: image handling, base64 encoding, prompt scoping for accessibility.

  • Dependencies: Ollama with llava, jq, coreutils (base64).

Pull the model:

ollama pull llava

Script img-alt-text.sh:

#!/usr/bin/env bash
set -euo pipefail

MODEL="${OLLAMA_MODEL:-llava}"
HOST="${OLLAMA_HOST:-http://localhost:11434}"
IMG_DIR="${IMG_DIR:-images}"
OUT_DIR="${OUT_DIR:-alt}"
mkdir -p "$OUT_DIR"

shopt -s nullglob
for img in "$IMG_DIR"/*.{png,jpg,jpeg,webp}; do
  echo "Processing: $img"
  b64="$(base64 -w0 "$img")"
  prompt="Write a concise, descriptive, non-redundant alt text (<= 140 chars). Do not say 'image of' or repeat file names."

  payload="$(jq -n --arg model "$MODEL" --arg prompt "$prompt" --arg img "$b64" \
    '{model:$model, prompt:$prompt, images:[$img], stream:false}')"

  resp="$(curl -s "$HOST/api/generate" -d "$payload" | jq -r '.response' | tr -d '\r')"
  out="$OUT_DIR/$(basename "$img").alt.txt"
  printf "%s\n" "$resp" > "$out"
  echo "Wrote: $out"
done

Usage:

mkdir -p images
# Drop images into images/
bash img-alt-text.sh

What to add to your portfolio:

  • A note on alt-text best practices, sampling strategy for QA, and a simple benchmark (manual spot-checks).

Tips to polish your portfolio

  • Add Makefile targets to bootstrap dependencies and run demos.

  • Include a tests/ folder with smoke tests (e.g., mock the API and assert non-empty outputs).

  • Provide a setup.sh to install prerequisites and models automatically.

  • Log with timestamps and exit non-zero on failures to show reliability.

  • Document environment variables, resource usage, and limits.

Example bootstrap Makefile:

SHELL := /usr/bin/env bash

.PHONY: deps models
deps:
    @echo "Install base deps (choose one):"
    @echo "  apt:    sudo apt update && sudo apt install -y curl jq ffmpeg python3 python3-venv python3-pip"
    @echo "  dnf:    sudo dnf install -y curl jq python3 python3-pip python3-virtualenv && sudo dnf install -y ffmpeg || true"
    @echo "  zypper: sudo zypper install -y curl jq ffmpeg python3 python3-pip python3-virtualenv"

models:
    ollama pull llama3
    ollama pull llava

Conclusion and next steps (CTA)

You now have four practical AI utilities that run on any Linux box and play nicely with the rest of your system. Turn them into a portfolio:

  • Put each project in its own folder with a README, demo GIFs, and a “How it works” section.

  • Add a top-level index README that links to each project and explains your design principles.

  • Publish to GitHub and tag issues for future improvements. Bonus: package them in a Docker image.

Ready for the next step? Pick one project, generalize the script, add flags/help output, and share your repo. Hiring managers love to see AI that actually ships.