UNPKG

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 4.27 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* 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. */ var _chunkK5NJVUL4cjs = require('./chunk-K5NJVUL4.cjs');var _prompts = require('@inquirer/prompts');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var _clitable3 = require('cli-table3'); var _clitable32 = _interopRequireDefault(_clitable3);var _commander = require('commander');var S=()=>{let g=new (0, _commander.Command)("provider");return g.description([_chalk2.default.bold("Show information about supported AI providers and their models."),"",_chalk2.default.gray("Use this to discover available providers and their capabilities.")].join(` `)).option("-l, --list",_chalk2.default.white("List all supported AI providers")).option("-m, --list-models <provider>",_chalk2.default.white("List all models for a specific provider")).addHelpText("after",[_chalk2.default.bold.cyan(` See also:`),_chalk2.default.gray(" rawi configure --show"),_chalk2.default.gray(" rawi act --list"),_chalk2.default.gray(" rawi ask --profile <profile>")].join(` `)).action(async m=>{if(m.list){let r=_chunkK5NJVUL4cjs.e.call(void 0, );console.log(_chalk2.default.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 (0, _clitable32.default)({head:[_chalk2.default.cyan("Provider"),_chalk2.default.cyan("Icon"),_chalk2.default.cyan("Display Name"),_chalk2.default.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([_chalk2.default.cyan(o.name),c,p,_chalk2.default.gray(`[${y}]`)])}),console.log(n.toString()),console.log(_chalk2.default.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 _prompts.select.call(void 0, {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=_chunkK5NJVUL4cjs.d.call(void 0, m.listModels);if(!r){console.error(_chalk2.default.red(`Provider '${m.listModels}' not found.`));return}let d=r.models?r.models.length:0;console.log(_chalk2.default.bold.blue(` Models for provider '${r.name}' [${d} models]:`));let n=20,a=0,s=Math.ceil(d/n),l=i=>{let t=new (0, _clitable32.default)({head:[_chalk2.default.cyan("Model Name"),_chalk2.default.cyan("Description")],style:{head:["cyan"]},colWidths:[28,48],wordWrap:!0});r.models.slice(i*n,(i+1)*n).forEach(o=>{t.push([_chalk2.default.cyan(o.name),o.description?_chalk2.default.gray(o.description):""])}),console.log(t.toString()),console.log(_chalk2.default.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 _prompts.select.call(void 0, {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(_chalk2.default.red(`Error: ${r instanceof Error?r.message:String(r)}`))}return}g.help()}),g};exports.a = S; /* 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-NQWMSMA6.cjs.map