pi-elixir — BEAM runtime tools for pi
pi-elixir gives pi direct access to the running BEAM — evaluate code, read docs from bytecode, query Ecto, inspect processes, walk supervision trees. The agent talks to your app the same way you would in IEx. No project changes required, works with any mix.exs project.
v0.3.0 adds two new tools powered by ExAST — search and replace Elixir code by AST pattern. Patterns are plain Elixir, not regex:
mix ex_ast.search 'IO.inspect(_, _)' lib/
mix ex_ast.replace 'dbg(expr)' 'expr'
mix ex_ast.replace '%Step{id: "subject"}' 'SharedSteps.subject()'
Variables capture, _ is a wildcard, structs match partially. The agent can now refactor code structurally instead of doing fragile text substitution.
Also pairs well with ExDNA — a duplication detector that understands Elixir’s AST. Point the agent at your codebase, it finds clones (including renamed-variable ones), and now it can fix them with ExAST.
pi install pi-elixir
github.com/dannote/pi-elixir · hex.pm/packages/ex_ast · hex.pm/packages/ex_dna
Read next Fusion — Remote task runner over SSH using Erlang distribution
