Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # OpenAgents - GitHub Project Management
  2. # Quick commands for managing your GitHub Project board from the terminal
  3. REPO := darrenhinde/OpenAgents
  4. PROJECT_NUMBER := 2
  5. OWNER := darrenhinde
  6. .PHONY: help idea ideas board labels project-info issue-view issue-comment issue-close bug feature
  7. help: ## Show this help message
  8. @echo "OpenAgents GitHub Project Management"
  9. @echo ""
  10. @echo "Usage: make [target] [ARGS]"
  11. @echo ""
  12. @echo "Targets:"
  13. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
  14. @echo ""
  15. @echo "Examples:"
  16. @echo " make idea TITLE=\"Add eval harness\" BODY=\"Description here\""
  17. @echo " make bug TITLE=\"Fix login error\" BODY=\"Users can't login\""
  18. @echo " make feature TITLE=\"Add dark mode\" PRIORITY=\"high\""
  19. @echo " make ideas"
  20. @echo " make board"
  21. @echo " make issue-view NUM=123"
  22. idea: ## Create a new idea (requires TITLE, optional BODY, PRIORITY, CATEGORY)
  23. @if [ -z "$(TITLE)" ]; then \
  24. echo "Error: TITLE is required"; \
  25. echo "Usage: make idea TITLE=\"Your title\" BODY=\"Description\" PRIORITY=\"high\" CATEGORY=\"agents\""; \
  26. exit 1; \
  27. fi
  28. @LABELS="idea"; \
  29. BODY=$${BODY:-}; \
  30. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  31. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  32. gh issue create \
  33. --repo $(REPO) \
  34. --title "$(TITLE)" \
  35. --body "$$BODY" \
  36. --label "$$LABELS"
  37. bug: ## Create a bug report (requires TITLE, optional BODY, PRIORITY)
  38. @if [ -z "$(TITLE)" ]; then \
  39. echo "Error: TITLE is required"; \
  40. echo "Usage: make bug TITLE=\"Bug description\" BODY=\"Details\" PRIORITY=\"high\""; \
  41. exit 1; \
  42. fi
  43. @LABELS="bug"; \
  44. BODY=$${BODY:-}; \
  45. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  46. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  47. gh issue create \
  48. --repo $(REPO) \
  49. --title "$(TITLE)" \
  50. --body "$$BODY" \
  51. --label "$$LABELS"
  52. feature: ## Create a feature request (requires TITLE, optional BODY, PRIORITY, CATEGORY)
  53. @if [ -z "$(TITLE)" ]; then \
  54. echo "Error: TITLE is required"; \
  55. echo "Usage: make feature TITLE=\"Feature name\" BODY=\"Description\" PRIORITY=\"high\" CATEGORY=\"agents\""; \
  56. exit 1; \
  57. fi
  58. @LABELS="feature"; \
  59. BODY=$${BODY:-}; \
  60. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  61. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  62. gh issue create \
  63. --repo $(REPO) \
  64. --title "$(TITLE)" \
  65. --body "$$BODY" \
  66. --label "$$LABELS"
  67. ideas: ## List all open ideas
  68. @gh issue list --repo $(REPO) --label idea --state open
  69. bugs: ## List all open bugs
  70. @gh issue list --repo $(REPO) --label bug --state open
  71. features: ## List all open features
  72. @gh issue list --repo $(REPO) --label feature --state open
  73. issues: ## List all open issues
  74. @gh issue list --repo $(REPO) --state open
  75. by-priority: ## List issues by priority (requires PRIORITY=high|medium|low)
  76. @if [ -z "$(PRIORITY)" ]; then \
  77. echo "Error: PRIORITY is required"; \
  78. echo "Usage: make by-priority PRIORITY=high"; \
  79. exit 1; \
  80. fi
  81. @gh issue list --repo $(REPO) --label "priority-$(PRIORITY)" --state open
  82. by-category: ## List issues by category (requires CATEGORY=agents|evals|framework|docs)
  83. @if [ -z "$(CATEGORY)" ]; then \
  84. echo "Error: CATEGORY is required"; \
  85. echo "Usage: make by-category CATEGORY=agents"; \
  86. exit 1; \
  87. fi
  88. @gh issue list --repo $(REPO) --label "$(CATEGORY)" --state open
  89. board: ## Open the project board in browser
  90. @open "https://github.com/users/$(OWNER)/projects/$(PROJECT_NUMBER)"
  91. labels: ## List all labels in the repo
  92. @gh label list --repo $(REPO)
  93. project-info: ## Show project information
  94. @gh project view $(PROJECT_NUMBER) --owner $(OWNER)
  95. project-items: ## List all items in the project
  96. @gh project item-list $(PROJECT_NUMBER) --owner $(OWNER) --format json | jq -r '.items[] | "\(.id) - \(.content.title) [\(.content.state)]"'
  97. issue-view: ## View an issue (requires NUM=issue_number)
  98. @if [ -z "$(NUM)" ]; then \
  99. echo "Error: NUM is required"; \
  100. echo "Usage: make issue-view NUM=123"; \
  101. exit 1; \
  102. fi
  103. @gh issue view $(NUM) --repo $(REPO)
  104. issue-comment: ## Comment on an issue (requires NUM and COMMENT)
  105. @if [ -z "$(NUM)" ] || [ -z "$(COMMENT)" ]; then \
  106. echo "Error: NUM and COMMENT are required"; \
  107. echo "Usage: make issue-comment NUM=123 COMMENT=\"Your comment\""; \
  108. exit 1; \
  109. fi
  110. @gh issue comment $(NUM) --repo $(REPO) --body "$(COMMENT)"
  111. issue-close: ## Close an issue (requires NUM)
  112. @if [ -z "$(NUM)" ]; then \
  113. echo "Error: NUM is required"; \
  114. echo "Usage: make issue-close NUM=123"; \
  115. exit 1; \
  116. fi
  117. @gh issue close $(NUM) --repo $(REPO)
  118. # Advanced: Add issue to project (requires ISSUE_URL)
  119. add-to-project: ## Add an issue to the project (requires ISSUE_URL)
  120. @if [ -z "$(ISSUE_URL)" ]; then \
  121. echo "Error: ISSUE_URL is required"; \
  122. echo "Usage: make add-to-project ISSUE_URL=https://github.com/darrenhinde/OpenAgents/issues/123"; \
  123. exit 1; \
  124. fi
  125. @gh project item-add $(PROJECT_NUMBER) --owner $(OWNER) --url "$(ISSUE_URL)"
  126. # Quick shortcuts
  127. .PHONY: new list open high-priority
  128. new: idea ## Alias for 'idea'
  129. list: ideas ## Alias for 'ideas'
  130. open: board ## Alias for 'board'
  131. high-priority: ## List all high priority items
  132. @make by-priority PRIORITY=high