Skip to main content

Sahya Code - Your AI coding companion.

Project description

Sahya Code

Sahya Code is a CLI-based AI coding agent that helps you write, edit, and understand code through natural language interaction. It is a customized fork of kimi-cli, pre-configured to work with LiteLLM endpoints.

Features

  • 🤖 AI-powered coding assistance
  • 📝 Code reading, writing, and editing
  • 🔍 Web search and fetch capabilities
  • 🐚 Shell command execution
  • 🔧 Extensible tool system with MCP support
  • 💻 Terminal UI with rich formatting
  • 🌐 Web interface for browser-based interaction

Installation

pip install sahya-code-code

Configuration

API Key

Set your API key as an environment variable:

export SAHYA_API_KEY="sk-VBkuXAOO7e2kV5-uWpz84A"

Or configure interactively on first run using the setup wizard.

Custom Endpoint

Sahya Code uses a LiteLLM-compatible endpoint by default:

  • URL: https://llm.nexiant.ai
  • Protocol: OpenAI-compatible API

To use a different endpoint:

export SAHYA_BASE_URL="https://your-endpoint.com"

Configuration File

You can also configure via the config file at ~/.local/share/sahya-code-code/config.toml:

default_model = "default"

[models.default]
provider = "sahya-code"
model = "kimi-k2.5"
max_context_size = 256000
capabilities = ["image_in", "thinking"]

[providers.sahya-code]
type = "openai_legacy"
base_url = "https://llm.nexiant.ai"
api_key = "sk-VBkuXAOO7e2kV5-uWpz84A"

Usage

Start Sahya Code:

sahya-code

Or with a specific prompt:

sahya-code "Explain this codebase to me"

Available Commands

sahya-code --help              # Show help
sahya-code --version           # Show version
sahya-code web                 # Start web interface
sahya-code mcp list            # List MCP servers
sahya-code mcp add <name> ...  # Add MCP server

Interactive Commands

Once in the shell, you can use:

  • Ctrl+X - Toggle between agent mode and shell mode
  • /help - Show available slash commands
  • /exit or Ctrl+D - Exit

Environment Variables

Variable Description Default
SAHYA_API_KEY API key for authentication Required
SAHYA_BASE_URL LiteLLM endpoint URL https://llm.nexiant.ai
SAHYA_SHARE_DIR Config and data directory ~/.local/share/sahya-code-code
SAHYA_CACHE_DIR Cache directory ~/.cache/sahya-code-code

Documentation

Requirements

  • Python 3.12 or higher
  • API key for the LiteLLM endpoint

Acknowledgments

Sahya Code is based on kimi-cli by Moonshot AI.

License

Apache License 2.0

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

sahya_code-1.0.1.tar.gz (368.2 kB view details)

Uploaded Source

Built Distribution

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

sahya_code-1.0.1-py3-none-any.whl (469.5 kB view details)

Uploaded Python 3

File details

Details for the file sahya_code-1.0.1.tar.gz.

File metadata

  • Download URL: sahya_code-1.0.1.tar.gz
  • Upload date:
  • Size: 368.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for sahya_code-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2ecd5e028994a358d303b9339072cc2c9615c2f9c14423b0d985060d5bc96134
MD5 2d565f63ae1daa32e23d22719d2eebcb
BLAKE2b-256 a87ecd1239566d271062a412edadf5dd77e15e25dc630bfd25a58515084b53f0

See more details on using hashes here.

File details

Details for the file sahya_code-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sahya_code-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 469.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for sahya_code-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32ec685c243935fdee49f13b50bd97b5185e973cf61a76979a44a20d28fe3860
MD5 ea2254bb6fb9c2d827118f68f4cf518c
BLAKE2b-256 41bef5bf39bacf78f26fcb31b74249eec27d63edfb460eeebd71ac79ae437b3a

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