@open-agent-toolkit/cli 0.1.17 → 0.1.18
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 +1 -0
- package/assets/docs/cli-utilities/config-and-local-state.md +2 -0
- package/assets/docs/cli-utilities/tool-packs.md +30 -1
- package/assets/docs/reference/cli-reference.md +12 -11
- package/assets/docs/reference/oat-directory-structure.md +16 -6
- package/assets/public-package-versions.json +4 -4
- package/assets/templates/current-state.md +18 -0
- package/assets/templates/decision-record.md +21 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/init/tools/shared/skill-manifest.d.ts +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.js +2 -0
- package/dist/commands/pjm/index.d.ts +14 -0
- package/dist/commands/pjm/index.d.ts.map +1 -0
- package/dist/commands/pjm/index.js +67 -0
- package/dist/commands/pjm/init.d.ts +12 -0
- package/dist/commands/pjm/init.d.ts.map +1 -0
- package/dist/commands/pjm/init.js +119 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Additional useful entry points:
|
|
|
31
31
|
- `oat instructions validate --strategy pointer`
|
|
32
32
|
- `oat instructions sync --dry-run --strategy symlink`
|
|
33
33
|
- `oat docs init --app-name my-docs`
|
|
34
|
+
- `oat pjm init` - initialize the project-management repo-reference surface after installing the pack
|
|
34
35
|
- `oat config dump --json`
|
|
35
36
|
- `oat project status --json`
|
|
36
37
|
- `oat project list --json`
|
|
@@ -20,6 +20,8 @@ Use the `oat backlog` group when you want direct CLI support for the file-backed
|
|
|
20
20
|
|
|
21
21
|
Run `oat backlog init` first when the local backlog scaffold does not exist yet in a fresh repo. This command group is primarily used by the `oat-pjm-*` project-management skills, but it is also available directly when you need to inspect or repair backlog metadata by hand.
|
|
22
22
|
|
|
23
|
+
For full project-management repo-reference setup, use [`oat pjm init`](tool-packs.md#install-vs-initialize). It scaffolds `current-state.md`, `roadmap.md`, `decision-record.md`, and delegates the backlog sub-surface to `oat backlog init`.
|
|
24
|
+
|
|
23
25
|
## `oat local ...`
|
|
24
26
|
|
|
25
27
|
`oat local` manages local-only, gitignored paths that still need to follow you between the main repo and worktrees.
|
|
@@ -20,7 +20,7 @@ This page covers CLI commands that manage bundled OAT tool packs and installed O
|
|
|
20
20
|
- `workflows` - project lifecycle skills, wrap-up reporting, reviewer agents, and core project templates
|
|
21
21
|
- `ideas` - lightweight ideation and promotion flows
|
|
22
22
|
- `utility` - review and repo-maintenance helpers
|
|
23
|
-
- `project-management` - file-backed backlog/reference skills plus backlog and
|
|
23
|
+
- `project-management` - file-backed backlog/reference skills plus backlog, roadmap, current-state, and decision-record templates
|
|
24
24
|
- `research` - research, analysis, comparison, and synthesis skills
|
|
25
25
|
- `brainstorm` - always-on brainstorming entry point with visual companion
|
|
26
26
|
|
|
@@ -28,6 +28,35 @@ This page covers CLI commands that manage bundled OAT tool packs and installed O
|
|
|
28
28
|
|
|
29
29
|
The `oat tools` command group provides a unified interface for managing installed tools (skills and agents) across scopes.
|
|
30
30
|
|
|
31
|
+
## Install vs. initialize
|
|
32
|
+
|
|
33
|
+
The `project-management` pack has two lifecycle steps:
|
|
34
|
+
|
|
35
|
+
- **Install**: `oat tools install project-management` (or the legacy `oat init tools project-management`) copies project-management skills into `.agents/skills/` and template sources into `.oat/templates/`.
|
|
36
|
+
- **Initialize**: `oat pjm init` instantiates the working repo-reference surface under `.oat/repo/reference/`.
|
|
37
|
+
|
|
38
|
+
Installing the pack makes the skills and templates available; it does not create the repo's working project-management reference docs. Run `oat pjm init` when you want to scaffold the canonical PJM surface for a repo:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
oat pjm init
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The command creates missing files and directories for:
|
|
45
|
+
|
|
46
|
+
- `.oat/repo/reference/current-state.md`
|
|
47
|
+
- `.oat/repo/reference/roadmap.md`
|
|
48
|
+
- `.oat/repo/reference/decision-record.md`
|
|
49
|
+
- `.oat/repo/reference/backlog/`
|
|
50
|
+
|
|
51
|
+
`oat pjm init` is idempotent and non-destructive. Existing reference docs are skipped and left unchanged, so curated repo state is not overwritten on repeated runs.
|
|
52
|
+
|
|
53
|
+
Useful options:
|
|
54
|
+
|
|
55
|
+
- `--reference-root <path>` - scaffold a different reference root instead of `.oat/repo/reference/`
|
|
56
|
+
- `--json` - emit a machine-readable result with created and skipped paths
|
|
57
|
+
|
|
58
|
+
Backlog scaffolding is delegated to the lower-level [`oat backlog init`](config-and-local-state.md#oat-backlog-) helper. Use `oat pjm init` for the full PJM repo-reference surface, and use `oat backlog init` directly only when you need to create or repair the backlog sub-surface by itself.
|
|
59
|
+
|
|
31
60
|
### `oat tools list`
|
|
32
61
|
|
|
33
62
|
Purpose:
|
|
@@ -22,17 +22,18 @@ The CLI is also a standalone value path. You can use `oat init`, `oat sync`, `oa
|
|
|
22
22
|
|
|
23
23
|
## Command Groups
|
|
24
24
|
|
|
25
|
-
| Command group | What it covers | Go deeper
|
|
26
|
-
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
-
| `oat init` | Bootstrap canonical OAT directories, sync config, optional hooks, and guided setup. | [CLI Bootstrap](../cli-utilities/bootstrap.md)
|
|
28
|
-
| `oat tools ...` | Install, inspect, update, and remove bundled OAT tool packs and assets. | [Tool Packs](../cli-utilities/tool-packs.md)
|
|
29
|
-
| `oat
|
|
30
|
-
| `oat
|
|
31
|
-
| `oat
|
|
32
|
-
| `oat
|
|
33
|
-
| `oat
|
|
34
|
-
| `oat
|
|
35
|
-
| `oat
|
|
25
|
+
| Command group | What it covers | Go deeper |
|
|
26
|
+
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
27
|
+
| `oat init` | Bootstrap canonical OAT directories, sync config, optional hooks, and guided setup. | [CLI Bootstrap](../cli-utilities/bootstrap.md) |
|
|
28
|
+
| `oat tools ...` | Install, inspect, update, and remove bundled OAT tool packs and assets. | [Tool Packs](../cli-utilities/tool-packs.md) |
|
|
29
|
+
| `oat pjm ...` | Initialize the project-management repo-reference surface after installing the project-management pack. | [Install vs. initialize](../cli-utilities/tool-packs.md#install-vs-initialize) |
|
|
30
|
+
| `oat backlog ...` / `oat local ...` | File-backed backlog helpers, local path sync, and local-only operational support. | [Config and Local State](../cli-utilities/config-and-local-state.md) |
|
|
31
|
+
| `oat config ...` / `oat instructions ...` | Config discovery, source-aware config dumps, supported mutations, and instruction-integrity helpers. | [Config and Local State](../cli-utilities/config-and-local-state.md) |
|
|
32
|
+
| `oat state ...` / `oat index ...` / `internal` | Repo dashboard refresh, repo indexing, validation helpers, and diagnostics. | [Config and Local State](../cli-utilities/config-and-local-state.md) |
|
|
33
|
+
| `oat docs ...` | Docs app bootstrap, migration, index generation, nav sync, and docs workflow entrypoints. | [Docs Tooling Commands](../docs-tooling/commands.md) |
|
|
34
|
+
| `oat status` / `oat sync` / `oat providers ...` | Provider sync, drift inspection, provider configuration, and adoption behavior. | [Provider Sync](../provider-sync/index.md) |
|
|
35
|
+
| `oat project ...` / `oat cleanup ...` | Project scaffolding, active-project status inspection, tracked-project listing, plan validation, and project/artifact cleanup commands. | [Workflow & Projects](../workflows/projects/index.md) |
|
|
36
|
+
| `oat repo ...` | Repository-level analysis workflows, currently centered on PR comments. | [Repository Analysis](../workflows/projects/repo-analysis.md) |
|
|
36
37
|
|
|
37
38
|
Notable inspection commands introduced in the current CLI surface:
|
|
38
39
|
|
|
@@ -210,12 +210,22 @@ Not all workflow modes require every artifact:
|
|
|
210
210
|
|
|
211
211
|
## `.oat/repo/` structure
|
|
212
212
|
|
|
213
|
-
| Path | Purpose
|
|
214
|
-
| ---------------------- |
|
|
215
|
-
| `.oat/repo/knowledge/` | Generated codebase knowledge indexes
|
|
216
|
-
| `.oat/repo/reference/` | Repo-level reference docs (
|
|
217
|
-
| `.oat/repo/reviews/` | Repo-scoped review artifacts (ad-hoc/non-project)
|
|
218
|
-
| `.oat/repo/archive/` | Archived repo-level artifacts
|
|
213
|
+
| Path | Purpose |
|
|
214
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
215
|
+
| `.oat/repo/knowledge/` | Generated codebase knowledge indexes |
|
|
216
|
+
| `.oat/repo/reference/` | Repo-level reference docs, including the canonical PJM surface (`current-state.md`, `roadmap.md`, `decision-record.md`, and `backlog/`) |
|
|
217
|
+
| `.oat/repo/reviews/` | Repo-scoped review artifacts (ad-hoc/non-project) |
|
|
218
|
+
| `.oat/repo/archive/` | Archived repo-level artifacts |
|
|
219
|
+
|
|
220
|
+
Canonical project-management repo-reference surface:
|
|
221
|
+
|
|
222
|
+
```text
|
|
223
|
+
.oat/repo/reference/
|
|
224
|
+
current-state.md
|
|
225
|
+
roadmap.md
|
|
226
|
+
decision-record.md
|
|
227
|
+
backlog/
|
|
228
|
+
```
|
|
219
229
|
|
|
220
230
|
## User scope (`~/.oat/`)
|
|
221
231
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
oat_template: true
|
|
3
|
+
oat_template_name: current-state
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OAT Current State
|
|
7
|
+
|
|
8
|
+
## Canonical References
|
|
9
|
+
|
|
10
|
+
<!-- List durable repo references, source-of-truth docs, dashboards, or processes here. -->
|
|
11
|
+
|
|
12
|
+
## What's Implemented
|
|
13
|
+
|
|
14
|
+
<!-- Summarize shipped capabilities and important repo conventions here. -->
|
|
15
|
+
|
|
16
|
+
## What's Next
|
|
17
|
+
|
|
18
|
+
<!-- Track near-term follow-up work, known gaps, and active handoff context here. -->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
oat_template: true
|
|
3
|
+
oat_template_name: decision-record
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OAT Decision Record
|
|
7
|
+
|
|
8
|
+
## Decision Index
|
|
9
|
+
|
|
10
|
+
| ID | Date | Status | Decision | Context |
|
|
11
|
+
| --- | ---- | ------ | -------- | ------- |
|
|
12
|
+
|
|
13
|
+
<!--
|
|
14
|
+
## ADR-NNN: Decision title
|
|
15
|
+
|
|
16
|
+
- Date: YYYY-MM-DD
|
|
17
|
+
- Status: proposed | accepted | superseded
|
|
18
|
+
- Context: What problem or constraint led to this decision?
|
|
19
|
+
- Decision: What choice was made?
|
|
20
|
+
- Consequences: What tradeoffs, follow-ups, or migration notes matter?
|
|
21
|
+
-->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoBvD"}
|
package/dist/commands/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { createInitCommand } from './init/index.js';
|
|
|
8
8
|
import { createInstructionsCommand } from './instructions/index.js';
|
|
9
9
|
import { createInternalCommand } from './internal/index.js';
|
|
10
10
|
import { createLocalCommand } from './local/index.js';
|
|
11
|
+
import { createPjmCommand } from './pjm/index.js';
|
|
11
12
|
import { createProjectCommand } from './project/index.js';
|
|
12
13
|
import { createProvidersCommand } from './providers/index.js';
|
|
13
14
|
import { createRemoveCommand } from './remove/index.js';
|
|
@@ -31,6 +32,7 @@ export function registerCommands(program) {
|
|
|
31
32
|
program.addCommand(createDocsCommand());
|
|
32
33
|
program.addCommand(createInstructionsCommand());
|
|
33
34
|
program.addCommand(createIndexCommand());
|
|
35
|
+
program.addCommand(createPjmCommand());
|
|
34
36
|
program.addCommand(createProjectCommand());
|
|
35
37
|
program.addCommand(createStateCommand());
|
|
36
38
|
program.addCommand(createToolsCommand());
|
|
@@ -21,7 +21,7 @@ export declare const DOCS_SKILLS: readonly ["oat-agent-instructions-analyze", "o
|
|
|
21
21
|
export declare const DOCS_SCRIPTS: readonly ["resolve-tracking.sh"];
|
|
22
22
|
export declare const UTILITY_SKILLS: readonly ["create-agnostic-skill", "oat-repo-maintainability-review", "oat-review-provide", "oat-review-provide-remote", "oat-review-receive", "oat-review-receive-remote"];
|
|
23
23
|
export declare const PROJECT_MANAGEMENT_SKILLS: readonly ["oat-pjm-add-backlog-item", "oat-pjm-update-repo-reference", "oat-pjm-review-backlog"];
|
|
24
|
-
export declare const PROJECT_MANAGEMENT_TEMPLATES: readonly ["backlog-item.md", "roadmap.md"];
|
|
24
|
+
export declare const PROJECT_MANAGEMENT_TEMPLATES: readonly ["backlog-item.md", "roadmap.md", "current-state.md", "decision-record.md"];
|
|
25
25
|
export declare const PROJECT_MANAGEMENT_SCRIPTS: readonly [];
|
|
26
26
|
export declare const BRAINSTORM_SKILLS: readonly ["oat-brainstorm"];
|
|
27
27
|
export declare const RESEARCH_SKILLS: readonly ["analyze", "compare", "deep-research", "skeptic", "synthesize"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAKtD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5E;AAID,eAAO,MAAM,eAAe,6xBAgClB,CAAC;AAEX,eAAO,MAAM,eAAe,oFAIlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,6GAQrB,CAAC;AAEX,eAAO,MAAM,gBAAgB,qFAInB,CAAC;AAIX,eAAO,MAAM,WAAW,2FAKd,CAAC;AAIX,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAI/D,eAAO,MAAM,WAAW,yIAMd,CAAC;AAEX,eAAO,MAAM,YAAY,kCAAmC,CAAC;AAI7D,eAAO,MAAM,cAAc,6KAOjB,CAAC;AAIX,eAAO,MAAM,yBAAyB,kGAI5B,CAAC;AAEX,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAKtD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5E;AAID,eAAO,MAAM,eAAe,6xBAgClB,CAAC;AAEX,eAAO,MAAM,eAAe,oFAIlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,6GAQrB,CAAC;AAEX,eAAO,MAAM,gBAAgB,qFAInB,CAAC;AAIX,eAAO,MAAM,WAAW,2FAKd,CAAC;AAIX,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAI/D,eAAO,MAAM,WAAW,yIAMd,CAAC;AAEX,eAAO,MAAM,YAAY,kCAAmC,CAAC;AAI7D,eAAO,MAAM,cAAc,6KAOjB,CAAC;AAIX,eAAO,MAAM,yBAAyB,kGAI5B,CAAC;AAEX,eAAO,MAAM,4BAA4B,sFAK/B,CAAC;AAEX,eAAO,MAAM,0BAA0B,aAAc,CAAC;AAItD,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAI7D,eAAO,MAAM,eAAe,2EAMlB,CAAC;AAEX,eAAO,MAAM,eAAe,qCAAsC,CAAC"}
|
|
@@ -103,6 +103,8 @@ export const PROJECT_MANAGEMENT_SKILLS = [
|
|
|
103
103
|
export const PROJECT_MANAGEMENT_TEMPLATES = [
|
|
104
104
|
'backlog-item.md',
|
|
105
105
|
'roadmap.md',
|
|
106
|
+
'current-state.md',
|
|
107
|
+
'decision-record.md',
|
|
106
108
|
];
|
|
107
109
|
export const PROJECT_MANAGEMENT_SCRIPTS = [];
|
|
108
110
|
// ── Brainstorm pack ───────────────────────────────────────────────
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buildCommandContext } from '../../app/command-context.js';
|
|
2
|
+
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
3
|
+
import { resolveProjectRoot } from '../../fs/paths.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { initializeRepoReference } from './init.js';
|
|
6
|
+
interface PjmCommandDependencies {
|
|
7
|
+
buildCommandContext: typeof buildCommandContext;
|
|
8
|
+
resolveProjectRoot: typeof resolveProjectRoot;
|
|
9
|
+
resolveAssetsRoot: typeof resolveAssetsRoot;
|
|
10
|
+
initializeRepoReference: typeof initializeRepoReference;
|
|
11
|
+
}
|
|
12
|
+
export declare function createPjmCommand(overrides?: Partial<PjmCommandDependencies>): Command;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAMjD,UAAU,sBAAsB;IAC9B,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;CACzD;AAqBD,wBAAgB,gBAAgB,CAC9B,SAAS,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC9C,OAAO,CA+DT"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { buildCommandContext } from '../../app/command-context.js';
|
|
3
|
+
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
4
|
+
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
5
|
+
import { resolveProjectRoot } from '../../fs/paths.js';
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { initializeRepoReference } from './init.js';
|
|
8
|
+
const DEFAULT_DEPENDENCIES = {
|
|
9
|
+
buildCommandContext,
|
|
10
|
+
resolveProjectRoot,
|
|
11
|
+
resolveAssetsRoot,
|
|
12
|
+
initializeRepoReference,
|
|
13
|
+
};
|
|
14
|
+
async function resolveReferenceRoot(context, projectRoot, configuredRoot) {
|
|
15
|
+
if (configuredRoot) {
|
|
16
|
+
return resolve(context.cwd, configuredRoot);
|
|
17
|
+
}
|
|
18
|
+
return resolve(projectRoot, '.oat', 'repo', 'reference');
|
|
19
|
+
}
|
|
20
|
+
export function createPjmCommand(overrides = {}) {
|
|
21
|
+
const dependencies = {
|
|
22
|
+
...DEFAULT_DEPENDENCIES,
|
|
23
|
+
...overrides,
|
|
24
|
+
};
|
|
25
|
+
const cmd = new Command('pjm').description('Manage project-management repo reference docs');
|
|
26
|
+
cmd
|
|
27
|
+
.command('init')
|
|
28
|
+
.description('Scaffold the canonical PJM repo reference surface')
|
|
29
|
+
.option('--reference-root <path>', 'Reference root directory (defaults to .oat/repo/reference)')
|
|
30
|
+
.action(async (options, command) => {
|
|
31
|
+
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
32
|
+
try {
|
|
33
|
+
const projectRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
34
|
+
const referenceRoot = await resolveReferenceRoot(context, projectRoot, options.referenceRoot);
|
|
35
|
+
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
36
|
+
const result = await dependencies.initializeRepoReference({
|
|
37
|
+
referenceRoot,
|
|
38
|
+
assetsRoot,
|
|
39
|
+
templatesRoot: resolve(projectRoot, '.oat', 'templates'),
|
|
40
|
+
});
|
|
41
|
+
if (context.json) {
|
|
42
|
+
context.logger.json({ status: 'ok', ...result });
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
context.logger.info(`Initialized PJM repo reference scaffold at ${result.referenceRoot}`);
|
|
46
|
+
if (result.created.length > 0) {
|
|
47
|
+
context.logger.info(`Created: ${result.created.join(', ')}`);
|
|
48
|
+
}
|
|
49
|
+
if (result.skipped.length > 0) {
|
|
50
|
+
context.logger.info(`Skipped existing: ${result.skipped.join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
process.exitCode = 0;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
57
|
+
if (context.json) {
|
|
58
|
+
context.logger.json({ status: 'error', message });
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
context.logger.error(message);
|
|
62
|
+
}
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return cmd;
|
|
67
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface InitializeRepoReferenceOptions {
|
|
2
|
+
referenceRoot: string;
|
|
3
|
+
assetsRoot: string;
|
|
4
|
+
templatesRoot?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RepoReferenceInitResult {
|
|
7
|
+
referenceRoot: string;
|
|
8
|
+
created: string[];
|
|
9
|
+
skipped: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function initializeRepoReference(options: InitializeRepoReferenceOptions): Promise<RepoReferenceInitResult>;
|
|
12
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/init.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,8BAA8B;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA4GD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CA6ClC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { initializeBacklog } from '../backlog/init.js';
|
|
4
|
+
const REFERENCE_TEMPLATES = [
|
|
5
|
+
'current-state.md',
|
|
6
|
+
'roadmap.md',
|
|
7
|
+
'decision-record.md',
|
|
8
|
+
];
|
|
9
|
+
const BACKLOG_PATHS = [
|
|
10
|
+
'backlog/index.md',
|
|
11
|
+
'backlog/completed.md',
|
|
12
|
+
'backlog/items/.gitkeep',
|
|
13
|
+
'backlog/archived/.gitkeep',
|
|
14
|
+
];
|
|
15
|
+
async function pathExists(path) {
|
|
16
|
+
try {
|
|
17
|
+
await access(path);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
const code = error && typeof error === 'object' && 'code' in error
|
|
22
|
+
? String(error.code)
|
|
23
|
+
: null;
|
|
24
|
+
if (code !== 'ENOENT') {
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function readIfExists(path) {
|
|
31
|
+
try {
|
|
32
|
+
return await readFile(path, 'utf8');
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const code = error && typeof error === 'object' && 'code' in error
|
|
36
|
+
? String(error.code)
|
|
37
|
+
: null;
|
|
38
|
+
if (code !== 'ENOENT') {
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function resolveTemplateContent(name, options) {
|
|
45
|
+
if (options.templatesRoot) {
|
|
46
|
+
const localTemplate = await readIfExists(join(options.templatesRoot, name));
|
|
47
|
+
if (localTemplate !== null) {
|
|
48
|
+
return localTemplate;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const bundledTemplate = await readIfExists(join(options.assetsRoot, 'templates', name));
|
|
52
|
+
if (bundledTemplate !== null) {
|
|
53
|
+
return bundledTemplate;
|
|
54
|
+
}
|
|
55
|
+
throw new Error(`Template ${name} was not found in repo-local templates or bundled assets.`);
|
|
56
|
+
}
|
|
57
|
+
function stripTemplateFrontmatter(content) {
|
|
58
|
+
if (!content.startsWith('---\n')) {
|
|
59
|
+
return content;
|
|
60
|
+
}
|
|
61
|
+
const end = content.indexOf('\n---', 4);
|
|
62
|
+
if (end === -1) {
|
|
63
|
+
return content;
|
|
64
|
+
}
|
|
65
|
+
const frontmatter = content.slice(4, end);
|
|
66
|
+
if (!/\boat_template\s*:/i.test(frontmatter) &&
|
|
67
|
+
!/\boat_template_name\s*:/i.test(frontmatter)) {
|
|
68
|
+
return content;
|
|
69
|
+
}
|
|
70
|
+
const afterFrontmatter = content.slice(end + '\n---'.length);
|
|
71
|
+
return afterFrontmatter.replace(/^\r?\n+/, '');
|
|
72
|
+
}
|
|
73
|
+
async function writeFileIfMissing(filePath, content) {
|
|
74
|
+
if (await pathExists(filePath)) {
|
|
75
|
+
return 'skipped';
|
|
76
|
+
}
|
|
77
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
78
|
+
await writeFile(filePath, content, 'utf8');
|
|
79
|
+
return 'created';
|
|
80
|
+
}
|
|
81
|
+
export async function initializeRepoReference(options) {
|
|
82
|
+
const created = [];
|
|
83
|
+
const skipped = [];
|
|
84
|
+
for (const templateName of REFERENCE_TEMPLATES) {
|
|
85
|
+
const targetPath = join(options.referenceRoot, templateName);
|
|
86
|
+
if (await pathExists(targetPath)) {
|
|
87
|
+
skipped.push(templateName);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const template = await resolveTemplateContent(templateName, options);
|
|
91
|
+
const status = await writeFileIfMissing(targetPath, stripTemplateFrontmatter(template));
|
|
92
|
+
if (status === 'created') {
|
|
93
|
+
created.push(templateName);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
skipped.push(templateName);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const existingBacklogPaths = new Set();
|
|
100
|
+
for (const relativePath of BACKLOG_PATHS) {
|
|
101
|
+
if (await pathExists(join(options.referenceRoot, relativePath))) {
|
|
102
|
+
existingBacklogPaths.add(relativePath);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
await initializeBacklog(join(options.referenceRoot, 'backlog'));
|
|
106
|
+
for (const relativePath of BACKLOG_PATHS) {
|
|
107
|
+
if (existingBacklogPaths.has(relativePath)) {
|
|
108
|
+
skipped.push(relativePath);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
created.push(relativePath);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
referenceRoot: options.referenceRoot,
|
|
116
|
+
created,
|
|
117
|
+
skipped,
|
|
118
|
+
};
|
|
119
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ora": "^9.0.0",
|
|
35
35
|
"yaml": "2.8.2",
|
|
36
36
|
"zod": "^3.25.76",
|
|
37
|
-
"@open-agent-toolkit/control-plane": "0.1.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.1.18"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|