0
# @moonrepo/core-linux-x64-musl
1
2
This package provides the pre-compiled Linux x64 musl binary distribution of the moon repository management and build orchestration tool. Moon is a comprehensive workspace management system written in Rust that provides repository organization, orchestration, and notification capabilities.
3
4
## Package Information
5
6
- **Package Name**: @moonrepo/core-linux-x64-musl
7
- **Package Type**: npm
8
- **Language**: Binary distribution (compiled from Rust)
9
- **Installation**: `npm install @moonrepo/core-linux-x64-musl`
10
- **Platform**: Linux x64 with musl libc
11
- **License**: MIT
12
13
## Architecture
14
15
This package follows the platform-specific binary distribution pattern:
16
17
- **Binary Artifact**: Contains the statically-linked `moon` executable compiled for x86_64-unknown-linux-musl
18
- **Platform Detection**: Used as optional dependency by `@moonrepo/cli` with automatic platform selection
19
- **Integration**: Binary is resolved via Node.js module resolution and executed via child_process
20
- **Distribution**: Part of a family of platform-specific packages covering different OS/architecture combinations
21
22
## Core Integration
23
24
This package is designed to be used by the `@moonrepo/cli` package through Node.js module resolution:
25
26
```javascript
27
const { findMoonExe } = require('@moonrepo/cli/utils');
28
29
// Resolves to the moon binary in this package
30
const moonPath = findMoonExe();
31
```
32
33
Direct binary access:
34
35
```javascript
36
const path = require('path');
37
const pkgPath = require.resolve('@moonrepo/core-linux-x64-musl/package.json');
38
const moonBinary = path.join(path.dirname(pkgPath), 'moon');
39
```
40
41
## Capabilities
42
43
### Binary Executable
44
45
The main capability provided by this package is the moon CLI binary with comprehensive repository management functionality.
46
47
```bash { .api }
48
# Moon CLI executable
49
moon [COMMAND] [OPTIONS] [ARGS...]
50
```
51
52
**Platform Requirements:**
53
- Linux x64 architecture
54
- musl libc (suitable for Alpine Linux and containerized environments)
55
- No runtime dependencies (statically linked)
56
57
### Package Configuration
58
59
Package metadata defines platform and architecture constraints for npm installation.
60
61
```json { .api }
62
{
63
"name": "@moonrepo/core-linux-x64-musl",
64
"os": ["linux"],
65
"cpu": ["x64"],
66
"libc": ["musl"],
67
"publishConfig": {
68
"executableFiles": ["moon"]
69
}
70
}
71
```
72
73
### Module Resolution
74
75
The package integrates with Node.js module resolution system for binary discovery.
76
77
```javascript { .api }
78
/**
79
* Resolve package.json path for this platform-specific package
80
*/
81
require.resolve('@moonrepo/core-linux-x64-musl/package.json');
82
83
/**
84
* Binary location relative to package root
85
*/
86
const binaryPath = path.join(path.dirname(packageJsonPath), 'moon');
87
```
88
89
## Moon CLI Commands
90
91
The moon binary provides extensive repository management capabilities:
92
93
### Environment Management
94
95
```bash { .api }
96
moon init [path] # Initialize new moon repository
97
moon setup # Install all configured tools
98
moon teardown # Uninstall tools and cleanup
99
```
100
101
### Project and Task Operations
102
103
```bash { .api }
104
moon project <id> # Project-specific operations (alias: p)
105
moon task <target> # Display information about a single task (alias: t)
106
moon generate [template] # Code generation and scaffolding (alias: g)
107
```
108
109
### Task Orchestration
110
111
```bash { .api }
112
moon run [targets...] # Execute tasks with dependency resolution (alias: r)
113
moon ci [targets...] # CI-optimized task execution
114
moon check [ids...] # Validation and health checks (alias: c)
115
```
116
117
### Analysis and Visualization
118
119
```bash { .api }
120
moon action-graph # Interactive dependency graph (alias: ag)
121
moon project-graph # Project relationship visualization (alias: pg)
122
moon task-graph # Task dependency visualization (alias: tg)
123
```
124
125
### Workspace Query Operations
126
127
```bash { .api }
128
moon query hash <id> # Inspect the contents of a generated hash
129
moon query hash-diff <a> <b> # Query the difference between two hashes
130
moon query projects [options] # Query for projects within the project graph
131
moon query tasks [options] # List all available tasks, grouped by project
132
moon query touched-files [options] # Query for touched files between revisions
133
```
134
135
### Workspace Synchronization
136
137
```bash { .api }
138
moon sync # Sync all projects and configs in the workspace
139
moon sync codeowners [options] # Aggregate and sync code owners to a CODEOWNERS file
140
moon sync config-schemas [options] # Generate and sync configuration JSON schemas
141
moon sync hooks [options] # Generate and sync hook scripts for workspace VCS
142
moon sync projects [options] # Sync all projects and configs in the workspace
143
```
144
145
### Tool Management
146
147
```bash { .api }
148
moon bin <tool> # Get absolute path to tool binary
149
moon clean [targets...] # Cleanup operations
150
moon toolchain add <tool> [options] # Add and configure a toolchain plugin
151
moon toolchain info <tool> [options] # Show detailed information about a toolchain plugin
152
```
153
154
### Docker Integration
155
156
```bash { .api }
157
moon docker file [options] # Generate a default Dockerfile for a project
158
moon docker prune # Remove extraneous files and folders within a Dockerfile
159
moon docker scaffold [options] # Scaffold a repository skeleton for use within Dockerfile(s)
160
moon docker setup # Setup a Dockerfile by installing dependencies for necessary projects
161
```
162
163
### Migration and Node.js Operations
164
165
```bash { .api }
166
moon migrate from-package-json [options] # Migrate package.json scripts and dependencies to moon
167
moon migrate from-turborepo # Migrate turbo.json to moon configuration files
168
moon node run-script <script> [options] # Run a package.json script within a project
169
```
170
171
### Debugging and Advanced Features
172
173
```bash { .api }
174
moon debug config # Debug loaded configuration
175
moon debug vcs # Debug the VCS
176
moon ext [options] # Execute an extension plugin
177
moon mcp [options] # Model Context Protocol support
178
```
179
180
### Utility Commands
181
182
```bash { .api }
183
moon completions <shell> # Generate shell completions
184
moon templates [options] # Template management
185
moon upgrade # Upgrade to the latest version of moon (alias: up)
186
```
187
188
## Error Handling
189
190
**Binary Not Found:**
191
If the moon executable is not found at the expected path, the package will throw an error:
192
193
```
194
Error: moon executable "<path>" not found!
195
```
196
197
**Platform Mismatch:**
198
If installed on incompatible platforms, npm will skip installation due to platform constraints in package.json.
199
200
**Permission Issues:**
201
The binary requires executable permissions, which are automatically set during npm installation via the `executableFiles` configuration.
202
203
## Usage Patterns
204
205
### Via @moonrepo/cli (Recommended)
206
207
```javascript
208
const cp = require('child_process');
209
const { findMoonExe } = require('@moonrepo/cli/utils');
210
211
// Execute moon command
212
const result = cp.spawnSync(findMoonExe(), ['--version'], {
213
stdio: 'inherit'
214
});
215
```
216
217
### Direct Binary Access
218
219
```javascript
220
const fs = require('fs');
221
const path = require('path');
222
const cp = require('child_process');
223
224
// Resolve binary path
225
const pkgPath = require.resolve('@moonrepo/core-linux-x64-musl/package.json');
226
const moonPath = path.join(path.dirname(pkgPath), 'moon');
227
228
// Verify binary exists
229
if (fs.existsSync(moonPath)) {
230
// Execute moon command
231
cp.spawnSync(moonPath, ['--help'], { stdio: 'inherit' });
232
}
233
```
234
235
### Container Usage
236
237
This musl-compiled binary is ideal for containerized environments:
238
239
```dockerfile
240
FROM alpine:latest
241
RUN npm install -g @moonrepo/cli
242
# The appropriate platform binary (@moonrepo/core-linux-x64-musl)
243
# will be automatically selected and installed
244
```