Atlas is a terminal-native AI coding agent that runs inside a Phoenix app. In 2026 you start atlas in an app with a mix.exs and a lib/<app>_web directory, and Atlas reads your router pipelines, LiveView modules, contexts, and Ecto schemas with their changesets. Contexts, LiveView sockets, and changesets are the real surface area of a Phoenix app, and Atlas works at that level.
Why Phoenix developers use Atlas
Phoenix developers use Atlas in 2026 because contexts, LiveView sockets, and Ecto changesets are the real surface area, not the controllers. Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so an Elixir function head and its clauses stay together in the index.
Elixir code is defined by function clauses, pattern matches, and pipelines, and a tool that chunks by line windows will split a multi-clause function down the middle. Atlas indexes by AST declarations, so each def and its guards survive as one unit. Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion, so asking which context function a LiveView calls returns the context module and the changeset it builds, rather than the first file that happens to mention the word. That is the difference between an answer about Phoenix and an answer about text.
How Atlas reads router pipelines, contexts, and Ecto schemas
Start Atlas in an app with a mix.exs and a lib/<app>_web directory, and Atlas reads your router pipelines, LiveView modules, contexts, and Ecto schemas with their changesets. Phoenix splits web concerns from domain concerns across 2 trees, and Atlas maps both.
Atlas walks the router to learn which pipelines apply to which scopes, then follows each route into either a controller or a LiveView module. On the domain side it reads the context modules and the Ecto schemas they own, including every changeset function and the validations attached to it. When you ask why a form rejects an input, Atlas can trace the LiveView handle_event to the context function to the changeset validation that failed. For a large umbrella, Atlas fans out work to subagents that can run in the foreground or in parallel background sessions.
Moving logic out of controllers into Phoenix contexts
Atlas moves business logic out of a Phoenix controller into a context function that returns an ok or error tuple. Contexts exist so the web layer stays thin, and in 2026 that 2-element tuple is still the idiomatic boundary a controller or a LiveView pattern matches on.
Atlas reads the controller action, identifies the domain logic that has leaked into the web layer, and proposes a context function that returns {:ok, value} or {:error, changeset}. The controller then pattern matches on that tuple, which is the Phoenix convention and also what makes the same context function reusable from a LiveView. Atlas computes a unified diff for every file edit and surfaces it for approval before writing, so the thinned controller and the new context function land as one reviewable change instead of a rewrite you have to reverse engineer.
Ecto migrations: review up and down before touching the database
Atlas generates an Ecto migration and shows you both directions, the up and the down, before you let it near a database. In Phoenix a migration is the 1 change a file edit cannot take back, so Atlas surfaces it for review first.
Atlas writes the migration module, then shows you the up function and the down function so you can confirm the rollback path actually exists before anything is applied. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so you can allow mix commands that only generate files while leaving anything that connects to a database on ask, or deny it entirely in a production checkout. The migration file itself is a unified diff you approve like any other edit.
Testing with LiveViewTest, mix test, and mix format
Atlas adds LiveViewTest cases, runs mix test behind a permission prompt, and finishes with mix format. LiveViewTest drives a real Phoenix LiveView through mount and handle_event, so 1 test exercises the socket lifecycle rather than a mocked stand-in that never mounts.
Atlas writes LiveViewTest cases against the LiveView modules it just changed, covering mount, the handle_event that triggers the context call, and the rendered result. It asks before running mix test, because every tool call is permission-gated. When the suite passes, Atlas finishes with mix format so the change matches the project's formatter rather than adding style noise to review. Atlas snapshots file changes as git patches, so a context extraction you dislike is a rollback, and Atlas can stage and create commits on your behalf once you are satisfied.
Getting started
- 01Run atlas in an app with a mix.exs and a lib/<app>_web directory
- 02Let Atlas read your router pipelines, LiveView modules, contexts, and Ecto schemas with their changesets
- 03Ask Atlas to move business logic out of a controller into a context function that returns an ok or error tuple
- 04Let Atlas generate an Ecto migration and show you the up and down before you let it near a database
- 05Have Atlas add LiveViewTest cases, run mix test behind a permission prompt, and finish with mix format
Frequently asked questions
- how to use an AI coding agent with phoenix and elixir
- Run atlas in an app with a mix.exs and a lib/<app>_web directory. Atlas reads your router pipelines, LiveView modules, contexts, and Ecto schemas with their changesets, then proposes edits as unified diffs you approve.
- can atlas write liveview tests
- Yes. Atlas adds LiveViewTest cases against the LiveView modules it changed, runs mix test behind a permission prompt, and finishes with mix format.
- is it safe to let an AI agent generate ecto migrations
- Atlas generates the Ecto migration and shows you the up and down before you let it near a database. Every tool call is permission-gated against allow, ask, and deny rules first.
- how do i move logic out of a phoenix controller
- Ask Atlas to move business logic out of a controller into a context function that returns an ok or error tuple, so both controllers and LiveViews can pattern match on the result.
- does atlas understand elixir pattern matching and function clauses
- Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so a multi-clause Elixir function stays intact in the index instead of being split across chunks.
- can atlas index my phoenix code locally
- Yes. Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, which suits Phoenix apps with strict data handling rules.
- can i undo an atlas change to a phoenix context
- Yes. Atlas snapshots file changes as git patches so edits can be diffed and rolled back, and it reads git branches, status, and diffs to keep the change reviewable.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Onboard to an Unfamiliar Phoenix Codebase with Atlas in 2026
Quickly build a mental model of any Phoenix codebase in 2026 with Atlas. Leverage semantic search, AST indexing, and permission-gated tools to understand contexts, LiveView, and Ecto without reading every file.
Run Atlas Headless in CI for Phoenix Projects in 2026
Automate Atlas sessions in your Phoenix CI/CD pipeline for non-interactive code generation and refactoring. Get machine-readable output, integrate with mix test, and ensure safety with permission-gated tools for your
Add a Regression Test for a Phoenix Bug Fix with Atlas in 2026
Lock in Phoenix bug fixes with Atlas by writing red-green regression tests. Use `mix test (ExUnit)` and `mix format` to ensure code quality and prevent future regressions in your Phoenix application.
Diagnose a Hanging or Long-Running Command in Phoenix with Atlas in 2026
Phoenix developers in 2026 can use Atlas to diagnose hanging `mix test` or `mix deps.get` commands. Learn how Atlas identifies if a process is genuinely slow or blocked on interactive input, helping you unblock your
Write Unit Tests for Untested Phoenix Code with Atlas in 2026
Learn how Atlas helps Phoenix developers in 2026 add robust unit tests to untested modules, adhering to existing repo conventions and using `mix test (ExUnit)` for verification. Streamline your Phoenix testing workflow.
Document a module with a README in Phoenix with Atlas in 2026
In 2026, Atlas helps Phoenix developers generate accurate README documentation for modules. It reads your LiveView, Ecto, and context code, ensuring docs reflect current implementation, not outdated plans.
Debug a single failing test in Phoenix with Atlas in 2026
Pinpoint and fix failing Phoenix tests with Atlas in 2026. Leverage `mix test (ExUnit)` and Atlas's AI to quickly diagnose issues in LiveView, Ecto, and contexts.
Automate GitHub Issue and Pull Request Triage in Phoenix with Atlas in 2026
Streamline GitHub issue and PR triage for your Phoenix projects using Atlas. Automate responses, enforce safety, and integrate with your `mix` toolchain for efficient development in 2026.