oh-my-pr 4.1.2 → 4.2.1
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/bin/codefactory.cjs +3 -2
- package/dist/cli.cjs +12 -3
- package/dist/index.cjs +175 -147
- package/package.json +3 -1
package/bin/codefactory.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
const pkg = require("../package.json");
|
|
5
|
-
const { formatCliHelp, parseCliArgs } = require("../dist/cli.cjs");
|
|
5
|
+
const { applyLogEnv, formatCliHelp, parseCliArgs } = require("../dist/cli.cjs");
|
|
6
6
|
const parsed = parseCliArgs(process.argv.slice(2));
|
|
7
7
|
|
|
8
8
|
if (parsed.mode === "version") {
|
|
@@ -15,10 +15,11 @@ if (parsed.mode === "help") {
|
|
|
15
15
|
console.error(parsed.error);
|
|
16
16
|
}
|
|
17
17
|
console.log(formatCliHelp(pkg.version));
|
|
18
|
-
process.exit(0);
|
|
18
|
+
process.exit(parsed.error ? 1 : 0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
process.env.NODE_ENV = process.env.NODE_ENV || "production";
|
|
22
|
+
applyLogEnv(parsed.log);
|
|
22
23
|
if (parsed.mode === "mcp") {
|
|
23
24
|
require("../dist/mcp.cjs");
|
|
24
25
|
} else if (parsed.mode === "web") {
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var
|
|
2
|
-
oh-my-pr v${
|
|
1
|
+
"use strict";var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var l in t)s(e,l,{get:t[l],enumerable:!0})},f=(e,t,l,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!c.call(e,i)&&i!==l&&s(e,i,{get:()=>t[i],enumerable:!(r=p(t,i))||r.enumerable});return e};var v=e=>f(s({},"__esModule",{value:!0}),e);var L={};d(L,{applyLogEnv:()=>m,formatCliHelp:()=>b,parseCliArgs:()=>h});module.exports=v(L);var a={web:"web",mcp:"mcp"};function h(e){let t=null,l={},r=0;for(;r<e.length;){let o=e[r].trimEnd();if(o==="--help"||o==="-h")return{mode:"help"};if(o==="--version"||o==="-v")return{mode:"version"};if(o==="--quiet"||o==="-q"){l.level="error",r+=1;continue}if(o==="--verbose"){l.level="debug",r+=1;continue}if(o==="--debug"){l.level="debug",r+=1;continue}if(o==="--trace"){l.level="trace",r+=1;continue}if(o==="--no-log-file"){l.noLogFile=!0,r+=1;continue}if(o==="--log-file"){let n=e[r+1];if(!n||n.startsWith("-"))return{mode:"help",error:"--log-file requires a path"};l.logFile=n,r+=2;continue}if(o.startsWith("--log-file=")){l.logFile=o.slice(11),r+=1;continue}if(o==="--log-level"||o.startsWith("--log-level=")){let n=o.startsWith("--log-level=")?o.slice(12):e[r+1],g=["trace","debug","info","warn","error","fatal"];if(!n||!g.includes(n))return{mode:"help",error:`--log-level must be one of ${g.join(", ")}`};l.level=n,r+=o.startsWith("--log-level=")?1:2;continue}if(t===null&&a[o]){t=a[o],r+=1;continue}return{mode:"help",error:`Unknown command: ${o}`}}let i={mode:t??"web"};return(l.level||l.logFile||l.noLogFile)&&(i.log=l),i}function m(e){e&&(e.level&&(process.env.LOG_LEVEL=e.level),e.noLogFile&&(process.env.OH_MY_PR_NO_LOG_FILE="1"),e.logFile&&(process.env.OH_MY_PR_LOG_FILE=e.logFile))}function b(e){return`
|
|
2
|
+
oh-my-pr v${e}
|
|
3
3
|
|
|
4
4
|
Autonomous GitHub PR babysitter \u2014 watches repos, triages review
|
|
5
5
|
feedback, and dispatches AI agents to fix code locally.
|
|
@@ -11,10 +11,19 @@
|
|
|
11
11
|
oh-my-pr --help Show this help message
|
|
12
12
|
oh-my-pr --version Print the version
|
|
13
13
|
|
|
14
|
+
Logging options:
|
|
15
|
+
-q, --quiet Errors only
|
|
16
|
+
--verbose, --debug Verbose output (debug level)
|
|
17
|
+
--trace Maximum verbosity
|
|
18
|
+
--log-level <level> trace | debug | info | warn | error | fatal
|
|
19
|
+
--log-file <path> Override log file location
|
|
20
|
+
--no-log-file Disable file logging
|
|
21
|
+
|
|
14
22
|
Environment variables:
|
|
15
23
|
PORT Server port (default: 5001)
|
|
16
24
|
GITHUB_TOKEN GitHub personal access token
|
|
17
25
|
OH_MY_PR_HOME Override config/state directory (~/.oh-my-pr)
|
|
26
|
+
LOG_LEVEL Same as --log-level
|
|
18
27
|
|
|
19
28
|
https://github.com/yungookim/oh-my-pr
|
|
20
|
-
`}0&&(module.exports={formatCliHelp,parseCliArgs});
|
|
29
|
+
`}0&&(module.exports={applyLogEnv,formatCliHelp,parseCliArgs});
|