Summary
Allow users to create brand-new GitHub repositories directly from the Archon Add Project screen, without needing to first create the repo on GitHub and then paste the URL. Since Archon already holds a GitHub token (used to clone private repos and push code in existing workflows), the same credential can be used to call the GitHub API and provision a new repo on behalf of the user.
Motivation
Today, adding a project to Archon requires an existing GitHub URL. This creates unnecessary friction for the common "start from scratch" case: the user must context-switch to GitHub, create a repo, copy the URL, come back to Archon, and then register it. Archon already has everything needed to eliminate those steps.
Proposed UX Flow
- On the Add Project screen, expose a toggle or tab: "Add existing repo" (current behaviour) vs "Create new repo" (new).
- In the "Create new repo" panel, collect:
- Repository name (required)
- Description (optional)
- Visibility: Public / Private (radio or select)
- Owner: personal account or an organisation the token has access to (dropdown populated via
GET /user/orgs)
- Initialise with README (checkbox, optional)
- Add .gitignore template (optional, e.g. Node, Python, etc.)
- On submit:
- Call
POST /user/repos (personal) or POST /orgs/{org}/repos (org) with the supplied fields.
- Receive the new repo's clone URL from the API response.
- Clone it locally into
~/.archon/workspaces/<owner>/<repo>/source/ (same layout as existing projects).
- Register it as a project in Archon's database (same path as the existing "add by URL" flow).
- Redirect the user to the newly registered project.
GitHub API Surface
| Action |
Endpoint |
| Create personal repo |
POST /user/repos |
| Create org repo |
POST /orgs/{org}/repos |
| List orgs for token |
GET /user/orgs |
All calls use the existing GitHub token already stored for the user/workspace.
Implementation Notes
- Backend: Add a new API route (e.g.
POST /api/github/repos/create) that accepts { name, description, private, org?, initReadme?, gitignoreTemplate? }, calls the GitHub API, clones the result, and registers the codebase — reusing the existing clone + register logic.
- Auth: Use the same GitHub token already plumbed through for private-repo cloning and push workflows. No new credential surface needed.
- Frontend: Extend the Add Project dialog/page with the new panel; use the existing API client patterns.
- Error handling: Surface GitHub API errors clearly (name taken, insufficient org permissions, token lacks
repo scope, etc.).
- Scope gate: If the token only has
public_repo scope and the user tries to create a private repo, return a clear error message rather than a generic failure.
Acceptance Criteria
Out of Scope (for this issue)
- Repository template selection (can be a follow-up).
- SSH key management (HTTPS clone with token is sufficient).
- Deleting or archiving repos from Archon.
Summary
Allow users to create brand-new GitHub repositories directly from the Archon Add Project screen, without needing to first create the repo on GitHub and then paste the URL. Since Archon already holds a GitHub token (used to clone private repos and push code in existing workflows), the same credential can be used to call the GitHub API and provision a new repo on behalf of the user.
Motivation
Today, adding a project to Archon requires an existing GitHub URL. This creates unnecessary friction for the common "start from scratch" case: the user must context-switch to GitHub, create a repo, copy the URL, come back to Archon, and then register it. Archon already has everything needed to eliminate those steps.
Proposed UX Flow
GET /user/orgs)POST /user/repos(personal) orPOST /orgs/{org}/repos(org) with the supplied fields.~/.archon/workspaces/<owner>/<repo>/source/(same layout as existing projects).GitHub API Surface
POST /user/reposPOST /orgs/{org}/reposGET /user/orgsAll calls use the existing GitHub token already stored for the user/workspace.
Implementation Notes
POST /api/github/repos/create) that accepts{ name, description, private, org?, initReadme?, gitignoreTemplate? }, calls the GitHub API, clones the result, and registers the codebase — reusing the existing clone + register logic.reposcope, etc.).public_reposcope and the user tries to create a private repo, return a clear error message rather than a generic failure.Acceptance Criteria
Out of Scope (for this issue)