Skip to content

factory ceo --issue <url>: target a GitHub/GitLab issue directly #202

@ghelleks

Description

@ghelleks

Problem

Working on a specific GitHub or GitLab issue requires a multi-step workaround:

```bash
gh issue view 42 --json title,body -q '"# " + .title + "\n\n" + .body' > /tmp/issue-42.md
factory ceo /path/to/project --prompt /tmp/issue-42.md
```

There's no way to point the factory at an issue URL directly. `--focus` only accepts short strings and loses issue detail. `--issue` on `factory finalize` is metadata-only.

Proposed Solution

Add `--issue ` to `factory ceo` and `factory run`:

```bash
factory ceo /path/to/project --issue 42
factory ceo /path/to/project --issue https://github.com/owner/repo/issues/42
factory ceo /path/to/project --issue https://gitlab.com/owner/repo/-/issues/42
```

The CLI fetches the issue (via `gh issue view` or `glab issue view`), formats title + body as a spec, and passes it through the same `--prompt` pipeline — writing it to `.factory/strategy/current.md` so all agents have full context.

If `--issue` is a bare number, infer the remote from `git remote get-url origin`. If it's a full URL, detect GitHub vs. GitLab from the host.

Behavior

  • Mutually exclusive with `--prompt` and `--focus` (same constraints as `--prompt`)
  • Issue number is automatically recorded in `factory finalize --issue` for traceability
  • `--no-github` suppresses fetching (errors out with a clear message if `--issue` is also set)

Implementation Notes

  • Fetch via subprocess: `gh issue view --json title,body,labels,milestone` / `glab issue view --output json`
  • Format: `# <title>\n\n` — same shape as a hand-written spec file
  • Remote inference: `git -C <project_path> remote get-url origin`, then parse owner/repo from the URL

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions