AI pair programmer for your terminal — a Rust CLI that talks to your local AI server.
Whyed Code (whyedcode) is a terminal-based AI coding companion. It runs in your console, reads your messages, sends them to a local AI server (OpenAI-compatible /v1/chat/completions), and prints the assistant's replies. It keeps a conversation history, supports slash commands for configuration, and lets you customize the terminal accent color.
- 🤖 AI chat — sends your input as
usermessages to a local AI server and displaysassistantreplies. - 💬 Conversation history — full message history is sent with each request, so the model remembers context.
- 📜 Slash commands —
/help,/status,/history,/ai,/accent,/clear,/exit,/quit. - 🎨 Customizable accent — choose from orange, blue, green, or purple terminal colors.
- 💾 Persistent history — session history is saved to
~/.whyed/history.json. - 🖥️ Native Windows binary — compiled with Rust, no dependencies required to run.
- Rust toolchain (stable) — only needed if you want to build from source.
- A local AI server listening on
http://localhost:8080/v1(OpenAI-compatible).
cargo build --releaseAfter building, copy the release binary to the project root:
copy target/release/whyedcode.exe whyedcode.exe.\whyedcode.exeOn first launch, ~/.whyed/config.ini is created automatically:
[ai]
api = token-abc123
api_url = http://localhost:8080/v1
[app]
accent = orange
version = v2.0.12-dev
[history]
enabled = true
max_items = 100
save_path = ~/.whyed/history.jsonEdit api_url if your AI server runs on a different address.
Type anything that doesn't start with / to send it to the AI:
~/Documents/whyed_core ❯ explain this Rust function
Slash commands:
| Command | Description |
|---|---|
/help |
Show available commands |
/status |
Show current configuration |
/history |
Show recent conversation history |
/ai |
Show AI settings (key and URL) |
/accent |
List available accent colors |
/accent <name> |
Change accent color (orange, blue, green, purple) |
/clear |
Clear the terminal screen |
/exit / /quit |
Exit the application |
Config file: ~/.whyed/config.ini (Windows: %USERPROFILE%\.whyed\config.ini).
| Section | Key | Default | Description |
|---|---|---|---|
[ai] |
api |
token-abc123 |
Bearer token for the AI server |
[ai] |
api_url |
http://localhost:8080/v1 |
Base URL of your local AI server |
[app] |
accent |
orange |
Terminal accent color |
[app] |
version |
v2.0.12-dev |
Application version |
[history] |
enabled |
true |
Save history to disk |
[history] |
max_items |
100 |
Max history entries kept |
[history] |
save_path |
~/.whyed/history.json |
History file path |
If the AI server is not running, instead of a raw network error you will see:
⚠ Не удалось подключиться к AI-серверу
Проверьте, что сервер запущен на http://localhost:8080/v1
URL ожидается: http://localhost:8080/v1/chat/completions
See the .skills/ folder for markdown skill files that describe the project structure, build process, API protocol, and configuration reference for AI coding assistants.
MIT License. See LICENSE.
Whyed Code (whyedcode) — это AI-партнёр по программированию для терминала. Программа работает в консоли, читает ваши сообщения, отправляет их на локальный сервер ИИ (совместимый с OpenAI /v1/chat/completions) и выводит ответы ассистента. Сохраняет историю беседы, поддерживает слэш-команды для настройки и позволяет изменить цвет акцента терминала.
- 🤖 Чат с ИИ — отправляет ваш ввод как сообщения
userна локальный сервер ИИ и отображает ответыassistant. - 💬 История беседы — полная история сообщений отправляется с каждым запросом, чтобы модель помнила контекст.
- 📜 Слэш-команды —
/help,/status,/history,/ai,/accent,/clear,/exit,/quit. - 🎨 Настраиваемый акцент — выбор из оранжевого, синего, зелёного или фиолетового цветов терминала.
- 💾 Постоянная история — история сеанса сохраняется в
~/.whyed/history.json. - 🖥️ Нативный бинарник для Windows — собран на Rust, дополнительных зависимостей для запуска не требуется.
- Инструментарий Rust (stable) — только если вы хотите собрать из исходников.
- Локальный сервер ИИ, прослушивающий
http://localhost:8080/v1(совместимый с OpenAI).
cargo build --releaseПосле сборки скопируйте релизный бинарник в корень проекта:
copy target/release/whyedcode.exe whyedcode.exe.\whyedcode.exeПри первом запуске автоматически создаётся ~/.whyed/config.ini:
[ai]
api = token-abc123
api_url = http://localhost:8080/v1
[app]
accent = orange
version = v2.0.12-dev
[history]
enabled = true
max_items = 100
save_path = ~/.whyed/history.jsonОтредактируйте api_url, если ваш сервер ИИ запущен по другому адресу.
Введите любой текст, не начинающийся с /, чтобы отправить его ИИ:
~/Documents/whyed_core ❯ объясни эту функцию на Rust
Слэш-команды:
| Команда | Описание |
|---|---|
/help |
Показать доступные команды |
/status |
Показать текущую конфигурацию |
/history |
Показать недавнюю историю беседы |
/ai |
Показать настройки ИИ (ключ и URL) |
/accent |
Список доступных цветов акцента |
/accent <имя> |
Сменить цвет акцента (orange, blue, green, purple) |
/clear |
Очистить экран терминала |
/exit / /quit |
Выйти из приложения |
Файл конфигурации: ~/.whyed/config.ini (Windows: %USERPROFILE%\.whyed\config.ini).
| Секция | Ключ | По умолчанию | Описание |
|---|---|---|---|
[ai] |
api |
token-abc123 |
Токен Bearer для сервера ИИ |
[ai] |
api_url |
http://localhost:8080/v1 |
Базовый URL вашего локального сервера ИИ |
[app] |
accent |
orange |
Цвет акцента терминала |
[app] |
version |
v2.0.12-dev |
Версия приложения |
[history] |
enabled |
true |
Сохранять историю на диск |
[history] |
max_items |
100 |
Максимальное количество записей истории |
[history] |
save_path |
~/.whyed/history.json |
Путь к файлу истории |
Если сервер ИИ не запущен, вместо необработанной сетевой ошибки вы увидите:
⚠ Не удалось подключиться к AI-серверу
Проверьте, что сервер запущен на http://localhost:8080/v1
URL ожидается: http://localhost:8080/v1/chat/completions
В папке .skills/ находятся markdown-файлы навыков, описывающие структуру проекта, процесс сборки, протокол API и справочник конфигурации для ИИ-помощников по кодированию.
Лицензия MIT. См. LICENSE.
whyed_core/
├── .skills/ # AI skill documentation (markdown)
│ ├── api-protocol.md
│ ├── build-run.md
│ ├── config.md
│ ├── project.md
│ └── structure.md
├── src/
│ ├── main.rs # Entry point
│ └── app/
│ ├── mod.rs # Module declarations, run()
│ ├── api.rs # AI HTTP client
│ ├── commands.rs # Slash commands
│ ├── config.rs # INI config parser
│ ├── history.rs # Persistent history
│ ├── input.rs # Line editor (crossterm)
│ ├── render.rs # Box rendering
│ ├── ui.rs # Colors, visible width, padding
│ └── window.rs # Main REPL loop
├── Cargo.toml # Rust manifest
├── Cargo.lock # Locked dependencies
├── config.ini # Default configuration example
├── whyedcode.exe # Release binary (root launcher)
├── whyedcode.cmd # Windows launcher script
├── LICENSE
└── README.md
Contributions are welcome! Please open an issue or pull request on GitHub.
If you encounter issues, please check:
- That your AI server is running on the configured
api_url. - That the endpoint
<api_url>/chat/completionsis reachable. - The
.skills/build-run.mdand.skills/api-protocol.mdfiles for troubleshooting details.
Made with ❤️ and Rust.