UNPKG

rawi

Version:

Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into

4 lines 3.23 kB
/* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 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{a as s}from"./chunk-2DPVFSBV.js";import{d as t}from"./chunk-YGEDZIJR.js";import i from"chalk";var c=new s,d=(o=t)=>c.getCredentials(o),v=(o=t)=>{let e=d(o);if(e?.provider==="ollama"||e?.provider==="lmstudio")return!!(e.provider&&e.model);if(e?.provider==="azure")return!!(e.provider&&e.model&&(e.apiKey||e.providerSettings&&"apiKey"in e.providerSettings&&e.providerSettings.apiKey)&&e.providerSettings&&"resourceName"in e.providerSettings);if(e?.provider==="bedrock"){if(!e.provider||!e.model||!e.providerSettings)return!1;let r=e.providerSettings;return!!("useProviderChain"in r&&r.useProviderChain||"accessKeyId"in r&&"secretAccessKey"in r&&r.accessKeyId&&r.secretAccessKey)}let n=e&&(e.apiKey||e.providerSettings&&"apiKey"in e.providerSettings&&e.providerSettings.apiKey);return e?.provider==="xai"||e?.provider==="openai"||e?.provider==="google"||e?.provider==="anthropic"?!!(e?.provider&&e?.model&&n):!!(n&&e?.provider&&e?.model)},g=(o=t)=>{let e=d(o);e||(console.error(i.red(`\u274C No configuration found for profile '${o}'. Run 'rawi configure' to set up.`)),process.exit(1));let n=e&&(e.apiKey||e.providerSettings&&"apiKey"in e.providerSettings&&e.providerSettings.apiKey);if(e.provider==="ollama")(!e.provider||!e.model)&&(console.error(i.red(`\u274C Incomplete configuration for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1));else if(e.provider==="azure")(!n||!e.provider||!e.model||!e.providerSettings||!("resourceName"in e.providerSettings))&&(console.error(i.red(`\u274C Incomplete Azure configuration for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1));else if(e.provider==="bedrock"){(!e.provider||!e.model||!e.providerSettings)&&(console.error(i.red(`\u274C Incomplete Bedrock configuration for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1));let r=e.providerSettings,p="useProviderChain"in r&&r.useProviderChain,a="accessKeyId"in r&&"secretAccessKey"in r&&r.accessKeyId&&r.secretAccessKey;!p&&!a&&(console.error(i.red(`\u274C Incomplete Bedrock credentials for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1))}else e.provider==="xai"||e.provider==="openai"||e.provider==="google"||e.provider==="anthropic"?(!e.provider||!e.model||!n)&&(console.error(i.red(`\u274C Incomplete ${e.provider} configuration for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1)):(!n||!e.provider||!e.model)&&(console.error(i.red(`\u274C Incomplete configuration for profile '${o}'. Run 'rawi configure' to update.`)),process.exit(1));return e};export{d as a,v as b,g as c}; /* Rawi (راوي) is the developer-friendly AI CLI that brings the power of 11 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-7GP3BBAG.js.map