@nexoracoding/cli 0.1.5 → 0.1.7

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.
Files changed (3) hide show
  1. package/README.md +19 -14
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,28 +1,33 @@
1
1
  # Nexora CLI
2
2
 
3
- The Nexora CLI (`nexora`) is a customizable command line coding agent.
3
+ `nexora` is an AI coding agent for your terminal — with the models included.
4
+ You do not bring an API key and you are not billed per token: the models come
5
+ with the plan, and the free tier is large enough to judge it on real work.
4
6
 
5
- ![Nexora CLI Demo](./media/demo.gif)
7
+ It shares an account, and the same `/` commands, with the Nexora extensions for
8
+ VS Code and the JetBrains IDEs.
6
9
 
7
10
  ## Installation
8
11
 
9
- **macOS / Linux:**
12
+ Requires Node.js 20 or later.
10
13
 
11
14
  ```bash
12
- curl -fsSL https://raw.githubusercontent.com/kemzang-Bryan/Nexora/main/extensions/cli/scripts/install.sh | bash
15
+ npm i -g @nexoracoding/cli
13
16
  ```
14
17
 
15
- **Windows (PowerShell):**
16
-
17
- ```powershell
18
- irm https://raw.githubusercontent.com/kemzang-Bryan/Nexora/main/extensions/cli/scripts/install.ps1 | iex
19
- ```
18
+ ## Commands
20
19
 
21
- Or install with npm if you have Node.js 20+:
20
+ Type `/` in the chat to run one of these:
22
21
 
23
- ```bash
24
- npm i -g @nexoracoding/cli
25
- ```
22
+ | Command | What it does |
23
+ | ----------- | --------------------------------------------- |
24
+ | `/review` | Reviews your working tree and reports defects |
25
+ | `/commit` | Writes a commit message for your changes |
26
+ | `/test` | Writes tests, then runs them |
27
+ | `/fix` | Fixes the errors and warnings reported |
28
+ | `/explain` | Explains the code you point it at |
29
+ | `/docs` | Documents the code you point it at |
30
+ | `/optimize` | Finds and fixes what is slow |
26
31
 
27
32
  ## Usage
28
33
 
@@ -119,4 +124,4 @@ The CLI automatically detects TTY-less environments and adjusts its behavior:
119
124
  - Disables interactive UI components
120
125
  - Ensures clean stdout/stderr output
121
126
 
122
- For more details, see [`spec/tty-less-support.md`](./spec/tty-less-support.md).
127
+ This is detected automatically; there is nothing to configure.
package/dist/index.js CHANGED
@@ -6023,7 +6023,7 @@ Login failed: ${e.message}`)),{exit:!1,output:`Login failed: ${e.message}`}}}asy
6023
6023
  `)}}catch(e){return{exit:!1,output:mt.red(`Impossible de lire l'utilisation : ${e.message}`)}}}function TAm(){try{let e=dAm("git diff --color=never",{encoding:"utf8",maxBuffer:10485760});return e.trim()?{exit:!1,diffContent:e}:{exit:!1,output:mt.gray("No uncommitted changes in the current repository.")}}catch(e){let t=e?.status===128?"The current directory is not a git repository.":`Could not get the diff: ${e.message}`;return{exit:!1,output:mt.yellow(t)}}}function SAm(){let e=[...Wie].sort((n,o)=>n.name.localeCompare(o.name)),t=Math.max(...e.map(n=>n.name.length));return{exit:!1,output:[mt.bold(`Outils disponibles (${e.length})`),"",...e.map(n=>{let o=(n.description||"").split(`
6024
6024
  `)[0].trim(),i=o.length>70?o.slice(0,69).trim()+"\u2026":o;return` ${mt.cyan(n.name.padEnd(t))} ${mt.gray(i)}`})].join(`
6025
6025
  `)}}function yAm(){return{exit:!1,output:[mt.bold("Nexora CLI")+mt.gray(` v${Xg()}`),"",mt.white(" An AI assistant for the terminal \u2014 write, edit and"),mt.white(" run tasks without leaving your terminal."),"",` ${mt.gray("Docs")} ${mt.cyan("https://nexoracoding.com/docs")}`,` ${mt.gray("Site")} ${mt.cyan("https://nexoracoding.com")}`,"",mt.gray(" Type /help for shortcuts, / for commands.")].join(`
6026
- `)}}function vAm(){return{copyLastResponse:!0}}function bAm(){return{exportSession:!0}}function CAm(){let e="https://github.com/kemzang-Bryan/Nexora/issues/new";return Promise.resolve().then(()=>(P_e(),r$t)).then(t=>t.default(e)).catch(()=>{}),{exit:!1,output:mt.gray(`Ouverture du rapport de bug : ${e}`)}}function RAm(e,t){let r=mt.green("\u2713"),n=mt.red("\u2717"),o=!!process.env.NEXORA_API_KEY||!!process.env.CONTINUE_API_KEY,i="\u2014",s=!1;try{let d=ll();s=d!==null,d&&DT(d)?i=d.account?.label||d.userEmail||"signed in":d&&(i="session Nexora")}catch{}let a=t?.models??[],u=a[0]?.model||a[0]?.name||"(set by plan/server)",l=o||s;return{exit:!1,output:[mt.bold("Nexora diagnostics"),"",` ${l?r:n} Authentication : ${o?"API key (env)":l?mt.white(i):mt.yellow("not signed in \u2014 /login")}`,` ${r} Model : ${mt.white(u)}`,` ${r} CLI version : ${mt.white("v"+Xg())}`,` ${r} Runtime : ${mt.white(`Node ${process.version} \xB7 ${process.platform}/${process.arch}`)}`,` ${r} Config folder : ${mt.gray(Ai.continueHome)}`,` ${r} Model proxy : ${mt.gray(Ai.modelProxyBase)}`,` ${r} Nexora site : ${mt.gray(Ai.siteUrl)}`].join(`
6026
+ `)}}function vAm(){return{copyLastResponse:!0}}function bAm(){return{exportSession:!0}}function CAm(){let e="https://nexoracoding.com/contact";return Promise.resolve().then(()=>(P_e(),r$t)).then(t=>t.default(e)).catch(()=>{}),{exit:!1,output:mt.gray(`Ouverture du rapport de bug : ${e}`)}}function RAm(e,t){let r=mt.green("\u2713"),n=mt.red("\u2717"),o=!!process.env.NEXORA_API_KEY||!!process.env.CONTINUE_API_KEY,i="\u2014",s=!1;try{let d=ll();s=d!==null,d&&DT(d)?i=d.account?.label||d.userEmail||"signed in":d&&(i="session Nexora")}catch{}let a=t?.models??[],u=a[0]?.model||a[0]?.name||"(set by plan/server)",l=o||s;return{exit:!1,output:[mt.bold("Nexora diagnostics"),"",` ${l?r:n} Authentication : ${o?"API key (env)":l?mt.white(i):mt.yellow("not signed in \u2014 /login")}`,` ${r} Model : ${mt.white(u)}`,` ${r} CLI version : ${mt.white("v"+Xg())}`,` ${r} Runtime : ${mt.white(`Node ${process.version} \xB7 ${process.platform}/${process.arch}`)}`,` ${r} Config folder : ${mt.gray(Ai.continueHome)}`,` ${r} Model proxy : ${mt.gray(Ai.modelProxyBase)}`,` ${r} Nexora site : ${mt.gray(Ai.siteUrl)}`].join(`
6027
6027
  `)}}function IAm(){return{openJobsSelector:!0}}function wAm(){return{openSessionSelector:!0}}var xAm={help:pAm,clear:()=>({clear:!0,output:"Chat history cleared"}),exit:()=>({exit:!0,output:"Goodbye!"}),collab:I$a,config:()=>({openConfigSelector:!0}),login:fAm,logout:mAm,whoami:hAm,info:O$a,model:()=>({openModelSelector:!0}),compact:()=>({compact:!0}),mcp:()=>({openMcpSelector:!0}),resume:()=>({openSessionSelector:!0}),fork:gAm,title:e=>pYa(e,"title"),rename:e=>pYa(e,"rename"),init:(e,t)=>P$a(e,t),update:()=>({openUpdateSelector:!0}),jobs:IAm,sessions:wAm,checkpoint:_Am,revert:EAm,cost:AAm,diff:TAm,tools:SAm,copy:vAm,about:yAm,doctor:RAm,export:bAm,bug:CAm};async function fYa(e,t,r){if(!e.startsWith("/")||!e.trim().startsWith("/"))return null;let[n,...o]=e.slice(1).split(" ");co.recordSlashCommand(n),Ac.capture("useSlashCommand",{name:n});let i=new Set(["diff","apply"]),s=r?.isRemoteMode&&i.has(n)?void 0:xAm[n];if(s)return await s(o,t,r?.remoteUrl,r);let a=t.prompts?.find(p=>p?.name===n);if(a)return{newInput:a.prompt+o.join(" ")};let u=t.rules?.find(p=>{if(!p||typeof p=="string")return!1;let f=p;return f.invokable===!0&&f.name===n});if(u)return{newInput:u.rule+" "+o.join(" ")};let l=x5t.find(p=>p.name===n);if(l?.prompt){let p=o.join(" ");return{newInput:p?`${l.prompt}
6028
6028
 
6029
6029
  ${p}`:l.prompt}}return uWe(t,{isRemoteMode:r?.isRemoteMode}).some(p=>p.name.toLowerCase().includes(n.toLowerCase()))?{output:`Unknown command: ${n}`}:null}Q1();DG();ri();Phe();o_();nqt();DG();ri();async function mYa({chatHistory:e,model:t,llmApi:r,setChatHistory:n,setCompactionIndex:o,currentSession:i,setCurrentSession:s,setIsCompacting:a,setCompactionStartTime:u,setCompactionAbortController:l}){let c=new AbortController;l(c),a(!0),u(Date.now());try{let d=await Nhe(e,t,r,{abortController:c});if(c.signal.aborted)return;n(d.compactedHistory),o(d.compactionIndex);let p={...i,history:d.compactedHistory};$k(d.compactedHistory),s(p),n(f=>[...f,{message:{role:"system",content:"Chat history compacted successfully."},contextItems:[]}])}catch(d){c.signal.aborted?(be.info("Manual compaction was cancelled by user"),n(p=>[...p,{message:{role:"system",content:"Compaction cancelled."},contextItems:[]}])):(be.error("Compaction failed:",d),n(p=>[...p,{message:{role:"system",content:`Compaction failed: ${oa(d)}`},contextItems:[]}]))}finally{a(!1),u(null),l(null)}}async function Wdn({chatHistory:e,model:t,llmApi:r,compactionIndex:n,setChatHistory:o,setCompactionIndex:i,abortController:s}){let a=await xhe(e,t,r,{isHeadless:!1,callbacks:{setChatHistory:o,setCompactionIndex:i}});return a.wasCompacted?{currentChatHistory:a.chatHistory,currentCompactionIndex:a.compactionIndex}:{currentChatHistory:e,currentCompactionIndex:n}}import*as _Ya from"node:path";$Pt();ri();WPt();o_();t3();Q1();ri();async function NAm(){try{let t=await new Function('return import("sharp")')().catch(()=>null);return t?t.default||t:null}catch{return null}}async function PAm(e,t=1024,r=1024){try{let n=await NAm();if(!n)return be.debug("Sharp not available, using original image buffer"),{buffer:e,isJpeg:!1};be.debug("Processing image with Sharp...");let o=await n(e).resize(t,r,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:85,progressive:!0}).toBuffer();return be.debug(`Image processed with Sharp: ${e.length} bytes -> ${o.length} bytes`),{buffer:o,isJpeg:!0}}catch(n){return be.warn("Failed to process image with Sharp, using original:",n),{buffer:e,isJpeg:!1}}}function OAm(e){if(e.length<4)return"image/png";let t=e.subarray(0,4);if(t[0]===255&&t[1]===216&&t[2]===255)return"image/jpeg";if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return"image/png";if(t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56)return"image/gif";if(t[0]===82&&t[1]===73&&e.length>=12){let r=e.subarray(8,12);if(r[0]===87&&r[1]===69&&r[2]===66&&r[3]===80)return"image/webp"}return"image/png"}async function hYa(e,t,r,n){be.debug(`Processing image placeholder: ${e}, original size: ${t.length} bytes`);try{let o=await PAm(t),i=o.buffer,s=o.isJpeg,a=10*1024*1024;if(i.length>a)return be.warn(`Processed image is still too large (${Math.round(i.length/1024/1024)}MB). Skipping image.`),{textContent:r.replace(e,"[Large image skipped - reduce image size and try again]")};be.debug("Converting processed image to base64...");let u=await new Promise(p=>{setImmediate(()=>{let f=i.toString("base64");p(f)})}),l=s?"image/jpeg":OAm(i),c=`data:${l};base64,${u}`;be.debug(`Image converted to base64 with MIME type ${l}, dataUrl length: ${c.length}`);let d=r.split(e);return d.length>1?(d[0]&&n.push({type:"text",text:d[0]}),n.push({type:"imageUrl",imageUrl:{url:c}}),{textContent:d.slice(1).join(e)}):{textContent:r}}catch(o){return be.error(`Failed to process image ${e}:`,o),{textContent:r.replace(e,"[Image processing failed]")}}}async function Jdn(e,t){if(e){let r=Zde();if(r)return r.history}return[]}function FAm(e){Ac.capture("useSlashCommand",{name:"config"}),e()}function EYa(e){return t=>e(r=>[...r,{message:{role:"system",content:t},contextItems:[]}])}function HAm(){if(process.platform!=="linux")return"Clipboard is not available on this system.";let e=process.env.WAYLAND_DISPLAY||process.env.XDG_SESSION_TYPE==="wayland"?"wl-clipboard":"xclip";return`Clipboard unavailable: install ${e} (sudo apt install ${e}), then try again.`}function VAm(e,t){let r=[...e].reverse().find(i=>i.message.role==="assistant"),n=typeof r?.message.content=="string"?r.message.content:Array.isArray(r?.message.content)?r.message.content.map(i=>i.type==="text"?i.text:"").join(""):"",o=EYa(t);if(!n.trim()){o("No response to copy yet.");return}Promise.resolve().then(()=>($dn(),jdn)).then(({default:i})=>i.write(n)).then(()=>o("Last response copied to clipboard.")).catch(()=>o(HAm()))}function GAm(e,t){let r=EYa(t),n=a=>typeof a=="string"?a:Array.isArray(a)?a.map(u=>u.type==="text"?u.text:"").join(""):"",o=e.filter(a=>a.message.role!=="system").map(a=>`${a.message.role==="user"?"## \u{1F9D1} Vous":a.message.role==="assistant"?"## \u{1F916} Nexora":`## ${a.message.role}`}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexoracoding/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Nexora CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",