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.48 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 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. */ var _prompts = require('@inquirer/prompts');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var a=class{async getBaseURL(t){console.log(_chalk2.default.gray("Note: The Base URL is where your service is running.")),console.log(_chalk2.default.gray("Leave empty to use the default endpoint."));let e=(await _prompts.input.call(void 0, {message:"Base URL:",default:t||"",validate:r=>{if(!r.trim())return!0;try{return new URL(r.trim()),!0}catch (e2){return"Please enter a valid URL (e.g., https://api.example.com)"}}})).trim();return e===""?void 0:e}async getAPIEndpoint(t){console.log(_chalk2.default.gray("Note: API endpoint for custom deployments.")),console.log(_chalk2.default.gray("Leave empty to use the default endpoint."));let e=(await _prompts.input.call(void 0, {message:"API Endpoint:",default:t||"",validate:r=>{if(!r.trim())return!0;let o=r.trim();return!o.startsWith("http://")&&!o.startsWith("https://")?"Endpoint must start with http:// or https://":!0}})).trim();return e===""?void 0:e}async getRegion(t){return console.log(_chalk2.default.gray("Select the region for your cloud provider:")),(await _prompts.input.call(void 0, {message:"Region:",default:t||"us-east-1",validate:e=>e.trim()?!0:"Region is required"})).trim()}async getProjectId(t){return console.log(_chalk2.default.gray("Note: Project ID from your cloud provider console.")),(await _prompts.input.call(void 0, {message:"Project ID:",default:t||"",validate:e=>{if(!e.trim())return"Project ID is required";let r=e.trim();return/^[a-zA-Z0-9-]+$/.test(r)?!0:"Project ID can only contain letters, numbers, and hyphens"}})).trim()}async getAccessKey(t){return console.log(_chalk2.default.gray("Note: AWS Access Key ID from your AWS console.")),(await _prompts.input.call(void 0, {message:"Access Key ID:",default:t||"",validate:e=>{if(!e.trim())return"Access Key ID is required";let r=e.trim();return r.length<16||r.length>32?"Access Key ID should be 16-32 characters long":!0}})).trim()}async getSecretAccessKey(t){return console.log(_chalk2.default.gray("Note: AWS Secret Access Key from your AWS console.")),(await _prompts.input.call(void 0, {message:"Secret Access Key:",default:t||"",validate:e=>e.trim()?e.trim().length<16?"Secret Access Key seems too short":!0:"Secret Access Key is required"})).trim()}async getSessionToken(t){console.log(_chalk2.default.gray("Note: Optional session token for temporary AWS credentials.")),console.log(_chalk2.default.gray("Leave empty if using permanent credentials."));let e=(await _prompts.input.call(void 0, {message:"Session Token (optional):",default:t||""})).trim();return e===""?void 0:e}};exports.a = a; /* 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-YEL2W4UF.cjs.map