oh-my-pr 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -287
- package/bin/codefactory.cjs +30 -0
- package/dist/index.cjs +329 -66
- package/dist/public/assets/index-HtntK0qZ.js +8 -0
- package/dist/public/assets/index-d4p4gdQE.css +1 -0
- package/dist/public/index.html +2 -2
- package/package.json +1 -1
- package/dist/public/assets/index-B5nWJt5i.js +0 -58
- package/dist/public/assets/index-BS64Pene.css +0 -1
package/README.md
CHANGED
|
@@ -1,348 +1,136 @@
|
|
|
1
|
-
# Code Factory
|
|
2
|
-
|
|
1
|
+
# Code Factory
|
|
2
|
+
|
|
3
|
+
**Local-first GitHub PR babysitter for Codex and Claude.**
|
|
3
4
|
|
|
4
5
|
<p align="center">
|
|
5
|
-
<img width="409" height="409" alt="
|
|
6
|
+
<img width="409" height="409" alt="Code Factory logo" src="https://github.com/user-attachments/assets/ca339a71-40d9-4619-900f-55825f30a57f" />
|
|
6
7
|
</p>
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
**Autonomous GitHub PR babysitter — watches your repos, triages review feedback, dispatches AI agents to fix code, and creates releases**
|
|
10
|
-
|
|
11
9
|
[](https://www.npmjs.com/package/oh-my-pr)
|
|
12
10
|
[](https://github.com/yungookim/oh-my-pr/actions/workflows/ci.yml)
|
|
13
11
|
[](LICENSE)
|
|
14
12
|
[](https://nodejs.org/)
|
|
15
13
|
[](https://www.typescriptlang.org/)
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
> Stop babysitting pull requests manually. Code Factory watches your GitHub repos, syncs review comments into a local dashboard, auto-triages feedback, and launches Claude Code CLI or Codex agents to fix everything — all running on your machine.
|
|
20
|
-
|
|
21
|
-
> **Note:** This project is intended for those obsessed with development speed and is still in development.
|
|
22
|
-
|
|
23
|
-
---
|
|
15
|
+
Code Factory watches GitHub repositories, syncs PR feedback, triages what matters, and dispatches locally installed coding agents inside isolated app-owned worktrees. It keeps durable state in `~/.oh-my-pr` and exposes the same system through a dashboard, REST API, and MCP server.
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Why Code Factory?
|
|
28
|
-
|
|
29
|
-
This is what Code Factory is good at:
|
|
30
|
-
1. Watch the PR to check for PR feedback from humans, agents, failing lint/tests, conflicts etc and auto-fix them
|
|
31
|
-
2. Automatically generate lacking tests for all open PR
|
|
32
|
-
3. Auto-generate and update user-facing documents
|
|
33
|
-
|
|
34
|
-
Code Factory runs locally and uses the CLI coding agents that are already installed in your machine. No need to add OPEN_API_KEY or any such. Just install & have it running and let it do its thing.
|
|
35
|
-
|
|
36
|
-
<p align="center">
|
|
37
|
-
<img src="docs/architecture-diagram.svg" alt="Code Factory Architecture" width="900" />
|
|
38
|
-
</p>
|
|
17
|
+
No hosted service. No agent edits inside your working copy. Your PR automation stays on your machine.
|
|
39
18
|
|
|
40
|
-
|
|
19
|
+
<img width="1365" height="686" alt="Code Factory dashboard" src="https://github.com/user-attachments/assets/66dfa082-c732-4989-8b05-f19aa550acb5" />
|
|
41
20
|
|
|
42
|
-
|
|
43
|
-
- **Sync** review comments, reviews, and discussion threads into persistent local storage
|
|
44
|
-
- **Triage** feedback into `accept`, `reject`, or `flag` buckets — automatically or manually
|
|
45
|
-
- **Dispatch** Claude or Codex agents in isolated git worktrees to apply approved changes
|
|
46
|
-
- **Ask** follow-up questions about PR status, feedback, and activity from the dashboard
|
|
47
|
-
- **Resolve** merge conflicts automatically using AI-powered conflict resolution
|
|
48
|
-
- **Push** verified fixes back to the PR branch with full audit logs
|
|
21
|
+
## Features
|
|
49
22
|
|
|
50
|
-
|
|
23
|
+
- Watch multiple repositories or add a single PR by URL.
|
|
24
|
+
- Auto-register open PRs, archive closed or merged PRs, and keep syncing review activity.
|
|
25
|
+
- Pause background automation for an individual tracked PR while keeping manual runs available.
|
|
26
|
+
- Store PR state, questions, logs, and social changelogs in SQLite with mirrored log files.
|
|
27
|
+
- Triage feedback into `accept`, `reject`, or `flag`, with manual overrides and retry for failed or warned items.
|
|
28
|
+
- Run `codex` or `claude` in isolated worktrees under `~/.oh-my-pr`, then push verified fixes back to the PR branch.
|
|
29
|
+
- Evaluate review comments and failing CI statuses, post GitHub follow-ups, resolve review threads, and persist CI healing sessions per PR head.
|
|
30
|
+
- Detect merge conflicts and optionally let the agent resolve them automatically.
|
|
31
|
+
- Ask natural-language questions about any tracked PR from the dashboard or via MCP.
|
|
32
|
+
- Configure trusted reviewers, ignored bots, polling, batching, run limits, and CI-healing retry budgets from settings.
|
|
33
|
+
- Enable drain mode to pause new work and wait for active runs to finish before deploys or upgrades.
|
|
34
|
+
- Check onboarding status, install Claude or Codex review workflows, and generate social changelogs every 5 PRs merged to `main`.
|
|
35
|
+
- Use the React dashboard, local REST API, MCP server, or optional Tauri desktop shell.
|
|
51
36
|
|
|
52
37
|
## How It Works
|
|
53
38
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<img width="969" height="572" alt="image" src="https://github.com/user-attachments/assets/b9dbd102-ae2e-4837-a862-a0282bdfa0b8" />
|
|
57
|
-
|
|
39
|
+
<img width="969" height="572" alt="Code Factory workflow" src="https://github.com/user-attachments/assets/b9dbd102-ae2e-4837-a862-a0282bdfa0b8" />
|
|
58
40
|
|
|
59
41
|
1. Add a repository to the watch list or register a PR directly by URL.
|
|
60
|
-
2. The watcher polls GitHub, auto-registers open PRs, archives PRs that closed upstream, and queues babysitter runs.
|
|
61
|
-
3.
|
|
62
|
-
4. The
|
|
63
|
-
5. If work is needed, Code Factory prepares an app-owned repo cache and isolated worktree under `~/.codefactory`, and resolves merge conflicts there when needed.
|
|
64
|
-
6. The agent works inside that isolated worktree, runs verification, commits, and pushes directly to the PR branch.
|
|
65
|
-
7. Code Factory re-syncs GitHub, posts follow-up comments, resolves review threads, polls CI on the new commit, and returns the PR to `watching`.
|
|
42
|
+
2. The watcher polls GitHub, auto-registers open PRs, syncs reviews and comments, archives PRs that closed upstream, records failing CI on the current head SHA, and queues babysitter runs for tracked PRs whose background watch is enabled.
|
|
43
|
+
3. Accepted work is executed in an app-owned repo cache and isolated git worktree under `~/.oh-my-pr`.
|
|
44
|
+
4. The agent applies fixes, verifies the result, pushes to the PR branch, updates GitHub threads, and writes logs for the full run.
|
|
66
45
|
|
|
67
|
-
##
|
|
46
|
+
## CI Healing
|
|
68
47
|
|
|
69
|
-
|
|
70
|
-
|---------|-------------|
|
|
71
|
-
| **Multi-repo watching** | Monitor multiple GitHub repos simultaneously |
|
|
72
|
-
| **PR registration** | Add individual PRs by URL for one-off tracking |
|
|
73
|
-
| **Smart triage** | Auto-categorize feedback with manual override support |
|
|
74
|
-
| **Agent flexibility** | Choose between Claude and Codex for code remediation |
|
|
75
|
-
| **PR Q&A** | Ask the configured agent questions about a PR and get context-aware answers from feedback and logs |
|
|
76
|
-
| **Isolated worktrees** | Agent runs happen in detached git worktrees — zero risk to your working copy |
|
|
77
|
-
| **Persistent state** | SQLite-backed storage survives restarts |
|
|
78
|
-
| **Activity logs** | Daily mirrored log files with full run details |
|
|
79
|
-
| **Trusted reviewers** | Configure whose feedback gets auto-accepted |
|
|
80
|
-
| **Conflict resolution** | Automatically resolve merge conflicts using AI agents |
|
|
81
|
-
| **Bot filtering** | Ignore noise from dependabot, codecov, and other bots |
|
|
82
|
-
| **Real-time dashboard** | React-based UI with live status, triage controls, PR Q&A, and config management |
|
|
83
|
-
|
|
84
|
-
## Tech Stack
|
|
85
|
-
|
|
86
|
-
| Layer | Technology |
|
|
87
|
-
|-------|-----------|
|
|
88
|
-
| **Server** | Node.js 22+, TypeScript (strict), Express 5 |
|
|
89
|
-
| **Client** | React 18, Vite, TanStack Query, Tailwind CSS, shadcn/ui |
|
|
90
|
-
| **Storage** | SQLite via `node:sqlite`, Drizzle ORM |
|
|
91
|
-
| **GitHub** | Octokit + `gh auth token` fallback |
|
|
92
|
-
| **Agents** | Claude CLI or Codex CLI |
|
|
93
|
-
| **Testing** | Node test runner with tsx |
|
|
48
|
+
When `Automatic CI healing` is enabled, Code Factory creates a healing session for each failing PR head SHA, classifies failures as safe to fix in-branch or blocked external, and runs bounded repair attempts in isolated worktrees. The dashboard surfaces the current session state and retry budget, and the local API exposes `GET /api/healing-sessions` plus `GET /api/healing-sessions/:id` for operator visibility.
|
|
94
49
|
|
|
95
50
|
## Quick Start
|
|
96
51
|
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g oh-my-pr
|
|
54
|
+
oh-my-pr
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
That's it. The dashboard opens in your browser at `http://localhost:5001`.
|
|
58
|
+
|
|
97
59
|
### Prerequisites
|
|
98
60
|
|
|
99
61
|
- **Node.js 22+** (tested with Node v24.12.0)
|
|
100
|
-
- **npm**
|
|
101
62
|
- **git**
|
|
102
|
-
-
|
|
103
|
-
- Either `codex` or `claude` CLI installed
|
|
63
|
+
- GitHub auth via `gh auth login`, `GITHUB_TOKEN`, app config, or a saved dashboard token
|
|
64
|
+
- Either the `codex` CLI or `claude` CLI installed and authenticated locally
|
|
104
65
|
|
|
105
|
-
###
|
|
66
|
+
### CLI Usage
|
|
106
67
|
|
|
107
68
|
```bash
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# Start the server
|
|
112
|
-
oh-my-pr
|
|
69
|
+
oh-my-pr Start the dashboard server (opens browser)
|
|
70
|
+
oh-my-pr --help Show help message
|
|
71
|
+
oh-my-pr --version Print the version
|
|
113
72
|
```
|
|
114
73
|
|
|
115
|
-
|
|
74
|
+
Set `PORT` to change the default port (`5001`).
|
|
116
75
|
|
|
117
|
-
###
|
|
76
|
+
### Run From Source
|
|
118
77
|
|
|
119
78
|
```bash
|
|
120
|
-
# Clone the repository
|
|
121
79
|
git clone https://github.com/yungookim/oh-my-pr.git
|
|
122
|
-
cd
|
|
123
|
-
|
|
124
|
-
# Install dependencies
|
|
80
|
+
cd oh-my-pr
|
|
125
81
|
npm install
|
|
126
|
-
|
|
127
|
-
# Start in development mode
|
|
128
82
|
npm run dev
|
|
129
83
|
```
|
|
130
84
|
|
|
131
|
-
|
|
85
|
+
The dashboard is served on port `5001` by default. All `/api/*` routes are restricted to loopback callers.
|
|
132
86
|
|
|
133
|
-
|
|
134
|
-
npm run build # Build the production bundle
|
|
135
|
-
npm run start # Start the production server
|
|
136
|
-
```
|
|
87
|
+
## MCP and API
|
|
137
88
|
|
|
138
|
-
|
|
89
|
+
Code Factory exposes the same local system through REST and MCP.
|
|
139
90
|
|
|
140
91
|
```bash
|
|
141
|
-
npm run
|
|
142
|
-
npm run lint # ESLint validation
|
|
143
|
-
npm run test # Run all tests
|
|
144
|
-
npm run db:push # Push Drizzle schema changes
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Authentication
|
|
148
|
-
|
|
149
|
-
GitHub auth is resolved in order:
|
|
150
|
-
|
|
151
|
-
1. `GITHUB_TOKEN` environment variable
|
|
152
|
-
2. Token stored in app config (via the dashboard)
|
|
153
|
-
3. `gh auth token` (GitHub CLI fallback)
|
|
154
|
-
|
|
155
|
-
## Configuration
|
|
156
|
-
|
|
157
|
-
All configuration is managed through the dashboard or the API. Persisted settings include:
|
|
158
|
-
|
|
159
|
-
| Setting | Description |
|
|
160
|
-
|---------|-------------|
|
|
161
|
-
| **Agent** | `codex` or `claude` |
|
|
162
|
-
| **Model** | Model name for the selected agent |
|
|
163
|
-
| **Max turns** | Maximum agent conversation turns |
|
|
164
|
-
| **Polling interval** | How often to check GitHub for updates |
|
|
165
|
-
| **Batch window** | Time window for batching feedback |
|
|
166
|
-
| **Max changes per run** | Limit on changes per agent execution |
|
|
167
|
-
| **Watched repositories** | List of repos to monitor |
|
|
168
|
-
| **Trusted reviewers** | Reviewers whose feedback is auto-accepted |
|
|
169
|
-
| **Ignored bots** | Bot accounts to filter out (defaults: dependabot, codecov, github-actions) |
|
|
170
|
-
|
|
171
|
-
## Local State & Filesystem
|
|
172
|
-
|
|
173
|
-
| Path | Purpose |
|
|
174
|
-
|------|---------|
|
|
175
|
-
| `~/.codefactory/state.sqlite` | Durable app state |
|
|
176
|
-
| `~/.codefactory/log/` | Daily mirrored activity logs |
|
|
177
|
-
| `~/.codefactory/repos/` | App-owned repo caches used to create clean PR worktrees |
|
|
178
|
-
| `~/.codefactory/worktrees/` | Isolated PR worktrees for agent runs |
|
|
179
|
-
|
|
180
|
-
Override the root path with the `CODEFACTORY_HOME` environment variable.
|
|
181
|
-
|
|
182
|
-
## API Reference
|
|
183
|
-
|
|
184
|
-
The dashboard communicates with the server through a REST API:
|
|
185
|
-
|
|
186
|
-
| Method | Endpoint | Description |
|
|
187
|
-
|--------|----------|-------------|
|
|
188
|
-
| `GET` | `/api/repos` | List watched repositories |
|
|
189
|
-
| `POST` | `/api/repos` | Add a repository to watch |
|
|
190
|
-
| `GET` | `/api/prs` | List tracked pull requests |
|
|
191
|
-
| `GET` | `/api/prs/:id` | Get PR details with feedback |
|
|
192
|
-
| `POST` | `/api/prs` | Register a PR by URL |
|
|
193
|
-
| `DELETE` | `/api/prs/:id` | Remove a tracked PR |
|
|
194
|
-
| `POST` | `/api/prs/:id/fetch` | Force-refresh PR feedback |
|
|
195
|
-
| `POST` | `/api/prs/:id/triage` | Run triage on a PR |
|
|
196
|
-
| `POST` | `/api/prs/:id/apply` | Apply accepted changes via agent |
|
|
197
|
-
| `POST` | `/api/prs/:id/babysit` | Run full babysit cycle |
|
|
198
|
-
| `PATCH` | `/api/prs/:id/feedback/:feedbackId` | Update feedback triage status |
|
|
199
|
-
| `GET` | `/api/prs/:id/questions` | List PR question/answer history |
|
|
200
|
-
| `POST` | `/api/prs/:id/questions` | Ask the configured agent a question about the PR |
|
|
201
|
-
| `GET` | `/api/logs` | Retrieve activity logs |
|
|
202
|
-
| `GET` | `/api/config` | Get current configuration |
|
|
203
|
-
| `PATCH` | `/api/config` | Update configuration |
|
|
204
|
-
|
|
205
|
-
## Project Structure
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
client/ React dashboard (Vite + Tailwind + shadcn/ui)
|
|
209
|
-
server/ Express API, babysitter logic, GitHub integration, storage
|
|
210
|
-
shared/ Shared Zod schemas and TypeScript types
|
|
211
|
-
script/ Build tooling
|
|
212
|
-
docs/plans/ Design and implementation planning documents
|
|
213
|
-
tasks/ Project lessons and working notes
|
|
92
|
+
npm run mcp
|
|
214
93
|
```
|
|
215
94
|
|
|
216
|
-
|
|
95
|
+
Use it with MCP hosts such as Claude Desktop or OpenClaw, or call the REST API directly from local tooling. Full endpoint and tool docs live in [LOCAL_API.md](LOCAL_API.md).
|
|
217
96
|
|
|
218
|
-
|
|
97
|
+
## Docs
|
|
219
98
|
|
|
220
|
-
|
|
99
|
+
- [Getting Started](docs/public/getting-started.md)
|
|
100
|
+
- [PR Babysitter](docs/public/pr-babysitter.md)
|
|
101
|
+
- [Agent Dispatch](docs/public/agent-dispatch.md)
|
|
102
|
+
- [Configuration](docs/public/configuration.md)
|
|
103
|
+
- [Local API and MCP](LOCAL_API.md)
|
|
221
104
|
|
|
222
|
-
|
|
105
|
+
## Development
|
|
223
106
|
|
|
224
|
-
|
|
107
|
+
| Command | Purpose |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| `npm run dev` | Start the development server |
|
|
110
|
+
| `npm run build` | Build the production bundle |
|
|
111
|
+
| `npm run start` | Run the production build |
|
|
112
|
+
| `npm run mcp` | Start the MCP server |
|
|
113
|
+
| `npm run check` | Run TypeScript checks |
|
|
114
|
+
| `npm run lint` | Run ESLint |
|
|
115
|
+
| `npm run test` | Run the server test suite |
|
|
116
|
+
| `npm run tauri:dev` | Start the Tauri desktop app in development |
|
|
117
|
+
| `npm run tauri:build` | Build the Tauri desktop app |
|
|
225
118
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
GET http://localhost:5001/api/runtime
|
|
230
|
-
```
|
|
119
|
+
## Local State
|
|
231
120
|
|
|
232
|
-
|
|
121
|
+
By default Code Factory stores its runtime data in `~/.oh-my-pr`:
|
|
233
122
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
npm install -g oh-my-pr
|
|
240
|
-
oh-my-pr &
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Or from source:
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
git clone https://github.com/yungookim/oh-my-pr.git
|
|
247
|
-
cd codefactory
|
|
248
|
-
npm install
|
|
249
|
-
npm run dev &
|
|
250
|
-
```
|
|
123
|
+
- `state.sqlite` for durable app state
|
|
124
|
+
- `log/` for mirrored activity logs
|
|
125
|
+
- `repos/` for app-owned repository caches
|
|
126
|
+
- `worktrees/` for isolated PR worktrees
|
|
251
127
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
### Step 3 — How to use your MCP tools
|
|
255
|
-
|
|
256
|
-
All tools communicate with `http://localhost:5001` over the local network only. External requests are blocked. Call tools in this order for common workflows:
|
|
257
|
-
|
|
258
|
-
**Watch a new repository and process its PRs**
|
|
259
|
-
1. `add_repo` — add the repo slug (e.g. `"owner/repo"`)
|
|
260
|
-
2. `sync_repos` — trigger an immediate fetch from GitHub
|
|
261
|
-
3. `list_prs` — inspect what was found
|
|
262
|
-
|
|
263
|
-
**Handle a specific PR end-to-end**
|
|
264
|
-
1. `get_pr` — read current state and feedback items
|
|
265
|
-
2. `triage_pr` — auto-classify all un-triaged feedback
|
|
266
|
-
3. `apply_pr_fixes` — dispatch the AI agent to apply accepted items
|
|
267
|
-
— or use `babysit_pr` to do all three in one call
|
|
268
|
-
|
|
269
|
-
**Investigate a PR**
|
|
270
|
-
1. `fetch_pr_feedback` — force a fresh pull from GitHub
|
|
271
|
-
2. `get_logs` with `pr_id` — read the full activity history
|
|
272
|
-
3. `ask_pr_question` — ask a natural-language question; poll the returned question `id` via `list_pr_questions` until `status` is `"answered"`
|
|
273
|
-
|
|
274
|
-
**Override a triage decision**
|
|
275
|
-
- `set_feedback_decision` with `decision: "accept" | "reject" | "flag"`
|
|
276
|
-
|
|
277
|
-
**Graceful shutdown before a deploy**
|
|
278
|
-
1. `set_drain_mode` with `enabled: true, wait_for_idle: true`
|
|
279
|
-
2. Wait for `activeRuns: 0` in the response
|
|
280
|
-
3. Perform your deploy, then call `set_drain_mode` with `enabled: false`
|
|
281
|
-
|
|
282
|
-
### Available tools
|
|
283
|
-
|
|
284
|
-
| Tool | What it does |
|
|
285
|
-
|------|-------------|
|
|
286
|
-
| `list_repos` | List all watched repositories |
|
|
287
|
-
| `add_repo` | Add a repo (`owner/repo` or full URL) to the watch list |
|
|
288
|
-
| `sync_repos` | Force an immediate sync cycle across all repos |
|
|
289
|
-
| `list_prs` | List all actively tracked PRs |
|
|
290
|
-
| `list_archived_prs` | List archived (closed/merged) PRs |
|
|
291
|
-
| `get_pr` | Get full PR details including every feedback item |
|
|
292
|
-
| `add_pr` | Register a PR by its full GitHub URL |
|
|
293
|
-
| `remove_pr` | Remove a PR from tracking |
|
|
294
|
-
| `fetch_pr_feedback` | Force-refresh GitHub comments and reviews for a PR |
|
|
295
|
-
| `triage_pr` | Auto-triage all un-triaged feedback on a PR |
|
|
296
|
-
| `apply_pr_fixes` | Dispatch AI agent to apply accepted feedback |
|
|
297
|
-
| `babysit_pr` | Full cycle: sync → triage → apply in one call |
|
|
298
|
-
| `set_feedback_decision` | Manually set `accept`, `reject`, or `flag` on a feedback item |
|
|
299
|
-
| `retry_feedback_item` | Re-queue a failed or warned feedback item |
|
|
300
|
-
| `list_pr_questions` | List Q&A history for a PR |
|
|
301
|
-
| `ask_pr_question` | Ask the AI agent a question about a PR (async — poll for answer) |
|
|
302
|
-
| `get_logs` | Get activity logs; pass `pr_id` to filter to one PR |
|
|
303
|
-
| `get_config` | Read current configuration (token is redacted) |
|
|
304
|
-
| `update_config` | Partially update configuration |
|
|
305
|
-
| `get_agent_models` | List available AI models for each agent type |
|
|
306
|
-
| `refresh_agent_models` | Re-discover installed agent models |
|
|
307
|
-
| `get_runtime` | Get runtime state: drain mode status and active run count |
|
|
308
|
-
| `set_drain_mode` | Enable or disable drain mode |
|
|
309
|
-
| `list_changelogs` | List generated social-media changelogs |
|
|
310
|
-
| `get_changelog` | Get one changelog by ID |
|
|
311
|
-
| `get_onboarding_status` | Check GitHub Actions workflow status for watched repos |
|
|
312
|
-
| `install_review_workflow` | Install the Code Factory review workflow on a repo |
|
|
313
|
-
|
|
314
|
-
Full parameter schemas are in [LOCAL_API.md](LOCAL_API.md).
|
|
315
|
-
|
|
316
|
-
### Error conditions you must handle
|
|
317
|
-
|
|
318
|
-
| Error | Meaning | Action |
|
|
319
|
-
|-------|---------|--------|
|
|
320
|
-
| Connection refused on port 5001 | Server is not running | Run `npm run dev` in the codefactory directory |
|
|
321
|
-
| `403 Forbidden` | Request did not come from localhost | Ensure you are calling `127.0.0.1`, not a hostname that resolves externally |
|
|
322
|
-
| `409 Conflict` | Drain mode is active | Call `set_drain_mode` with `enabled: false` first, or wait for the drain to complete |
|
|
323
|
-
| `404 Not Found` | PR or feedback item ID is wrong | Call `list_prs` to get valid IDs before acting on them |
|
|
324
|
-
|
|
325
|
-
### If something is broken or missing, file a GitHub issue
|
|
326
|
-
|
|
327
|
-
If you encounter a bug, an unexpected error response, a missing tool, or behaviour that does not match this documentation, create a GitHub issue so the maintainers can fix it.
|
|
328
|
-
|
|
329
|
-
**Issue URL:** `https://github.com/yungookim/oh-my-pr/issues/new`
|
|
330
|
-
|
|
331
|
-
Include the following in the issue body:
|
|
332
|
-
- What you were trying to do (the goal)
|
|
333
|
-
- Which tool or endpoint you called and with what parameters
|
|
334
|
-
- The exact error or unexpected response you received
|
|
335
|
-
- The output of `get_logs` filtered to the relevant PR (if applicable)
|
|
336
|
-
- The output of `get_runtime` at the time of the failure
|
|
337
|
-
|
|
338
|
-
Use a clear title such as `[OpenClaw] <tool_name> returns unexpected 500 when X`.
|
|
339
|
-
|
|
340
|
-
---
|
|
128
|
+
Set `OH_MY_PR_HOME` to override the root path. The legacy `CODEFACTORY_HOME` name is still supported for compatibility.
|
|
341
129
|
|
|
342
130
|
## Contributing
|
|
343
131
|
|
|
344
|
-
|
|
132
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
345
133
|
|
|
346
134
|
## License
|
|
347
135
|
|
|
348
|
-
[MIT](LICENSE)
|
|
136
|
+
[MIT](LICENSE) Copyright 2026 KimY
|
package/bin/codefactory.cjs
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
const pkg = require("../package.json");
|
|
5
|
+
const arg = process.argv[2];
|
|
6
|
+
|
|
7
|
+
if (arg === "--version" || arg === "-v") {
|
|
8
|
+
console.log(pkg.version);
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (arg === "--help" || arg === "-h") {
|
|
13
|
+
console.log(`
|
|
14
|
+
oh-my-pr v${pkg.version}
|
|
15
|
+
|
|
16
|
+
Autonomous GitHub PR babysitter — watches repos, triages review
|
|
17
|
+
feedback, and dispatches AI agents to fix code locally.
|
|
18
|
+
|
|
19
|
+
Usage:
|
|
20
|
+
oh-my-pr Start the dashboard server
|
|
21
|
+
oh-my-pr --help Show this help message
|
|
22
|
+
oh-my-pr --version Print the version
|
|
23
|
+
|
|
24
|
+
Environment variables:
|
|
25
|
+
PORT Server port (default: 5001)
|
|
26
|
+
GITHUB_TOKEN GitHub personal access token
|
|
27
|
+
OH_MY_PR_HOME Override config/state directory (~/.oh-my-pr)
|
|
28
|
+
|
|
29
|
+
https://github.com/yungookim/oh-my-pr
|
|
30
|
+
`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
4
34
|
process.env.NODE_ENV = process.env.NODE_ENV || "production";
|
|
5
35
|
require("../dist/index.cjs");
|