@mmmnt/cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -18
- package/dist/moment.mjs +2708 -2014
- package/dist/moment.mjs.map +4 -4
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Command-line interface for the Moment domain specification language and implemen
|
|
|
11
11
|
|
|
12
12
|
From initializing a new project to parsing specifications, deriving test topologies, generating TypeScript code and BDD scenarios, running conformance tests, detecting implementation drift, and managing schema lifecycles -- every operation is available as a single CLI command. The CLI handles file I/O, output formatting, error reporting, and watch mode so that the underlying library packages remain focused on their core logic.
|
|
13
13
|
|
|
14
|
-
The CLI is designed for both interactive development and CI/CD pipeline integration. All commands produce structured output suitable for scripting, and exit codes follow standard conventions for use in automated workflows.
|
|
14
|
+
The CLI is designed for both interactive development and CI/CD pipeline integration. All commands produce structured output suitable for scripting, and exit codes follow standard conventions for use in automated workflows. Many commands support the `--json` flag for machine-readable output; see the Common Options table below for details.
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -37,7 +37,7 @@ yarn global add @mmmnt/cli
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Initialize a new Moment project
|
|
40
|
-
moment init my-service
|
|
40
|
+
moment init --name my-service
|
|
41
41
|
|
|
42
42
|
# Parse and validate a .moment specification
|
|
43
43
|
moment parse specs/my-service.moment
|
|
@@ -63,11 +63,11 @@ moment watch specs/
|
|
|
63
63
|
- **Unified entry point** -- a single `moment` binary that wraps all `@mmmnt` packages, so you do not need to import or configure individual libraries.
|
|
64
64
|
- **20+ commands** -- covers the full lifecycle from project initialization through specification, derivation, generation, testing, synchronization, and governance.
|
|
65
65
|
- **Watch mode** -- monitors `.moment` files and automatically re-parses and regenerates artifacts on save.
|
|
66
|
-
- **Structured output** --
|
|
66
|
+
- **Structured output** -- most commands support `--json` for machine-readable output in CI/CD pipelines.
|
|
67
67
|
- **Standard exit codes** -- non-zero exit on validation failures, drift detection, or test failures for pipeline gating.
|
|
68
68
|
- **Subcommand structure** -- complex operations like `sync` and `schema` use subcommands (`sync status`, `sync propose`, `sync accept`, `schema status`) for organized workflows.
|
|
69
69
|
- **Authentication support** -- `moment auth` subcommands manage credentials for Moment cloud services when applicable.
|
|
70
|
-
- **Verbose mode** --
|
|
70
|
+
- **Verbose mode** -- `moment status --verbose` enables detailed logging for the unified status command.
|
|
71
71
|
|
|
72
72
|
## Commands
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ moment watch specs/
|
|
|
75
75
|
|
|
76
76
|
| Command | Description |
|
|
77
77
|
|---------|-------------|
|
|
78
|
-
| `moment init <name>` | Initialize a new Moment project with
|
|
78
|
+
| `moment init --name <name>` | Initialize a new Moment project with `.manifest.yaml`, `.moment/contexts/`, and `.moment/flows/` directories. Optionally specify `--dir <path>` for the target directory (defaults to `.`). |
|
|
79
79
|
|
|
80
80
|
### Specification
|
|
81
81
|
|
|
@@ -126,7 +126,7 @@ moment watch specs/
|
|
|
126
126
|
| Command | Description |
|
|
127
127
|
|---------|-------------|
|
|
128
128
|
| `moment schema status <file>` | Display schema lifecycle status for all events and commands in the specification, grouped by phase. |
|
|
129
|
-
| `moment lint <file>` | Run codex governance rules against the specification and report policy violations. Supports `--
|
|
129
|
+
| `moment lint <file>` | Run codex governance rules against the specification and report policy violations. Supports `--json` for CI integration. |
|
|
130
130
|
|
|
131
131
|
### Import
|
|
132
132
|
|
|
@@ -142,15 +142,21 @@ moment watch specs/
|
|
|
142
142
|
| `moment auth status` | Display current authentication status and account information. |
|
|
143
143
|
| `moment auth logout` | Clear stored authentication credentials. |
|
|
144
144
|
|
|
145
|
-
##
|
|
145
|
+
## Common Options
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
151
|
-
| `--
|
|
152
|
-
| `--
|
|
153
|
-
| `--
|
|
147
|
+
These are commonly used options available on the commands indicated, not globally on every command. Individual commands may support additional command-specific flags not listed here.
|
|
148
|
+
|
|
149
|
+
| Option | Available on | Description |
|
|
150
|
+
|--------|-------------|-------------|
|
|
151
|
+
| `--json` | derive, simulate, lint, schema status, sync status/propose/accept, reconcile, status, import | Machine-readable JSON output to stdout. |
|
|
152
|
+
| `--out <dir>` | generate, emit-ts | Override the output directory for generated artifacts (defaults to the project root or cwd). |
|
|
153
|
+
| `--out-dir <dir>` | simulate | Write topology, scenario, and artifact files to the specified directory. |
|
|
154
|
+
| `--output-dir <dir>` | import --from-sift | Write imported `.moment` files to the specified directory. |
|
|
155
|
+
| `--all` | simulate, serve | Generate all branch combinations and negative scenarios (simulate) or serve all scenarios including negatives (serve). |
|
|
156
|
+
| `--all` | sync accept | Accept all pending proposals. |
|
|
157
|
+
| `--dry-run` | emit-ts | List files that would be emitted without writing them. |
|
|
158
|
+
| `--verbose` | status | Enable detailed output. |
|
|
159
|
+
| `--port <n>` | serve | WebSocket port (default 4321). |
|
|
154
160
|
|
|
155
161
|
## Examples
|
|
156
162
|
|
|
@@ -158,7 +164,7 @@ moment watch specs/
|
|
|
158
164
|
|
|
159
165
|
```bash
|
|
160
166
|
# Scaffold a new project
|
|
161
|
-
moment init my-service
|
|
167
|
+
moment init --name my-service --dir my-service
|
|
162
168
|
cd my-service
|
|
163
169
|
|
|
164
170
|
# Write your .moment specification, then generate everything
|
|
@@ -207,7 +213,7 @@ moment sync status specs/my-service.moment
|
|
|
207
213
|
moment test specs/my-service.moment
|
|
208
214
|
|
|
209
215
|
# Lint governance rules
|
|
210
|
-
moment lint specs/my-service.moment --
|
|
216
|
+
moment lint specs/my-service.moment --json
|
|
211
217
|
|
|
212
218
|
# Generate documentation artifacts
|
|
213
219
|
moment generate specs/my-service.moment
|
|
@@ -239,8 +245,8 @@ moment schema status specs/my-service.moment
|
|
|
239
245
|
moment lint specs/my-service.moment
|
|
240
246
|
|
|
241
247
|
# Machine-readable output for dashboards
|
|
242
|
-
moment schema status specs/my-service.moment --
|
|
243
|
-
moment lint specs/my-service.moment --
|
|
248
|
+
moment schema status specs/my-service.moment --json
|
|
249
|
+
moment lint specs/my-service.moment --json
|
|
244
250
|
```
|
|
245
251
|
|
|
246
252
|
## Integration
|