Files
PMOCrazycoder/bin/jj-ai-commit.sh
Eric Coissac 2d53f89172 Refactor MCP server structure and add AI commit tool
- Restructure src/ into package src/crazy_mcp with modular tools
- Add jj.py and sandbox.py tool modules for jujutsu and sandbox management
- Remove circular dependency on crazy-mcp from pyproject.toml
- Fix async get_state call in PMOCrazyCoder.py increment tool
- Add bin/jj-ai-commit.sh for AI-generated commit messages from diffs
- Update entrypoint to copy all bin scripts and create config directory
2026-02-21 23:28:22 +00:00

17 lines
626 B
Bash
Executable File

#!/bin/bash
LOCAL_LLM_API=${LOCAL_LLM_API:-http://host.docker.internal:1248/v1}
DIFF=$(jj diff)
PROMPT='Analyse ce diff et réponds UNIQUEMENT avec un objet JSON valide contenant "title" (string) et "message" (string) pour le message de commit. Pas de texte avant ou après le JSON.'
CONTENT="${PROMPT}
${DIFF}"
REQUEST=$(jq -n --arg content "$CONTENT" '{"model": "qwen3-coder", "messages": [{"role": "user", "content": $content}]}')
curl -s -X POST \
-H "Content-Type: application/json" \
-d "$REQUEST" \
"$LOCAL_LLM_API/chat/completions" | jq -r '.choices[0].message.content' | jq -r '.title + "\n\n" + .message'