#!/bin/bash # wq — Work Queue CLI wrapper # Usage: wq [options] set -e API_URL="${WORK_QUEUE_API_URL:-}" if [[ -z "$API_URL" ]]; then if [[ -f ~/.config/work_queue_api_url ]]; then API_URL=$(cat ~/.config/work_queue_api_url) else echo "Error: WORK_QUEUE_API_URL not set and no ~/.config/work_queue_api_url" >&2 exit 1 fi fi CMD="$1" shift || { echo "Usage: wq [args]" >&2; exit 1; } case "$CMD" in add) wq_add "$@" ;; dispatch) wq_dispatch "$@" ;; update) wq_update "$@" ;; list) wq_list "$@" ;; get) wq_get "$@" ;; my-queue) wq_my_queue "$@" ;; stale-check) wq_stale_check "$@" ;; *) echo "Unknown command: $CMD" >&2 echo "Commands: add, dispatch, update, list, get, my-queue, stale-check" >&2 exit 1 ;; esac