Files
enlightenment-ai-plugin/README.md

53 lines
1.9 KiB
Markdown

# Enlightenment AI Prompt Plugin
An AI agent prompt plugin for the [Enlightenment](https://www.enlightenment.org/) Everything launcher.
## Usage
Open the Everything launcher and type `ai:` followed by your question:
```
ai:what is the capital of France
```
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
- **Claude** (Anthropic API) — set `ANTHROPIC_API_KEY` in your environment
- **Ollama** (local LLM) — runs against `http://localhost:11434` by default
Backend is auto-detected: Claude is used when `ANTHROPIC_API_KEY` is set, otherwise Ollama is assumed.
## Configuration
Set these environment variables (e.g. in `~/.profile`):
| Variable | Default | Description |
|---|---|---|
| `ANTHROPIC_API_KEY` | — | Anthropic API key; enables Claude when set |
| `AI_PROVIDER` | auto | Force `"claude"` or `"ollama"` |
| `CLAUDE_MODEL` | `claude-haiku-4-5-20251001` | Claude model to use |
| `OLLAMA_MODEL` | `llama3.2` | Ollama model to use |
| `OLLAMA_HOST` | `http://localhost:11434` | Ollama server base URL |
## 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.
**Files changed:**
| File | Change |
|---|---|
| `src/modules/everything/evry_plug_ai.c` | New plugin (the main implementation) |
| `src/modules/everything/e_mod_main.h` | Added `evry_plug_ai_init/shutdown/save` declarations |
| `src/modules/everything/e_mod_main.c` | Added `evry_plug_ai_init(m)` and `evry_plug_ai_shutdown()` calls |
| `src/modules/everything/meson.build` | Added `evry_plug_ai.c` to the source list |
Then rebuild with meson/ninja.
## Requirements
- `curl` must be available in `PATH` (used to call the AI APIs)
- Enlightenment with the Everything module enabled