Nanocoder

A beautiful local-first coding agent running in your terminal - built by the community for the community ⚒

Last verified:

Visit Nanocoder

What is Nanocoder?

Nanocoder is a local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, it supports any AI provider with an OpenAI-compatible endpoint, including local models (Ollama, LM Studio, vLLM, llama.cpp) and cloud providers (OpenRouter, OpenAI, Z.ai). The tool runs in your terminal and provides file operations, command execution, and MCP server integration for extended capabilities.

Key features include multi-provider support with smart fallback, an advanced tool system with built-in file operations and bash execution, a custom command system using markdown files with template variables, smart autocomplete, configurable logging levels, colorized output with syntax highlighting, session persistence across sessions, real-time indicators showing token usage and timing, three development modes (Normal, Auto-accept, Plan mode), VS Code extension integration with live diff previews, and project-specific configuration via agents.config.json. It also includes built-in commands like /init for project initialization, /test for test generation, /review for code reviews, and /refactor for applying DRY/SOLID principles.

Nanocoder is designed for developers who value privacy and want control over their AI coding workflow. It's ideal for users who prefer local models, want to avoid corporate telemetry, contribute to open-source projects, work in CI/CD pipelines with its non-interactive mode, or need enterprise-grade local logging. The tool is built by the Nano Collective, a community-led group building AI tools for the community rather than for profit.

Nanocoder pricing

Pricing model: Freemium

Completely free and open-source with no paid tier. Nanocoder is built by the community collective for the community, not for profit. Users can install globally via npm (npm install -g @nanocollective/nanocoder) and use it anywhere. There is no telemetry you cannot see, and the community collective cannot be quietly acquired. API costs depend on the provider you choose - local models like Ollama are free, while cloud providers like OpenRouter or Z.ai charge their own rates based on usage.

Nanocoder pros

  • Open-source and community-led development
  • Local-first approach keeps data on your machine
  • Supports any OpenAI-compatible API endpoint
  • Works with local models like Ollama and LM Studio
  • No paid tier - completely free to use
  • No hidden telemetry you cannot see
  • VS Code extension with live diff previews
  • MCP server support for extended tool capabilities
  • Custom markdown-based command system with parameters
  • Three development modes including Plan mode for exploration
  • Non-interactive mode for CI/CD automation
  • Conversation checkpointing to save and restore sessions
  • Enterprise-grade local logging with Pino
  • Smart autocomplete with tab completion
  • Project-specific configuration per repository
  • Smart fallback to available providers if one fails
  • Built-in commands for testing, reviewing, and refactoring
  • Session persistence maintains context across sessions

Nanocoder cons

  • CLI-only interface (no native GUI)
  • Requires Node.js 18+ and npm for installation
  • Local models require sufficient hardware resources
  • VS Code extension requires manual installation if auto-install fails
  • Smaller community compared to commercial alternatives
  • Setup complexity for MCP servers and providers
  • No official enterprise supportSLA
  • Active editor context may disappear when switching files

Frequently asked questions about Nanocoder

What is Nanocoder?

Nanocoder is a local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, it supports any AI provider that has an OpenAI-compatible endpoint, including both tool-calling and non-tool-calling models. It runs in your terminal and provides file operations, command execution, and MCP server integration.

How is this different from OpenCode?

The difference comes down to philosophy. OpenCode is owned and managed by a venture-backed company that restricts community and open-source involvement to the outskirts. Nanocoder is a true community-led project where anyone can contribute openly and directly. Nanocoder strongly believes in the local-first approach where your data, models, and processing stay on your machine for maximum privacy and user control, and actively pushes advancements for small local models to be effective at coding locally.

How do I install Nanocoder?

For users, install globally via npm: npm install -g @nanocollective/nanocoder, then run nanocoder in any directory. For development, clone the repo, run npm install, then npm run build, and npm run start. Or use npm run dev to build and run in one command. Prerequisites are Node.js 18+ and npm.

What AI providers does Nanocoder support?

Nanocoder supports any OpenAI-compatible API. Local providers include Ollama, LM Studio, vLLM, LocalAI, and llama.cpp. Cloud providers include OpenRouter, OpenAI, and Z.ai. You configure providers in agents.config.json with a name, baseUrl, optional apiKey, and model list. Smart fallback automatically switches to available providers if one fails.

How do I configure local models like Ollama?

Create agents.config.json in your working directory with a provider configuration. For Ollama, use: { name: 'Ollama', baseUrl: 'http://localhost:11434/v1', models: ['qwen2.5-coder:14b', 'llama3.2'] }. Other local options include llama.cpp server (http://localhost:8080/v1), LM Studio (http://localhost:1234/v1), and vLLM (http://localhost:8000/v1).

What is the VS Code extension?

The Nanocoder VS Code extension bridges the CLI with VS Code. When AI proposes file edits, you see a full diff preview in VS Code before approving. The file you have focused and any selection inside it is automatically pushed to the CLI and attached to your next message. Key features include active editor context showing on the status line, live diff preview in VS Code's diff viewer, and diagnostics sharing where VS Code's LSP diagnostics are shared with Nanocoder for context.

What are the development modes?

Nanocoder has three development modes toggled with Shift+Tab: Normal mode is the standard tool confirmation flow where you review each tool call before execution. Auto-accept mode automatically accepts all tool calls without confirmation for faster workflows. Plan mode has the AI suggest actions but doesn't execute tools, useful for planning and exploration.

How do custom commands work?

Custom commands are markdown files in .nanocoder/commands/ directory with YAML frontmatter for metadata (description, aliases, parameters). Use {{parameter}} syntax for template variable substitution. For example, create test.md with description and parameters, then use /test component='UserService'. Pre-installed commands include /test, /review, /refactor:dry, and /refactor:solid. Commands support namespace organization through directories.

What is MCP server support?

MCP (Model Context Protocol) servers extend Nanocoder's capabilities with additional tools. Configure them in agents.config.json under mcpServers with name, command, args, and optional env variables. Popular MCP servers include filesystem for enhanced file operations, GitHub for repository management, Brave Search for web search, and Memory for persistent context storage. Nanocoder automatically connects to all configured servers on startup and makes their tools available to the AI model.

How do I contribute to Nanocoder?

You can contribute code by reading the CONTRIBUTING.md guide for development setup and coding standards. For design, marketing, or community involvement, join the Discord server to connect with other users, ask questions, and share ideas. You can also open GitHub issues or discussions. Areas needing help include adding new AI providers, improving tool functionality, enhancing UX, writing documentation, reporting bugs, marketing, design, and creating model cards for the recommendations database.

Categories

Use cases

Browse all AI tools on NeedAnAI