### Build and Install App for Development Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Builds the application and installs it directly into the /Applications directory, skipping DMG creation. ```bash pnpm run install-app ``` -------------------------------- ### Install a Plugin Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Use this command to install a plugin from a GitHub repository. Ensure the repository exists and is accessible. ```bash prompt-line-plugin install github.com/nkmr-jp/prompt-line-plugins ``` -------------------------------- ### Install Prompt Line Application Source: https://github.com/nkmr-jp/prompt-line/blob/main/README.md Clone the repository, install dependencies, and build/install the application. This includes setting up code signing. ```bash git clone https://github.com/nkmr-jp/prompt-line.git cd prompt-line git checkout v0.x.x # Optional: replace with desired version tag pnpm install pnpm run install-app # Build and install to /Applications (includes code signing setup) ``` -------------------------------- ### Install Plugins Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Installs plugins from a specified local path or a GitHub repository. ```bash pnpm run plugin:install ``` -------------------------------- ### Install Prompt Line Plugins Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Install plugins from GitHub repositories or local paths using the `prompt-line-plugin install` command. Supports specific versions and branches. ```bash # Install from GitHub prompt-line-plugin install github.com/nkmr-jp/prompt-line-plugins # Install specific version/branch prompt-line-plugin install github.com/nkmr-jp/prompt-line-plugins@v1.0.0 prompt-line-plugin install github.com/user/repo@develop # Install from local path prompt-line-plugin install ./my-local-plugins prompt-line-plugin install ~/path/to/plugins # Show help prompt-line-plugin help ``` -------------------------------- ### Install Prompt Line and Global Plugin CLI Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Clone the repository, install dependencies using pnpm, build the application, and link the global plugin CLI. ```bash # Clone the repository git clone https://github.com/nkmr-jp/prompt-line.git cd prompt-line # Install dependencies pnpm install # Build and install to /Applications (includes code signing) pnpm run install-app # Install the global plugin CLI pnpm link ``` -------------------------------- ### Install Python Websockets Library Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Install the necessary library for communicating with the Electron CDP. ```bash pip3 install websockets ``` -------------------------------- ### Local YAML Configuration Example Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Example of a `custom-search` entry in a local YAML file within `~/.prompt-line/`, demonstrating simplified configuration without a dedicated plugin. ```yaml sourcePath: ~/notes/**/*.md name: "{basename}" description: "{heading}" searchPrefix: note shortcut: Ctrl+n ``` -------------------------------- ### Install Prompt Line Plugins Source: https://github.com/nkmr-jp/prompt-line/blob/main/README.md Use this command to install plugins globally. You can specify a GitHub repository and optionally a branch or tag for versioning. ```bash pnpm link ``` ```bash prompt-line-plugin install github.com/nkmr-jp/prompt-line-plugins ``` ```bash prompt-line-plugin install github.com/user/repo@branch # specific version ``` -------------------------------- ### Manage Plugins Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Registers external plugins to extend functionality. Refer to the Plugin Guide for detailed setup instructions. ```yaml plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-built-in/en # Built-in commands, skills, agents | lang: en,ja - claude/agent-skills/commands # sourcePath: ~/.claude/commands/*.md - claude/agent-skills/skills # sourcePath: ~/.claude/skills/**/SKILL.md - claude/custom-search/agents@agent # sourcePath: ~/.claude/agents/*.md - claude/custom-search/history@r # sourcePath: ~/.claude/history.jsonl ``` -------------------------------- ### Regenerate Settings Example Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Updates the `settings.example.yaml` file with the current default settings. ```bash pnpm run generate:settings-example ``` -------------------------------- ### Install Plugin from Git Repository Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Install plugins organized in a Git repository. You can specify a GitHub repository, a specific version tag, or a local path. The plugin files will be copied to `~/.prompt-line/plugins/`. ```bash prompt-line-plugin install github.com/user/my-plugins ``` ```bash prompt-line-plugin install github.com/user/my-plugins@v1.0.0 ``` ```bash prompt-line-plugin install ./local/path ``` -------------------------------- ### Start Prompt-Line in Dev Mode Source: https://github.com/nkmr-jp/prompt-line/blob/main/native/CLAUDE.md Launches the prompt-line application in development mode with debug logging enabled. Ensure you are starting from the correct worktree. ```bash LOG_LEVEL=debug ./node_modules/.bin/electron . ``` -------------------------------- ### Manage Plugins via CLI Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Use the prompt-line-plugin CLI to install or manage plugin sources. ```bash prompt-line-plugin install # Install from local path or GitHub prompt-line-plugin install @ # Install at specific branch/tag/hash prompt-line-plugin help # Show help ``` -------------------------------- ### Built-in Commands Plugin Example Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Define built-in commands, skills, and agents for a tool by creating a YAML file in `~/.prompt-line/agent-built-in/`. This example configures a tool named 'My Tool' with deploy commands, test skills, and a reviewer agent. ```yaml name: My Tool color: blue reference: https://example.com/docs commands: - name: deploy description: Deploy to production argument-hint: "[env]" icon: codicon-rocket skills: - name: test description: Run test suite icon: codicon-beaker agents: - name: reviewer description: Code review agent icon: codicon-eye ``` -------------------------------- ### Custom Search Plugin Example Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Create a custom search plugin by placing a YAML file in `~/.prompt-line/custom-search/`. This example sets up a search for markdown files, using the filename as the name and the first heading as the description. ```yaml sourcePath: ~/notes/**/*.md name: "{basename}" description: "{heading}" searchPrefix: note icon: codicon-note ``` -------------------------------- ### Link Global CLI Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Install the plugin manager globally using pnpm link. ```bash pnpm link prompt-line-plugin install github.com/nkmr-jp/prompt-line-plugins ``` -------------------------------- ### Agent Skill Plugin Example Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Define an agent skill plugin by creating a YAML file in `~/.prompt-line/agent-skills/`. This example configures a skill to use markdown files as a source and extracts metadata for its properties. ```yaml sourcePath: ~/my-project/skills/**/*/SKILL.md name: "{frontmatter@name}" description: "{frontmatter@description}" argumentHint: "{frontmatter@argument-hint}" icon: codicon-edit-sparkle ``` -------------------------------- ### Migrate agentBuiltIn to Plugins Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Example of migrating `agentBuiltIn` configurations to the new `plugins` format. ```yaml agentBuiltIn: - claude ``` ```yaml plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-built-in/en ``` -------------------------------- ### Build Native Tools Source: https://github.com/nkmr-jp/prompt-line/blob/main/native/CLAUDE.md Commands to build, install, clean, and rebuild the native Swift tools. Ensure you are in the 'native' directory. ```bash cd native make all # Build all 4 tools make install # Build + set executable permissions make clean # Remove binaries make rebuild # Clean + rebuild ``` -------------------------------- ### Example Commit Message - Feature Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md An example of a commit message following Angular conventions for a new feature. ```git feat(history): add search functionality to paste history ``` -------------------------------- ### Install Prompt Line Plugin Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Run this command once in your prompt-line project directory to link the plugin globally. This makes the `prompt-line-plugin` command available from any directory. ```bash pnpm link ``` -------------------------------- ### YAML SourcePath Examples Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Demonstrates different ways to specify input files using recursive glob, simple glob, specific files, and JSON with jq filtering. ```yaml sourcePath: ~/.claude/skills/**/*/SKILL.md # Recursive glob ``` ```yaml sourcePath: ~/.claude/commands/*.md # Simple glob ``` ```yaml sourcePath: ~/.claude/history.jsonl # Specific file ``` ```yaml sourcePath: "~/.claude/teams/**/config.json@. | select(.active)" # JSON + jq ``` -------------------------------- ### Enable Plugins in settings.yaml Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Configure which plugins and their specific components to enable by adding entries to your `~/.prompt-line/settings.yaml` file. This example shows how to enable various built-in commands, skills, and custom search entries from a plugin. ```yaml plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-built-in/en # Built-in commands, skills, agents | lang: en, ja - claude/agent-skills/commands # sourcePath: ~/.claude/commands/*.md - claude/agent-skills/skills # sourcePath: ~/.claude/skills/**/SKILL.md - claude/agent-skills/plugin-commands # sourcePath: ~/.claude/plugins/cache/*/*/{latest}/**/commands/*.md - claude/agent-skills/plugin-skills # sourcePath: ~/.claude/plugins/cache/*/*/{latest}/**/SKILL.md - claude/custom-search/agents@agent # sourcePath: ~/.claude/agents/*.md - claude/custom-search/plans@plan # sourcePath: ~/.claude/plans/*.md - claude/custom-search/plugin-agents@agent # sourcePath: ~/.claude/plugins/cache/*/*/{latest}/**/agents/*.md - claude/custom-search/teams@team # sourcePath: ~/.claude/teams/**/config.json - claude/custom-search/history@r # sourcePath: ~/.claude/history.jsonl # - codex/agent-built-in/en # Codex CLI built-in # - gemini/agent-built-in/en # Gemini CLI built-in # - path/custom-search/ghq@ghq?open=iTerm # sourceCommand: ghq list ``` -------------------------------- ### Example Commit Message - Fix Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md An example of a commit message following Angular conventions for a bug fix. ```git fix(window): resolve positioning issue on multi-monitor setups ``` -------------------------------- ### Migrate agentSkills to Plugins Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Example of migrating `agentSkills` configurations to the new `plugins` format. ```yaml agentSkills: - name: "{basename}" description: "{frontmatter@description}" sourcePath: ~/.claude/commands/*.md ``` ```yaml plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-skills/commands # sourcePath: ~/.claude/commands/*.md ``` -------------------------------- ### Configure Shortcut Activation Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Assign keyboard shortcuts in `settings.yaml` to activate specific plugins or searches. This example shows how to bind shortcuts to insert search prefixes and trigger searches. ```yaml shortcuts: Ctrl+g: "input=@ghq:" Ctrl+r: "input=@r:" Ctrl+n: "input=@note:" ``` -------------------------------- ### Run App in Development Mode Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Use this command to start the application in development mode. It automatically enables DEBUG logging. ```bash pnpm start ``` -------------------------------- ### Codicon Icon Examples Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Shows how to set the `icon` field using Codicon class names for different purposes like rockets, terminals, skills, and agents. ```yaml icon: codicon-rocket # Rocket icon ``` ```yaml icon: codicon-terminal # Terminal icon ``` ```yaml icon: codicon-edit-sparkle # Edit sparkle (used for skills) ``` ```yaml icon: codicon-hubot # Robot icon (used for agents) ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Required for resolving native tools compilation errors on macOS. ```bash xcode-select --install ``` -------------------------------- ### Activate Application via AppleScript Source: https://github.com/nkmr-jp/prompt-line/blob/main/native/CLAUDE.md Example of using AppleScript to activate an application, which can be used in conjunction with native tools for end-to-end testing. ```applescript osascript -e 'tell application "Visual Studio Code" to activate' ``` -------------------------------- ### Symbol Search Configuration Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Example of the `symbolSearch` section, including the new `respectGitignore` setting which defaults to `true`. ```yaml symbolSearch: respectGitignore: true # New (default: true) maxSymbols: 200000 timeout: 60000 ``` -------------------------------- ### Agent Skills (Slash Commands) Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Access and search agent skills triggered by '/'. Provides functions to get all skills, search skills by keyword, retrieve file paths, check for individual skill files, and get usage bonuses for sorting. ```APIDOC ## Agent Skills (Slash Commands) Access and search agent skills triggered by `/`. ### Get All Agent Skills Retrieves a list of all available agent skills. ### Method GET ### Endpoint `/api/agentSkills/get` ### Response #### Success Response (200) - **skills** (AgentSkillItem[]) - An array of agent skill objects. ### AgentSkillItem Structure - **name** (string) - The name of the skill. - **description** (string, optional) - A description of the skill. - **argumentHint** (string, optional) - Hint for skill arguments. - **filePath** (string, optional) - The file path of the skill. - **source** (string, optional) - The source of the skill. - **displayName** (string, optional) - The display name of the skill. - **label** (string, optional) - The label for the skill. - **color** (string, optional) - The color associated with the skill. - **icon** (string, optional) - The icon for the skill. - **triggers** (string[], optional) - List of triggers for the skill. ### Search Agent Skills Searches for agent skills matching a given keyword. ### Method GET ### Endpoint `/api/agentSkills/get/{keyword}` ### Parameters #### Path Parameters - **keyword** (string) - The keyword to search for. ### Response #### Success Response (200) - **filteredSkills** (AgentSkillItem[]) - An array of agent skill objects matching the keyword. ### Get File Path for a Skill Retrieves the file path for a specific agent skill. ### Method GET ### Endpoint `/api/agentSkills/getFilePath/{skillName}` ### Parameters #### Path Parameters - **skillName** (string) - The name of the skill. ### Response #### Success Response (200) - **filePath** (string | null) - The file path of the skill, or null if not found. ### Check if Skill Has Individual File Checks if a specific agent skill has an associated individual file. ### Method GET ### Endpoint `/api/agentSkills/hasFile/{skillName}` ### Parameters #### Path Parameters - **skillName** (string) - The name of the skill. ### Response #### Success Response (200) - **hasFile** (boolean) - True if the skill has an individual file, false otherwise. ### Get Usage Bonuses for Sorting Retrieves usage bonuses for a list of skills, used for sorting purposes. ### Method POST ### Endpoint `/api/agentSkills/getUsageBonuses` ### Parameters #### Request Body - **skillNames** (string[]) - An array of skill names. ### Response #### Success Response (200) - **bonuses** (Record) - An object mapping skill names to their usage bonuses. ``` -------------------------------- ### Update Prompt Line Source: https://github.com/nkmr-jp/prompt-line/blob/main/README.md Update Prompt Line by pulling the latest changes, installing dependencies, rebuilding the app, and migrating settings. ```bash git pull pnpm install pnpm run install-app pnpm run migrate-settings # Migrate settings to latest defaults (auto-backup) ``` -------------------------------- ### Test Directory Detector Source: https://github.com/nkmr-jp/prompt-line/blob/main/native/CLAUDE.md Example of directly testing the directory-detector tool with a specific bundle ID. This helps verify its functionality outside the main application. ```bash ./dist/native-tools/directory-detector detect --bundleId com.microsoft.VSCode ``` -------------------------------- ### Configure Symbol Search Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Settings for symbol indexing triggered by @lang:query. Requires the ripgrep utility to be installed. ```yaml symbolSearch: respectGitignore: true # Respect .gitignore files maxSymbols: 200000 # Maximum number of symbols to index timeout: 60000 # Search timeout in milliseconds #rgPath: null # Custom path to rg (null = auto-detect) includePatterns: [] # Force include (e.g., ["*.test.ts", "vendor/**"]) excludePatterns: [] # Additional excludes (e.g., ["*.generated.go"]) ``` -------------------------------- ### Configure File Search Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Settings for the file search feature triggered by @. Requires the fd utility to be installed. ```yaml fileSearch: respectGitignore: true # Respect .gitignore files (fd only) includeHidden: true # Include hidden files (starting with .) maxFiles: 100000 # Maximum number of files to index maxDepth: null # Directory depth limit (null = unlimited) maxSuggestions: 50 # Max suggestions shown in popup followSymlinks: false # Follow symbolic links during search #fdPath: null # Custom path to fd (null = auto-detect) includePatterns: [] # Force include even if in .gitignore (e.g., ["*.log", "dist/**"]) excludePatterns: [] # Additional excludes (e.g., ["node_modules", "*.min.js"]) ``` -------------------------------- ### Run Tests in Watch Mode Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Starts the test runner in watch mode, automatically re-running tests when files change. ```bash pnpm run test:watch ``` -------------------------------- ### Migrate customSearch to Plugin or Local YAML Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Example of migrating inline `customSearch` entries using `path` and `pattern` to a format suitable for plugins or local YAML files. ```yaml customSearch: - name: "{basename}" path: ~/.claude/agents pattern: "*.md" searchPrefix: agent ``` ```yaml sourcePath: ~/.claude/agents/*.md name: "{basename}" searchPrefix: agent ``` -------------------------------- ### Check Ripgrep Availability for Code Search Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Verify if ripgrep is installed and accessible for code symbol searching. Returns availability status, path, and version if found. ```typescript const rgCheck = await window.electronAPI.codeSearch.checkRg(); // Returns: { available: boolean, path?: string, version?: string } ``` -------------------------------- ### Get File Usage Bonuses Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve usage bonuses for a list of files, calculated based on historical usage data. Returns a record mapping file paths to their bonus values. ```typescript const bonuses = await window.electronAPI.usageHistory.getFileUsageBonuses([ '/path/to/file1.ts', '/path/to/file2.ts' ]); // Returns: Record ``` -------------------------------- ### Run Settings Migration Command Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md Execute this command to automatically back up your current settings and replace them with the latest defaults. ```bash pnpm run migrate-settings ``` -------------------------------- ### Code Search (Symbol Search) Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Search code symbols using ripgrep with '@lang:query' syntax. Includes functions to check ripgrep availability, get supported languages, search symbols, get cached symbols, and clear the symbol cache. ```APIDOC ## Code Search (Symbol Search) Search code symbols using ripgrep with `@lang:query` syntax. ### Check Ripgrep Availability Checks if ripgrep is available and provides its path and version. ### Method GET ### Endpoint `/api/codeSearch/checkRg` ### Response #### Success Response (200) - **rgCheck** ({ available: boolean, path?: string, version?: string }) - An object indicating ripgrep availability and details. ### Get Supported Languages Retrieves a list of languages supported by the code search functionality. ### Method GET ### Endpoint `/api/codeSearch/getSupportedLanguages` ### Response #### Success Response (200) - **languagesInfo** ({ languages: string[] }) - An object containing a list of supported language identifiers. ### Search Symbols Searches for code symbols within a specified project and language. ### Method POST ### Endpoint `/api/codeSearch/searchSymbols` ### Parameters #### Request Body - **projectPath** (string) - The path to the project directory. - **language** (string) - The programming language to search within. - **options** ({ query: string, maxResults?: number }) - Search options, including the query string and maximum number of results. ### Response #### Success Response (200) - **symbolResults** (SymbolSearchResult) - The results of the symbol search. ### Get Cached Symbols Retrieves cached symbols for a given project and language. ### Method GET ### Endpoint `/api/codeSearch/getCachedSymbols` ### Parameters #### Query Parameters - **projectPath** (string) - The path to the project directory. - **language** (string) - The programming language. ### Response #### Success Response (200) - **cachedSymbols** (SymbolSearchResult) - The cached symbol search results. ### Clear Symbol Cache Clears the symbol cache for a specific project. ### Method DELETE ### Endpoint `/api/codeSearch/clearCache` ### Parameters #### Query Parameters - **projectPath** (string) - The path to the project directory. ``` -------------------------------- ### Build Application and DMG Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Compiles the application and creates a DMG disk image for the current architecture. ```bash pnpm run build ``` -------------------------------- ### Migrate Prompt Line Settings Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Run the migration command to update settings to the latest defaults, creating a backup of the current settings file. ```bash # Run migration command pnpm run migrate-settings # Creates backup: ~/.prompt-line/settings.backup..yaml # Replaces with: latest default settings ``` -------------------------------- ### Prompt Line Settings Configuration Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Configure window behavior, shortcuts, plugins, file search, symbol search, and file opener preferences in settings.yaml. Settings are hot-reloaded on changes. ```yaml # Window: active-text-field | active-window-center | cursor | center window: position: active-text-field width: 640 height: 320 # Shortcuts (key → action) shortcuts: Cmd+Shift+Space: main # Show/hide the input window (global) Cmd+Enter: paste # Paste text and close window Escape: close # Close window without pasting Ctrl+j: historyNext # Navigate to next history item Ctrl+k: historyPrev # Navigate to previous history item Cmd+f: search # Enable search mode in history Ctrl+g: "input=@ghq:" # Custom action: insert @ghq: into input # Plugins (refs: `prompt-line-plugin help`) plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-built-in/en # Built-in commands, skills, agents - claude/agent-skills/commands # sourcePath: ~/.claude/commands/*.md - claude/agent-skills/skills # sourcePath: ~/.claude/skills/**/SKILL.md - claude/custom-search/agents@agent # sourcePath: ~/.claude/agents/*.md - claude/custom-search/history@r # sourcePath: ~/.claude/history.jsonl # File search (@path/to/file) — requires fd (brew install fd) fileSearch: respectGitignore: true includeHidden: true maxFiles: 100000 maxDepth: null maxSuggestions: 50 followSymlinks: false includePatterns: [] excludePatterns: [] # Symbol search (@lang:query) — requires ripgrep (brew install ripgrep) symbolSearch: respectGitignore: true maxSymbols: 200000 timeout: 60000 includePatterns: [] excludePatterns: [] # File opener (priority: extensions > directories > defaultEditor > system default) fileOpener: defaultEditor: "Visual Studio Code" extensions: png: "Preview" pdf: "Preview" go: "GoLand" directories: - path: "~/ghq/github.com/my-org/my-go*" editor: "GoLand" ``` -------------------------------- ### Get and Search Agents Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve all agents or search for specific agents by name. Requires the `agents.get` method. ```typescript const agents = await window.electronAPI.agents.get(); // Returns: AgentItem[] ``` ```typescript const filtered = await window.electronAPI.agents.get('reviewer'); ``` -------------------------------- ### Run All Tests Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Executes the entire test suite for the project. ```bash pnpm test ``` -------------------------------- ### Get Agent File Path Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve the file path associated with a specific agent. Requires the `agents.getFilePath` method. ```typescript const filePath = await window.electronAPI.agents.getFilePath('reviewer'); ``` -------------------------------- ### Configure Window Settings Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Defines the window's appearance and positioning behavior. Changes are hot-reloaded with a 300ms debounce. ```yaml window: position: active-text-field # Where the window appears (see below) width: 640 # Recommended: 400-800 pixels height: 320 # Recommended: 200-400 pixels ``` -------------------------------- ### Development Commands Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Essential commands for building, testing, and developing Prompt Line using pnpm. ```bash # Development mode (with debug logging) pnpm start ``` ```bash # Run all tests pnpm test ``` ```bash # Run tests in watch mode pnpm run test:watch ``` ```bash # Run specific test file pnpm test tests/unit/utils.test.js ``` ```bash # Run tests matching pattern pnpm test -- --testNamePattern="formatTimeAgo" ``` ```bash # TypeScript type checking pnpm run typecheck ``` ```bash # Lint and fix pnpm run lint:fix ``` ```bash # Build application (creates DMG) pnpm run build ``` ```bash # Build and install directly to /Applications pnpm run install-app ``` ```bash # Generate settings.example.yaml from defaults pnpm run generate:settings-example ``` ```bash # Reset accessibility permissions pnpm run reset-accessibility ``` -------------------------------- ### Get and Search Agent Skills Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve all agent skills or search for specific skills by name. Requires the `agentSkills.get` method. ```typescript const skills = await window.electronAPI.agentSkills.get(); // Returns: AgentSkillItem[] ``` ```typescript const filtered = await window.electronAPI.agentSkills.get('deploy'); ``` -------------------------------- ### Create Agent Skills Plugin Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Load slash commands from markdown files with frontmatter extraction. ```APIDOC ## Create Agent Skills Plugin ### Description Load slash commands from markdown files with frontmatter extraction. ### Configuration Example ```yaml # ~/.prompt-line/agent-skills/my-skills.yaml sourcePath: ~/my-project/skills/**/*/SKILL.md name: "{frontmatter@name}" description: "{frontmatter@description}" argumentHint: "{frontmatter@argument-hint}" label: global icon: codicon-edit-sparkle triggers: ["/", "$"] # Activates with both / and $ ``` ``` -------------------------------- ### YAML Shortcuts Format (Before v0.30) Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md The previous format for defining shortcuts in `settings.yaml`. ```yaml shortcuts: main: Cmd+Shift+Space paste: Cmd+Enter close: Escape historyNext: Ctrl+j historyPrev: Ctrl+k search: Cmd+f ``` -------------------------------- ### Perform Full Build Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Executes a complete build process including TypeScript compilation, Vite renderer build, and native tool compilation. ```bash pnpm run compile ``` -------------------------------- ### Get Cached Code Symbols Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve code symbols from the local cache for a given project and language. This is faster than performing a full search. ```typescript const cached = await window.electronAPI.codeSearch.getCachedSymbols('/path/to/project', 'ts'); ``` -------------------------------- ### YAML Shortcuts Format (After v0.30) Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/migration.md The new format for shortcuts, recommended for its support of custom actions. Both formats are auto-detected. ```yaml shortcuts: Cmd+Shift+Space: main # Show/hide the input window (global) Cmd+Enter: paste # Paste text and close window Escape: close # Close window without pasting Ctrl+j: historyNext # Navigate to next history item Ctrl+k: historyPrev # Navigate to previous history item Cmd+f: search # Enable search mode in history # Ctrl+m: "input=@md:" # Custom action # Ctrl+g: "input=@ghq:" ``` -------------------------------- ### Configure Plugin System Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Define plugins using either the simple string array format (v1) or the structured Record format (v2). ```yaml plugins: github.com/nkmr-jp/prompt-line-plugins: - claude/agent-built-in/claude - claude/agent-skills/commands ``` -------------------------------- ### Get Maximum Custom Search Suggestions Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve the maximum number of suggestions that can be displayed for a given custom search context. Useful for UI configuration. ```typescript const max = await window.electronAPI.customSearch.getMaxSuggestions('mention'); // Returns: number ``` -------------------------------- ### Cleanup Commands Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Reference for various cleanup tasks to manage build artifacts and cache. ```bash pnpm run clean ``` ```bash pnpm run clean:cache ``` ```bash pnpm run clean:full ``` -------------------------------- ### Get Custom Search Prefixes Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve a list of available search prefixes for custom search operations. Useful for autocompletion or understanding search capabilities. ```typescript const prefixes = await window.electronAPI.customSearch.getSearchPrefixes('mention'); // Returns: string[] (e.g., ['agent', 'plan', 'team', 'r']) ``` -------------------------------- ### Plugin Configuration Schemas Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Overview of the YAML configuration structures for defining different plugin types in prompt-line. ```APIDOC ## Plugin Configuration ### Description Defines how to configure plugins for prompt-line using YAML files. Plugins are categorized into agent-built-in, agent-skills, and custom-search. ### Configuration Fields - **sourcePath** (string) - Required* - Glob path to source files. - **sourceCommand** (string) - Required* - Shell command for data source. - **name** (string) - Required - Display name template. - **description** (string) - Optional - Description template. - **label** (string) - Optional - UI badge label. - **color** (string) - Optional - Badge color. - **icon** (string) - Optional - Codicon icon name. - **argumentHint** (string) - Optional - Argument hint template. - **searchPrefix** (string) - Optional - Activation prefix for custom-search (e.g., @prefix:). - **runCommand** (string) - Optional - Shell command executed on Ctrl+Enter. ### Configuration Example (Custom Search) ```yaml sourcePath: ~/.claude/agents/*.md searchPrefix: agent name: "{basename}(agent)" label: global description: "{frontmatter@description}" icon: codicon-hubot ``` ``` -------------------------------- ### Show Prompt Line Window Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Display the Prompt Line application window. This is the counterpart to `hide()` and brings the application to the foreground. ```typescript await window.electronAPI.window.show(); ``` -------------------------------- ### Custom Search Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Configure and execute custom search operations. Includes functions to get search prefixes, maximum suggestions, and execute custom search commands. ```APIDOC ## Custom Search Configure and execute custom search operations. ### Get Search Prefixes Retrieves search prefixes for a given context. ### Method GET ### Endpoint `/api/customSearch/getSearchPrefixes/{context}` ### Parameters #### Path Parameters - **context** (string) - The context for which to retrieve prefixes (e.g., 'mention'). ### Response #### Success Response (200) - **prefixes** (string[]) - An array of search prefixes. ### Get Max Suggestions Retrieves the maximum number of suggestions for a given context. ### Method GET ### Endpoint `/api/customSearch/getMaxSuggestions/{context}` ### Parameters #### Path Parameters - **context** (string) - The context for which to retrieve the maximum suggestions. ### Response #### Success Response (200) - **maxSuggestions** (number) - The maximum number of suggestions. ### Execute Custom Search Command Executes a custom search command. ### Method POST ### Endpoint `/api/customSearch/executeCommand` ### Parameters #### Request Body - **command** (string) - The custom search command to execute. ### Response #### Success Response (200) - **result** ({ success: boolean, output?: string, error?: string }) - The result of the command execution, indicating success, output, or error. ``` -------------------------------- ### Configure Custom Search Plugin for Command Output Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Create a custom search plugin that indexes the output of a command. Use `sourceCommand` to specify the command (e.g., `ghq list`) and template variables like `{line}` to represent each line of the command's output. ```yaml # ~/.prompt-line/custom-search/repos.yaml # Search command output sourceCommand: "ghq list" name: "{line}" searchPrefix: ghq # Activated by @ghq: icon: codicon-repo color: rose runCommand: "open -a iTerm ~/ghq/{line}" inputFormat: "~/ghq/{line}" maxSuggestions: 100 ``` -------------------------------- ### Agents (Custom Search) Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Access agents triggered by '@prefix:'. Provides functions to retrieve all agents, search agents by keyword, and get agent file paths. ```APIDOC ## Agents (Custom Search) Access agents triggered by `@prefix:`. ### Get All Agents Retrieves a list of all available agents. ### Method GET ### Endpoint `/api/agents/get` ### Response #### Success Response (200) - **agents** (AgentItem[]) - An array of agent objects. ### AgentItem Structure - **name** (string) - The name of the agent. - **description** (string, optional) - A description of the agent. - **filePath** (string, optional) - The file path of the agent. - **label** (string, optional) - The label for the agent. - **color** (string, optional) - The color associated with the agent. - **icon** (string, optional) - The icon for the agent. - **displayTime** (string, optional) - Display time information. - **runCommand** (string, optional) - The command to run the agent. ### Search Agents Searches for agents matching a given keyword. ### Method GET ### Endpoint `/api/agents/get/{keyword}` ### Parameters #### Path Parameters - **keyword** (string) - The keyword to search for. ### Response #### Success Response (200) - **filteredAgents** (AgentItem[]) - An array of agent objects matching the keyword. ### Get Agent File Path Retrieves the file path for a specific agent. ### Method GET ### Endpoint `/api/agents/getFilePath/{agentName}` ### Parameters #### Path Parameters - **agentName** (string) - The name of the agent. ### Response #### Success Response (200) - **filePath** (string | null) - The file path of the agent, or null if not found. ``` -------------------------------- ### Get Supported Languages for Code Search Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve a list of programming languages supported by the code search functionality. The result includes an array of language identifiers. ```typescript const { languages } = await window.electronAPI.codeSearch.getSupportedLanguages(); // Returns: { languages: SupportedLanguage[] } // Supported: go, ts, tsx, js, jsx, py, rs, java, kt, swift, rb, cpp, c, sh, make, php, cs, scala, tf, md ``` -------------------------------- ### Run Pre-Push Checks Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Executes all pre-push checks, including linting, type checking, and the full test suite. ```bash pnpm run pre-push ``` -------------------------------- ### Get Agent Skill File Path Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve the file path associated with a specific agent skill. Returns `string | null` if the skill does not have an associated file. ```typescript const filePath = await window.electronAPI.agentSkills.getFilePath('commit'); // Returns: string | null ``` -------------------------------- ### Debug Electron with CDP Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Commands to initiate Electron with remote debugging enabled and retrieve the WebSocket URL. ```bash LOG_LEVEL=debug ./node_modules/.bin/electron . --remote-debugging-port=9222 ``` ```bash curl http://localhost:9222/json/list ``` -------------------------------- ### Configure agent-skills plugin Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/plugins.md Maps markdown files to skills or commands using frontmatter templates. ```yaml sourcePath: ~/.claude/skills/**/*/SKILL.md name: "{frontmatter@name}" label: global description: "{frontmatter@description}" argumentHint: "{frontmatter@argument-hint}" icon: codicon-edit-sparkle ``` ```yaml sourcePath: ~/.claude/commands/*.md name: "{basename}" description: "{frontmatter@description}" icon: codicon-terminal ``` ```yaml sourcePath: ~/prompts/*.md name: "{basename}" description: "{heading}" triggers: ["/", "$"] # Activates with both / and $ ``` -------------------------------- ### Define Keyboard Shortcuts Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Maps key combinations to built-in or custom actions. Custom actions use the input= format to inject content into the input field. ```yaml shortcuts: Cmd+Shift+Space: main # Show/hide the input window (global) Cmd+Enter: paste # Paste text and close window Escape: close # Close window without pasting Ctrl+j: historyNext # Navigate to next history item Ctrl+k: historyPrev # Navigate to previous history item Cmd+f: search # Enable search mode in history # Custom actions Ctrl+m: "input=@md:" # Insert @md: into input field Ctrl+g: "input=@ghq:" # Insert @ghq: into input field ``` -------------------------------- ### Get Agent Usage Bonuses Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Retrieve usage bonuses for a list of agents, based on their historical usage frequency. Returns a record mapping agent names to their bonus values. ```typescript const agentBonuses = await window.electronAPI.usageHistory.getAgentUsageBonuses(['reviewer', 'explorer']); ``` -------------------------------- ### Get Symbol Usage Bonuses Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Fetch usage bonuses for a list of code symbols, based on their historical usage. Returns a record mapping symbol identifiers to their bonus values. ```typescript const symbolBonuses = await window.electronAPI.usageHistory.getSymbolUsageBonuses([ { filePath: '/path/to/file.ts', symbolName: 'MyFunction' } ]); ``` -------------------------------- ### Get Agent Skill Usage Bonuses Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Fetch usage bonuses for a list of agent skills, useful for sorting. Returns a record mapping skill names to their bonus values. ```typescript const bonuses = await window.electronAPI.agentSkills.getUsageBonuses(['commit', 'test']); // Returns: Record ``` -------------------------------- ### Create Agent Built-in Plugin Configuration Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Define built-in commands, skills, and agents for CLI tools in YAML format for Prompt Line plugins. Specify name, color, icon, and reference URL. ```yaml # ~/.prompt-line/agent-built-in/my-tool.yaml name: My Tool color: amber icon: codicon-tools reference: https://example.com/docs commands: - name: deploy description: Deploy to production argument-hint: "[env]" icon: codicon-rocket - name: test description: Run test suite argument-hint: "[--watch]" skills: - name: batch description: Run batch operations icon: codicon-run-all agents: - name: reviewer description: Code review agent icon: codicon-eye ``` -------------------------------- ### Configure Agent Skills Plugin Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Define agent skills by loading slash commands from markdown files with frontmatter extraction. Use `sourcePath` to specify the markdown files and template variables to extract `name`, `description`, and `argumentHint` from the frontmatter. ```yaml # ~/.prompt-line/agent-skills/my-skills.yaml sourcePath: ~/my-project/skills/**/*/SKILL.md name: "{frontmatter@name}" description: "{frontmatter@description}" argumentHint: "{frontmatter@argument-hint}" label: global icon: codicon-edit-sparkle triggers: ["/", "$"] # Activates with both / and $ ``` -------------------------------- ### Load Real User Data for Testing Source: https://github.com/nkmr-jp/prompt-line/blob/main/tests/fixtures/scoring/README.md Import and use utilities to load real user data for testing. `loadRealTestData` fetches history, file usage, commands, and agents, while `getHistoryStats` provides statistics on history data. `loadJsonl` is a generic loader. ```typescript import { loadRealTestData, getHistoryStats } from './tests/fixtures/scoring'; const realData = await loadRealTestData(); const stats = getHistoryStats(realData.history); console.log(`Total history entries: ${stats.total}`); console.log(`Last 24h: ${stats.last24h}`); console.log(`Average text length: ${stats.avgTextLength}`); ``` -------------------------------- ### Perform Full Cleanup Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Conducts a comprehensive cleanup, removing both build artifacts and caches. ```bash pnpm run clean:full ``` -------------------------------- ### Configure File Opener Source: https://github.com/nkmr-jp/prompt-line/blob/main/docs/en/settings.md Defines which applications open specific file types or directories when Cmd+clicking a path reference. ```yaml fileOpener: defaultEditor: "Visual Studio Code" # null = system default (macOS "open" command) extensions: # Extension-specific apps (overrides defaultEditor) go: "GoLand" py: "PyCharm" png: "Preview" pdf: "Preview" directories: # Directory-specific editors (glob: ~, *, **) - path: "~/ghq/github.com/my-org/my-go*" editor: "GoLand" ``` -------------------------------- ### Configure Custom Search Plugin for Markdown Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Create a custom search plugin to find markdown files. Use `sourcePath` to specify the markdown files and template variables like `{basename}` and `{heading}` to define the name and description of search results. ```yaml # ~/.prompt-line/custom-search/my-notes.yaml # Search markdown files sourcePath: ~/notes/**/*.md name: "{basename}" description: "{heading}" searchPrefix: note # Activated by @note: icon: codicon-note orderBy: "{updatedAt} desc" displayTime: "{updatedAt}" inputFormat: "{filepath}" ``` -------------------------------- ### Verify Prompt-Line Process Source: https://github.com/nkmr-jp/prompt-line/blob/main/native/CLAUDE.md Checks the running processes to confirm the prompt-line Electron application is running from the expected worktree path. ```bash ps -ax -o command | grep "Electron \." | grep prompt-line ``` -------------------------------- ### Reveal File in Finder Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Show the specified file in the system's file explorer (e.g., Finder on macOS, Explorer on Windows). ```typescript await window.electronAPI.file.revealInFinder('/path/to/file.ts'); ``` -------------------------------- ### Fallback Syntax for Description Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Illustrates a fallback syntax for the `description` field, which uses the value from `frontmatter@description` if available, otherwise falls back to the `{heading}`. ```yaml # Fallback syntax: uses right side if left is empty description: "{frontmatter@description}|{heading}" ``` -------------------------------- ### Generate Test Coverage Report Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Generates a comprehensive test coverage report for the project. ```bash pnpm run test:coverage ``` -------------------------------- ### Run Specific Test File Source: https://github.com/nkmr-jp/prompt-line/blob/main/CLAUDE.md Executes a single test file, useful for focused debugging. ```bash pnpm test tests/unit/utils.test.js ``` -------------------------------- ### Electron API - History Management Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Manage paste history with JSONL storage. ```APIDOC ## Electron API - History Management ### Description Manage paste history with JSONL storage. ### Methods ```typescript // Get recent history (up to 5000 items for search) const history = await window.electronAPI.history.get({ limit: 100, offset: 0 }); // Returns: HistoryItem[] // Search history const results = await window.electronAPI.history.search('search query'); // Returns: HistoryItem[] // Remove a history item await window.electronAPI.history.remove('item-id'); // Clear history cache (preserves file) await window.electronAPI.history.clear(); // History item structure interface HistoryItem { id: string; text: string; timestamp: number; appName?: string; directory?: string; itermSessionId?: string; } ``` ``` -------------------------------- ### File Operations Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Open files in configured editors and navigate the filesystem. Includes functions to open files, check existence, reveal in Finder, and open external URLs. ```APIDOC ## File Operations Open files in configured editors and navigate the filesystem. ### Open File in Editor Opens a file in the configured editor, optionally specifying a line number. ### Method POST ### Endpoint `/api/file/openInEditor` ### Parameters #### Request Body - **filePath** (string) - The path to the file, optionally including a line number (e.g., '/path/to/file.ts:42'). ### Response #### Success Response (200) - **result** ({ success: boolean, error?: string }) - Indicates if the file was opened successfully and provides an error message if not. ### Check if File Exists Checks if a file exists at the specified path. ### Method GET ### Endpoint `/api/file/checkExists` ### Parameters #### Query Parameters - **filePath** (string) - The path to the file. ### Response #### Success Response (200) - **exists** (boolean) - True if the file exists, false otherwise. ### Reveal in Finder Reveals the specified file or directory in the system's file explorer (e.g., Finder on macOS, Explorer on Windows). ### Method POST ### Endpoint `/api/file/revealInFinder` ### Parameters #### Request Body - **path** (string) - The path to the file or directory. ### Open External URL Opens an external URL in the default web browser. ### Method POST ### Endpoint `/api/shell/openExternal` ### Parameters #### Request Body - **url** (string) - The URL to open (must be http or https). ``` -------------------------------- ### Focus Prompt Line Window Source: https://context7.com/nkmr-jp/prompt-line/llms.txt Bring the Prompt Line application window into focus, ensuring it is the active window on the screen. ```typescript await window.electronAPI.window.focus(); ```