feat: add config command with dot-notation support#1387
Conversation
Package TarballHow to installgh release download pr-1387-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.15.0.tgz |
|
Claude Security Review: no high-confidence findings. (run) |
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Nice work on this — the schema split between strict (write) and lenient (read) is a clean pattern, and the integ tests are thorough. I found one issue that I think needs to be addressed before merging, plus a softer note about telemetry instrumentation.
Main concern: validating the merged config against a strict schema is incompatible with the documented behavior that readGlobalConfig preserves unknown keys (see existing test preserves unknown fields via passthrough in src/cli/__tests__/global-config.test.ts). Any user whose config file contains a legacy or future field will be unable to set any config value. Details inline.
Softer note: telemetry instrumentation — see inline comment on command.ts.
|
Claude Security Review: no high-confidence findings. (run) |
e521336 to
4d3cef1
Compare
|
Claude Security Review: no high-confidence findings. (run) |
| validate: 'Validate agentcore/ config files.', | ||
| 'config-bundle': '[preview] Manage configuration bundle versions and diffs.', | ||
| archive: '[preview] Archive (delete) a batch evaluation or recommendation on the service and clear local history.', | ||
| config: 'Adjust global configuration settings such as telemetry opt-out status', |
There was a problem hiding this comment.
we should move this to another file, IMO its not intuitive that descriptions are in src/cli/tui/copy.ts
Description
Add a new
agentcore config [key] [value]command for reading and writing global CLI configuration values using dot-notation keys.agentcore config— lists all configagentcore config telemetry.enabled— gets a valueagentcore config telemetry.enabled true— sets a valueAlso introduces:
resilientParse: a util for parsing zod schemas field by field, and allow for fallbacks, skipping, and additional fields. Unifies implementation with existing telemetry implementation.global-config.tsto use a single strict schema as source of truthRelated Issue
Closes #
Documentation PR
N/A
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.