Package Exports
- cost-katana-cli
- cost-katana-cli/dist/index.js
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 (cost-katana-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Cost Katana CLI 🥷
Chat with AI from your terminal. Track costs automatically.
$ cost-katana chat
You: Hello!
AI: Hi! How can I help you today?
💰 Cost: $0.0001
You: Write me a Python function
AI: Here's a Python function...
💰 Session: $0.0023Simple. Powerful. Cost-aware.
Installation
npm install -g cost-katana-cliQuick Start
1. Setup (One-time)
cost-katana initAnswer 2 questions:
- Your API key (from costkatana.com)
- Your default AI model
Done! ✅
2. Start Chatting
cost-katana chatThat's it!
📚 More Examples
Looking for more comprehensive examples? Check out our complete examples repository
🔗 github.com/Hypothesize-Tech/costkatana-examples
What's included:
- ✅ 44 feature sections covering every Cost Katana capability
- ✅ CLI examples and guides in Section 9
- ✅ HTTP REST API examples (
.httpfiles) - ✅ TypeScript/Node.js examples
- ✅ Python SDK examples
- ✅ Framework integrations (Express, Next.js, Fastify, NestJS, FastAPI)
- ✅ Real-world use cases with best practices
Popular examples:
- CLI Examples - Complete CLI guides
- Cost Tracking - Track costs across all providers
- Webhooks - Real-time notifications
- Workflows - Multi-step AI orchestration
- Semantic Caching - 30-40% cost reduction
Essential Commands
Chat with AI
# Start interactive chat
cost-katana chat
# Use specific model
cost-katana chat --model claude-3-sonnet
# With system prompt
cost-katana chat --system "You are a coding expert"Quick Question (No chat mode)
# Ask a single question
cost-katana ask "What is the capital of France?"
# Save answer to file
cost-katana ask "Explain Python" --output answer.txt
# Use different model
cost-katana ask "Write a poem" --model gpt-4Analyze Costs
# See your spending
cost-katana analyze
# Last 7 days
cost-katana analyze --days 7
# Export to CSV
cost-katana analyze --export costs.csvList Models
# See available models
cost-katana models
# Filter by provider
cost-katana models --provider openai
# Show with prices
cost-katana models --pricesSupported Models
The CLI uses type-safe model constants internally for reliability and autocomplete support. All models from the following providers are supported:
OpenAI
- GPT-5, GPT-5 Mini, GPT-5 Nano, GPT-5 Pro
- GPT-4, GPT-4 Turbo, GPT-4o, GPT-4o Mini
- GPT-3.5 Turbo
- O1, O1 Mini, O1 Preview
- DALL-E, Whisper, TTS
Anthropic
- Claude Sonnet 4.5
- Claude 3.5 Sonnet, Claude 3.5 Haiku
- Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- Gemini 2.5 Pro, Gemini 2.5 Flash
- Gemini 1.5 Pro, Gemini 1.5 Flash
AWS Bedrock
- Claude models via Bedrock
- Titan models
- Mistral models
Others
- xAI Grok models
- DeepSeek models
- Mistral AI models
- Cohere models
- Groq models
- Meta Llama models
For the complete list, run cost-katana models or visit costkatana.com/docs
Chat Session Commands
While in a chat session, you can use:
help- Show commandscost- Show session costmodels- Switch modelclear- Clear historysave- Save conversationquit- Exit
Advanced Features
Cost Optimization
# Enable Cortex (40-75% savings)
cost-katana chat --cortex
# Enable caching
cost-katana chat --cacheCompare Models
# Compare costs across models
cost-katana compare "Explain AI" --models gpt-4,claude-3-sonnet,gemini-proBudget Tracking
# Set daily budget
cost-katana budget set --daily 10
# Check budget status
cost-katana budget status
# Get alerts
cost-katana budget alertsConfiguration
View Config
cost-katana configUpdate Settings
# Change default model
cost-katana config set model gpt-4
# Set temperature
cost-katana config set temperature 0.7
# Set daily limit
cost-katana config set daily-limit 5Environment Variables
# Option 1: Cost Katana API Key (Recommended)
export COST_KATANA_API_KEY="dak_your_key"
export COST_KATANA_MODEL="gpt-4"
# Option 2: Direct Provider Keys (for self-hosted)
# ⚠️ USER PROVIDED - CostKATANA does not include these keys
export OPENAI_API_KEY="sk-..." # Required for OpenAI models (GPT-4, GPT-3.5)
export GEMINI_API_KEY="..." # Required for Gemini models (Gemini 2.5, etc.)
export AWS_ACCESS_KEY_ID="..." # For AWS Bedrock (Claude, Nova)
export AWS_SECRET_ACCESS_KEY="..."⚠️ Important: When using self-hosted mode, you must provide your own OpenAI and Gemini API keys.
Real-World Examples
Code Assistant
$ cost-katana chat --system "You are a senior developer. Be concise."
You: Review this code: [paste code]
AI: Here are the issues...
💰 Cost: $0.0045
You: How do I fix issue #2?
AI: Here's how to fix it...
💰 Session: $0.0067Content Writer
$ cost-katana chat --model gpt-4 --cortex
You: Write a blog post about AI
AI: [Generates comprehensive post with 70% cost savings]
💰 Cost: $0.0123 (saved $0.041 with Cortex!)Quick Answers
# Get quick answers without entering chat mode
$ cost-katana ask "What's the weather API for Node.js?"
> Use the 'axios' library to call weather APIs like OpenWeatherMap...
💰 Cost: $0.0002
$ cost-katana ask "Python sort list by date" --output answer.md
✅ Saved to answer.md
💰 Cost: $0.0003Tips
Save Money
# Use cheaper models for simple tasks
cost-katana chat --model gpt-3.5-turbo # 10x cheaper
# Enable optimization for long content
cost-katana chat --cortex # 70-95% savings
# Cache repeated queries
cost-katana chat --cache # Free repeated answersProductivity
# Save conversations
cost-katana chat --output session.json
# Load previous conversation
cost-katana chat --file session.json
# Pipe output
cost-katana ask "List of AI models" | grep gptComparison
Traditional AI CLIs
# Complex setup
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
# Different commands for each provider
openai chat
anthropic messages createCost Katana CLI
# Simple setup
cost-katana init
# One command for all providers
cost-katana chat
# Automatic cost tracking!Troubleshooting
"API key not found"
# Run init again
cost-katana init
# Or set environment variable
export COST_KATANA_API_KEY="dak_your_key""Model not available"
# See available models
cost-katana models
# Try a different model
cost-katana chat --model gpt-3.5-turbo"Rate limit exceeded"
# CLI automatically retries
# If persistent, try different model:
cost-katana chat --model claude-3-haikuDashboard Integration
All your CLI usage is tracked at costkatana.com/dashboard:
- Real-time cost tracking
- Usage by model
- Daily/weekly/monthly stats
- Budget alerts
- Optimization tips
# Every command is tracked
cost-katana chat
cost-katana ask "Hello"
# View at: https://costkatana.com/dashboardWhy Cost Katana CLI?
✅ Simple: 2-step setup, then just cost-katana chat
✅ Universal: Works with all AI providers
✅ Cost-Aware: See costs in real-time
✅ Optimized: Built-in 70-95% cost reduction
✅ Tracked: Everything logged to dashboard
✅ Beautiful: Clean, colorful terminal UI
Support
- Documentation: https://docs.costkatana.com/cli
- Dashboard: https://costkatana.com
- GitHub: https://github.com/Hypothesize-Tech/costkatana-cli
- Discord: https://discord.gg/D8nDArmKbY
- Email: support@costkatana.com
License
MIT © Cost Katana
Start chatting with AI in your terminal!
npm install -g cost-katana-cli
cost-katana init
cost-katana chat