Skip to main content

svg-picker

PyPI version Python versions License Downloads

A Human-in-the-Loop Icon Selector for AI Agents

Inspired by HULA: Human-In-the-Loop Software Development Agents (ICSE SEIP 2025)


What Is This?

svg-picker is a lightweight tool that gives AI coding agents the ability to ask a human to visually select an icon, then returns the SVG source code directly to the agent via stdout.

Instead of guessing icon names or embedding random SVG strings, the AI can now say:

"I need a home icon — please select one from the options"

A native dark-themed window opens. The human picks. The AI gets clean SVG code.

The human provides visual judgment. The AI handles everything else.


Background: Why "Human-in-the-Loop"?

The paper HULA: Human-In-the-Loop Software Development Agents (Takerngsaksiri et al., ICSE SEIP 2025) demonstrates a critical insight:

Existing LLM-based coding agents rarely incorporate human feedback at intermediate stages. When humans can intervene during plan generation and code writing — not just review final output — development time and effort decrease significantly.

HULA was deployed at Atlassian JIRA and evaluated by real engineers. The results confirm what many suspected: fully autonomous AI agents produce better outcomes when humans stay in the loop.

svg-picker applies this principle to a specific, narrow task: icon selection. It is a minimal, production-ready implementation of human-in-the-loop tooling for AI agents — without the complexity of a full framework.


How It Works

User/CI:  svg-picker <keyword>
            │
            ▼
    ┌─────────────────┐
    │  Search Iconify  │   (Background thread)
    │  Download SVGs    │
    └────────┬────────┘
               │
               ▼
    ┌─────────────────────┐
    │   GUI Window        │   ← Human picks icon(s)
    │   Dark theme        │
    │   Click to select   │
    └────────┬───────────┘
               │
               ▼
         SVG code to stdout  →  AI agent consumes it

The human acts as a visual judge — the AI remains in full control of the workflow.


Features

  • Native GUI — PySide6 window, no browser required
  • Themable — cream / sky / dark backgrounds via --theme
  • Pagination — 10 icons per page, flip with ‹ / › buttons or ← / → keys; selections persist across pages
  • Iconify API — Access to 150+ icon sets, 500,000+ icons
  • stdout output — SVG code flows directly into the AI's context
  • Cancellation signal — closing the window writes [svg-picker] cancelled: ... to stderr so callers can distinguish user cancel from program crash
  • One-step install — pip install, single command
  • Zero config — No API keys, no servers, no infrastructure

Install

pip install svg-picker

Or for development:

pip install -e .

Usage

svg-picker <keyword> [--theme cream|sky|dark]

Options

Flag Description
-t, --theme <name> Background theme. Choices: cream (default), sky, dark

Examples

svg-picker home                  # default cream theme
svg-picker home --theme sky      # sky blue background
svg-picker arrow -t dark         # dark theme, short flag

Default theme via .env

To set a project-wide default without typing --theme every time, edit .env in the directory you run svg-picker from. On first launch, svg-picker creates an empty .env for you if one doesn't exist — just add a line like:

# .env
SVG_PICKER_THEME=sky

Resolution order: CLI --theme → .env SVG_PICKER_THEME → cream. An invalid value in .env prints a warning to stderr and falls back to the built-in default.

Steps

  1. Window opens with the first page of 10 matching icons
  2. Click to select one or more; click again to deselect
  3. Flip pages with ‹ / › buttons or ← / → keys — selections persist across pages
  4. Press Confirm — SVG source code is printed to stdout, window closes
  5. Close the window (X) to cancel — a [svg-picker] cancelled: ... line is written to stderr

For AI Agents

As a Claude Code Skill

Place this file as ~/.claude/skills/svg-picker.md:

# svg-picker

Pick SVG icons via keyword search with human visual selection.

Usage: svg-picker <keyword> [--theme cream|sky|dark]

The human selects icons from the window. SVG source code is output to stdout.
If the window is closed without confirming, a "[svg-picker] cancelled: ..."
line is written to stderr — read stderr to distinguish cancel from crash.

Programmatic Usage

import subprocess

result = subprocess.run(
    ["svg-picker", "home"],
    capture_output=True, text=True,
)

if result.returncode != 0:
    # 程序异常退出 —— stderr 会有 Python traceback
    raise RuntimeError(f"svg-picker crashed: {result.stderr}")

if "[svg-picker] cancelled" in result.stderr:
    # 用户主动关闭窗口,没点 Confirm
    if "selected but not confirmed" in result.stderr:
        # 选了但没用上 —— 尊重取消意图,不要 fallback
        print("User cancelled with selections discarded")
    else:
        print("User cancelled without selection")
else:
    # 正常完成 —— result.stdout 是 SVG 源码
    svg_code = result.stdout
    # 每段格式:<!-- iconify_id -->\n<svg>...</svg>

Comparison

svg-picker HULA (Atlassian)
Domain Icon selection Full software dev
Scope Minimal, single-task Full agent framework
Human role Visual judge Plan + code reviewer
Deployment pip install Jira plugin
Target AI agents Human engineers

Both share the same core principle: human judgment improves AI output.



License

MIT

Release files for svg-picker 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svg-picker 1.0.0
File Size Uploaded
svg_picker-1.0.0.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for svg-picker 1.0.0
File Interpreter ABI Platform
svg_picker-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / svg_picker-1.0.0.tar.gz

Download URL svg_picker-1.0.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9ce15bf5c79b7460a1f97f32556930c7f470277ab5df9d32cf6d64d3c16a1d8a
BLAKE2b-256 checksum
How to use checksums
4ef0d95c1928464f99ef6e1f6320d0918296d2e198f21c15d19bb229a2cda199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / svg_picker-1.0.0-py3-none-any.whl

Download URL svg_picker-1.0.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be9f674e934f03b6a04abf1ccf41bf437a9a22d569ae9b0610b1408d95d6224e
BLAKE2b-256 checksum
How to use checksums
6cbe89f21222c66778c0422a9dc1d32ef0c28d755715e2b92fed7fb59a651213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page