Skip to main content
The moon bin command queries the binary/executable path for a specific toolchain managed by moon. This command wraps the underlying proto bin command and is useful for finding where toolchain binaries are installed.
moon bin <toolchain>

Arguments

<toolchain>

The toolchain must be configured in your workspace’s toolchains.yml or toolchain.yml file.

How it works

The command:
  1. Queries the configured toolchain from your workspace configuration
  2. Delegates to the underlying proto bin command
  3. Returns the absolute path to the toolchain’s binary/executable
  4. Outputs the path to stdout in quiet mode
This is particularly useful for:
  • Shell scripts that need to reference toolchain binaries
  • CI/CD pipelines requiring explicit binary paths
  • Debugging toolchain installation issues
  • Integration with other tools that need toolchain paths

Examples

Get Node.js binary path

moon bin node
# Output: /Users/username/.proto/tools/node/20.11.0/bin/node

Get Rust binary path

moon bin rust
# Output: /Users/username/.proto/tools/rust/1.75.0/bin/rustc

Use in shell scripts

#!/bin/bash
NODE_BIN=$(moon bin node)
$NODE_BIN --version

Check Bun installation

moon bin bun
# Output: /Users/username/.proto/tools/bun/1.0.0/bin/bun

Exit codes

The command returns:
  • 0 - Successfully retrieved the binary path
  • 1 or higher - Failed to retrieve the path (toolchain not found or not installed)

Build docs developers (and LLMs) love