From a211b56303aee456120039864893b2a5baab4be7 Mon Sep 17 00:00:00 2001 From: shoko Date: Tue, 7 Apr 2026 05:48:41 +0200 Subject: [PATCH] fix: move msg file to .kugetsu/ and add tea PR creation instructions (#201) --- skills/kugetsu/scripts/kugetsu-session.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/skills/kugetsu/scripts/kugetsu-session.sh b/skills/kugetsu/scripts/kugetsu-session.sh index 52676d6..6c5fb85 100755 --- a/skills/kugetsu/scripts/kugetsu-session.sh +++ b/skills/kugetsu/scripts/kugetsu-session.sh @@ -286,7 +286,9 @@ Workflow: 6. If anything is unclear, post a comment on the issue asking for clarification before implementing 7. Implement the solution 8. Create a branch named fix/issue-$number and implement the fix -9. Create a PR when the implementation is complete +9. Create a PR when the implementation is complete using: tea pr create --repo $owner/$repo --title \"Your PR title\" --body \"PR description\" + - Make sure you are logged in with: tea login add --name gitea --token \$GITEA_TOKEN --url https://$instance + - If tea is not available, use: curl -X POST \"https://$instance/api/v1/repos/$owner/$repo/pulls\" -H \"Authorization: Bearer \$GITEA_TOKEN\" -H \"Content-Type: application/json\" -d '{\"title\":\"PR Title\",\"head\":\"branch-name\",\"base\":\"main\",\"body\":\"PR description\"}' Work directory: $worktree_path" @@ -379,7 +381,11 @@ cmd_start() { cd "$worktree_path" local sanitized_id=$(echo "$new_session_id" | sed 's/[^a-zA-Z0-9_-]/_/g') - local msg_file="$worktree_path/.kugetsu-msg.txt" + mkdir -p "$worktree_path/.kugetsu" + if [ ! -f "$worktree_path/.gitignore" ] || ! grep -q "^.kugetsu/" "$worktree_path/.gitignore"; then + echo ".kugetsu/" >> "$worktree_path/.gitignore" 2>/dev/null || true + fi + local msg_file="$worktree_path/.kugetsu/msg.txt" printf '%s' "$dev_message" > "$msg_file" nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 & @@ -445,7 +451,11 @@ cmd_continue() { cd "$worktree_path" local sanitized_id=$(echo "$opencode_session_id" | sed 's/[^a-zA-Z0-9_-]/_/g') - local msg_file="$worktree_path/.kugetsu-msg.txt" + mkdir -p "$worktree_path/.kugetsu" + if [ ! -f "$worktree_path/.gitignore" ] || ! grep -q "^.kugetsu/" "$worktree_path/.gitignore"; then + echo ".kugetsu/" >> "$worktree_path/.gitignore" 2>/dev/null || true + fi + local msg_file="$worktree_path/.kugetsu/msg.txt" printf '%s' "$message" > "$msg_file" nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$opencode_session_id'" >> "$LOGS_DIR/dev-$sanitized_id.log" 2>&1 & }