Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (swiftopenai-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SwiftOpenAI-CLI
A powerful command-line interface for OpenAI API and compatible providers, built with Swift.
Installation
npm install -g swiftopenai-cliQuick Start
- Set your API key:
swiftopenai config set api-key YOUR_API_KEY- Start chatting:
swiftopenai "What is the capital of France?"Features
- 💬 Chat - Interactive conversations with GPT models
- 🖼️ Image Generation - Create images with DALL-E
- 📊 Models - List available models
- 🧮 Embeddings - Generate text embeddings
- ⚙️ Multi-Provider Support - OpenAI, Grok, Groq, DeepSeek, OpenRouter, and more
Usage Examples
Chat
# Simple chat
swiftopenai "Explain quantum computing"
# Interactive mode
swiftopenai chat --interactive
# With specific model
swiftopenai chat --model gpt-4o "Write a haiku"
# Plain output for scripts
swiftopenai -p "What is 2+2?"Image Generation
swiftopenai image "A sunset over mountains"Configuration
# Set API key
swiftopenai config set api-key sk-...
# Use alternative provider
swiftopenai config set provider openrouter
swiftopenai config set base-url https://openrouter.ai/apiDocumentation
For full documentation, visit: https://github.com/jamesrochabrun/SwiftOpenAICLI
License
MIT