feat(install): interactive environment setup (URLs + secrets)

- prompt TRACKER_URL (visible, current value as default) and JIRA_TOKEN/GITLAB_TOKEN/provider key (hidden read -rs, never echoed) via /dev/tty (works under curl|bash)
- persist to ~/.config/pi-kit/env.sh (umask 077 => chmod 600), sourced from shell rc via idempotent managed block
- ask provider key only if none already set; empty input keeps existing value; re-runs load stored values as defaults
- non-interactive / PI_KIT_SETUP_ENV=0 falls back to printed guidance
- README documents the flow, env.sh, and the skip switch

Unit-tested: single-quote escaping round-trip, 600 perms, empty-value omission, rc-block idempotency.
This commit is contained in:
2026-07-16 12:56:35 +03:00
parent e98e4ca9ae
commit a6a4d4fee3
2 changed files with 120 additions and 20 deletions

View File

@@ -17,11 +17,15 @@ curl -fsSL https://git.codelab.vc/ai/pi-kit/-/raw/main/install.sh | bash
```
Скрипт проверит Node.js (>= 20), поставит Pi (если нет), установит этот пакет, **спросит
твой профиль**, поставит нужные скилы и подскажет, какие переменные окружения нужны
(ключ вашего LLM-провайдера, `TRACKER_URL`, `JIRA_TOKEN`).
твой профиль**, поставит нужные скилы и **интерактивно настроит окружение** (`TRACKER_URL`,
`JIRA_TOKEN`, `GITLAB_TOKEN`, ключ LLM-провайдера). Секреты вводятся скрыто и сохраняются в
`~/.config/pi-kit/env.sh` (`chmod 600`), который подключается из твоего `~/.zshrc`/`~/.bashrc`.
Pi провайдер-агностичен — модель/провайдера пакет не навязывает, каждый выбирает свой
(Anthropic, OpenAI, OpenRouter, …).
Пропустить интерактивную настройку окружения: `PI_KIT_SETUP_ENV=0`. Значения потом можно
поменять прямо в `~/.config/pi-kit/env.sh` или перезапустив `./install.sh`.
Профиль можно задать заранее (для CI/неинтерактивной установки):
```bash