apcore-cli 0.4.0 → 0.6.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/CHANGELOG.md +39 -0
- package/README.md +20 -1
- package/dist/bin/apcore-cli.js +1043 -12
- package/dist/bin/apcore-cli.js.map +1 -1
- package/dist/index.d.ts +155 -22
- package/dist/index.js +2234 -1041
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ All notable changes to apcore-cli (TypeScript SDK) will be documented in this fi
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.0] - 2026-04-06
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Dependency bump**: requires `apcore-js >= 0.17.1` (was `>= 0.15.1`). Adds Execution Pipeline Strategy, Config Bus enhancements, Pipeline v2 declarative step metadata, `minimal` strategy preset.
|
|
13
|
+
- **Schema parser**: Required schema properties now correctly enforced at Commander option level (was silently optional).
|
|
14
|
+
- `checkApproval()` now accepts `timeout` parameter instead of hardcoded 60s.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **FE-11: Usability Enhancements** — 11 new capabilities:
|
|
19
|
+
- `--dry-run` preflight mode. Standalone `validate` command via `registerValidateCommand()`.
|
|
20
|
+
- System management commands: `health`, `usage`, `enable`, `disable`, `reload`, `config get`/`config set` in `system-cmd.ts`. Graceful no-op when system modules unavailable.
|
|
21
|
+
- Enhanced error output: `emitErrorJson()` / `emitErrorTty()` with structured guidance fields.
|
|
22
|
+
- `--trace` pipeline visualization.
|
|
23
|
+
- `CliApprovalHandler` class implementing apcore `ApprovalHandler` protocol. `--approval-timeout`, `--approval-token` flags.
|
|
24
|
+
- `--stream` JSONL output.
|
|
25
|
+
- Enhanced `list` command: `--search`, `--status`, `--annotation`, `--sort`, `--reverse`, `--deprecated`, `--deps`, `--flat`.
|
|
26
|
+
- `--strategy` selection: `standard`, `internal`, `testing`, `performance`, `minimal`. `describe-pipeline` command in `strategy.ts`.
|
|
27
|
+
- Output format extensions: `--format csv|yaml|jsonl`, `--fields` dot-path field selection.
|
|
28
|
+
- Multi-level grouping: `groupDepth` parameter in `resolveGroup()`.
|
|
29
|
+
- Custom command extension: `CreateCliOptions.extraCommands` with collision detection.
|
|
30
|
+
- `Executor` interface extended with optional `validate()`, `callWithTrace()`, `stream()`, `call()` methods.
|
|
31
|
+
- `PreflightResult`, `PreflightCheck`, `PipelineTrace`, `PipelineTraceStep` types exported.
|
|
32
|
+
- New error code: `CONFIG_ENV_MAP_CONFLICT` in `EXIT_CODES`.
|
|
33
|
+
- Config defaults: `cli.approval_timeout` (60), `cli.strategy` ("standard"), `cli.group_depth` (1).
|
|
34
|
+
- New files: `system-cmd.ts`, `strategy.ts`.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [0.5.1] - 2026-04-03
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- **Pre-populated registry support** — `createCli()` accepts a `CreateCliOptions` object with optional `registry` and `executor` fields. When a pre-populated `Registry` is provided, filesystem discovery is skipped entirely. This enables frameworks that register modules at runtime to generate CLI commands from their existing registry without requiring an extensions directory.
|
|
42
|
+
- `CreateCliOptions` interface exported from package index.
|
|
43
|
+
- Passing `executor` without `registry` throws an error.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
8
47
|
## [0.4.0] - 2026-03-29
|
|
9
48
|
|
|
10
49
|
### Added
|
package/README.md
CHANGED
|
@@ -73,11 +73,28 @@ All modules are auto-discovered. CLI flags are auto-generated from each module's
|
|
|
73
73
|
```typescript
|
|
74
74
|
import { createCli } from "apcore-cli";
|
|
75
75
|
|
|
76
|
-
// Build the CLI from
|
|
76
|
+
// Build the CLI from an extensions directory (auto-discovers modules)
|
|
77
77
|
const cli = createCli("./extensions");
|
|
78
78
|
cli.parse(process.argv);
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
#### Pre-populated registry
|
|
82
|
+
|
|
83
|
+
Frameworks that register modules at runtime can pass a pre-populated `Registry` directly via `CreateCliOptions`, skipping filesystem discovery entirely:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { createCli } from "apcore-cli";
|
|
87
|
+
import type { CreateCliOptions } from "apcore-cli";
|
|
88
|
+
|
|
89
|
+
// registry and executor are already populated by your framework
|
|
90
|
+
const cli = createCli({
|
|
91
|
+
registry,
|
|
92
|
+
executor,
|
|
93
|
+
progName: "myapp",
|
|
94
|
+
});
|
|
95
|
+
cli.parse(process.argv);
|
|
96
|
+
```
|
|
97
|
+
|
|
81
98
|
Or use the `LazyModuleGroup` directly with Commander:
|
|
82
99
|
|
|
83
100
|
```typescript
|
|
@@ -277,6 +294,8 @@ apcore Registry + Executor (your modules, unchanged)
|
|
|
277
294
|
|
|
278
295
|
**Classes:** `LazyModuleGroup`, `ConfigResolver`, `AuthProvider`, `ConfigEncryptor`, `AuditLogger`, `Sandbox`
|
|
279
296
|
|
|
297
|
+
**Interfaces:** `CreateCliOptions`, `Registry`, `Executor`, `ModuleDescriptor`
|
|
298
|
+
|
|
280
299
|
**Functions:** `createCli`, `main`, `buildModuleCommand`, `validateModuleId`, `collectInput`, `schemaToCliOptions`, `reconvertEnumValues`, `resolveRefs`, `checkApproval`, `resolveFormat`, `formatModuleList`, `formatModuleDetail`, `formatExecResult`, `registerDiscoveryCommands`, `registerShellCommands`, `setAuditLogger`, `getAuditLogger`, `setVerboseHelp`, `setDocsUrl`, `buildProgramManPage`, `configureManHelp`, `exitCodeForError`, `mapType`, `extractHelp`, `truncate`
|
|
281
300
|
|
|
282
301
|
**Errors:** `ApprovalTimeoutError`, `ApprovalDeniedError`, `AuthenticationError`, `ConfigDecryptionError`, `ModuleExecutionError`, `ModuleNotFoundError`, `SchemaValidationError`
|