# How to programatically format code using plugins

**URL:** <https://forum.elixirforum.com/t/how-to-programatically-format-code-using-plugins/58533>\
**Category:** Questions\
**Tags:** formatter, code\
**Created:** [September 28, 2023, 4:05am UTC](https://forum.elixirforum.com/t/how-to-programatically-format-code-using-plugins/58533 "2023-09-28T04:05:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![krasenyp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/krasenyp/32/39733_2.png) [@krasenyp](https://forum.elixirforum.com/u/krasenyp)\
**Post date:** [September 28, 2023, 6:21am UTC](https://forum.elixirforum.com/t/how-to-programatically-format-code-using-plugins/58533/2 "2023-09-28T06:21:37Z")

</div>

`mix format -` reads from standard input and prints to standard output. I haven’t tested it but I suspect you can use it in conjunction with heredoc and skip the writing to stdin. If you want to batch the formatting you can first write to temporary files and format them with one call to `mix format`.

---

_[View the full topic](https://forum.elixirforum.com/t/how-to-programatically-format-code-using-plugins/58533)._
