Languages

Atlas for Nim: A Terminal-Native AI Coding Agent for Nimble Packages and Macros in 2026

Updated 6 min read

Atlas is a terminal-native AI coding agent for Nim in 2026, built around nimble packages, compile-time macros, and the unittest module. Atlas reads your Nim modules, the exported symbols marked with an asterisk, and the requires lines in the nimble file. Atlas adds a suite and check block from std/unittest under tests/, runs nimble test behind a permission prompt, formats the touched modules with nph, and shows you a diff before writing.

Nim macros, templates, and why Atlas indexes with tree-sitter

Nim leans hard on compile-time macros and templates, and a macro expands into code that exists nowhere in your source. Atlas indexes code by AST declarations using tree-sitter, so in 2026 a query for a Nim macro resolves to the macro declaration itself.

A grep across a Nim package finds the word template a hundred times and tells you nothing. Nim metaprogramming means a proc you are looking for may be generated, and a template you are debugging may look like an ordinary call. Atlas indexes by AST declarations rather than blind line windows, so a macro, a template, a proc, and a type each become their own retrievable unit. Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion, which is why asking which macro generates a serializer returns that macro rather than every module that imports it. Atlas runs as a terminal-native TUI beside nim and nimble.

The asterisk: how Atlas reads Nim export visibility

Nim marks a public symbol with a single asterisk, and Atlas reads it. Atlas reads your modules, exported symbols marked with an asterisk, and requires lines in the nimble file, so a 2026 change knows which proc is package API and which proc is internal.

One character decides whether a Nim proc is part of your package contract. A proc without the asterisk is invisible to importers, and a proc that gains one is a public commitment you now have to keep. Atlas reads the asterisk before it plans, so it will not quietly export an internal helper or strip the asterisk from a proc that three other nimble packages import. Atlas drafts a plan in a read-only plan agent and asks before switching to a build agent, which means you see the proposed export changes, the new imports, and the requires lines while the working tree is still untouched.

Adding std/unittest suites and running nimble test

Nim ships testing in the standard library, and Atlas uses it in 2026. Ask Atlas to add a suite and check block from std/unittest under tests/, then let Atlas run nimble test behind a permission prompt before it commits the diff to your Nim package.

A suite block with check assertions under tests/ is the idiomatic Nim test, and nimble test is how it runs. Atlas writes the suite, then proves it. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so nimble test executes only because you allowed it, and an edit to the requires lines in your .nimble file prompts separately. Nim compile errors that surface from inside a macro expansion are famously opaque, so an agent that actually runs nimble test and reads the expansion error has a real advantage over one that reasons about what the compiler probably said.

Formatting Nim with nph and reviewing the diff

Nim uses significant indentation, so a formatting change can be a semantic change. Atlas formats the touched modules with nph, then computes a unified diff for every file edit and surfaces it for approval before writing anything into your Nim package in 2026.

Running nph over the touched modules before review keeps a Nim diff honest, because a shifted indent level moves a statement into or out of a block. What you read is the proc that changed, the asterisk that appeared, the suite that landed under tests/. Atlas snapshots file changes as git patches, so a template rewrite that compiled cleanly but broke a downstream nimble package can be diffed and rolled back without hand surgery. Atlas also reads git branches, status, and diffs, and can stage and create commits on your behalf after you approve.

Nim on private systems code: local Ollama embeddings

Nim compiles to C and lands in embedded and systems work where source does not leave the building. Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, so indexing your Nim modules runs on your own hardware in 2026.

Nim is picked for performance and small binaries, and that work tends to be proprietary. Building the code index with local Ollama embeddings keeps the embedding pass over your .nim modules on a machine you control. Atlas is extensible through plugins that contribute tools and hook into agent lifecycle events, so a Nim team can add its own cross-compile check to the agent loop. Atlas connects to Model Context Protocol servers and exposes their tools to the agent, and Atlas lets you switch the active model and provider on the fly with favorites and recents, so a mechanical unittest pass and a gnarly macro problem need not share a model.

Getting started

  1. 01Run atlas in a package with a .nimble file
  2. 02Let Atlas read your modules, exported symbols marked with an asterisk, and requires lines in the nimble file
  3. 03Ask Atlas to add a suite and check block from std/unittest under tests/
  4. 04Let Atlas run nimble test behind a permission prompt before it commits the diff
  5. 05Have Atlas format the touched modules with nph

Frequently asked questions

does atlas work with nim and nimble
Yes. Atlas runs in a package with a .nimble file, reads the requires lines, and runs nimble test behind a permission prompt before it commits the diff.
can an ai coding agent handle nim compile-time macros
Atlas indexes code by AST declarations using tree-sitter, so a Nim macro or template resolves to its own declaration, and Atlas reads the expansion error from nimble test when one fails.
how does atlas know which nim procs are exported
Nim marks public symbols with an asterisk. Atlas reads your exported symbols marked with an asterisk, so it can tell package API from internal helpers.
can atlas write std/unittest tests for nim
Yes. Ask Atlas to add a suite and check block from std/unittest under tests/, then let Atlas run nimble test to prove the suite passes.
does atlas format nim code with nph
Yes. Atlas formats the touched modules with nph, which matters in Nim because indentation is significant and a stray indent moves a statement between blocks.
will atlas add nim dependencies without asking
No. Every Atlas tool call is permission-gated against allow, ask, and deny rules, so an edit to the requires lines in your .nimble file prompts you first.
is atlas safe on proprietary nim systems code
Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, and it snapshots file changes as git patches so any edit can be rolled back.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Document a Nim Module with a README Using Atlas in 2026

For Nim developers in 2026, Atlas generates accurate READMEs directly from your codebase, leveraging `nimble` and `nph` to reflect current code behavior.

Trace a Nim Runtime Bug from a Stack Trace with Atlas in 2026

Pinpoint and fix Nim runtime bugs from production stack traces using Atlas, the terminal-native AI coding agent. Leverage Nim's toolchain, including nimble and nph, for efficient debugging.

Debug a single failing test in Nim with Atlas in 2026

In 2026, Nim developers use Atlas to efficiently debug failing tests. Learn how Atlas leverages `nimble test`, `lsp`, and `nph` to pinpoint and fix issues in your Nim codebase.

Locate where a behavior is implemented in Nim with Atlas in 2026

In 2026, Nim developers use Atlas to pinpoint behavior implementations. Atlas combines semantic search, `grep`, and LSP tools to quickly find exact files and symbols within `nimble` projects, ensuring precise code

Extract a Shared Helper from Duplicated Nim Code with Atlas in 2026

Refactor duplicated Nim code into a shared helper using Atlas. Leverage semantic search, nimble test, and nph to streamline your Nim codebase in 2026.

Review a pull request in Nim with Atlas in 2026

Streamline your Nim pull request reviews in 2026 with Atlas. Leverage its AI to fetch branches, analyze diffs, run `nimble test`, and format code with `nph` for comprehensive feedback.

Onboard to an unfamiliar codebase in Nim with Atlas in 2026

Quickly build a mental model of any Nim codebase in 2026 using Atlas. Leverage nimble, nph, and semantic search to understand new projects without reading every file.

Research a third-party API before integrating it in Nim with Atlas in 2026

Nim developers in 2026 use Atlas to efficiently research third-party APIs. Learn how Atlas leverages websearch and webfetch to get current API shapes, ensuring accurate integrations in your Nim projects.

Browse this resource hub