# Hat: a cargo-like wrapper for pixi

**URL:** <https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705>\
**Category:** Installation & Packaging\
**Created:** [February 9, 2026, 1:01pm UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705 "2026-02-09T13:01:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duck\_tape](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/duck_tape/32/432_2.png) [@duck\_tape](https://forum.modular.com/u/duck_tape)\
**Post date:** [February 9, 2026, 1:01pm UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705/1 "2026-02-09T13:01:55Z")

</div>

## What

> **[GitHub - sstadick/hat: Thin wrapper over pixi to be used as a mojo build...](https://github.com/sstadick/hat)**
>
> Thin wrapper over pixi to be used as a mojo build tool.

A convenience wrapper over pixi to create and manage mojo projects loosely based on the `cargo` api. Intended for maximum flexibility.

## Why

This was created as a way to quickly make mojo projects to try out different ideas. It cuts down on the boilerplate of creating new projects and having to add different channels / setup the `pixi-build-mojo` backend and add some default tasks that I tend to copy around. Everything is 100% compatible with pixi.

Longer term, instead of shelling out to `pixi` I’d like to use the pixi-libs directly, either through FFI with Mojo, or by converting `hat` to rust.

## Usage:

```auto
# Create a new binary project
hat new --name mojo-grep --nightly

# Create a new lib project
hat new --lib --nightly --name amazing-lib

# Build project (defaults to release build)
hat build 

# Build with debug and asserts on
hat build --debug

# Test your project
hat test

```

## Benefits for new-to-mojo people:

- Running `hat new` will create the project structure, but also install the deps, so when they open their editor, the LSP is available right away. I’ve had too many people not realize they needed to install the pixi deps _then_ open the editor.
- They don’t need to go chase down what channels are needed.
- The project structure is pre-templated. This is not a huge deal, but for some it will remove decision paralysis of where to put things and lets them just start coding.
- Test dir is created by default, lowering the barrier to just adding _any_ tests.
- Projects that are buildable with `pixi-build-mojo` backend can be depended on by git-paths and don’t need to be published to conda. This dramatically lowers the barrier to entry for people to get useful libs started before they start jumping through the hoops to publish conda packages.

---

<div class="post-metadata">

**Author:** ![owenhilyard](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/owenhilyard/32/41_2.png) [@owenhilyard](https://forum.modular.com/u/owenhilyard)\
**Post date:** [February 9, 2026, 4:41pm UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705/2 "2026-02-09T16:41:44Z")

</div>

This is a fantastic tool! Thanks for making it!

---

<div class="post-metadata">

**Author:** ![Ehsan](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/ehsan/32/142_2.png) [@Ehsan](https://forum.modular.com/u/Ehsan)\
**Post date:** [February 9, 2026, 7:35pm UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705/3 "2026-02-09T19:35:44Z")

</div>

Awesome! I was thinking of similar idea something like cookiecutter for mojo.

---

<div class="post-metadata">

**Author:** ![duck\_tape](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/duck_tape/32/432_2.png) [@duck\_tape](https://forum.modular.com/u/duck_tape)\
**Post date:** [April 3, 2026, 10:00am UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705/4 "2026-04-03T10:00:26Z")

</div>

## Hat v0.2.0

> **[Release v0.2.0 · sstadick/hat](https://github.com/sstadick/hat/releases/tag/v0.2.0)**
>
> What's Changed
> 
> fix: properly run pixi install for new projects
> fix: no double newlines when printing pixi install, hat test, and hat build
> feat: switch to mojopt
> 
> Full Changelog: https://github.co...

- Fixes to output forwarding from pixi
- Migrates to using [mojopt](https://github.com/sstadick/mojopt)
- Fixes to project initialization to auto-run pixi install at setup time

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [September 30, 2026, 10:00am UTC](https://forum.modular.com/t/hat-a-cargo-like-wrapper-for-pixi/2705/5 "2026-09-30T10:00:42Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
