Documentation Index Fetch the complete documentation index at: https://mintlify.com/moonrepo/moon/llms.txt
Use this file to discover all available pages before exploring further.
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 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'
Requires a specific version of the moon binary using a semver requirement. versionConstraint : '>=1.20.0'
The default project to focus on when no project scope is specified for task targets. Added in v2.0.0
Collects anonymous usage information and checks for new moon versions. Can be controlled via MOON_TELEMETRY environment variable.
Project Management
Configures code ownership rules for generating a CODEOWNERS file. File patterns and their owners at the workspace level. codeowners :
globalPaths :
'*' : [ '@admins' ]
'config/' : [ '@infra' ]
orderBy
'file-source' | 'project-id'
default: "file-source"
Order in which code owners are listed in the CODEOWNERS file.
Automatically generates and syncs a CODEOWNERS file.
Added in v1.8.0
Configures boundaries and constraints between projects. enforceLayerRelationships
Enforces allowed relationships between projects based on their layer and stack settings. Layer hierarchy: automation → application → tool → library → scaffolding → configuration → unknown constraints :
enforceLayerRelationships : true
Enforces allowed relationships based on project tags. constraints :
tagRelationships :
next : [ 'react' ]
Version Control
Configures the version control system integration. The VCS tool/binary being used.
provider
'github' | 'gitlab' | 'bitbucket' | 'other'
default: "github"
The service provider hosting the repository.
The default branch for comparing differences. vcs :
defaultBranch : 'main'
remoteCandidates
string[]
default: ["origin","upstream"]
Remote candidates to query for merge bases.
Mapping of hook names to command lists. vcs :
hooks :
pre-commit :
- 'moon run :lint --affected'
hookFormat
'native' | 'bash'
default: "native"
Shell format for generated hook files. Added in v1.29.0
Automatically generates and syncs hook scripts. Added in v1.9.0
Action Pipeline
Configures aspects of task running and the action pipeline. Automatically cleans cached artifacts older than cacheLifetime. Added in v1.24.0
Maximum lifetime of cached artifacts before being marked stale. pipeline :
cacheLifetime : '24 hours'
installDependencies
boolean | string[]
default: true
Runs dependency installation actions before tasks. # Disable all
pipeline :
installDependencies : false
# Only for specific toolchains
pipeline :
installDependencies : [ 'node' ]
Added in v1.34.0 Runs workspace sync action before all other actions. Added in v1.34.0
syncProjects
boolean | string[]
default: true
Runs project sync action before tasks. Added in v1.34.0
Logs the task’s command and arguments when running.
inheritColorsForPipedTasks
Forces colors to be inherited for piped task output.
Threshold in milliseconds to force kill processes after receiving a signal. Added in v1.32.1
Hashing & Caching
Configures aspects of the smart hashing layer. optimization
'accuracy' | 'performance'
default: "accuracy"
Optimization level for hashing dependency versions.
accuracy: Uses resolved versions from lockfile
performance: Uses version ranges from manifest
walkStrategy
'glob' | 'vcs'
default: "vcs"
File system walking strategy for discovering inputs.
glob: Walks using glob patterns
vcs: Extracts files from VCS working tree
Logs warnings when attempting to hash missing inputs.
Glob patterns to filter and ignore files during hashing. hasher :
ignorePatterns :
- '**/*.png'
Added in v1.10.0 Glob patterns to ignore missing input warnings. hasher :
ignoreMissingPatterns :
- '**/.env.*'
Added in v1.10.0
Remote Caching
Configures remote service for cloud-based caching. Host URL for uploading/downloading artifacts. Supports grpc(s):// and http(s):// protocols. remote :
host : 'grpcs://cache.example.com:9092'
api
'grpc' | 'http'
default: "grpc"
API format of the remote server. Added in v1.32.0
Authentication configuration. Environment variable name containing Bearer token.
HTTP headers to include in requests.
Added in v1.32.0 Cache layer configuration. instanceName
string
default: "moon-outputs"
Unique identifier for partitioning remote instances.
compression
'none' | 'zstd'
default: "none"
Compression format for blobs (gRPC only). Added in v1.31.0
When local, only download blobs; don’t upload. Added in v1.40.0
Verify blob digests/hashes when downloading. Added in v1.36.0
Server-only TLS authentication. Domain for certificate verification.
Mutual TLS authentication. Path to client certificate.
Path to client private key.
Domain for certificate verification.
Added in v1.30.0
Code Generation
Configures the template generator. templates
string[]
default: ["./templates"]
Paths where templates are located. Supports:
File system paths (relative from workspace root)
Git repositories: git://github.com/user/repo#branch
npm packages: npm://@scope/package#1.2.3
generator :
templates :
- './templates'
- 'git://github.com/moonrepo/templates#master'
Git/npm support added in v1.23.0
Notifications
Configures how moon sends notifications. HTTPS URL where pipeline events are posted. notifier :
webhookUrl : 'https://api.example.com/webhook'
Waits for webhook response and validates 2xx status.
terminalNotifications
'always' | 'failure' | 'success' | 'task-failure'
Display OS notifications for pipeline events. Added in v1.38.0
Docker Integration
Configures Docker integration. Docker pruning configuration. Delete vendor directories while pruning.
installToolchainDependencies
Install production dependencies after pruning.
Docker scaffolding configuration. Globs for copying additional files to workspace skeleton. docker :
scaffold :
configsPhaseGlobs :
- '**/package.json'
Added in v1.27.0
Experiments
Enable or disable experimental features. Uses concurrent glob walking (1.5-2x faster). Added in v1.34.0
Uses improved Git implementation with better submodule support. Added in v1.34.0
Added in v1.11.0
Complete Example
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