A command-line interface for interacting with AI models (GPT-4o, Claude, Deepseek, etc) via OpenRouter.

It's available on npmjs.com at https://www.npmjs.com/package/shelly-ai
- Interactive chat with AI models
- One-time query mode
- Automatic command detection and execution
- Configuration wizard
- Model selection from popular models.
- File context support (analyze code, documents, etc.)
- Conversation history management
Firstly you will need API keys from Openrouter
npm install -g shelly-ai
Then run
shelly-ai --setup
or
sa --setupPaste your API key that you obtained from https://openrouter.ai/settings/keys here, and select a model of your choice. You can choose any models (Free or Paid) from https://openrouter.ai/models.
# Clone the repository
git clone https://github.com/yourusername/shelly-ai.git
cd shelly-ai
# Install dependencies
npm install
# Install globally (optional)
npm install -g .First, run the setup wizard to configure your API key and preferred model:
shelly-ai --setupOr use the shorthand:
sa --setup# Start an interactive chat
sa# Ask a question without starting interactive mode
sa "How do I list all Docker containers?"
# Ask a question and continue in interactive mode
sa --continue "How do I list all Docker containers?"# Analyze a file
sa -f ./myfile.js "Can you explain this code?"# Analyze multiple files
sa -f ./myfile.js ./otherfile.txt "What do these files do?"
# Just analyze files without a specific question
sa -f ./myfile.js ./otherfile.txt
# Important: Always use quotes around your query when using file context
sa -f ./myfile.js "What does this file do?" # CORRECT
sa -f ./myfile.js What does this file do? # INCORRECT - will parse words as filenames# Auto-execute any commands suggested by the assistant
sa --execute "How do I create a new directory in the current folder?"By default, responses are streamed in real-time for a more interactive experience:
# Streaming is enabled by default
sa "Tell me about Node.js"
# Explicitly enable streaming
sa --stream "Tell me about Node.js"
# Disable streaming
sa --no-stream "Tell me about Node.js"Streaming shows the model's response word by word as it's being generated, which provides a more interactive experience.
# List available models
sa --list-models
# Specify a model to use
sa --model anthropic/claude-3.5-sonnet
# Set response temperature (0-1)
sa --temperature 0.8
# Clear conversation history
sa --clearWithin interactive chat mode, you can use these commands:
.exit- Exit the chat.clear- Clear conversation history.help- Show help message.model [modelId]- Change model (leave blank to list available models).temp [0-1]- Change temperature (0 = deterministic, 1 = creative).save [filename]- Save conversation to file.continue- Continue generating from last response.history- Show conversation history.file [path]- Load a file as context
MIT
