Skip to content

feat: accept YAML or JSON agent config files for run start#14

Merged
hbrooks merged 1 commit into
mainfrom
feat/config-file-yaml-or-json
Jun 28, 2026
Merged

feat: accept YAML or JSON agent config files for run start#14
hbrooks merged 1 commit into
mainfrom
feat/config-file-yaml-or-json

Conversation

@hbrooks

@hbrooks hbrooks commented Jun 28, 2026

Copy link
Copy Markdown
Member

What

agent run start --config-file <path> now accepts either YAML or JSON, chosen by file extension:

  • .json → parsed as JSON
  • .yaml / .yml (and any other extension) → parsed as YAML

The parsed value is validated to be a top-level mapping; otherwise it errors with a clear could not parse {JSON|YAML} config file … message. File-read failures keep the existing could not read config file … message.

This reuses the yaml package already in the dependency tree (used by the config command's output formatting).

Details

  • readJsonFilereadConfigFile in src/commands/run.tsx, now extension-aware and exported for testing.
  • Updated -f, --config-file help text to (.yaml/.yml or .json file).
  • Added 7 tests in test/run.test.ts covering .yaml, .yml, .json, unknown-extension fallback, invalid JSON, non-mapping top-level values, and a missing file.
  • Bumps version to 0.1.3.

Test

bun run typecheck and bun run test (96 tests) both pass.

🤖 Generated with Claude Code

`agent run start --config-file` now picks the parser by extension: .json
parses as JSON, .yaml/.yml (and any other extension) parse as YAML. The
result is validated to be a top-level mapping, with a clear error otherwise.

Bumps version to 0.1.3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hbrooks hbrooks merged commit 5ff6be1 into main Jun 28, 2026
1 check passed
@hbrooks hbrooks deleted the feat/config-file-yaml-or-json branch June 28, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant