feat(cli): add non-interactive flags and help examples for agent readiness#252
feat(cli): add non-interactive flags and help examples for agent readiness#252MarioCadenas wants to merge 6 commits intomainfrom
Conversation
…iness Phase 1: Add flag-based non-interactive paths to `plugin create` and `plugin add-resource` so agents can invoke them headlessly. Includes --placement, --path, --name, --description, --resources, --resources-json, --force for create; --type, --required/--no-required, --resource-key, --permission, --fields-json, --dry-run for add-resource. Phase 2: Add Examples sections via addHelpText to all CLI commands so agents can pattern-match correct invocations from --help output. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
- generate-types: print info message to stderr when warehouse ID is missing (exit 0 preserved for template hook compatibility), add success message after generation - list: suggest --manifest or --dir when manifest not found - setup: show install commands when no packages found - sync: suggest --plugins-dir when no plugins discovered Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
- sync --json: outputs the full TemplatePluginsManifest JSON to stdout, suppresses human-readable progress lines (works in both preview and write modes) - validate --json: outputs status-only JSON array with path, valid, and errors fields; exit code still reflects overall validity Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Test buildResourceFromType, parseResourcesShorthand, and parseResourcesJson — the pure functions backing the new flag-based non-interactive path for `appkit plugin create`. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
- sync --json: output valid JSON when zero plugins found instead of human text that breaks JSON.parse in agent pipelines - create: guard against null/non-object entries in --resources-json - create + add-resource: validate --type against schema's resourceType enum before building entries, preventing manifest corruption - create: reject absolute/parent paths in non-interactive in-repo mode, matching the interactive mode's existing validation - create: error when optional-only flags (--resources, --force) are provided without required flags instead of silently falling through to interactive mode - sync: reuse serialized JSON string instead of double JSON.stringify - validate: avoid redundant formatValidationErrors call - tests: add cases for null guard, unknown type validation Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
61e1996 to
113c4ce
Compare
pkosiec
left a comment
There was a problem hiding this comment.
Overall LGTM - but we should update our docs to show the command usages because right now there's no way for agent to discover them
There was a problem hiding this comment.
So the commands might be used non-interactively - great 😄 But how does the agent know about it? Should we update our docs? They still say e.g. "Interactively add a new resource requirement to an existing plugin manifest. "
IMO it's worth to mention that the commands run interactively by default but also flags can be used. Like "For all available options, run" here: https://databricks.github.io/appkit/docs/development/remote-bridge#starting-and-stopping-remote-bridge
Also, you can consider putting the most common usages to the docs too.
WDYT?
Update plugin-management.md and custom-plugins.md to document both interactive and non-interactive modes for `plugin create` and `plugin add-resource`. Add flag-based examples and mention --help for discovering all options. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
@pkosiec Good call — updated the docs in 3657464:
The command descriptions in |
Summary
plugin createandplugin add-resourceso coding agents can invoke them headlessly without Clack promptsExamples:sections to--helpoutput on all CLI commands so agents can pattern-match correct invocationsplugin createnow accepts--placement,--path,--name,--description,--resources/--resources-json,--forceplugin add-resourcenow accepts--type,--required/--no-required,--resource-key,--permission,--fields-json,--dry-runTest plan
appkit plugin create --placement in-repo --path plugins/test --name test --description "Test" --forcescaffolds without promptsappkit plugin create --name test(partial flags) exits 1 with clear error listing missing flagsappkit plugin create(no flags) falls back to interactive Clack flow unchanged--resources sql_warehouse,volumeand--resources-json '[{"type":"sql_warehouse"}]'both produce correct manifests--resourcesand--resources-jsontogether are rejected by Commander conflictappkit plugin add-resource --path <dir> --type sql_warehouseadds resource non-interactivelyappkit plugin add-resource --type volume --no-required --dry-runpreviews without writing--fields-jsonoverrides default env var mappings--helpnow includes anExamples:section