Skip to main content

LLM chat

Project description

drawing

Bashimu

A command-line LLM chat tool that supports multiple AI providers with customizable personas.

Features

  • Multiple AI Providers: OpenAI, Anthropic Claude, Google Gemini, and Ollama
  • Customizable Personas: Define AI behavior and conversation styles
  • Interactive REPL: Rich terminal interface with markdown rendering
  • Non-Interactive Mode: Send queries directly from command line
  • Conversation Management: Save, edit, and review chat history
  • Provider & Model Switching: Change providers and models on the fly

Installation

pip install bashimu

Quick Start

Interactive Mode

Launch the interactive chat:

bashimu-cli

Non-Interactive Mode

Send a single query and get the response:

bashimu-cli "What is the capital of France?"

Use with specific provider or persona:

bashimu-cli --provider anthropic "Explain Python decorators"
bashimu-cli --persona coding_mentor "Review this code: def foo(): pass"

Perfect for scripting and piping:

bashimu-cli "Generate a JSON list of 5 colors" | jq '.'

Configuration

On first run, bashimu creates configuration files at:

  • Config: ~/.config/llm-chat/config.json
  • Personas: ~/.config/llm-chat/personas/

Edit the config file to add your API keys:

{
  "default_provider": "openai",
  "default_persona": "default",
  "providers": {
    "openai": {
      "name": "OpenAI",
      "api_key": "YOUR_OPENAI_API_KEY",
      "default_model": "gpt-4o"
    },
    "anthropic": {
      "name": "Anthropic",
      "api_key": "YOUR_ANTHROPIC_API_KEY",
      "default_model": "claude-3-haiku-20240307"
    }
  }
}

Interactive Commands

When in interactive mode, use these commands:

  • /help - Show help message
  • /clear - Clear conversation history
  • /history - Show conversation history
  • /save - Save conversation to JSON file
  • /edit - Edit and resend your last message
  • /provider [name] - Switch AI provider
  • /models - List available models
  • /model [name] - Switch model
  • /personas - List available personas
  • /persona [name] - Switch persona (clears chat)
  • /quit, /q, /exit - Exit the chat

Creating Custom Personas

Create JSON files in ~/.config/llm-chat/personas/:

{
  "name": "Code Reviewer",
  "provider": "anthropic",
  "model": "claude-3-opus-20240229",
  "user_identity": "A developer seeking code review",
  "ai_identity": "An expert code reviewer",
  "conversation_goal": "To review code for bugs, style, and best practices",
  "response_style": "Technical, thorough, and constructive"
}

Command-Line Options

bashimu-cli [query] [options]

Positional Arguments:
  query                Optional query to send (non-interactive mode)

Options:
  --provider PROVIDER  Override the default provider
  --persona PERSONA    Override the default persona
  --config CONFIG      Path to a custom config file
  -h, --help          Show help message

License

MIT License - see LICENSE file for details

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bashimu-1.2.3.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bashimu-1.2.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file bashimu-1.2.3.tar.gz.

File metadata

  • Download URL: bashimu-1.2.3.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for bashimu-1.2.3.tar.gz
Algorithm Hash digest
SHA256 91468162a78adcc2e1bf73719e9de2822a533564e07de06ad9ee4c0d203d6ff4
MD5 55467ed904717c077d05e83d6fc65a3a
BLAKE2b-256 bb87f30ada1027e9502901bf0755bd40ae8ea700e9d67e20f3563c3d4b8f8581

See more details on using hashes here.

File details

Details for the file bashimu-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: bashimu-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for bashimu-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 097377f97c28fa98c766cce7e6cac3b7426bb9def3752b92962ea548ea1c657c
MD5 1c09e8219789257683de5f25e51ba9b1
BLAKE2b-256 22837c79fccc50eba635ac33e0c10ff06f4ccf03b73757c260a91edb8ecb50ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page