DEV Community

Alex Spinov
Alex Spinov

Posted on

moon Has a Free API — Here's How to Use This Rust-Powered Repository Management Tool

moon is a repository management tool built in Rust. It handles task running, dependency management, and code generation for JavaScript, TypeScript, and other language monorepos — with blazing speed.

Installation

curl -fsSL https://moonrepo.dev/install/moon.sh | bash
# or
npm install -g @moonrepo/cli
Enter fullscreen mode Exit fullscreen mode

Workspace Setup

# .moon/workspace.yml
projects:
  - "apps/*"
  - "packages/*"

node:
  version: "20.11.0"
  packageManager: "pnpm"
  pnpm:
    version: "8.15.0"
Enter fullscreen mode Exit fullscreen mode

Task Configuration

# moon.yml (in project root)
tasks:
  build:
    command: "tsc --build"
    inputs:
      - "src/**/*"
      - "tsconfig.json"
    outputs:
      - "dist"
    deps:
      - "^:build"

  test:
    command: "vitest run"
    inputs:
      - "src/**/*"
      - "tests/**/*"
    deps:
      - "~:build"

  lint:
    command: "eslint src/"
    inputs:
      - "src/**/*"
Enter fullscreen mode Exit fullscreen mode

Running Tasks

# Run a task for a project
moon run app:build

# Run task for all projects
moon run :build

# Run affected tasks only
moon ci

# Check what would run
moon run :build --status
Enter fullscreen mode Exit fullscreen mode

Code Generation

# Generate from templates
moon generate react-component

# Templates are defined in .moon/templates/
Enter fullscreen mode Exit fullscreen mode

Project Graph

# Visualize project dependencies
moon project-graph

# Query specific project
moon query projects --affected
Enter fullscreen mode Exit fullscreen mode

Why moon?

  • Rust performance — 10-100x faster than JS-based tools
  • Language agnostic — supports JS, TS, and more coming
  • Smart caching — content-hash based, incremental
  • Toolchain management — manages Node.js versions per project
  • CI integrationmoon ci runs only affected tasks

Need to extract or automate web content at scale? Check out my web scraping tools on Apify — no coding required. Or email me at spinov001@gmail.com for custom solutions.

Top comments (0)