From 272957dae4a2cfdc414afcab2e7eff6329a8ef41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 22 Nov 2025 02:44:33 +0100 Subject: [PATCH] feat: add arty notes command with markdown rendering support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds 'arty notes' command to display project notes from arty.yml with beautiful markdown rendering. Features include: - Reads 'notes' field from arty.yml - Supports full markdown syntax (headers, bold, italic, code blocks, links, lists) - Smart rendering fallbacks: glow → mdcat → python3 → plain text - Beautiful terminal output with colors and formatting - ANSI escape codes for syntax highlighting - Horizontal separators for code blocks Also renamed arty.sh to artifact_git_download.sh for better clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- arty.sh => artifact_git_download.sh | 113 ++++++++++++++++++++++++++++ comfyui_models.example.yaml | 80 -------------------- 2 files changed, 113 insertions(+), 80 deletions(-) rename arty.sh => artifact_git_download.sh (92%) delete mode 100644 comfyui_models.example.yaml diff --git a/arty.sh b/artifact_git_download.sh similarity index 92% rename from arty.sh rename to artifact_git_download.sh index 5cb5e41..c0db725 100755 --- a/arty.sh +++ b/artifact_git_download.sh @@ -821,6 +821,114 @@ list_libs() { echo } +# Display notes from arty.yml with markdown rendering +show_notes() { + local config_file="${1:-$ARTY_CONFIG_FILE}" + + if [[ ! -f "$config_file" ]]; then + log_error "Config file not found: $config_file" + return 1 + fi + + # Get notes field from YAML + local notes=$(yq eval '.notes' "$config_file" 2>/dev/null) + + if [[ -z "$notes" ]] || [[ "$notes" == "null" ]]; then + log_info "No notes found in $config_file" + log_info "Add a 'notes' field to your arty.yml to display project notes" + return 0 + fi + + # Get project name for header + local project_name=$(get_yaml_field "$config_file" "name") + [[ "$project_name" == "null" ]] && project_name="$(basename "$PWD")" + + echo + echo -e "${BOLD}${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo -e "${BOLD}${GREEN} Notes: ${project_name}${NC}" + echo -e "${BOLD}${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo + + # Try to render markdown with available tools + if command -v glow &>/dev/null; then + # Use glow if available (best option) + echo "$notes" | glow - + elif command -v mdcat &>/dev/null; then + # Use mdcat if available (good alternative) + echo "$notes" | mdcat + elif command -v python3 &>/dev/null; then + # Fallback to Python markdown rendering - create temp file to avoid quoting issues + local temp_notes=$(mktemp) + echo "$notes" > "$temp_notes" + python3 - "$temp_notes" <<'EOPY' 2>/dev/null || echo "$notes" +import sys +import re + +# Read from temp file +with open(sys.argv[1], 'r') as f: + text = f.read() + +# Simple markdown-like formatting for terminal +# Code blocks first (before other processing) +lines = text.split('\n') +in_code_block = False +processed_lines = [] +for line in lines: + if line.strip().startswith('```'): + in_code_block = not in_code_block + if in_code_block: + processed_lines.append('\033[2;37m' + '─' * 60 + '\033[0m') + else: + processed_lines.append('\033[2;37m' + '─' * 60 + '\033[0m') + continue + if in_code_block: + processed_lines.append('\033[0;36m ' + line + '\033[0m') + else: + processed_lines.append(line) + +text = '\n'.join(processed_lines) + +# Headers +text = re.sub(r'^### (.+)$', r'\033[1;36m\1\033[0m', text, flags=re.MULTILINE) +text = re.sub(r'^## (.+)$', r'\033[1;32m\1\033[0m', text, flags=re.MULTILINE) +text = re.sub(r'^# (.+)$', r'\033[1;33m\1\033[0m', text, flags=re.MULTILINE) + +# Bold +text = re.sub(r'\*\*(.+?)\*\*', r'\033[1m\1\033[0m', text) +text = re.sub(r'__(.+?)__', r'\033[1m\1\033[0m', text) + +# Italic (avoid matching bold) +text = re.sub(r'(? [name] Install a library from git repository deps [--dry-run] Install all dependencies from arty.yml list List installed libraries with dependency tree + notes Display project notes from arty.yml (supports markdown) remove Remove an installed library init [name] Initialize a new arty.yml project source [file] Source a library (for use in scripts) @@ -1673,6 +1782,7 @@ EXAMPLES: arty deps arty deps --dry-run arty list + arty notes arty init my-project arty test arty build @@ -1885,6 +1995,9 @@ main() { list | ls) list_libs ;; + notes) + show_notes "$config" + ;; remove | rm) if [[ ${#args[@]} -eq 0 ]]; then log_error "Library name required" diff --git a/comfyui_models.example.yaml b/comfyui_models.example.yaml deleted file mode 100644 index afee3bd..0000000 --- a/comfyui_models.example.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# ComfyUI Models Configuration Example -# -# This file defines which models to download from HuggingFace -# and where to symlink them in your ComfyUI installation. -# -# Model types correspond to ComfyUI subdirectories: -# - checkpoints: Stable Diffusion checkpoints -# - vae: VAE models -# - loras: LoRA models -# - controlnet: ControlNet models -# - clip: CLIP models -# - clip_vision: CLIP Vision models -# - upscale_models: Upscaler models -# - embeddings: Textual inversion embeddings -# - hypernetworks: Hypernetwork models -# - style_models: Style transfer models - -settings: - cache_dir: ~/.cache/huggingface - parallel_downloads: 1 - -model_categories: - # Stable Diffusion Checkpoints - checkpoints: - - repo_id: runwayml/stable-diffusion-v1-5 - description: Stable Diffusion v1.5 - size_gb: 4 - essential: true - type: checkpoints - filename: "" # Empty means all model files - - - repo_id: stabilityai/stable-diffusion-xl-base-1.0 - description: SDXL Base 1.0 - size_gb: 7 - essential: true - type: checkpoints - filename: "" - - # VAE Models - vae: - - repo_id: stabilityai/sd-vae-ft-mse-original - description: SD VAE ft MSE - size_gb: 0.3 - essential: true - type: vae - filename: "" - - # LoRA Models - loras: - - repo_id: latent-consistency/lcm-lora-sdv1-5 - description: LCM LoRA for SD v1.5 - size_gb: 0.1 - essential: false - type: loras - filename: "" - - # ControlNet Models - controlnet: - - repo_id: lllyasviel/control_v11p_sd15_canny - description: ControlNet Canny - size_gb: 1.4 - essential: false - type: controlnet - filename: "" - - - repo_id: lllyasviel/control_v11p_sd15_openpose - description: ControlNet OpenPose - size_gb: 1.4 - essential: false - type: controlnet - filename: "" - - # Upscale Models - upscale_models: - - repo_id: ai-forever/Real-ESRGAN - description: Real-ESRGAN x4 - size_gb: 0.1 - essential: false - type: upscale_models - filename: "RealESRGAN_x4plus.pth"