@lioneltay/claude-pilot 0.1.5 → 0.1.6
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/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -391,7 +391,7 @@ Configure Claude Code with:`),console.log(` export ANTHROPIC_BASE_URL=http://lo
|
|
|
391
391
|
\u{1F4E6} Update available: ${n} \u2192 ${t.latestVersion}`),console.log(` npm install -g @lioneltay/claude-pilot@latest
|
|
392
392
|
`))}return}let r=zJ();if(VJ({lastCheck:e,latestVersion:r}),r){let n=kA();n&&r!==n&&(console.log(`
|
|
393
393
|
\u{1F4E6} Update available: ${n} \u2192 ${r}`),console.log(` npm install -g @lioneltay/claude-pilot@latest
|
|
394
|
-
`))}}catch{}})}import{readFileSync as BJ}from"node:fs";import{fileURLToPath as GJ}from"node:url";import{dirname as WJ,join as JJ}from"node:path";function KJ(){try{let t=GJ(import.meta.url),e=WJ(t),r=JJ(e,"..","package.json");return JSON.parse(BJ(r,"utf-8")).version||"0.0.0"}catch{return"0.0.0"}}var rg=KJ(),YJ=["login","logout","start","stop","status","dashboard","help"];function XJ(t){let e=t[0];return
|
|
394
|
+
`))}}catch{}})}import{readFileSync as BJ}from"node:fs";import{fileURLToPath as GJ}from"node:url";import{dirname as WJ,join as JJ}from"node:path";function KJ(){try{let t=GJ(import.meta.url),e=WJ(t),r=JJ(e,"..","package.json");return JSON.parse(BJ(r,"utf-8")).version||"0.0.0"}catch{return"0.0.0"}}var rg=KJ(),YJ=["login","logout","start","stop","status","dashboard","help"];function XJ(t){let e=t[0];if(!e)return!1;let r=["--help","--version","-h","-V"];return YJ.includes(e)||r.includes(e)}async function QJ(t){let{running:e,state:r}=await Tt();if(e)HA(t,r.port);else{await xr(ft)||(console.error("Not authenticated. Run `claude-pilot login` first."),process.exit(1)),console.log("Proxy not running, starting..."),await tg({port:Nu});let{running:s,state:i}=await Tt();(!s||!i)&&(console.error("Failed to start proxy. Check logs with: cat ~/.config/claude-pilot/server.log"),process.exit(1)),console.log(),HA(t,i.port)}}function HA(t,e){let r=UJ("claude",t,{stdio:"inherit",env:{...process.env,ANTHROPIC_BASE_URL:`http://localhost:${e}`,ANTHROPIC_AUTH_TOKEN:"dummy"}});r.on("error",n=>{n.code==="ENOENT"?console.error("Claude CLI not found. Install it with: npm install -g @anthropic-ai/claude-code"):console.error("Failed to run claude:",n.message),process.exit(1)}),r.on("exit",n=>{process.exit(n??0)})}async function ZJ(){MA();let t=process.argv.slice(2);if(t.length===0||!XJ(t)){await QJ(t);return}let e=new Sg,r=FA(),n=r&&r!==rg?`${rg} (update available: ${r})`:rg;e.name("claude-pilot").description("Run Claude Code through GitHub Copilot API").version(n),e.command("login").description("Authenticate with GitHub Copilot").action(async()=>{try{await TA()}catch(s){console.error("Login failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("logout").description("Clear credentials and stop proxy").action(async()=>{try{await PA()}catch(s){console.error("Logout failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("start").description("Start the proxy server in background").option("-p, --port <port>","Port for proxy and dashboard").action(async s=>{try{await tg({port:s.port?parseInt(s.port,10):void 0})}catch(i){console.error("Start failed:",i instanceof Error?i.message:i),process.exit(1)}}),e.command("stop").description("Stop the running proxy server").action(async()=>{try{await xu()}catch(s){console.error("Stop failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("status").description("Show proxy status and configuration").action(async()=>{try{await IA()}catch(s){console.error("Status failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.command("dashboard").description("Open the log viewer dashboard in browser").action(async()=>{try{await NA()}catch(s){console.error("Dashboard failed:",s instanceof Error?s.message:s),process.exit(1)}}),e.parse()}ZJ().catch(t=>{console.error("Error:",t instanceof Error?t.message:t),process.exit(1)});
|
|
395
395
|
/*! Bundled license information:
|
|
396
396
|
|
|
397
397
|
@fastify/proxy-addr/index.js:
|