Skip to content

Implement prompts JSON CLI workflow#7

Open
jasonsky-pub wants to merge 2 commits into
mainfrom
feat/add-prompts-json-cli
Open

Implement prompts JSON CLI workflow#7
jasonsky-pub wants to merge 2 commits into
mainfrom
feat/add-prompts-json-cli

Conversation

@jasonsky-pub
Copy link
Copy Markdown
Collaborator

Description

Adds a prompt JSON workflow for project init and project update.

This change introduces:

  • --print-prompts-json to export prompt requirements as JSON without modifying project state
  • --prompts-json-file and --prompts-json-stdin to supply prompt answers non-interactively
  • dedicated prompt document parsing, export, usage tracking, and warning paths
  • helper extraction to keep the normal runtime walk behavior stable while isolating prompt JSON concerns
  • focused regression and feature coverage for prompt export/import and existing runtime behavior

Related Issue

N/A

Motivation and Context

This allows machine-driven OpenPlate runs to discover required prompt inputs ahead of time, fill them in externally, and execute init/update without interactive prompting.

The implementation keeps JSON-input mode on the normal runtime walk, while --print-prompts-json uses a read-only collector path so prompt discovery does not mutate project state.

How Has This Been Tested?

Ran:

  • pytest tests/test_existing_runtime_regressions.py tests/test_prompt_json_cli.py tests/test_project_init_source_urls.py tests/test_prompt_document.py -m unit -n 0

Validated areas:

  • prompt JSON export
  • prompt JSON import from file and stdin
  • duplicate and omitted-value validation
  • ignored template and unused parameter warnings
  • blank string handling
  • unresolved required prompt failures
  • template command confirmation failure paths in JSON mode
  • regression coverage for existing runtime control flow

Screenshots

N/A

Types of Changes

Put an x in all boxes that apply.

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Documentation update
  • Maintenance or refactor

Checklist

Put an x in all boxes that apply.

  • My code follows the style of this project.
  • My change requires documentation updates.
  • I have updated the documentation accordingly.
  • I have read CONTRIBUTING.md.
  • I have added or updated tests to cover my changes.
  • All relevant new and existing tests passed.

Declaration

I confirm that this contribution is made under the Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants