Skip to main content
The .moon/workspace.* configuration file defines workspace-level settings for moon, including project discovery, version control, caching, and more. This file is required at the root of your workspace.

Configuration File

Location: .moon/workspace.yml or .moon/workspace.json Type: WorkspaceConfig

Schema

Core Settings

projects
WorkspaceProjects
required
Configures all projects within the workspace to create a project graph. Supports three formats:
  • Map format: Explicit mapping of project IDs to source paths
  • Glob format: Array of glob patterns to auto-discover projects
  • Both format: Object with sources, globs, and globFormat fields
# Map format
projects:
  web: 'apps/web'
  api: 'apps/api'

# Glob format
projects:
  - 'apps/*'
  - 'packages/*'

# Both format
projects:
  globs:
    - 'apps/*'
  sources:
    www: 'www'
  globFormat: 'source-path'
extends
string | string[]
Extends one or many workspace configuration files. Supports relative file paths or HTTPS URLs.Settings are merged recursively with local configuration taking precedence.
extends: 'https://example.com/.moon/workspace.yml'
versionConstraint
string
Requires a specific version of the moon binary using a semver requirement.
versionConstraint: '>=1.20.0'
defaultProject
string
The default project to focus on when no project scope is specified for task targets.
defaultProject: 'web'
Added in v2.0.0
telemetry
boolean
default:true
Collects anonymous usage information and checks for new moon versions.Can be controlled via MOON_TELEMETRY environment variable.
telemetry: false

Project Management

codeowners
CodeownersConfig
Configures code ownership rules for generating a CODEOWNERS file.Added in v1.8.0
constraints
ConstraintsConfig
Configures boundaries and constraints between projects.

Version Control

vcs
VcsConfig
Configures the version control system integration.

Action Pipeline

pipeline
PipelineConfig
Configures aspects of task running and the action pipeline.

Hashing & Caching

hasher
HasherConfig
Configures aspects of the smart hashing layer.

Remote Caching

remote
RemoteConfig
Configures remote service for cloud-based caching.Added in v1.30.0

Code Generation

generator
GeneratorConfig
Configures the template generator.

Notifications

notifier
NotifierConfig
Configures how moon sends notifications.

Docker Integration

docker
DockerConfig
Configures Docker integration.Added in v1.27.0

Experiments

experiments
ExperimentsConfig
Enable or disable experimental features.Added in v1.11.0

Complete Example

.moon/workspace.yml
projects:
  globs:
    - 'apps/*'
    - 'packages/*'
  sources:
    www: 'www'

versionConstraint: '>=1.20.0'
defaultProject: 'web'

vcs:
  provider: 'github'
  defaultBranch: 'main'
  hooks:
    pre-commit:
      - 'moon run :lint :format --affected --status=staged'
  sync: true

hasher:
  optimization: 'performance'
  ignorePatterns:
    - '**/*.log'
    - '**/*.tmp'

pipeline:
  cacheLifetime: '7 days'
  autoCleanCache: true

remote:
  host: 'grpcs://cache.example.com:9092'
  auth:
    token: 'MOON_REMOTE_TOKEN'
  cache:
    instanceName: 'my-repo'
    compression: 'zstd'

generator:
  templates:
    - './templates'
    - 'git://github.com/org/templates#main'

codeowners:
  sync: true
  globalPaths:
    '*': ['@admins']

constraints:
  enforceLayerRelationships: true
  tagRelationships:
    react: ['frontend']

telemetry: true

Build docs developers (and LLMs) love