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

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/config.toml:

default_model = "default"

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

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

Usage

Start Sahya Code:

sahya

Or with a specific prompt:

sahya "Explain this codebase to me"

Available Commands

sahya --help              # Show help
sahya --version           # Show version
sahya web                 # Start web interface
sahya mcp list            # List MCP servers
sahya 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
SAHYA_CACHE_DIR Cache directory ~/.cache/sahya-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.0.tar.gz (368.1 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.0-py3-none-any.whl (469.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sahya_code-1.0.0.tar.gz
  • Upload date:
  • Size: 368.1 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.0.tar.gz
Algorithm Hash digest
SHA256 be7f566cccbfd09837b81eef15baaabef2af8fbc567110c7c0e8dfa73b1c1220
MD5 e3688e306caa3182a81a546c8647adf4
BLAKE2b-256 db256a0a90c407c04a166f9f3c683663305bd77e2ea8394853a1257d05d4aadf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sahya_code-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 469.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17dd8e132bb9c370fa4f92b54c8d92741a56161f021ae871c8793f87d1335007
MD5 2e4833d4b974e781a2ba91b649ed24e9
BLAKE2b-256 fc1934aeb74238b364b655da232193f305535b459e63d807f5dfa6ef6076e33e

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