Convert roadmaps to GitHub issues
Project description
Gitscaffold – Generate GitHub Issues from Markdown & YAML Roadmaps
Gitscaffold is a command-line tool and GitHub Action that primarily converts unstructured Markdown documents into GitHub issues and milestones using AI-driven extraction and enrichment. It also supports structured roadmap files (YAML/JSON) when you need strict schemas and milestones.
Key Features
- AI-Powered Issue Extraction: Convert free-form Markdown documents into structured GitHub issues using OpenAI.
- Structured Roadmap Support: Generate issues and milestones from YAML or JSON roadmap files.
- Roadmap Synchronization (
sync): Compare your roadmap with an existing GitHub repository and interactively create missing issues to keep them aligned. - Bulk Delete Closed Issues (
delete-closed): Clean up your repository by permanently removing all closed issues, with dry-run and confirmation steps. - AI Enrichment: Enhance issue descriptions with AI-generated content for clarity and context.
- Roadmap Initialization: Quickly scaffold a new roadmap template file.
- Flexible Authentication: Supports GitHub tokens and OpenAI keys via environment variables,
.envfiles, or command-line options.
Installation
pip install gitscaffold
Authentication and API Keys
gitscaffold requires a GitHub Personal Access Token (PAT) for interacting with GitHub and an OpenAI API key for AI-driven features.
You can provide these keys in a few ways:
- Environment Variables: Set
GITHUB_TOKENandOPENAI_API_KEYin your shell. .envfile: Create a.envfile in your project's root directory.gitscaffoldwill automatically load it.GITHUB_TOKEN="your_github_personal_access_token" OPENAI_API_KEY="your_openai_api_key"- GitHub Token (
GITHUB_TOKEN):- You'll need a Personal Access Token (PAT).
- For operations on existing repositories (e.g.,
gitscaffold create,gitscaffold import-md), the token primarily needs theissues:writepermission. - If you use commands that create new repositories (e.g.,
gitscaffold setup-repositoryfrom thescaffold.clior./gitscaffold.py setup), your PAT will need thereposcope (which includespublic_repoandrepo:status).
- OpenAI API Key (
OPENAI_API_KEY): This is your standard API key from OpenAI. - Important: Add your
.envfile to your.gitignoreto prevent accidentally committing your secret keys.
- GitHub Token (
- Command-line Options: Pass them directly, e.g.,
--token YOUR_GITHUB_TOKEN.
If a token/key is provided via a command-line option, it will take precedence over environment variables or .env file settings. If not provided via an option, environment variables are checked next, followed by the .env file. Some commands like gitscaffold create may prompt for the GitHub token if it's not found.
CLI Usage
Import and enrich from unstructured Markdown
When you have a free-form Markdown document instead of a structured YAML roadmap, use import-md to extract and enrich issues.
Example Markdown roadmap (markdown_roadmap.md):
# Authentication Service
Implement login, logout, and registration flows.
## Database Schema
- Define `users` table: id, email, password_hash
- Define `sessions` table: id, user_id, expires_at
# Payment Integration
Enable subscription payments with Stripe.
## Stripe Webhook
- Listen to payment events and update user plans
# Preview extracted and enriched issues (dry-run)
export OPENAI_API_KEY=<your-openai-key>
gitscaffold import-md owner/repo markdown_roadmap.md \
--heading-level 1 --dry-run --token $GITHUB_TOKEN
# Show detailed progress logs during extraction and enrichment
gitscaffold import-md owner/repo markdown_roadmap.md \
--heading-level 1 --dry-run --verbose --token $GITHUB_TOKEN --openai-key $OPENAI_API_KEY
# Create enriched issues on GitHub
gitscaffold import-md owner/repo markdown_roadmap.md \
--heading-level 1 --token $GITHUB_TOKEN
Create issues from a Markdown roadmap (AI-powered)
Use create with --ai-extract to generate issues from a Markdown roadmap.
# Create GitHub issues from a Markdown roadmap file using AI extraction
# Ensure OPENAI_API_KEY is set in your .env file or environment
gitscaffold create your-roadmap.md \
--repo owner/repo \
--token $GITHUB_TOKEN \
--ai-extract \
--ai-enrich # Optional: to also enrich descriptions
# Preview extracted issues without creating them (dry run)
gitscaffold create your-roadmap.md \
--repo owner/repo \
--token $GITHUB_TOKEN \
--ai-extract \
--dry-run
Note: The create command also supports structured YAML/JSON roadmap files for manual issue definition if you don't use the --ai-extract flag.
Sync roadmap with an existing repository
Use sync to compare a roadmap file with an existing GitHub repository. It will identify roadmap items that don't have corresponding entries in GitHub and prompt you to create them. This is particularly useful for Markdown roadmaps using AI extraction.
# Sync with a Markdown roadmap, extracting issues with AI
# This is useful if your roadmap is in a Markdown file like docs/example_roadmap.md
# Ensure GITHUB_TOKEN and OPENAI_API_KEY are set in your .env file or environment.
gitscaffold sync docs/example_roadmap.md \
--repo josephedward/gitscaffold \
--ai-extract \
--ai-enrich # Optional: to also enrich descriptions of extracted issues
# Simulate the sync process without making any changes (dry run)
gitscaffold sync docs/example_roadmap.md \
--repo josephedward/gitscaffold \
--ai-extract \
--dry-run
Note: The sync command also supports structured YAML/JSON roadmap files if you don't use the --ai-extract flag. The --token option can be used to override the GITHUB_TOKEN from the environment or .env file.
Delete closed issues
Use delete-closed to permanently remove all closed issues from a specified repository. This action is irreversible and requires confirmation.
# List closed issues that would be deleted (dry run)
gitscaffold delete-closed --repo owner/repo --token $GITHUB_TOKEN --dry-run
# Delete all closed issues (will prompt for confirmation)
gitscaffold delete-closed --repo owner/repo --token $GITHUB_TOKEN
Initialize a roadmap template
gitscaffold init example-roadmap.yml
From the source checkout
You can clone this repository and use the top-level gitscaffold.py script:
## Setup GitHub labels, milestones, and project board
./gitscaffold.py setup owner/repo --phase phase-1 --create-project
## Delete all closed issues in a repository
./gitscaffold.py delete-closed owner/repo
## Enrich a single issue or batch
./gitscaffold.py enrich owner/repo --issue 123 --path ROADMAP.md --apply
./gitscaffold.py enrich owner/repo --batch --path ROADMAP.md --csv out.csv --interactive
## Import from unstructured Markdown (via AI)
./gitscaffold.py import-md owner/repo markdown_roadmap.md --heading-level 2 --token $GITHUB_TOKEN
# Show detailed progress logs during import
./gitscaffold.py import-md owner/repo markdown_roadmap.md \
--heading-level 2 --dry-run --verbose --token $GITHUB_TOKEN --openai-key $OPENAI_API_KEY
## Initialize a new roadmap YAML template
./gitscaffold.py init ROADMAP.yml
GitHub Action Usage
name: Sync Roadmap to Issues
on: workflow_dispatch
jobs:
scaffold:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Gitscaffold CLI
uses: your-org/gitscaffold-action@vX.Y.Z
with:
roadmap-file: roadmap.yml
repo: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
dry-run: 'true'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitscaffold-0.1.6.tar.gz.
File metadata
- Download URL: gitscaffold-0.1.6.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc90c53fb3a64d8c50d6be31742bf7a13b4a1a3ef010e17304d7f05c609cccb
|
|
| MD5 |
6da228fb4dfcce08a8d31fbf844ce3a7
|
|
| BLAKE2b-256 |
be401d8d49bb57ba7daa798e086a4ac637b46bdfcb9a9ca45217cf30edab3dab
|
File details
Details for the file gitscaffold-0.1.6-py3-none-any.whl.
File metadata
- Download URL: gitscaffold-0.1.6-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
227cc0acbe71d9b2037de88d46f650bac82dd1907c5e17da14f9548dc8221660
|
|
| MD5 |
92069fc8edd0513a51f1c82bd33e6ee8
|
|
| BLAKE2b-256 |
7e706118df8aff05c1274531b2fd921279ce3ab96902d6a0758ccc784d25b67b
|