Atlas is a terminal-native AI coding agent that works on OCaml codebases in 2026. Atlas reads each dune stanza, your .mli interface files, and the packages pinned in your opam switch, then proposes edits as a unified diff you approve before anything is written. Atlas can run dune runtest behind a permission prompt, read the compiler errors back into its plan, and finish with ocamlformat so the diff is style-clean.
Why OCaml developers use Atlas
OCaml developers use Atlas because Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so a search for a variant constructor returns the real type definition in your .ml file. Atlas runs in the terminal, next to dune and opam, in 2026.
OCaml punishes vague tooling. A module has an implementation in one file and a signature in another, dune decides what actually compiles, and the type checker rejects anything approximate. Atlas is built for that. Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion, so asking for the record type behind a Config.t finds the declaration rather than the fifty call sites that mention config. Because Atlas indexes by AST declarations, a query about a variant lands on the variant itself, with its constructors, which is exactly the context needed to reason about exhaustiveness. Atlas is a terminal-native TUI, so it lives in the same shell where you already run dune build and opam switch.
Working in OCaml day to day with Atlas
Day to day in OCaml, Atlas reads each dune stanza, your .mli signatures, and the packages pinned in your opam switch before it edits anything. Ask Atlas in 2026 to make a variant exhaustive or to add an Alcotest case to the test/ dune stanza, and it plans first.
The unit of work in OCaml is a module and the dune stanza that builds it. Atlas treats it that way. Before a change, Atlas drafts a plan in a read-only plan agent and asks before switching to a build agent, so you see the intended edit to the .ml file, the matching change to the .mli signature, and the new dependency in the library stanza while nothing has been written yet. A typical request looks like: make this variant exhaustive, or add an Alcotest case to the test/ dune stanza. Atlas can also fan out work to subagents that run in the foreground or in parallel background sessions, which suits a project where several libraries in the same dune workspace need the same signature change.
Running dune runtest behind a permission prompt
Atlas can run dune runtest for you in 2026, but every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs. In practice you allow dune runtest, and Atlas reads the OCaml compiler errors back into the plan and iterates until the suite is green.
OCaml compiler errors are precise, and Atlas uses that. When Atlas runs dune runtest behind a permission prompt, the type error, the unused variable warning, and the non-exhaustive match warning all come back as structured feedback that Atlas folds into its next iteration instead of guessing. Permission rules are the control surface: allow the commands you trust, such as dune build and dune runtest, ask on anything that touches your opam switch, and deny the rest. Nothing escalates silently. The loop that results is the same one an OCaml developer already runs by hand, which is to compile, read the error, narrow the type, and compile again, except Atlas drives it and shows you the result.
Reviewing the diff and formatting with ocamlformat
Atlas computes a unified diff for every file edit and surfaces it for approval before writing, so in 2026 no OCaml module changes without your review. Atlas finishes with ocamlformat so the diff is style-clean, and it snapshots file changes as git patches so any edit can be rolled back.
Review is where an OCaml change is accepted or rejected, and Atlas makes review the default rather than an afterthought. Every edit to an .ml or .mli file arrives as a unified diff you approve or decline. Running ocamlformat before you look means the diff contains real changes and not whitespace churn, which matters when a signature file and its implementation both move. Atlas snapshots file changes as git patches, so an edit that looked right and then broke the build can be diffed and rolled back cleanly. Atlas also reads git branches, status, and diffs, and can stage and create commits on your behalf once you approve the change.
Keeping OCaml source local with Ollama embeddings
Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers. For an OCaml team with a proprietary compiler pipeline or a regulated codebase, that means the index over your .ml and .mli files is computed on your machine in 2026.
OCaml is common in places where the source itself is the asset, including trading systems, verification tools, and compilers. Atlas accounts for that. The code index that powers Atlas's search over your dune workspace can be built with local Ollama embeddings, so the embedding step never leaves your hardware. Atlas also lets you switch the active model and provider on the fly with favorites and recents, so you can route a routine refactor to one model and a harder type-level problem to another without restarting the session. Atlas connects to Model Context Protocol servers and exposes their tools to the agent, and Atlas is extensible through plugins that contribute tools and hook into agent lifecycle events, which is how teams wire in their own internal OCaml tooling.
Getting started
- 01Run atlas in a workspace with a dune-project at the root
- 02Let Atlas read each dune stanza, your .mli signatures, and the packages pinned in your opam switch
- 03Ask Atlas to make a variant exhaustive or add an Alcotest case to the test/ dune stanza
- 04Let Atlas run dune runtest behind a permission prompt and read the compiler errors back into the plan
- 05Have Atlas finish with ocamlformat so the diff is style-clean before you approve it
Frequently asked questions
- does atlas work with ocaml and dune
- Yes. Atlas runs in a workspace with a dune-project at the root, reads each dune stanza, and can run dune runtest behind a permission prompt before it commits.
- can atlas read .mli interface files
- Yes. Atlas reads your .mli signatures alongside the .ml implementations and the packages pinned in your opam switch, so a signature change and its implementation stay in sync.
- how do i get an ai agent to run my alcotest suite
- Ask Atlas to add an Alcotest case to the test/ dune stanza, then let Atlas run dune runtest behind a permission prompt. Atlas reads the compiler errors back into the plan and iterates.
- does atlas format ocaml code with ocamlformat
- Yes. Atlas finishes a change with ocamlformat so the unified diff you review is style-clean and contains real edits rather than whitespace churn.
- can i use an ai coding agent on a private ocaml codebase
- Yes. Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, which suits proprietary OCaml codebases.
- will atlas edit my ocaml files without asking
- No. Atlas computes a unified diff for every file edit and surfaces it for approval before writing, and every tool call is permission-gated against allow, ask, and deny rules.
- can atlas commit ocaml changes to git
- Yes. Atlas reads git branches, status, and diffs, and can stage and create commits on your behalf. Atlas also snapshots file changes as git patches so edits can be rolled back.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Trace a runtime bug from a stack trace in OCaml with Atlas in 2026
Pinpoint OCaml runtime bugs from production stack traces using Atlas in 2026. Leverage dune, opam, and ocamlformat to quickly identify and fix issues without a debugger attached.
Review a pull request in OCaml with Atlas in 2026
In 2026, Atlas helps OCaml developers review pull requests by fetching diffs, reading full files, checking .mli signatures, running dune runtest, and applying ocamlformat.
Diagnose a hanging or long-running command in OCaml with Atlas in 2026
Diagnose hanging OCaml `dune` builds or `opam` scripts with Atlas in 2026. Atlas identifies blocked input, suggests non-interactive flags, or recommends timeout adjustments.
Write Unit Tests for Untested Code in OCaml with Atlas in 2026
Learn how Atlas helps OCaml developers in 2026 write unit tests for untested modules. Atlas uses dune runtest, opam, and ocamlformat to integrate with your existing OCaml workflow.
Onboard to an Unfamiliar OCaml Codebase with Atlas in 2026
Quickly build a working mental model of any OCaml repository in 2026 using Atlas. Leverage `dune` build rules, `opam` switches, and `.mli` interface files for rapid understanding and safe code exploration.
Debug a single failing test in OCaml with Atlas in 2026
Pinpoint and fix failing OCaml tests with Atlas, the terminal-native AI coding agent. Leverage dune runtest, opam, and ocamlformat for efficient debugging in 2026.
Upgrade an OCaml Dependency and Fix Breakage with Atlas in 2026
In 2026, OCaml developers use Atlas to upgrade dependencies like opam packages to new major versions. Atlas automates fixing compile and test failures, integrating with dune, ocamlformat, and .mli files for a
Rename a symbol across the repo in OCaml with Atlas in 2026
Learn how Atlas renames OCaml functions, classes, and constants across your repository in 2026. Leverage lsp, grep, edit, and dune for precise, verified refactoring.