Lines 117-140javascript
117 plugin install Install a plugin package
118 version Print the current CLI version
119 help Print this help message
122 run --host <host> Bind to a specific host (default: 127.0.0.1)
123 run --port <port> Bind to a specific port (default: 3001)
124 plugin init --path <path> Initialize in a specific path
125 plugin init --name <name> Initialize in a child directory
126 plugin install --target <path> Install into a specific plugin directory
127 -v, --version Print the current CLI version
128 -h, --help Print this help message
129`,me=new Set(["version","--version","-v"]),fe=new Set(["help","--help","-h"]),we="127.0.0.1",he=3001,Se=async(e,t)=>{const[r,i,...a]=e;if(r===void 0||fe.has(r))return t.write(I),{exitCode:0};if(me.has(r))return t.write(`${t.packageVersion}
130`),{exitCode:0};if(r==="run")try{const n=ye([i,...a]),u=await(t.startRunServer??ke)({host:n.host,port:n.port,write:t.write});return t.write(`Hold Rein is running at ${u.url}
131`),{exitCode:0}}catch(n){return t.write(`Failed to start service: ${w(n)}
132`),{exitCode:1}}if(r==="plugin"&&i==="init")try{const n=le(t.currentWorkingDirectory??process.cwd(),be(a));return t.write(`Initialized plugin package ${n.packageName}
133`),{exitCode:0}}catch(n){return t.write(`Failed to initialize plugin package: ${w(n)}
134`),{exitCode:1}}if(r==="plugin"&&i==="install")try{const n=ve(a),u=await(t.installPluginPackage??te)({currentWorkingDirectory:t.currentWorkingDirectory??process.cwd(),pluginRoot:n.target??s(G(),".hold-rein","plugins"),source:n.source,write:t.write});return t.write(`Installed plugin to ${u}
135`),{exitCode:0}}catch(n){return t.write(`Failed to install plugin: ${w(n)}
136`),{exitCode:1}}return t.write(`Unknown command: ${r}
138${I}`),{exitCode:1}};function w(e){return e instanceof Error?e.message:String(e)}function ve(e){const t=e[0];if(t===void 0||t.startsWith("-"))throw new Error("Missing plugin source");const r={source:t},i=p(e,"--target");return i!==void 0&&(r.target=i),r}function ye(e){const t=e.filter(n=>n!==void 0),r=p(t,"--host")??we,i=p(t,"--port"),a=i===void 0?he:Number(i);if(!Number.isInteger(a)||a<1||a>65535)throw new Error("Port must be an integer between 1 and 65535");return{host:r,port:a}}function be(e){const t={},r=p(e,"--name"),i=p(e,"--path");return r!==void 0&&(t.name=r),i!==void 0&&(t.path=i),t}a ...
139//# sourceMappingURL=index.js.map
MediumDynamic Require
Package source references dynamic require/import behavior.
dist/index.jsView on unpkg · L137 Long lines were clipped for display.