swiftopenai-cli
v1.8.0
Published
Command-line interface for OpenAI API, supporting multiple providers
Maintainers
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
