Turn your terminal habits into enemies and defeat them with aliases.
- First-run setup with persistent config at
~/.aliasfight/config.json - Multi-provider AI narration:
- OpenAI (
gpt-4o-mini) - OpenRouter (
openrouter/auto) - Gemini (
gemini-1.5-flash)
- OpenAI (
- Environment variable override support:
OPENAI_API_KEYOPENROUTER_API_KEYGEMINI_API_KEY
- Battle analysis from shell history:
- repeated commands
- long commands (
>30chars) - git frequency
- repeated
cdnavigation
- Rich UI with ASCII banner, enemies panel, upgrades panel, and narration panel
- AI failure-safe fallback narration when API/network fails
python -m pip install .
aliasfightFor editable local development:
pip install -r requirements.txt
python -m aliasfightOn first run, aliasfight asks:
Choose your AI provider:
1. OpenAI
2. OpenRouter
3. Gemini
4. Skip (no AI)
API key (hidden input):
If the key is wrong or cannot be validated, aliasfight tells you and asks you to paste it again.
Then it saves:
{
"provider": "openai",
"api_key": "xxxx"
}at ~/.aliasfight/config.json.
Config priority:
- Environment variables
- Saved config file
- First-run setup prompt
OpenAIvia officialopenaipackageOpenRouterviarequeststo/chat/completionsGeminiviagoogle-generativeai
aliasfight
aliasfight --no-ai
aliasfight --reset-config
aliasfight --add-api
aliasfight --history ~/.zsh_history
# module mode still works
python -m aliasfight
python -m aliasfight --no-ai
python -m aliasfight --reset-config
python -m aliasfight --add-api
python -m aliasfight --history ~/.zsh_historyaliasfight remembers your provider/key in ~/.aliasfight/config.json, so you usually do not need export ... commands.
Use environment variables only if you want a temporary override.
$ python -m aliasfight --reset-config
[yellow]Existing config removed.[/yellow]
Choose your AI provider:
1. OpenAI
2. OpenRouter
3. Gemini
4. Skip (no AI)
Enter choice: 2
API key (hidden input): **************
Summoning openrouter narrator...
To use your own large ASCII art banner, create:
mkdir -p ~/.aliasfight
nano ~/.aliasfight/banner.txtPaste your ASCII art there. aliasfight auto-loads it at startup.
You are a dramatic RPG narrator. Turn these terminal habits into enemies, roast them humorously, and present alias upgrades as power-ups.
If AI is disabled, unconfigured, or fails due to invalid keys/network issues, aliasfight still prints a full battle report with fallback narration.