fix: change trigger from '?' to 'ai:' to avoid clash with help

This commit is contained in:
2026-06-17 20:48:15 +10:00
parent 811044cf8f
commit fd8d72d968

View File

@@ -4,49 +4,49 @@ An AI agent prompt plugin for the [Enlightenment](https://www.enlightenment.org/
## Usage ## Usage
Open the Everything launcher and type `?` followed by your question: Open the Everything launcher and type `ai:`?`ai:` followed by your question:
``` `ai:``ai:`
?what is the capital of France ?what is the capital of France
``` `ai:``ai:`
The plugin shows **Asking AI...** while waiting, then updates the item with the AI response. Select the item to copy it to clipboard. The plugin shows **Asking AI...** while waiting, then updates the item with the AI response. Select the item to copy it to clipboard.
## Supported backends ## Supported backends
- **Claude** (Anthropic API) — set `ANTHROPIC_API_KEY` in your environment - **Claude** (Anthropic API) — set `ai:`ANTHROPIC_API_KEY`ai:` in your environment
- **Ollama** (local LLM) — runs against `http://localhost:11434` by default - **Ollama** (local LLM) — runs against `ai:`http://localhost:11434`ai:` by default
Backend is auto-detected: Claude is used when `ANTHROPIC_API_KEY` is set, otherwise Ollama is assumed. Backend is auto-detected: Claude is used when `ai:`ANTHROPIC_API_KEY`ai:` is set, otherwise Ollama is assumed.
## Configuration ## Configuration
Set these environment variables (e.g. in `~/.profile`): Set these environment variables (e.g. in `ai:`~/.profile`ai:`):
| Variable | Default | Description | | Variable | Default | Description |
|---|---|---| |---|---|---|
| `ANTHROPIC_API_KEY` | — | Anthropic API key; enables Claude when set | | `ai:`ANTHROPIC_API_KEY`ai:` | — | Anthropic API key; enables Claude when set |
| `AI_PROVIDER` | auto | Force `"claude"` or `"ollama"` | | `ai:`AI_PROVIDER`ai:` | auto | Force `ai:`"claude"`ai:` or `ai:`"ollama"`ai:` |
| `CLAUDE_MODEL` | `claude-haiku-4-5-20251001` | Claude model to use | | `ai:`CLAUDE_MODEL`ai:` | `ai:`claude-haiku-4-5-20251001`ai:` | Claude model to use |
| `OLLAMA_MODEL` | `llama3.2` | Ollama model to use | | `ai:`OLLAMA_MODEL`ai:` | `ai:`llama3.2`ai:` | Ollama model to use |
| `OLLAMA_HOST` | `http://localhost:11434` | Ollama server base URL | | `ai:`OLLAMA_HOST`ai:` | `ai:`http://localhost:11434`ai:` | Ollama server base URL |
## Applying to your Enlightenment source tree ## Applying to your Enlightenment source tree
This repo mirrors the directory structure of the Enlightenment source tree. Copy the files into `src/modules/everything/` in your Enlightenment checkout. This repo mirrors the directory structure of the Enlightenment source tree. Copy the files into `ai:`src/modules/everything/`ai:` in your Enlightenment checkout.
**Files changed:** **Files changed:**
| File | Change | | File | Change |
|---|---| |---|---|
| `src/modules/everything/evry_plug_ai.c` | New plugin (the main implementation) | | `ai:`src/modules/everything/evry_plug_ai.c`ai:` | New plugin (the main implementation) |
| `src/modules/everything/e_mod_main.h` | Added `evry_plug_ai_init/shutdown/save` declarations | | `ai:`src/modules/everything/e_mod_main.h`ai:` | Added `ai:`evry_plug_ai_init/shutdown/save`ai:` declarations |
| `src/modules/everything/e_mod_main.c` | Added `evry_plug_ai_init(m)` and `evry_plug_ai_shutdown()` calls | | `ai:`src/modules/everything/e_mod_main.c`ai:` | Added `ai:`evry_plug_ai_init(m)`ai:` and `ai:`evry_plug_ai_shutdown()`ai:` calls |
| `src/modules/everything/meson.build` | Added `evry_plug_ai.c` to the source list | | `ai:`src/modules/everything/meson.build`ai:` | Added `ai:`evry_plug_ai.c`ai:` to the source list |
Then rebuild with meson/ninja. Then rebuild with meson/ninja.
## Requirements ## Requirements
- `curl` must be available in `PATH` (used to call the AI APIs) - `ai:`curl`ai:` must be available in `ai:`PATH`ai:` (used to call the AI APIs)
- Enlightenment with the Everything module enabled - Enlightenment with the Everything module enabled