JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 69
  • Score
    100M100P100Q70717F
  • License MIT

The simplest AI CLI. Chat with any AI model and track costs automatically.

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.0023

Simple. Powerful. Cost-aware.

Installation

npm install -g cost-katana-cli

Quick Start

1. Setup (One-time)

cost-katana init

Answer 2 questions:

  1. Your API key (from costkatana.com)
  2. Your default AI model

Done! ✅

2. Start Chatting

cost-katana chat

That'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 (.http files)
  • ✅ TypeScript/Node.js examples
  • ✅ Python SDK examples
  • ✅ Framework integrations (Express, Next.js, Fastify, NestJS, FastAPI)
  • ✅ Real-world use cases with best practices

Popular examples:


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-4

Analyze Costs

# See your spending
cost-katana analyze

# Last 7 days
cost-katana analyze --days 7

# Export to CSV
cost-katana analyze --export costs.csv

List Models

# See available models
cost-katana models

# Filter by provider
cost-katana models --provider openai

# Show with prices
cost-katana models --prices

Chat Session Commands

While in a chat session, you can use:

  • help - Show commands
  • cost - Show session cost
  • models - Switch model
  • clear - Clear history
  • save - Save conversation
  • quit - Exit

Advanced Features

Cost Optimization

# Enable Cortex (70-95% savings)
cost-katana chat --cortex

# Enable caching
cost-katana chat --cache

Compare Models

# Compare costs across models
cost-katana compare "Explain AI" --models gpt-4,claude-3-sonnet,gemini-pro

Budget Tracking

# Set daily budget
cost-katana budget set --daily 10

# Check budget status
cost-katana budget status

# Get alerts
cost-katana budget alerts

Configuration

View Config

cost-katana config

Update 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 5

Environment Variables

# Alternative to init command
export COST_KATANA_API_KEY="dak_your_key"
export COST_KATANA_MODEL="gpt-4"

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.0067

Content 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.0003

Tips

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 answers

Productivity

# 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 gpt

Comparison

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 create

Cost 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-haiku

Dashboard 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/dashboard

Why 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

License

MIT © Cost Katana


Start chatting with AI in your terminal!

npm install -g cost-katana-cli
cost-katana init
cost-katana chat