BharatCode

Getting Started

Introduction

BharatCode is a Go-native, MIT-licensed CLI coding agent — OpenCode for India. It runs in your terminal, edits real files, runs commands, and keeps your data in India by connecting only to the models you choose: open-weight providers, India-hosted endpoints, or fully local models.

BharatCode is a single static binary written in Go (1.24+, CGO-free). There is no daemon, no background service, and no required telemetry. You install one command, point it at a provider, and start working — either through an interactive terminal UI (TUI) or headlessly for CI and automation.

installbash
brew install arbazkhan971/tap/bharatcode

The three pillars

Everything in BharatCode follows from three commitments.

  • Data stays in India. BharatCode never phones home. It talks only to the model endpoints you configure — run fully local with Ollama or LM Studio so your source code never leaves your machine, or connect to open-weight and India-hosted providers you control.
  • Open-weight first. Open-weight models like DeepSeek and Moonshot/Kimi are first-class citizens, not an afterthought. Providers are config-driven, so you can mix hosted open-weight endpoints, frontier APIs, and local runtimes — and switch between them per session.
  • Yours to own. MIT-licensed and open source. An INR-aware cost ledger with a monthly budget gate keeps spend visible and bounded, and a permission system puts you in control of every file edit and shell command.

What you get

  • An interactive TUI plus a headless mode — bharatcode run "..." for one-shot prompts and --json for an NDJSON event stream you can pipe into CI.
  • 13 built-in tools — view, edit, multiedit, write, ls, glob, grep, bash, web_fetch, web_search, diagnostics, todo — plus background job control.
  • Slash commands in the TUI for sessions, models, agents, diffs, permissions, budget, and your own custom prompts.
  • /goal autonomous mode for bounded, iterative work — set a goal and let the agent run to completion within limits you define.
  • Integrations: MCP servers, LSP diagnostics in context, and shell-backed lifecycle hooks.

Who it's for

BharatCode is built for developers and teams who need to keep code and data within India's borders — banks, enterprises, and DPDP-regulated organizations — as well as individuals who want an open-source agent they can run locally and pay for in INR. If you want full control over which model sees your code and what it's allowed to do, this is for you.

New here?

Head to Installation to get the binary, then Quick Start to run your first session in under a minute.