---
slug: v0.26
title: moon v0.26 - Deeper proto integration, Docker setup, and query commands
authors: [milesj]
tags: [proto, docker, query, hash]
image: ./img/v0.26.png
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Button from '@site/src/ui/Button';
import Logo from '../static/brand/proto/logo.svg';

With this release, we're providing deeper integration with our new [proto](/proto) toolchain
manager, better Docker support, and new query commands for debugging.

<!--truncate-->

## Full proto toolchain integration

<div className="float-right ml-4 mb-1" style={{ width: '50%' }}>
  <Logo />
</div>

Earlier this week we announced [proto](/proto), our own toolchain manager, and an attempt at a next
generation version manager for multiple languages. proto was originally moon's toolchain layer, but
we felt it best to extract it out into a stand-alone tool for everyone to use, especially those not
using moon!

Now that proto has been released, we've updated moon's Rust internals to utilize proto's latest Rust
crates. For the most part, everything will continue to work the same. However, the biggest change is
that the toolchain has moved from `~/.moon` to `~/.proto`, and will result in tools being
re-downloaded and installed. Feel free to delete the old `~/.moon` directory manually.

Furthermore, we've added first-class support for the new [`.prototools`](/docs/proto/config)
configuration file. If this file is found in the workspace root, we'll automatically enable the
tools in our toolchain, and inject the versions (when not defined in `.moon/toolchain.yml`).

```toml title=".prototools"
node = "18.0.0"
pnpm = "7.29.0"
```

## New `moon docker setup` command

moon has provided [built-in `Dockerfile` support](/docs/guides/docker) since v0.15 (11 versions
ago!) and we've always encouraged the use of the [`moon setup`](/docs/commands/setup) command to
setup the toolchain and install project dependencies. Here's an example of a moon powered
`Dockerfile`:

```docker
FROM node:latest
WORKDIR /app

# Install moon binary
RUN npm install -g @moonrepo/cli

# Copy workspace skeleton
COPY ./.moon/docker/workspace .

# Install toolchain and dependencies
RUN moon setup

# Copy source files
COPY ./.moon/docker/sources .

# Build something
RUN moon run app:build

# Prune workspace
RUN moon docker prune

CMD ["moon", "run", "app:start"]
```

However, over the course of these 11 releases since v0.15, we refactored the `moon setup` command to
only setup the toolchain, and _no longer_ install project dependencies. We inadvertently broke our
Docker integration. This was an oversight on our part.

To rectify this situation, we're introducing a new
[`moon docker setup`](/docs/commands/docker/setup) command that will efficiently install
dependencies for projects focused/affected within the `Dockerfile`. This is a much better solution
than before, and you should see improved Docker layer caching!

```diff
-RUN moon setup
+RUN moon docker setup
```

## New `moon query hash` command

When moon runs a task, we generate a unique hash representing the state of that run. When something
goes wrong however, and the hash is different than what you expect, debugging why is rather
non-trivial and requires a lot of internal knowledge. We're looking to reduce this burden, by
introducing the new `moon query hash` command.

```shell
$ moon query hash 0b55b234
```

This command will print the contents of the hash manifest, which is all inputs and sources used to
generate the unique hash. From here you can use this output to investigate what's actually
happening.

```json
{
  "command": "build",
  "args": ["./build"]
  // ...
}
```

## New `moon query hash-diff` command

Expanding on the new command above, we're also introducing the `moon query hash-diff` command, which
can be used to compute the difference between 2 hashes. Perfect in understanding what has changed
between ran tasks.

```shell
$ moon query hash-diff 0b55b234 2388552f
```

When ran, the command will print out the differences as highlighted lines. If you use `git diff`,
this will feel familiar to you.

```diff
{
	"command": "build",
	"args": [
+		"./dist"
-		"./build"
	],
	...
}
```

## Other changes

View the
[official release](https://github.com/moonrepo/moon/releases/tag/%40moonrepo%2Fcli%400.26.0) for a
full list of changes.

- A handful of critical bug fixes.
- Targets that generate an empty hash are now considered a failure, as they may be an edge case not
  accounted for.

## What's next?

Expect the following in the v1 release!

- Officially release a v1!
- Project tagging and constraints.
