@theholocron/cli 2.0.0-alpha.6 → 2.0.0-alpha.61

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 CHANGED
@@ -1,3 +1,5 @@
1
+ <!-- editorconfig-checker-disable-file -->
2
+
1
3
  # `@theholocron/cli`
2
4
 
3
5
  The Holocron CLI — a pluggable, capability-based orchestrator for
@@ -5,24 +7,129 @@ spinning up and operating software projects.
5
7
 
6
8
  ## Install
7
9
 
10
+ <!-- prettier-ignore -->
8
11
  ```bash
9
12
  npm i -g @theholocron/cli@alpha
10
13
  holocron --help
14
+
15
+ ```
16
+
17
+ ## Config file
18
+
19
+ Holocron reads `holocron.config.{json,js,ts}` from the project root
20
+ (priority: json → js → ts).
21
+
22
+ **JSON** (simplest):
23
+
24
+ <!-- prettier-ignore -->
25
+ ```jsonc
26
+ // holocron.config.json
27
+ {
28
+ "name": "my-app",
29
+ "providers": {
30
+ "vault": ["1password", { "vault": "my-app" }],
31
+ "source": "github",
32
+ },
33
+ }
34
+
35
+ ```
36
+
37
+ **JS/TS** — use `defineConfig` for autocomplete and type-checking:
38
+
39
+ <!-- prettier-ignore -->
40
+ ```ts
41
+ // holocron.config.ts
42
+ import { defineConfig } from "@theholocron/cli";
43
+
44
+ export default defineConfig({
45
+ name: "my-app",
46
+ providers: {
47
+ vault: ["1password", { vault: "my-app" }],
48
+ source: "github",
49
+ },
50
+ });
51
+
52
+ ```
53
+
54
+ ### Auto-derived fields
55
+
56
+ `name` and `repo.name` are optional. When absent, Holocron fills them
57
+ in at load time:
58
+
59
+ | Field | Derived from | Fallback |
60
+ | ----------- | ---------------------------------------------------- | ------------------ |
61
+ | `name` | `package.json` → `name` field (scope stripped) | directory basename |
62
+ | `repo.name` | `git remote get-url origin` (parsed to `owner/repo`) | not set |
63
+
64
+ A minimal config — for repos with a `package.json` and a GitHub remote
65
+ — only needs `providers`:
66
+
67
+ <!-- prettier-ignore -->
68
+ ```jsonc
69
+ { "providers": { "source": "github" } }
70
+ ```
71
+
72
+ Set `name` explicitly whenever the derived value would be wrong: content
73
+ repos without a `package.json` (e.g. `.github`) will fall back to the
74
+ directory basename, which may not match what your vault or deployment
75
+ provider expects as a project identifier.
76
+
77
+ ### Shareable configs
78
+
79
+ **Level 1 — per-capability config packages.** Reference a published
80
+ package in any provider slot and Holocron resolves its bundled
81
+ `{ provider, options }` automatically. Per-project options merge on
82
+ top (project wins):
83
+
84
+ <!-- prettier-ignore -->
85
+ ```ts
86
+ providers: {
87
+ vault: '@acme/holocron-vault', // preset only
88
+ source: ['@acme/holocron-github', { repo: 'x' }], // preset + override
89
+ }
90
+
91
+ ```
92
+
93
+ A capability config package exports a `CapabilityConfigPackage` default:
94
+
95
+ <!-- prettier-ignore -->
96
+ ```ts
97
+ import type { CapabilityConfigPackage } from "@theholocron/cli";
98
+ export default {
99
+ provider: "1password",
100
+ options: { vault: "acme-app" },
101
+ } satisfies CapabilityConfigPackage;
102
+
103
+ ```
104
+
105
+ **Level 2 — whole-config presets.** Because the config file can be
106
+ JS/TS, a shared base is just an import:
107
+
108
+ <!-- prettier-ignore -->
109
+ ```ts
110
+ // holocron.config.ts
111
+ import { acmeConfig } from "@acme/holocron-config";
112
+ export default acmeConfig;
113
+
11
114
  ```
12
115
 
13
116
  ## What's in here
14
117
 
15
118
  - `src/capabilities/` — the 14 capability interfaces that providers
16
- implement
17
- - `src/config.ts` — `holocron.config.json` parser + plugin resolution
119
+ implement
120
+ - `src/config.ts` — config schema, `defineConfig`, `resolveConfig`,
121
+ `CapabilityConfigPackage`
122
+ - `src/load-config.ts` — `loadConfig` — reads JSON/JS/TS config files
123
+ - `src/define-config.ts` — `defineConfig` typed pass-through
124
+ - `src/loader.ts` — `PluginLoader` — dynamic-imports plugins, resolves
125
+ capability config packages, builds the capability registry
18
126
  - `src/cli.ts` — yargs entry, dispatches subcommands
19
- - `src/commands/` — `setup`, `doctor`, `deploy`, `secret set`,
20
- `secrets sync`, `npm publish-initial`
127
+ - `src/commands/` — `setup`, `sync`, `doctor`, `deploy`, `secret set`,
128
+ `secrets sync`, `npm publish-initial`, `sync-github`, `upgrade node`,
129
+ `plugin create`, `auth`
21
130
 
22
131
  ## Status
23
132
 
24
- **`v2.0.0-alpha.0`** — published on npm under the `alpha` dist-tag.
25
- [Release notes](https://github.com/theholocron/holocron/releases/tag/v2.0.0-alpha.0).
26
- Design in
27
- [`.notes/tech-architecture.spec.md`](../../.notes/tech-architecture.spec.md).
28
- APIs may still shift before stable v2.0.0.
133
+ Published on npm under the `alpha` dist-tag. APIs may still shift before
134
+ stable v2.0.0. Design in
135
+ [`.notes/archive/tech-architecture.spec.md`](../../.notes/archive/tech-architecture.spec.md).