@open-agent-toolkit/cli 0.0.55 → 0.0.56
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/assets/docs/contributing/skills.md +41 -0
- package/assets/docs/reference/cli-reference.md +4 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-complete/SKILL.md +2 -3
- package/assets/skills/oat-project-plan/SKILL.md +2 -3
- package/assets/skills/oat-project-pr-final/SKILL.md +2 -3
- package/assets/skills/oat-project-pr-progress/SKILL.md +2 -3
- package/assets/skills/oat-project-progress/SKILL.md +3 -3
- package/assets/skills/oat-project-reconcile/SKILL.md +7 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +9 -7
- package/dist/commands/project/status.d.ts.map +1 -1
- package/dist/commands/project/status.js +101 -13
- package/package.json +2 -2
|
@@ -59,6 +59,47 @@ Skill behavior is defined by frontmatter plus the process contract in each `SKIL
|
|
|
59
59
|
- Use `create-agnostic-skill` when you want a reusable workflow skill that is not OAT-specific.
|
|
60
60
|
- Use existing lifecycle skills as examples for progress banners, prerequisites, and artifact updates.
|
|
61
61
|
|
|
62
|
+
## Reading project state
|
|
63
|
+
|
|
64
|
+
Skills that need fields from the active project's `state.md` (e.g. `phase`, `phaseStatus`, `workflowMode`, `docsUpdated`, `lastCommit`) MUST query the CLI instead of hand-parsing YAML with `grep`/`awk`.
|
|
65
|
+
|
|
66
|
+
For one field, use `--field`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
WORKFLOW_MODE=$(oat project status --field project.workflowMode 2>/dev/null || echo null)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If the skill is reading a resolved project path instead of the active project pointer, add `--project-path`:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
WORKFLOW_MODE=$(oat project status --project-path "$PROJECT_PATH" --field project.workflowMode 2>/dev/null || echo null)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For multiple fields, use `--shell` so the CLI reads project state once and emits shell-safe assignments:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
eval "$(oat project status --shell \
|
|
82
|
+
PHASE=project.phase \
|
|
83
|
+
PHASE_STATUS=project.phaseStatus \
|
|
84
|
+
WORKFLOW_MODE=project.workflowMode 2>/dev/null)"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Skill snippets assume `oat` is available on `PATH`. Environments without a global install, including CI or cloud runners, can provide an `oat` shim backed by `npx`:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mkdir -p .oat/bin
|
|
91
|
+
cat > .oat/bin/oat <<'EOF'
|
|
92
|
+
#!/usr/bin/env bash
|
|
93
|
+
exec npx @open-agent-toolkit/cli "$@"
|
|
94
|
+
EOF
|
|
95
|
+
chmod +x .oat/bin/oat
|
|
96
|
+
export PATH="$PWD/.oat/bin:$PATH"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Create the shim once per checkout or CI job instead of putting `command -v oat` fallback branches in every skill. The same snippet also supports setups where `oat` is intentionally provided on `PATH` by `npx`.
|
|
100
|
+
|
|
101
|
+
The JSON output is a stable contract: the field set consumed by migrated skills is locked by `MIGRATED_FIELDS` in `packages/cli/src/commands/project/status.test.ts`, so removing or renaming any of those keys is a real test failure rather than a silent runtime break. See [CLI Reference](../reference/cli-reference.md) for the full locked field set.
|
|
102
|
+
|
|
62
103
|
## Reference artifacts
|
|
63
104
|
|
|
64
105
|
- `.agents/skills/*/SKILL.md`
|
|
@@ -37,7 +37,10 @@ The CLI is also a standalone value path. You can use `oat init`, `oat sync`, `oa
|
|
|
37
37
|
Notable inspection commands introduced in the current CLI surface:
|
|
38
38
|
|
|
39
39
|
- `oat config dump --json` - merged config with source attribution
|
|
40
|
-
- `oat project status --json` - full parsed state for the active tracked project
|
|
40
|
+
- `oat project status --json` - full parsed state for the active tracked project. **Stable contract for skills:** the JSON output is a typed read interface for OAT skills; the field set consumed by migrated skills is locked by `MIGRATED_FIELDS` in `packages/cli/src/commands/project/status.test.ts`. Removing or renaming any of `project.{name, path, phase, phaseStatus, workflowMode, docsUpdated, lastCommit, prStatus, prUrl}` is a breaking change and will fail the contract test.
|
|
41
|
+
- `oat project status --field <path>` - print one arbitrary dot-path field from the same status payload, e.g. `project.workflowMode` or `project.timestamps.stateUpdated`. Missing/null fields print `null`; object and array fields print compact JSON.
|
|
42
|
+
- `oat project status --project-path <path>` - read from a repo-relative or absolute project path instead of `.oat/config.local.json`'s active project pointer. Combine it with `--field` or `--shell` when a skill has already resolved the target project path.
|
|
43
|
+
- `oat project status --shell NAME=path ...` - print shell-safe assignments for one or more fields from one status read, e.g. `WORKFLOW_MODE='quick'`. This is the preferred multi-field read API for skills. See [Writing Skills → Reading project state](../contributing/skills.md#reading-project-state) for examples and the `npx`-backed `oat` shim contract.
|
|
41
44
|
- `oat project list --json` - summary state for tracked projects under the configured projects root
|
|
42
45
|
- `oat project complete-state <project-path>` - apply the canonical completed-state mutation to a project's `state.md`; used by `oat-project-complete` during lifecycle closeout
|
|
43
46
|
- `oat project validate-plan --project-path <path>` - validates `oat_plan_parallel_groups` metadata in `plan.md`; exits non-zero on invalid. See [Implementation Execution](../workflows/projects/implementation-execution.md#validating-plan-metadata).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-complete
|
|
3
|
-
version: 1.4.
|
|
3
|
+
version: 1.4.4
|
|
4
4
|
description: Use when all implementation work is finished and the project is ready to close. Marks the OAT project lifecycle as complete.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -183,8 +183,7 @@ fi
|
|
|
183
183
|
#### 3.3: Documentation Sync Status
|
|
184
184
|
|
|
185
185
|
```bash
|
|
186
|
-
|
|
187
|
-
DOCS_UPDATED=$(grep "^oat_docs_updated:" "$STATE_FILE" 2>/dev/null | awk '{print $2}' || true)
|
|
186
|
+
DOCS_UPDATED=$(oat project status --field project.docsUpdated 2>/dev/null || echo null)
|
|
188
187
|
|
|
189
188
|
# Read policy from config (default: false = soft suggestion)
|
|
190
189
|
REQUIRE_DOCS=$(oat config get documentation.requireForProjectCompletion 2>/dev/null || echo "false")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-plan
|
|
3
|
-
version: 1.3.
|
|
3
|
+
version: 1.3.2
|
|
4
4
|
description: Use when design.md is complete and executable implementation tasks are needed. Breaks design into bite-sized TDD tasks in canonical plan.md format.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -105,8 +105,7 @@ PROJECTS_ROOT="${PROJECTS_ROOT%/}"
|
|
|
105
105
|
### Step 1: Determine Workflow Mode and Route
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
|
-
WORKFLOW_MODE=$(
|
|
109
|
-
WORKFLOW_MODE="${WORKFLOW_MODE:-spec-driven}"
|
|
108
|
+
WORKFLOW_MODE=$(oat project status --field project.workflowMode 2>/dev/null || echo null)
|
|
110
109
|
```
|
|
111
110
|
|
|
112
111
|
**Mode: `quick`** — **STOP.** Print:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-pr-final
|
|
3
|
-
version: 1.3.
|
|
3
|
+
version: 1.3.4
|
|
4
4
|
description: Use when an active OAT project has completed all phases and is ready for final merge to main. Generates the final OAT lifecycle PR description from artifacts and review status, then creates the PR automatically.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -134,8 +134,7 @@ Rules:
|
|
|
134
134
|
Resolve workflow mode from `state.md` (default `spec-driven`):
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
|
-
WORKFLOW_MODE=$(
|
|
138
|
-
WORKFLOW_MODE=${WORKFLOW_MODE:-spec-driven}
|
|
137
|
+
WORKFLOW_MODE=$(oat project status --field project.workflowMode 2>/dev/null || echo null)
|
|
139
138
|
```
|
|
140
139
|
|
|
141
140
|
```bash
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-pr-progress
|
|
3
|
-
version: 1.2.
|
|
3
|
+
version: 1.2.1
|
|
4
4
|
description: Use when an active OAT project needs a mid-project PR for a completed phase (pNN). Generates a phase-scoped progress PR description from OAT artifacts and commit history, with optional PR creation.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -159,8 +159,7 @@ If scope is `range`/`base_sha`, set:
|
|
|
159
159
|
Resolve workflow mode from `state.md` (default `spec-driven`):
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
WORKFLOW_MODE=$(
|
|
163
|
-
WORKFLOW_MODE=${WORKFLOW_MODE:-spec-driven}
|
|
162
|
+
WORKFLOW_MODE=$(oat project status --field project.workflowMode 2>/dev/null || echo null)
|
|
164
163
|
```
|
|
165
164
|
|
|
166
165
|
Read (as available):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-progress
|
|
3
|
-
version: 1.2.
|
|
3
|
+
version: 1.2.3
|
|
4
4
|
description: Use when resuming work, checking status, or unsure which OAT skill to run next. Evaluates project progress and routes to the appropriate next step.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -202,8 +202,8 @@ PLAN_TASKS=$(grep -cE '^### Task p[0-9]+-t[0-9]+:' "$ACTIVE_PROJECT_PATH/plan.md
|
|
|
202
202
|
IMPL_COMPLETED=$(grep -cE '^\*\*Status:\*\* completed' "$ACTIVE_PROJECT_PATH/implementation.md" 2>/dev/null || echo 0)
|
|
203
203
|
|
|
204
204
|
# Check for commits since last tracked SHA
|
|
205
|
-
LAST_SHA=$(
|
|
206
|
-
if [ -n "$LAST_SHA" ]; then
|
|
205
|
+
LAST_SHA=$(oat project status --project-path "$ACTIVE_PROJECT_PATH" --field project.lastCommit 2>/dev/null || echo null)
|
|
206
|
+
if [ -n "$LAST_SHA" ] && [ "$LAST_SHA" != "null" ]; then
|
|
207
207
|
UNTRACKED_COMMITS=$(git rev-list --count "$LAST_SHA"..HEAD 2>/dev/null || echo 0)
|
|
208
208
|
else
|
|
209
209
|
UNTRACKED_COMMITS=0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-reconcile
|
|
3
|
-
version: 1.0.
|
|
3
|
+
version: 1.0.1
|
|
4
4
|
description: Use when human-implemented commits need to be mapped back to planned tasks. Reconciles implementation.md and state.md after manual work outside the OAT workflow.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -104,9 +104,13 @@ Verify the project is ready for reconciliation:
|
|
|
104
104
|
|
|
105
105
|
2. **Check project phase:**
|
|
106
106
|
|
|
107
|
+
The shell snippet below is indented so it remains inside this numbered list;
|
|
108
|
+
the leading whitespace is shell-safe when copied.
|
|
109
|
+
|
|
107
110
|
```bash
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
eval "$(oat project status --shell \
|
|
112
|
+
PHASE=project.phase \
|
|
113
|
+
PHASE_STATUS=project.phaseStatus 2>/dev/null)"
|
|
110
114
|
```
|
|
111
115
|
|
|
112
116
|
- If `PHASE` is `implement`: proceed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-review-provide
|
|
3
|
-
version: 1.3.
|
|
3
|
+
version: 1.3.2
|
|
4
4
|
description: Use when completed work in an active OAT project needs a quality gate before merge. Performs a lifecycle-scoped review after a task, phase, or full implementation, unlike oat-review-provide.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -122,9 +122,10 @@ If validation passes, derive `{project-name}` as basename of `PROJECT_PATH`.
|
|
|
122
122
|
Read `state.md` frontmatter to propose the most likely review type and scope:
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
eval "$(oat project status --shell \
|
|
126
|
+
PHASE=project.phase \
|
|
127
|
+
PHASE_STATUS=project.phaseStatus \
|
|
128
|
+
WORKFLOW_MODE=project.workflowMode 2>/dev/null)"
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
Inference rules (first match wins):
|
|
@@ -244,11 +245,12 @@ If the review is intentionally inline-only and the user explicitly wants to insp
|
|
|
244
245
|
|
|
245
246
|
### Step 2: Validate Artifacts Exist (Mode-Aware)
|
|
246
247
|
|
|
247
|
-
Resolve workflow mode from state
|
|
248
|
+
Resolve workflow mode from the resolved project state path:
|
|
248
249
|
|
|
249
250
|
```bash
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
# Step 1.5 may retarget PROJECT_PATH into another worktree, so read from the
|
|
252
|
+
# resolved project path instead of the active-project pointer.
|
|
253
|
+
WORKFLOW_MODE=$(oat project status --project-path "$PROJECT_PATH" --field project.workflowMode 2>/dev/null || echo null)
|
|
252
254
|
```
|
|
253
255
|
|
|
254
256
|
**Required for code review (by mode):**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/project/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC7E,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACjE;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/project/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC7E,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACjE;AAgND,wBAAgB,0BAA0B,CACxC,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CA0BT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
1
|
+
import { isAbsolute, join } from 'node:path';
|
|
2
2
|
import { buildCommandContext, } from '../../app/command-context.js';
|
|
3
3
|
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
4
4
|
import { resolveActiveProject, } from '../../config/oat-config.js';
|
|
@@ -11,6 +11,9 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
11
11
|
resolveActiveProject,
|
|
12
12
|
getProjectState,
|
|
13
13
|
};
|
|
14
|
+
function resolveTargetProjectPath(repoRoot, projectPath) {
|
|
15
|
+
return isAbsolute(projectPath) ? projectPath : join(repoRoot, projectPath);
|
|
16
|
+
}
|
|
14
17
|
function formatProjectStatusLines(project) {
|
|
15
18
|
return [
|
|
16
19
|
`Project: ${project.name}`,
|
|
@@ -22,9 +25,61 @@ function formatProjectStatusLines(project) {
|
|
|
22
25
|
`Reason: ${project.recommendation.reason}`,
|
|
23
26
|
];
|
|
24
27
|
}
|
|
25
|
-
|
|
28
|
+
function readDotPath(payload, path) {
|
|
29
|
+
const parts = path.split('.').filter(Boolean);
|
|
30
|
+
let cursor = payload;
|
|
31
|
+
for (const part of parts) {
|
|
32
|
+
if (cursor === null || typeof cursor !== 'object') {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (!Object.prototype.hasOwnProperty.call(cursor, part)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
cursor = cursor[part];
|
|
39
|
+
}
|
|
40
|
+
return cursor;
|
|
41
|
+
}
|
|
42
|
+
function formatRawValue(value) {
|
|
43
|
+
if (value === null || value === undefined) {
|
|
44
|
+
return 'null';
|
|
45
|
+
}
|
|
46
|
+
if (typeof value === 'string' ||
|
|
47
|
+
typeof value === 'number' ||
|
|
48
|
+
typeof value === 'boolean') {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
return JSON.stringify(value);
|
|
52
|
+
}
|
|
53
|
+
function shellQuote(value) {
|
|
54
|
+
return `'${value.split("'").join("'\\''")}'`;
|
|
55
|
+
}
|
|
56
|
+
const SHELL_ASSIGNMENT_RE = /^([A-Za-z_][A-Za-z0-9_]*)=(.+)$/;
|
|
57
|
+
function formatShellAssignment(assignment, payload) {
|
|
58
|
+
const match = SHELL_ASSIGNMENT_RE.exec(assignment);
|
|
59
|
+
if (!match) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const name = match[1];
|
|
63
|
+
const path = match[2];
|
|
64
|
+
if (!name || !path) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const value = formatRawValue(readDotPath(payload, path));
|
|
68
|
+
return `${name}=${shellQuote(value)}`;
|
|
69
|
+
}
|
|
70
|
+
async function runProjectStatus(context, dependencies, options) {
|
|
26
71
|
try {
|
|
72
|
+
if (options.projectPath && isAbsolute(options.projectPath)) {
|
|
73
|
+
const project = await dependencies.getProjectState(options.projectPath);
|
|
74
|
+
writeProjectStatusOutput(context, options, { status: 'ok', project });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
27
77
|
const repoRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
78
|
+
if (options.projectPath) {
|
|
79
|
+
const project = await dependencies.getProjectState(resolveTargetProjectPath(repoRoot, options.projectPath));
|
|
80
|
+
writeProjectStatusOutput(context, options, { status: 'ok', project });
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
28
83
|
const activeProject = await dependencies.resolveActiveProject(repoRoot);
|
|
29
84
|
if (activeProject.status === 'unset') {
|
|
30
85
|
const message = 'No active project set (.oat/config.local.json has no activeProject).';
|
|
@@ -56,15 +111,7 @@ async function runProjectStatus(context, dependencies) {
|
|
|
56
111
|
return;
|
|
57
112
|
}
|
|
58
113
|
const project = await dependencies.getProjectState(join(repoRoot, activeProject.path));
|
|
59
|
-
|
|
60
|
-
context.logger.json({ status: 'ok', project });
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
for (const line of formatProjectStatusLines(project)) {
|
|
64
|
-
context.logger.info(line);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
process.exitCode = 0;
|
|
114
|
+
writeProjectStatusOutput(context, options, { status: 'ok', project });
|
|
68
115
|
}
|
|
69
116
|
catch (error) {
|
|
70
117
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -77,6 +124,44 @@ async function runProjectStatus(context, dependencies) {
|
|
|
77
124
|
process.exitCode = 1;
|
|
78
125
|
}
|
|
79
126
|
}
|
|
127
|
+
function writeProjectStatusOutput(context, options, payload) {
|
|
128
|
+
if (options.field && options.shell?.length) {
|
|
129
|
+
context.logger.error('`--field` and `--shell` are mutually exclusive; pass only one.');
|
|
130
|
+
process.exitCode = 1;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (options.field) {
|
|
134
|
+
context.logger.info(formatRawValue(readDotPath(payload, options.field)));
|
|
135
|
+
process.exitCode = 0;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (options.shell?.length) {
|
|
139
|
+
const lines = [];
|
|
140
|
+
for (const assignment of options.shell) {
|
|
141
|
+
const line = formatShellAssignment(assignment, payload);
|
|
142
|
+
if (!line) {
|
|
143
|
+
context.logger.error(`Invalid shell assignment "${assignment}". Expected NAME=path with a shell-safe variable name.`);
|
|
144
|
+
process.exitCode = 1;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
lines.push(line);
|
|
148
|
+
}
|
|
149
|
+
for (const line of lines) {
|
|
150
|
+
context.logger.info(line);
|
|
151
|
+
}
|
|
152
|
+
process.exitCode = 0;
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (context.json) {
|
|
156
|
+
context.logger.json(payload);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
for (const line of formatProjectStatusLines(payload.project)) {
|
|
160
|
+
context.logger.info(line);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
process.exitCode = 0;
|
|
164
|
+
}
|
|
80
165
|
export function createProjectStatusCommand(overrides = {}) {
|
|
81
166
|
const dependencies = {
|
|
82
167
|
...DEFAULT_DEPENDENCIES,
|
|
@@ -84,8 +169,11 @@ export function createProjectStatusCommand(overrides = {}) {
|
|
|
84
169
|
};
|
|
85
170
|
return new Command('status')
|
|
86
171
|
.description('Show the current OAT project state')
|
|
87
|
-
.
|
|
172
|
+
.option('--field <path>', 'Print a single field from the project status payload by dot path')
|
|
173
|
+
.option('--project-path <path>', 'Read status from an explicit project path instead of the active project')
|
|
174
|
+
.option('--shell <assignment...>', 'Print shell-safe NAME=value assignments for one or more NAME=path pairs')
|
|
175
|
+
.action(async (options, command) => {
|
|
88
176
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
89
|
-
await runProjectStatus(context, dependencies);
|
|
177
|
+
await runProjectStatus(context, dependencies, options);
|
|
90
178
|
});
|
|
91
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ora": "^9.0.0",
|
|
34
34
|
"yaml": "2.8.2",
|
|
35
35
|
"zod": "^3.25.76",
|
|
36
|
-
"@open-agent-toolkit/control-plane": "0.0.
|
|
36
|
+
"@open-agent-toolkit/control-plane": "0.0.56"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|