commit a71eef90067c18dae051ea01fbde3508d518762d Author: Sebastian Krüger Date: Thu Oct 30 03:10:19 2025 +0100 Add utility scripts collection with auto-generated documentation This commit introduces a comprehensive collection of utility scripts for shell automation, color manipulation, and documentation generation: Core Scripts: - artifact_github_download.sh: Download GitHub Action artifacts via CLI - css_color_filter.sh: Generate CSS filter values using SPSA algorithm - css_color_palette.sh: Generate comprehensive color palettes (monochromatic, triadic, etc.) - css_json_convert.sh: Convert CSS variables to JSON/YAML formats - doc_bash_generate.sh: Auto-generate README.md with animated GIF demos - doc_rust_generate.sh: Generate Rust project documentation - jinja_template_render.sh: Render Jinja2 templates from CLI - mime_mp4_gif.sh: Convert MP4 videos to GIF format Documentation Features: - Comprehensive README.md with table of contents - 8 animated GIF demos showing real command examples - Sandboxed demo execution in temporary directories - 15-second timeout protection for intensive computations - Automatic example extraction from --help output Technical Implementation: - Pure bash color utilities using only bc for arithmetic - tput-based color codes for portability - IFS-safe string parsing using parameter expansion - Stdout/stderr isolation to prevent contamination - Base64 encoding for multi-line text preservation All scripts include detailed --help documentation with usage examples. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fec32c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tmp/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..87eddaf --- /dev/null +++ b/README.md @@ -0,0 +1,691 @@ +# Utility Scripts Collection + +> Comprehensive documentation with usage examples and demos + +This documentation was auto-generated using [`doc_bash_generate.sh`](https://github.com/yourusername/yourrepo). + +## Table of Contents +- [`artifact_github_download.sh`](#artifact-github-download-sh) +- [`css_color_filter.sh`](#css-color-filter-sh) +- [`css_color_palette.sh`](#css-color-palette-sh) +- [`css_json_convert.sh`](#css-json-convert-sh) +- [`doc_bash_generate.sh`](#doc-bash-generate-sh) +- [`doc_rust_generate.sh`](#doc-rust-generate-sh) +- [`jinja_template_render.sh`](#jinja-template-render-sh) +- [`mime_mp4_gif.sh`](#mime-mp4-gif-sh) + + +--- + +## `artifact_github_download.sh` + +GitHub Artifact Downloader + +### Demo + +![Demo of artifact_github_download.sh](docs/img/artifact_github_download.gif) + +### Usage + +```bash +artifact_github_download.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` +GitHub Artifact Downloader + +USAGE: + artifact_github_download.sh [OPTIONS] + +ARGUMENTS: + REPO GitHub repository (owner/repo) + +OPTIONS: + -n, --name NAME Artifact name to download (preselect) + -o, --output DIR Output directory (default: current directory) + -h, --help Show this help message + +EXAMPLES: + # Interactive mode - list and select artifacts + artifact_github_download.sh valknarness/awesome + + # Preselect artifact by name + artifact_github_download.sh valknarness/awesome -n awesome-database-latest + + # Download to specific directory + artifact_github_download.sh valknarness/awesome -o ~/downloads + + # Combine options + artifact_github_download.sh valknarness/awesome -n awesome-database-latest -o ~/downloads +``` + +
+ +### Examples + +```bash +# Interactive mode - list and select artifacts +artifact_github_download.sh valknarness/awesome + +# Preselect artifact by name +artifact_github_download.sh valknarness/awesome -n awesome-database-latest + +# Download to specific directory +artifact_github_download.sh valknarness/awesome -o ~/downloads + +# Combine options +artifact_github_download.sh valknarness/awesome -n awesome-database-latest -o ~/downloads +``` + +--- + +## `css_color_filter.sh` + +CSS Color Filter Generator + +### Demo + +![Demo of css_color_filter.sh](docs/img/css_color_filter.gif) + +### Usage + +```bash +css_color_filter.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` +CSS Color Filter Generator + +Generate CSS filter values to transform black elements into any target color. + +USAGE: + css_color_filter.sh [OPTIONS] [COLOR] + +ARGUMENTS: + COLOR Hex color (e.g., #FF0000, ff0000) or RGB (e.g., 255,0,0) + +OPTIONS: + -i, --interactive Interactive mode with colored preview + -r, --raw Output only the CSS filter (for piping) + -c, --copy Copy result to clipboard automatically + -h, --help Show this help message + +EXAMPLES: + css_color_filter.sh "#FF5733" + css_color_filter.sh ff5733 + css_color_filter.sh "255,87,51" + css_color_filter.sh -i + +NOTE: + This tool generates filters that work on black elements. + To use with non-black elements, prepend: brightness(0) saturate(100%) + +ALGORITHM: + Uses SPSA (Simultaneous Perturbation Stochastic Approximation) to find + optimal filter combinations that minimize color difference in RGB and HSL. + +DEPENDENCIES: + bc For floating-point arithmetic + jq For JSON formatting (optional) +``` + +
+ +### Examples + +```bash +css_color_filter.sh "#FF5733" +css_color_filter.sh ff5733 +css_color_filter.sh "255,87,51" +css_color_filter.sh -i +``` + +--- + +## `css_color_palette.sh` + +CSS Color Palette Generator (Pure Bash) + +### Demo + +![Demo of css_color_palette.sh](docs/img/css_color_palette.gif) + +### Usage + +```bash +css_color_palette.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` +CSS Color Palette Generator (Pure Bash) + +Generate comprehensive color palettes without Node.js dependencies. + +USAGE: + css_color_palette.sh COLOR [OPTIONS] + +ARGUMENTS: + COLOR Base hex color (e.g., #3498db, 3498db) + +OPTIONS: + -p, --palette TYPE Palette type: monochromatic, analogous, complementary, + split-complementary, triadic, tetradic + -o, --output FILE Output file (default: ./colors.yaml) + -m, --mode MODE Color mode: light, dark (default: light) + -s, --style STYLE Style: shades, tints, tones, all (default: all) + -n, --name NAME Palette name (default: auto-generated) + --scales N Number of scale steps (default: 11) + -i, --interactive Interactive mode + -v, --verbose Verbose output with color preview + -h, --help Show this help message + +DEPENDENCIES: + bc For floating-point arithmetic + +EXAMPLES: + css_color_palette.sh "#3498db" + css_color_palette.sh "#3498db" -p triadic -o palette.json + css_color_palette.sh "ff5733" -p analogous -m dark +``` + +
+ +### Examples + +```bash +css_color_palette.sh "#3498db" +css_color_palette.sh "#3498db" -p triadic -o palette.json +css_color_palette.sh "ff5733" -p analogous -m dark +``` + +--- + +## `css_json_convert.sh` + +USAGE: + +### Demo + +![Demo of css_json_convert.sh](docs/img/css_json_convert.gif) + +### Usage + +```bash +css_json_convert.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` + +================================================================ + CSS Variable to JSON/YAML Converter + Extract CSS custom properties with ease +================================================================ + +USAGE: + css_json_convert.sh [OPTIONS] + +DESCRIPTION: + Extracts CSS custom properties (variables) from a CSS file and converts + them to JSON or YAML format. Automatically detects output format from + file extension. + +ARGUMENTS: + Input CSS file containing CSS variables + +OPTIONS: + -o, --output FILE Output file path (default: ./output.yaml) + Format auto-detected from extension (.json/.yaml/.yml) + -c, --camel-case Convert variable names to camelCase + (e.g., --main-color -> mainColor) + -v, --verbose Enable verbose output + -h, --help Show this help message + +EXAMPLES: + # Extract CSS vars to YAML (default) + css_json_convert.sh styles.css + + # Extract to JSON with custom output + css_json_convert.sh styles.css -o theme.json + + # Convert variable names to camelCase + css_json_convert.sh styles.css -o vars.json --camel-case + +CSS VARIABLE FORMAT: + The script extracts CSS custom properties in the format: + --variable-name: value; + + Example input: + :root { + --main-color: #e8eaed; + --font-size: 16px; + } + + Example JSON output: + { + "main-color": "#e8eaed", + "font-size": "16px" + } +``` + +
+ +### Examples + +```bash +# Extract CSS vars to YAML (default) +css_json_convert.sh styles.css + +# Extract to JSON with custom output +css_json_convert.sh styles.css -o theme.json + +# Convert variable names to camelCase +css_json_convert.sh styles.css -o vars.json --camel-case +``` + +--- + +## `doc_bash_generate.sh` + +Bash Documentation Generator with Animated GIFs + +### Demo + +![Demo of doc_bash_generate.sh](docs/img/doc_bash_generate.gif) + +### Usage + +```bash +doc_bash_generate.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` + +================================================================ + Bash Documentation Generator +================================================================ + +Bash Documentation Generator with Animated GIFs + +Generate sexy, comprehensive README.md files with embedded asciinema GIFs. + +USAGE: + doc_bash_generate.sh [OPTIONS] [executable...] + +ARGUMENTS: + executable One or more executables or glob patterns + +OPTIONS: + -o, --output FILE Output README.md path (default: ./README.md) + -t, --title TITLE Documentation title (default: auto-generated) + --no-gif Skip GIF generation (faster, text only) + --gif-only Only generate GIFs, don't update README + -h, --help Show this help message + +EXAMPLES: + doc_bash_generate.sh css_*.sh + doc_bash_generate.sh -o docs/README.md *.sh + doc_bash_generate.sh --title "My Awesome Tools" script1.sh script2.sh + +DEPENDENCIES: + asciinema Terminal session recorder + agg Asciinema to GIF converter (cargo install agg) + +NOTES: + Demos are automatically generated by running --help on each command. + GIF recordings are created in a temporary directory and cleaned up after. +``` + +
+ +### Examples + +```bash +doc_bash_generate.sh css_*.sh +doc_bash_generate.sh -o docs/README.md *.sh +doc_bash_generate.sh --title "My Awesome Tools" script1.sh script2.sh +``` + +--- + +## `doc_rust_generate.sh` + +Rust Documentation Generator with Custom Themes + +### Demo + +![Demo of doc_rust_generate.sh](docs/img/doc_rust_generate.gif) + +### Usage + +```bash +doc_rust_generate.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` +Rust Documentation Generator with Custom Themes + +USAGE: + doc_rust_generate.sh [OPTIONS] + +DESCRIPTION: + Generate beautiful Rust documentation with custom color schemes and styling. + Supports various input types including Rust projects, individual files, and more. + +ARGUMENTS: + Input file(s) or pattern(s) to document: + - Rust project directories (containing Cargo.toml) + - Individual .rs files + - Markdown files (.md) + - JSON/TOML configuration files + - Glob patterns (e.g., src/**/*.rs) + +OPTIONS: + -o, --output DIR Output directory for generated docs + (default: $PWD/output) + -c, --color COLOR Primary accent color (hex format) + (default: #ff69b4) + Examples: #3498db, #10b981, #8b5cf6 + -s, --style STYLE Background style theme + Options: slate, zinc, neutral, stone, gray + (default: slate) + --font-sans FONT Google Font for body text (default: Inter) + --font-mono FONT Google Font for code blocks + (default: JetBrains Mono) + --serve Start HTTP server after generation + --open Open documentation in browser (implies --serve) + -p, --port PORT Port for HTTP server (default: 8000) + -v, --verbose Enable verbose output + -d, --dry-run Show what would be done without executing + -h, --help Show this help message + +EXAMPLES: + # Generate docs for current Rust project + doc_rust_generate.sh . + + # Custom color scheme + doc_rust_generate.sh . -c "#3498db" -s zinc -o ./docs + + # Document specific files + doc_rust_generate.sh src/lib.rs src/main.rs -o ./api-docs + + # Use custom fonts + doc_rust_generate.sh . --font-sans "Roboto" --font-mono "Fira Code" + + # Generate and open in browser + doc_rust_generate.sh . --open + +NOTES: + - Requires: cargo, rustdoc, bc, yq, jq, python3 with jinja2 + - Colors are automatically generated in light and dark variants + - Google Fonts are automatically imported + - Mermaid.js diagrams are automatically rendered +``` + +
+ +### Examples + +```bash +# Generate docs for current Rust project +doc_rust_generate.sh . + +# Custom color scheme +doc_rust_generate.sh . -c "#3498db" -s zinc -o ./docs + +# Document specific files +doc_rust_generate.sh src/lib.rs src/main.rs -o ./api-docs + +# Use custom fonts +doc_rust_generate.sh . --font-sans "Roboto" --font-mono "Fira Code" + +# Generate and open in browser +doc_rust_generate.sh . --open +``` + +--- + +## `jinja_template_render.sh` + +JINJA2 TEMPLATE RENDERER - NINJA EDITION + +### Demo + +![Demo of jinja_template_render.sh](docs/img/jinja_template_render.gif) + +### Usage + +```bash +jinja_template_render.sh [OPTIONS] [ARGUMENTS] +``` + +### Options + +
+Click to expand full help output + +``` +JINJA2 TEMPLATE RENDERER - NINJA EDITION + +USAGE: + jinja_template_render.sh [OPTIONS]