rawi
Version:
Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into
9 lines • 3.45 kB
JavaScript
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */
import{d as f,e as h}from"./chunk-LDSHVY7O.js";import{select as u}from"@inquirer/prompts";import e from"chalk";import v from"cli-table3";import{Command as w}from"commander";var S=()=>{let g=new w("provider");return g.description([e.bold("Show information about supported AI providers and their models."),"",e.gray("Use this to discover available providers and their capabilities.")].join(`
`)).option("-l, --list",e.white("List all supported AI providers")).option("-m, --list-models <provider>",e.white("List all models for a specific provider")).addHelpText("after",[e.bold.cyan(`
See also:`),e.gray(" rawi configure --show"),e.gray(" rawi act --list"),e.gray(" rawi ask --profile <profile>")].join(`
`)).action(async m=>{if(m.list){let r=h();console.log(e.bold.blue(`
Supported AI Providers:`));let d={anthropic:"\u{1F7E3}",azure:"\u{1F537}",bedrock:"\u{1F7E0}",deepseek:"\u{1F535}",google:"\u{1F534}",lmstudio:"\u{1F517}",mistral:"\u{1F7E0}",ollama:"\u{1F7E2}",openai:"\u{1F535}",qwen:"\u{1F7E1}",xai:"\u{1F916}"},n=new v({head:[e.cyan("Provider"),e.cyan("Icon"),e.cyan("Display Name"),e.cyan("Models")],style:{head:["cyan"]},colWidths:[16,8,24,10],wordWrap:!0}),a=10,s=0,l=Math.ceil(r.length/a),i=t=>{n.length=0,r.slice(t*a,(t+1)*a).forEach(o=>{let c=d[o.name]||"",y=o.models?o.models.length:0,p=o.displayName||o.name;p.startsWith(c)&&(p=p.slice(c.length).trim()),n.push([e.cyan(o.name),c,p,e.gray(`[${y}]`)])}),console.log(n.toString()),console.log(e.gray(`Page ${t+1} of ${l}`))};if(r.length>a){let t=!1;for(;!t;){i(s);let o=[];s>0&&o.push({name:"Previous",value:"prev"}),s<l-1&&o.push({name:"Next",value:"next"}),o.push({name:"Exit",value:"exit"});let c=await u({message:"Navigate pages:",choices:o,default:s<l-1?"next":"exit"});c==="prev"?s--:c==="next"?s++:t=!0,t||console.clear()}}else i(0);return}if(m.listModels){try{let r=f(m.listModels);if(!r){console.error(e.red(`Provider '${m.listModels}' not found.`));return}let d=r.models?r.models.length:0;console.log(e.bold.blue(`
Models for provider '${r.name}' [${d} models]:`));let n=20,a=0,s=Math.ceil(d/n),l=i=>{let t=new v({head:[e.cyan("Model Name"),e.cyan("Description")],style:{head:["cyan"]},colWidths:[28,48],wordWrap:!0});r.models.slice(i*n,(i+1)*n).forEach(o=>{t.push([e.cyan(o.name),o.description?e.gray(o.description):""])}),console.log(t.toString()),console.log(e.gray(`Page ${i+1} of ${s}`))};if(d>n){let i=!1;for(;!i;){l(a);let t=[];a>0&&t.push({name:"Previous",value:"prev"}),a<s-1&&t.push({name:"Next",value:"next"}),t.push({name:"Exit",value:"exit"});let o=await u({message:"Navigate pages:",choices:t,default:a<s-1?"next":"exit"});o==="prev"?a--:o==="next"?a++:i=!0,i||console.clear()}}else l(0)}catch(r){console.error(e.red(`Error: ${r instanceof Error?r.message:String(r)}`))}return}g.help()}),g};export{S as a};
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into an intelligent development workspace. */
//# sourceMappingURL=chunk-YL44MFU3.js.map