Initial import: selectel-ml-tui TUI for Selectel AI-router token usage

This commit is contained in:
2026-09-02 16:38:03 +03:00
commit f95223b88b
41 changed files with 6061 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Сборка однофайлового исполняемого файла selectel-ml-tui для macOS.
set -euo pipefail
cd "$(dirname "$0")/.."
make build
echo "Готово: dist/selectel-ml-tui (запуск: ./dist/selectel-ml-tui doctor)"
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Сборка однофайлового исполняемого файла selectel-ml-tui для Linux (Ubuntu).
set -euo pipefail
cd "$(dirname "$0")/.."
make build
echo "Готово: dist/selectel-ml-tui (запуск: ./dist/selectel-ml-tui doctor)"
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Установка selectel-ml-tui на macOS (Homebrew)
set -euo pipefail
brew install python@3.11
cd "$(dirname "$0")/.."
make install
echo "Готово. Запуск: make run или .venv/bin/selectel-ml-tui run"
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Установка selectel-ml-tui на Ubuntu (22.04+)
set -euo pipefail
sudo apt-get update
sudo apt-get install -y python3 python3-venv python3-pip
cd "$(dirname "$0")/.."
make install
echo "Готово. Запуск: make run или .venv/bin/selectel-ml-tui run"
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Запуск selectel-ml-tui с корректным окружением терминала.
# Использование: scripts/run.sh [doctor|run|...]
set -euo pipefail
cd "$(dirname "$0")/.."
# Подстраховка для минималистичных терминалов (tmux/screen, ssh).
if [[ -z "${TERM:-}" ]]; then
export TERM=xterm-256color
fi
if [[ -z "${LANG:-}" ]]; then
export LANG=C.UTF-8
fi
if command -v uv >/dev/null 2>&1; then
exec uv run selectel-ml-tui "$@"
elif command -v selectel-ml-tui >/dev/null 2>&1; then
exec selectel-ml-tui "$@"
else
echo "selectel-ml-tui не найден. Установите через 'pip install .' или 'uv sync'" >&2
exit 1
fi