Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
New package providing CLI tools that work with both Gitea and GitHub:
Commands:
- mosaic-issue-{create,list,view,assign,edit,close,reopen,comment}
- mosaic-pr-{create,list,view,merge,review,close}
- mosaic-milestone-{create,list,close}
Features:
- Auto-detects platform (Gitea vs GitHub) from git remote
- Unified interface regardless of platform
- Available via `pnpm exec mosaic-*` in monorepo context
Updated docs/claude/orchestrator.md:
- Added CLI Tools section with usage examples
- Updated issue creation to use package commands
This makes Mosaic Stack fully self-contained for orchestration tooling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
93 lines
2.2 KiB
Bash
Executable File
93 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# issue-create.sh - Create issues on Gitea or GitHub
|
|
# Usage: issue-create.sh -t "Title" [-b "Body"] [-l "label1,label2"] [-m "milestone"]
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/detect-platform.sh"
|
|
|
|
# Default values
|
|
TITLE=""
|
|
BODY=""
|
|
LABELS=""
|
|
MILESTONE=""
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: $(basename "$0") [OPTIONS]
|
|
|
|
Create an issue on the current repository (Gitea or GitHub).
|
|
|
|
Options:
|
|
-t, --title TITLE Issue title (required)
|
|
-b, --body BODY Issue body/description
|
|
-l, --labels LABELS Comma-separated labels (e.g., "bug,feature")
|
|
-m, --milestone NAME Milestone name to assign
|
|
-h, --help Show this help message
|
|
|
|
Examples:
|
|
$(basename "$0") -t "Fix login bug" -l "bug,priority-high"
|
|
$(basename "$0") -t "Add dark mode" -b "Implement theme switching" -m "0.2.0"
|
|
EOF
|
|
exit 1
|
|
}
|
|
|
|
# Parse arguments
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
-t|--title)
|
|
TITLE="$2"
|
|
shift 2
|
|
;;
|
|
-b|--body)
|
|
BODY="$2"
|
|
shift 2
|
|
;;
|
|
-l|--labels)
|
|
LABELS="$2"
|
|
shift 2
|
|
;;
|
|
-m|--milestone)
|
|
MILESTONE="$2"
|
|
shift 2
|
|
;;
|
|
-h|--help)
|
|
usage
|
|
;;
|
|
*)
|
|
echo "Unknown option: $1" >&2
|
|
usage
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ -z "$TITLE" ]]; then
|
|
echo "Error: Title is required (-t)" >&2
|
|
usage
|
|
fi
|
|
|
|
PLATFORM=$(detect_platform)
|
|
|
|
case "$PLATFORM" in
|
|
github)
|
|
CMD="gh issue create --title \"$TITLE\""
|
|
[[ -n "$BODY" ]] && CMD="$CMD --body \"$BODY\""
|
|
[[ -n "$LABELS" ]] && CMD="$CMD --label \"$LABELS\""
|
|
[[ -n "$MILESTONE" ]] && CMD="$CMD --milestone \"$MILESTONE\""
|
|
eval "$CMD"
|
|
;;
|
|
gitea)
|
|
CMD="tea issue create --title \"$TITLE\""
|
|
[[ -n "$BODY" ]] && CMD="$CMD --description \"$BODY\""
|
|
[[ -n "$LABELS" ]] && CMD="$CMD --labels \"$LABELS\""
|
|
# tea accepts milestone by name directly (verified 2026-02-05)
|
|
[[ -n "$MILESTONE" ]] && CMD="$CMD --milestone \"$MILESTONE\""
|
|
eval "$CMD"
|
|
;;
|
|
*)
|
|
echo "Error: Could not detect git platform" >&2
|
|
exit 1
|
|
;;
|
|
esac
|