Prompt Line

repository·main·Indexed 40 days ago

https://github.com/nkmr-jp/prompt-line

A macOS application designed to improve the prompt input experience for CLI-based AI coding agents such as Claude Code, OpenAI Codex CLI, and Aider. It provides a floating input window featuring context-aware search for files, symbols, and skills, prompt history, and plugin extensibility via YAML configurations.

Tokens
23.2K
Snippets
74
Records
116
Agent score
99%

What's inside Prompt Line

  1. Configure Context Search and Autocomplete

    main

    Prompt Line provides context-aware autocompletion using specific prefixes:

    • / : Search for agent skills and built-in commands.
    • @ : Search for files and directories.
    • @<language>:<query> : Search for code symbols (e.g., @ts:Config for TypeScript symbols).
    • @prefix: : Search for custom contexts (e.g., @agent:, @plan:, @team:) defined via plugins.
  2. Recover symlink aliases using `symlinkScanRoots`

    main

    When working in symlinked directories (e.g., a project in ~/ghq pointing to an iCloud vault), macOS may canonicalize the path to the real location. To ensure file search results show your preferred symlink path instead of the real path, use symlinkScanRoots.

    How it works:

    1. Prompt Line scans each root up to 5 levels deep for symbolic links.
    2. It builds an in-memory map of realpath → alias.
    3. When your CWD's real path matches a target in the map, the alias is substituted before searching.
    4. The cache has a 5-minute TTL, and scans are limited to a 1.5-second budget to prevent UI lag.
    5. Noise directories like node_modules or .git are automatically skipped.

    Usage: Add parent directories that contain your symlinks or the symlinks themselves to the list.

    fileSearch:
      symlinkScanRoots:
        - "~/ghq"                                  # Walks ~/ghq/<host>/<user>/<repo>
        - "~/projects"                             # Walks ~/projects
        - "~/ghq/github.com/foo/vault"             # Specific known symlink
  3. Understand Plugin Types and Triggers

    main

    Plugins are categorized by their purpose and how they are triggered in the UI:

    DirectoryTypeTriggerPurpose
    agent-built-in/Built-in/, @Define commands, skills, and agents for CLI tools
    agent-skills/Agent skills/Load skills from markdown files
    custom-search/Custom search@prefix:Search files, JSON, JSONL, or command output
  4. Use Context Search and Autocomplete in Prompt Line

    main

    Prompt Line supports context-aware searching and autocompletion using special prefixes:

    • Agent Skills and Commands: Type / to search.
    • File and Directory Search: Type @ to search files.
    • Symbol Search: Type @<lang>:<query> (e.g., @ts:Config to search for TypeScript symbols).
    • Custom Search: Type @prefix: to search custom contexts like agents, plans, or teams (extensible via plugins).

    These features allow you to quickly inject context into your prompts for CLI-based AI agents.

  5. Hot Reloading for YAML configurations

    main
    All YAML configuration files are automatically watched using chokidar (with a 300ms debounce). Changes to local directories or plugin directories are detected automatically, and updates are applied without requiring an application restart.
  6. Migrate customSearch to plugins or local YAML files

    main

    The inline customSearch section in settings.yaml is deprecated. You should move these entries to either a plugin or a local YAML file in the ~/.prompt-line/ subdirectories.

    When migrating, combine the old path and pattern fields into a single sourcePath field.

    Example migration:

    Before:

    customSearch:
      - name: "{basename}"
        path: ~/.claude/agents
        pattern: "*.md"
        searchPrefix: agent

    After (using local YAML):

    sourcePath: ~/.claude/agents/*.md
    name: "{basename}"
    searchPrefix: agent
  7. Install and enable plugins in Prompt Line

    main

    Plugins are YAML files that add agent skills (/), custom search (@prefix:), and built-in commands/skills/agents.

    To install a plugin from a remote repository:

    prompt-line plugin install github.com/nkmr-jp/prompt-line-plugins

    After installation, you must enable the specific plugin entries in your ~/.prompt-line/settings.yaml file under the plugins: key.

    To install from a specific version or a local path:

    # Specific version
    prompt-line plugin install github.com/user/my-plugins@v1.0.0
    
    # Local path
    prompt-line plugin install ./local/path
  8. Create an icns icon file from SVG

    main

    To generate a macOS .icns icon file from the original icon.svg, use the provided create_icns.sh script located in the assets directory. The script automates the process of converting the SVG into various PNG sizes using rsvg-convert and then bundling them into an .icns file using iconutil.

    cd assets
    chmod +x create_icns.sh
    ./create_icns.sh
  9. Update Prompt Line

    main

    Depending on your installation method, use the corresponding command to update:

    Homebrew Installation:

    brew upgrade --cask prompt-line

    Source Installation:

    git pull
    pnpm install
    pnpm run install-app
    pnpm run migrate-settings        # Migrates settings to latest defaults (auto-backups)
    # For Homebrew users
    brew upgrade --cask prompt-line
    
    # For source users
    git pull
    pnpm install
    pnpm run install-app
    pnpm run migrate-settings
  10. Install Prompt Line via Homebrew (Cask)

    main

    For Apple Silicon Macs, the easiest way to install Prompt Line is via Homebrew. This method automatically installs required dependencies like fd and ripgrep and links the prompt-line CLI.

    Note: This is an unsigned cask. The installation process automatically removes the quarantine attribute.

    To install:

    brew install --cask nkmr-jp/tap/prompt-line

    To update:

    brew upgrade --cask prompt-line
  11. Build and Install Prompt Line from Source

    main

    If you are on an Intel Mac or prefer building from source, follow these steps.

    Requirements:

    • macOS 13 (Ventura) or later
    • fd and ripgrep (brew install fd ripgrep)
    • Node.js 22.12 or later
    • pnpm
    • Xcode Command Line Tools or Xcode

    Steps:

    git clone https://github.com/nkmr-jp/prompt-line.git
    cd prompt-line
    git checkout prompt-line-v0.x.x  # Optional: replace with desired version tag
    pnpm install
    pnpm run install-app    # Build and install to /Applications

    To Update from Source:

    git pull
    pnpm install
    pnpm run install-app
    pnpm run migrate-settings        # Migrate settings to latest defaults (auto-backup)
    git clone https://github.com/nkmr-jp/prompt-line.git
    cd prompt-line
    pnpm install
    pnpm run install-app