Skip to main content
The moon projects command lists all projects configured in the workspace as a table of information, including project ID, source path, stack, layer, toolchains, and description.
$ moon projects
This command provides a quick overview of all projects in your workspace, making it easy to see what’s available and understand the workspace structure at a glance.

Synopsis

moon projects [OPTIONS]

Options

OptionTypeDescription
--jsonbooleanPrint the projects as JSON

Example output

The following output shows an example table of projects:
$ moon projects
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Project          Source                    Stack             Layer             Toolchains                                Description  │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│cli              packages/cli              backend           application       rust                                      CLI tool     │
│runtime          packages/runtime          frontend          library           javascript, node, typescript, yarn        Runtime pkg  │
│types            packages/types            frontend          library           javascript, node, typescript, yarn        Type defs    │
│website          website                   frontend          application       javascript, node, typescript, yarn        Docs site    │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
The table includes the following columns:
  • Project - The project ID or name
  • Source - The relative path from workspace root to the project
  • Stack - The technology stack (frontend, backend, unknown)
  • Layer - The project layer (application, library, tool, etc.)
  • Toolchains - Comma-separated list of enabled toolchains
  • Description - Project description from configuration
:::info Use moon query projects for advanced querying and filtering of projects. :::

JSON output

Use the --json flag to output the complete project list as JSON:
$ moon projects --json
[
  {
    "id": "cli",
    "source": "packages/cli",
    "stack": "backend",
    "layer": "application",
    "toolchains": ["rust"],
    "config": {
      "project": {
        "description": "CLI tool"
      }
    }
  },
  {
    "id": "runtime",
    "source": "packages/runtime",
    "stack": "frontend",
    "layer": "library",
    "toolchains": ["javascript", "node", "typescript", "yarn"],
    "config": {
      "project": {
        "description": "Runtime package"
      }
    }
  }
]

Usage examples

List all projects

$ moon projects

Export projects as JSON

$ moon projects --json > projects.json

Count total projects

$ moon projects --json | jq 'length'

Filter projects by toolchain

# Get all Node.js projects
$ moon projects --json | jq '.[] | select(.toolchains[] == "node") | .id'

Empty workspace

If no projects are configured in the workspace, you’ll see an informational message:
No projects exist. Have any been configured?
Make sure you have projects defined in your .moon/workspace.yml configuration file.

Configuration

Build docs developers (and LLMs) love