Posted on
Artificial Intelligence

Artificial Intelligence Productivity Projects

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

Artificial Intelligence Productivity Projects you can ship from your Bash terminal

If your terminal is already your productivity cockpit, AI can be the co‑pilot that quietly takes the busywork off your hands. The problem: knowledge workers are drowning in notes, emails, and context switching. The value: small, reliable Bash-friendly automations that use AI to summarize, prioritize, and propose safe commands—without dragging you into a new GUI or SaaS maze.

Below are four focused, real-world projects you can build this weekend. Each one runs primarily from Bash, composes well with Unix tools, and keeps you in control of your data and workflow.

Note: These examples use an OpenAI-compatible HTTP API. Set your own endpoint and model if you run a self-hosted or alternative provider by adjusting OPENAI_BASE_URL and OPENAI_MODEL.


Why this works (and keeps working)

  • Composable: Each script reads from stdin and writes to stdout. You can pipe, schedule, and glue them with existing tools.

  • Reproducible: The “automation” is code—checked into your dotfiles, versioned with git, and portable across machines.

  • Privacy-first by design: Point them at a local LLM server or switch to a cloud API per task sensitivity.

  • Low cognitive overhead: No new app paradigms; just commands you can wrap in aliases, cron jobs, and systemd timers.


Prerequisites (install once)

We’ll rely on a few standard tools.

  • curl: HTTP requests to LLM endpoints

  • jq: JSON creation/parsing

  • git: version control for your scripts

  • python3 + pipx: optional CLI installs (e.g., Whisper)

  • ffmpeg: audio handling (Project 1)

  • attr: set extended file attributes (Project 4)

Install via your package manager:

Debian/Ubuntu (apt):

sudo apt update
sudo apt install -y curl jq git python3 python3-pip pipx ffmpeg attr
pipx ensurepath

Fedora/RHEL/CentOS (dnf):

sudo dnf install -y curl jq git python3 python3-pip pipx attr
# ffmpeg is available as ffmpeg-free on newer Fedora, or via RPM Fusion if needed:
sudo dnf install -y ffmpeg-free || {
  sudo dnf install -y \
    https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
  sudo dnf install -y ffmpeg
}
pipx ensurepath

openSUSE (zypper):

sudo zypper refresh
sudo zypper install -y curl jq git python3 python3-pip pipx attr
# ffmpeg often comes from Packman; enable if ffmpeg is missing:
sudo zypper ar -cfp 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman
sudo zypper dup --from packman --allow-vendor-change
sudo zypper install -y ffmpeg
pipx ensurepath

Environment for an OpenAI-compatible endpoint:

export OPENAI_API_KEY="your_api_key_here"
export OPENAI_BASE_URL="${OPENAI_BASE_URL:-https://api.openai.com/v1}"
export OPENAI_MODEL="${OPENAI_MODEL:-gpt-4o-mini}"

Project 1 — AI Meeting Notes from Audio (transcribe + summarize)

Turn raw meeting audio into concise, actionable notes. We’ll use Whisper CLI locally for transcription and a chat model for summarization.

Install Whisper CLI via pipx:

pipx install openai-whisper

Create transcribe_and_summarize.sh:

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

AUDIO="${1:-}"
[[ -z "$AUDIO" ]] && { echo "Usage: $0 path/to/audio.mp3"; exit 1; }

mkdir -p transcripts
echo "[1/2] Transcribing with Whisper (small model for speed)..."
whisper "$AUDIO" --model small --language en --output_format txt --output_dir transcripts >/dev/null

TXT="transcripts/$(basename "${AUDIO%.*}").txt"
[[ ! -s "$TXT" ]] && { echo "Transcription failed."; exit 2; }

echo "[2/2] Summarizing with LLM..."
jq -n \
  --arg model "${OPENAI_MODEL:-gpt-4o-mini}" \
  --rawfile t "$TXT" \
  '{
    model: $model,
    messages: [
      {role:"system", "content":"You are a concise meeting-minutes generator. Produce bullet points with decisions, owners, and due dates. Include a brief TL;DR."},
      {role:"user", "content": ("Summarize the following transcript:\n\n" + $t)}
    ]
  }' \
| curl -sS "$OPENAI_BASE_URL/chat/completions" \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d @- \
| jq -r '.choices[0].message.content' \
| tee "transcripts/$(basename "${AUDIO%.*}")-summary.md"

Use:

chmod +x transcribe_and_summarize.sh
./transcribe_and_summarize.sh meeting.mp3

Real-world tip:

  • For long meetings, prefer --model medium for quality or chunk audio with ffmpeg -ss/-to and summarize in parts, then ask the model for a final merge.

Project 2 — CLI Copilot: Ask “what’s the command for …?” and get a safe one-liner

This helper suggests a single Bash command for a natural-language request. You can run it after reviewing.

Add this function to your shell (e.g., ~/.bashrc):

aicmd() {
  if [ $# -eq 0 ]; then
    echo "Usage: aicmd describe your task"; return 1
  fi
  prompt=$(printf "%s" "$*" | jq -Rs .)
  payload=$(jq -n \
    --arg model "${OPENAI_MODEL:-gpt-4o-mini}" \
    --arg p "Return ONLY a single safe Bash command (no explanation, no comments). Prefer POSIX tools and jq. Task: $*" \
    '{model:$model,messages:[{role:"system","content":"You write safe, minimal Bash one-liners."},{role:"user","content":$p}]}')
  cmd=$(curl -sS "$OPENAI_BASE_URL/chat/completions" \
        -H "Authorization: Bearer $OPENAI_API_KEY" \
        -H "Content-Type: application/json" \
        -d "$payload" \
        | jq -r '.choices[0].message.content' \
        | sed -e 's/^```bash//' -e 's/^```//' -e 's/```$//' | tr -d '\r')
  echo "Suggested:"
  echo "  $cmd"
  read -r -p "Run it? [y/N] " ans
  if [[ "$ans" =~ ^[Yy]$ ]]; then
    eval "$cmd"
  fi
}

Examples:

aicmd find the 10 largest files under ~/Downloads
aicmd convert all .wav in the current directory to 16k mono wav
aicmd show unique IPs hitting port 443 from nginx access.log with counts

Safety guardrail:

  • The system prompt requests a single safe command; you still review and confirm before execution.

Project 3 — Morning Brief: Summarize unread emails via IMAP

Pipe a quick snapshot of your inbox into a prioritized, human-readable brief.

1) Dump unseen messages (subjects/senders) using Python’s stdlib:

cat > imap_dump.py <<'PY'
import os, sys, imaplib, email
from email.header import decode_header

host = os.getenv("IMAP_HOST")
user = os.getenv("IMAP_USER")
pwd  = os.getenv("IMAP_PASS")
folder = os.getenv("IMAP_FOLDER","INBOX")
limit = int(os.getenv("IMAP_LIMIT","30"))

if not all([host,user,pwd]):
    sys.stderr.write("Set IMAP_HOST, IMAP_USER, IMAP_PASS\n")
    sys.exit(1)

M = imaplib.IMAP4_SSL(host)
M.login(user, pwd)
M.select(folder)
status, data = M.search(None, 'UNSEEN')
ids = data[0].split()
ids = ids[-limit:]
lines = []
for i in ids:
    status, msg_data = M.fetch(i, '(RFC822)')
    msg = email.message_from_bytes(msg_data[0][1])
    subj, enc = decode_header(msg.get('Subject') or '')[0]
    if isinstance(subj, bytes):
        subj = subj.decode(enc or 'utf-8', errors='replace')
    from_ = msg.get('From','')
    lines.append(f"- {from_} :: {subj}")
M.logout()

if not lines:
    print("No unseen messages.")
else:
    print("\n".join(lines))
PY

2) Summarize with the LLM:

python3 imap_dump.py \
| jq -n --arg model "${OPENAI_MODEL:-gpt-4o-mini}" --rawfile l /dev/stdin '{
    model:$model,
    messages:[
      {role:"system","content":"You are an executive assistant. Create a prioritized morning brief with 3 sections: (1) Urgent actions, (2) FYIs, (3) Waiting-on-others. Keep it to ~200 words."},
      {role:"user","content":("Summarize and prioritize these unread emails:\n\n" + $l)}
    ]
  }' \
| curl -sS "$OPENAI_BASE_URL/chat/completions" \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d @- \
| jq -r '.choices[0].message.content'

Environment:

export IMAP_HOST="imap.example.com"
export IMAP_USER="you@example.com"
export IMAP_PASS="app-specific-password"
export IMAP_FOLDER="INBOX"      # optional
export IMAP_LIMIT="30"          # optional

Automate with cron:

( crontab -l; echo "0 7 * * 1-5 IMAP_HOST=... IMAP_USER=... IMAP_PASS=... bash -lc 'python3 ~/imap_dump.py | ... > ~/Documents/morning-brief.txt'" ) | crontab -

Project 4 — Smart file tagging: auto-generate keywords and store as xattrs

Let AI scan text files and write concise tags into extended attributes. Great for grep/locate supplements and smarter search UIs.

Script:

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

# Usage: ./autotag.sh file1.txt file2.md ...
# Requires: attr (setfattr), curl, jq

model="${OPENAI_MODEL:-gpt-4o-mini}"

for f in "$@"; do
  [[ -f "$f" ]] || { echo "Skip non-file: $f" >&2; continue; }
  mime=$(file -b --mime-type "$f")
  case "$mime" in
    text/*) content=$(head -c 6000 "$f") ;;
    *) echo "Skipping non-text file: $f ($mime)"; continue ;;
  esac

  payload=$(jq -n --arg m "$model" --arg c "$content" '{
    model:$m,
    messages:[
      {role:"system","content":"You generate 3-7 lowercase, hyphen-separated topic tags from content. Output tags joined by commas, no extra text."},
      {role:"user","content":("Create tags for:\n\n" + $c)}
    ]
  }')

  tags=$(curl -sS "$OPENAI_BASE_URL/chat/completions" \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$payload" \
    | jq -r '.choices[0].message.content' \
    | tr -d '\r' | head -c 200)

  echo "$f :: $tags"
  setfattr -n user.ai.tags -v "$tags" "$f" || echo "Failed to set xattr on $f (need filesystem support)"
done

Use:

chmod +x autotag.sh
./autotag.sh *.md notes/*.txt
# Read tags later:
getfattr -n user.ai.tags -d yourfile.txt

Tip:

  • Index xattrs in your launcher/search tools or write a small ripgrep wrapper that shows tags alongside matches.

Real-world notes and guardrails

  • Cost and latency: Keep prompts short and content-bounded (e.g., head -c 6000). Cache results for unchanged inputs.

  • Security: Never pipe secrets to external models. For high-sensitivity, run a local model behind an OpenAI-compatible API and point OPENAI_BASE_URL there.

  • Observability: Log the raw inputs/outputs (sanitized) to a timestamped directory so you can audit or re-prompt later.

  • Idempotency: Make scripts safe to rerun—write outputs to predictable files, and check for existence.


Your next step (CTA)

Pick one project that would remove the most friction from your week:

  • If meetings dominate: start with “AI Meeting Notes.”

  • If you live in the terminal: wire up “CLI Copilot” to your shell.

  • If email is the firehose: ship the “Morning Brief” and schedule it.

  • If docs pile up: tag them today and find them faster tomorrow.

Drop these scripts into a ~/bin or a git-tracked dotfiles repo, add aliases, and iterate. When you’re ready, swap in your preferred OpenAI-compatible endpoint (local or cloud), tune the prompts, and grow your toolbox one small win at a time.