0
# Project & Task Management
1
2
Commands for working with projects and tasks within the moon repository, including project information, task details, and workspace synchronization.
3
4
## Capabilities
5
6
### Display Project Information
7
8
Show detailed information about a specific project in the workspace.
9
10
```bash { .api }
11
moon project <id> [--json] [--no-tasks]
12
```
13
14
**Arguments:**
15
- `id` (required) - Project ID to display information for
16
17
**Options:**
18
- `--json` - Output project information in JSON format
19
- `--no-tasks` - Exclude task information from the output
20
21
**Usage Examples:**
22
23
```bash
24
# Display project information
25
moon project my-app
26
27
# Get project info as JSON
28
moon project my-app --json
29
30
# Show project info without tasks
31
moon project my-app --no-tasks
32
```
33
34
**Sample Output:**
35
```
36
Project: my-app
37
Source: apps/my-app
38
Language: typescript
39
Platform: node
40
Tasks: build, test, lint, type-check
41
Dependencies: shared-utils, common-types
42
```
43
44
### Display Task Information
45
46
Show detailed information about a specific task, including its configuration and dependencies.
47
48
```bash { .api }
49
moon task <target> [--json]
50
```
51
52
**Arguments:**
53
- `target` (required) - Task target in the format `project:task` or `:task` for workspace tasks
54
55
**Options:**
56
- `--json` - Output task information in JSON format
57
58
**Usage Examples:**
59
60
```bash
61
# Display task information
62
moon task my-app:build
63
64
# Show workspace task
65
moon task :lint-all
66
67
# Get task info as JSON
68
moon task my-app:test --json
69
```
70
71
**Sample Output:**
72
```
73
Task: my-app:build
74
Platform: node
75
Command: npm run build
76
Inputs: src/**, package.json
77
Outputs: dist/**
78
Dependencies: my-app:type-check, shared-utils:build
79
```
80
81
### Sync Workspace
82
83
Synchronize the workspace to maintain a healthy state and update generated files.
84
85
```bash { .api }
86
moon sync [subcommand]
87
```
88
89
**Subcommands:**
90
91
#### Sync All
92
93
Synchronize the entire workspace, including all projects and configurations.
94
95
```bash { .api }
96
moon sync
97
```
98
99
This performs all sync operations:
100
- Updates project configurations
101
- Syncs dependency relationships
102
- Regenerates configuration schemas
103
- Updates code ownership files
104
- Syncs VCS hooks
105
106
#### Sync Code Owners
107
108
Generate and synchronize a `CODEOWNERS` file based on project ownership configuration.
109
110
```bash { .api }
111
moon sync codeowners [--add-missing] [--dry-run]
112
```
113
114
**Options:**
115
- `--add-missing` - Add entries for projects without explicit owners
116
- `--dry-run` - Preview changes without writing the file
117
118
**Usage Examples:**
119
120
```bash
121
# Generate CODEOWNERS file
122
moon sync codeowners
123
124
# Preview CODEOWNERS changes
125
moon sync codeowners --dry-run
126
127
# Include unowned projects
128
moon sync codeowners --add-missing
129
```
130
131
#### Sync Configuration Schemas
132
133
Generate and sync JSON schemas for configuration files to enable IDE support.
134
135
```bash { .api }
136
moon sync config-schemas [--minimal]
137
```
138
139
**Options:**
140
- `--minimal` - Generate minimal schemas without descriptions
141
142
**Usage Examples:**
143
144
```bash
145
# Generate configuration schemas
146
moon sync config-schemas
147
148
# Generate minimal schemas
149
moon sync config-schemas --minimal
150
```
151
152
#### Sync VCS Hooks
153
154
Generate and sync hook scripts for the workspace VCS (Git) integration.
155
156
```bash { .api }
157
moon sync hooks [--force]
158
```
159
160
**Options:**
161
- `--force` - Overwrite existing hook files
162
163
**Usage Examples:**
164
165
```bash
166
# Sync Git hooks
167
moon sync hooks
168
169
# Force overwrite existing hooks
170
moon sync hooks --force
171
```
172
173
#### Sync Projects
174
175
Synchronize all project configurations and dependency relationships.
176
177
```bash { .api }
178
moon sync projects
179
```
180
181
This command:
182
- Updates project dependency graphs
183
- Syncs workspace dependencies to project files
184
- Validates project configurations
185
- Regenerates derived configuration files
186
187
**Usage Examples:**
188
189
```bash
190
# Sync all project configurations
191
moon sync projects
192
```
193
194
## Project Configuration
195
196
Projects are configured through `moon.yml` files:
197
198
```yaml
199
# Project moon.yml example
200
language: 'typescript'
201
type: 'application'
202
platform: 'node'
203
204
tasks:
205
build:
206
command: 'npm run build'
207
inputs: ['src/**/*', 'package.json']
208
outputs: ['dist/**/*']
209
deps: ['~:type-check']
210
211
test:
212
command: 'npm test'
213
inputs: ['src/**/*', 'tests/**/*']
214
deps: ['~:build']
215
216
workspace:
217
inheritedTasks:
218
include: ['lint', 'format']
219
```
220
221
## Task Configuration
222
223
Tasks define the build and development operations:
224
225
- **Commands** - Shell commands to execute
226
- **Inputs** - Files that affect task output
227
- **Outputs** - Files generated by the task
228
- **Dependencies** - Other tasks that must run first
229
- **Environment** - Environment variables and settings
230
231
## Workspace Structure
232
233
Moon workspaces organize projects in a hierarchical structure:
234
235
```
236
workspace/
237
├── moon.yml # Workspace configuration
238
├── .moon/
239
│ ├── workspace.yml # Workspace settings
240
│ ├── toolchain.yml # Tool configurations
241
│ └── tasks/ # Global task definitions
242
├── apps/
243
│ ├── web-app/
244
│ │ └── moon.yml # Project configuration
245
│ └── mobile-app/
246
│ └── moon.yml
247
└── packages/
248
├── shared-utils/
249
│ └── moon.yml
250
└── ui-components/
251
└── moon.yml
252
```