Set configuration for the tool (available in ~/.openplate)
openplate config get
Set configuration for the tool (available in ~/.openplate)
openplate config set --parameter-default service_name=my-service
config set supports persistent parameter defaults and persistent trust/consent settings. Legacy source-resolution settings such as --vcs-url and --template-prefix are no longer supported runtime configuration.
-
--parameter-default <name>=<value>sets a default parameter value for later runs.openplate config set --parameter-default git_org=my-org -
--allow-template-commandsallows template-provided init commands to run by default during later init runs.openplate config set --allow-template-commands -
--allow-last-updater-emailallows templates that requirelast_updater_emailduring later init or update runs.openplate config set --allow-last-updater-email
Add a template to a project
openplate init https://github.com/my-org/ot-net-api.git#v1
openplate init git@github.com:my-org/ot-docker.git#v1
openplate init file:///C:/repos/template-catalog#main
init now uses URL-based sources only.
- Primary syntax:
openplate init <url> - Backward-compatible syntax:
openplate init -r <url> - Supported URL transports: HTTPS, SSH/scp-style Git URLs, and Git-compatible
file://URLs - Optional template sub-folder: append
?path=<relative-template-subdir> - Optional branch or tag: append
#<branch-or-tag>
The legacy nested project variant still works for compatibility, but openplate init is the documented command.
-
--allow-template-commandsallows template-providedinit_commandsto run for this init invocation.openplate init --allow-template-commands https://github.com/my-org/ot-template.git#v1 -
--allow-last-updater-emailallows a template that requireslast_updater_emailto use it for this init invocation.openplate init --allow-last-updater-email https://github.com/my-org/ot-template.git#v1
If you need a non-default SSH key for an SSH template URL, export GIT_SSH_COMMAND before running OpenPlate so Git uses the expected identity:
export GIT_SSH_COMMAND='ssh -i ~/.ssh/special-openplate-key -o IdentitiesOnly=yes'
openplate init git@github.com:my-org/template-catalog.git?path=python/api#main
This applies only to SSH template URLs. HTTPS template URLs do not use SSH keys.
init, update, verify, info, and project print-init-json share the --project-root option.
--project-root <path>sets the managed project root explicitly.- if
--project-rootis omitted and the invocation folder is inside a Git work tree, OpenPlate uses the Git top-level folder as the project root and the invocation-relative path as the defaultdest_folder - if
--project-rootis omitted outside Git, OpenPlate uses the invocation folder and defaultsdest_folderto. --project-folderis no longer accepted; use--project-rootinstead
Project root examples:
openplate init --project-root C:/workspaces/my-repo https://github.com/my-org/ot-template.git#v1
openplate update --project-root C:/workspaces/my-repo --update-full
openplate verify --project-root C:/workspaces/my-repo
openplate info --project-root C:/workspaces/my-repo
Source URL examples:
openplate init https://github.com/my-org/ot-template.git#v1
openplate init git@github.com:my-org/template-catalog.git?path=python/api#main
openplate init file:///C:/repos/template-catalog#main
# deprecated format
openplate init -r https://github.com/my-org/ot-template.git#v1
Some templates take advantage of a "sub-folder" to init into. This allows the template to access both the repo root and the sub-folder for it's files.
-
Example:
openplate init --dest-folder=src git@github.com:my-org/ot-docker.git#v1
If --dest-folder is omitted:
- with an explicit
--project-root, it resolves to. - inside Git without an explicit
--project-root, it resolves to the relative path from the Git top-level folder to the invocation folder - outside Git, it resolves to
.
- A plain rerun of
openplate initfor the same tracked template and dest-folder is rejected. openplate init --overwritereruns init for the same tracked template and dest-folder and overwrites tracked template output.openplate init --overwriteskips init-command reruns and reuses the existing tracked template entry in.openplate.project.yaml.
Update the current project with the latest versions of the template
openplate update
The legacy nested project variant still works for compatibility, but openplate update is the documented command.
-
--allow-last-updater-emailallows tracked templates that requirelast_updater_emailto use it for this update invocation.openplate update --allow-last-updater-email
-
--update-missingrecreates missing non-readonly files without overwriting existing non-readonly files.openplate update --update-missing -
--update-fullis the overwrite-oriented maintenance mode. It recreates missing non-readonly files and overwrites existing non-readonly files.openplate update --update-full
Inspect the tracked template state for the current project.
openplate info
The legacy nested project variant still works for compatibility, but openplate info is the documented command.
By default, info reads .openplate.project.yaml and inspects each tracked template source so it can show the tracked template reference, destination folder, provenance, and prompt metadata such as current, default, and existing values.
-
--offlineskips template inspection and shows only the data already persisted in.openplate.project.yaml.openplate info --offline
Use this mode when you want to inspect the tracked project state without fetching or cloning template sources.
Hidden Parameters
-
--show-hiddenincludes hidden parameters wheninfois inspecting live template metadata.openplate info --show-hidden
--show-hidden cannot be combined with --offline because offline mode does not inspect the template definitions needed to identify hidden parameters.
OpenPlate supports a machine-driven prompt workflow for both init and update. The general pattern is:
- Print the prompt document for the exact command context you plan to run.
- Edit only the answers you want to change.
- Re-run the matching command with
--prompts-json-fileor--prompts-json-stdin.
For init, the prompt document is bound to the same --dest-folder placement context that the later init run must use.
Export the init prompt tree:
openplate project print-init-json https://github.com/my-org/ot-template.git#v1 --dest-folder generated/app
openplate project print-init-json https://github.com/my-org/ot-template.git#v1 --dest-folder generated/app --verbose
Import answers from a file or standard input using the same --dest-folder:
openplate init https://github.com/my-org/ot-template.git#v1 --dest-folder generated/app --prompts-json-file prompts.json
type prompts.json | openplate init https://github.com/my-org/ot-template.git#v1 --dest-folder generated/app --prompts-json-stdin
project print-init-json is read-only. It does not update .openplate.project.yaml or write template output.
The compact init export format is a top-level JSON array of prompt nodes:
[
{
"node-id": "15cff52",
"answers": {
"service_name": null
}
}
]The verbose init export includes the same node-id and answers fields plus info metadata:
[
{
"node-id": "15cff52",
"answers": {
"service_name": null
},
"info": {
"template": "https://github.com/my-org/ot-template.git#v1",
"dest_folder": "generated/app",
"parameters": {
"service_name": {
"default": null,
"existing": null,
"description": "Service Name",
"choices": null,
"hidden": null,
"required": true
}
}
}
}
]Init semantics:
node-idis the import/export identity for a reached init node under the chosen--dest-folder.answerscontains only the prompt answers used on import.- compact export omits
info. - verbose export includes
info.template, project-relativeinfo.dest_folder, and prompt metadata. - when present, verbose
info.require_sibling_templatesdescribes caller-side sibling declarations, including any siblingconditionmetadata. - hidden parameters are included only when the command uses
--ask-hidden. nullmeans do not answer this parameter from JSON; normal runtime fallback still applies.""means an intentional blank string answer.- any other non-null string means an explicit supplied answer for that parameter.
- omitting an answer key also means unresolved, so normal runtime fallback applies if that parameter is reached.
Important:
project print-init-jsonandinitmust use the same resolved--dest-folderif you want the printednode-idvalues and prompt metadata to remain valid.- if you print for one init placement and later run init with a different
--dest-folder, the earlier prompt document no longer matches that later init run correctly.
For update, the prompt document is bound to the same selected project context and tracked template state that the later update run must use.
Export the update prompt tree:
openplate project print-update-json --project-root C:/workspaces/my-repo
Import update answers from a file or standard input against the same project root and tracked state:
openplate update --project-root C:/workspaces/my-repo --prompts-json-file prompts.json
type prompts.json | openplate update --project-root C:/workspaces/my-repo --prompts-json-stdin
project print-update-json is read-only. It does not update .openplate.project.yaml or write template output.
The update export always includes verbose metadata and uses a structured answer shape:
[
{
"node-id": "15cff52",
"answers": {
"service_name": {
"supplied": false,
"value": null
}
},
"info": {
"template": "https://github.com/my-org/ot-template.git#v1",
"dest_folder": "services/api",
"parameters": {
"service_name": {
"current": "existing-name",
"default": "default-name",
"existing": "existing-name",
"description": "Service Name",
"choices": null,
"hidden": null,
"required": false
}
}
}
}
]Update semantics:
node-idis the import/export identity for a reached update node in the selected project context.- every update answer entry uses
suppliedplusvalue. supplied: falsewithvalue: nullmeans leave the parameter untouched and use normal existing/default logic.supplied: truewith a non-null string means an explicit supplied answer.""remains an explicit blank string.supplied: truewithvalue: nullmeans clear any persisted explicit override and continue with normal default logic.- update prompt JSON always includes hidden parameters.
--ask-hiddendoes not gate update prompt JSON scope. info.parameters.currentshows the effective value update would use if the answer entry stays unsupplied.info.parameters.existingshows the persisted explicit project value, if any.info.parameters.defaultshows the processed template or global default, if any.
Important:
project print-update-jsonandupdatemust use the same selected project root and tracked template state if you want the printednode-idvalues and prompt metadata to remain valid.
Shared prompt JSON notes:
project print-init-jsonandproject print-update-jsonare the only modes that walk the full declared sibling tree without applying siblingconditionfilters.- imported nodes that are not processed by the run are ignored and logged by
node-id. - OpenPlate warns when supplied prompt answers are left unused for a matched node.
- init and update both reject invalid choice values under the same rules as interactive prompting.
Verify that the project has not drifted from the template. Exit with code -1 if so.
openplate verify
If you want to re-answer questions you can use
openplate update --ask-again
Answer "hidden" questions
The answer to some questions are usually assumed, but you have the ability to answer them by specifying the "--ask-hidden" option
openplate init --ask-hidden git@github.com:my-org/ot-docker.git#v1
or
openplate update --ask-hidden
The same flag controls init prompt JSON scope. With --ask-hidden, hidden parameters are included in project print-init-json output and may be answered through --prompts-json-file or --prompts-json-stdin on init. Without it, hidden parameters are omitted from init export and ignored on init import. Update prompt JSON is different: hidden parameters are always included in project print-update-json output and remain in scope on update prompt JSON import.
NOTE: to use a specific branch or tag of a template, append #branchname on init. If you omit #branchname, you must also pass --allow-default-branch.
Examples:
openplate init https://github.com/my-org/ot-sometemplate#0.0.9
openplate init --allow-default-branch https://github.com/my-org/ot-sometemplate
If a repository stores templates in sub-folders, use ?path= to select the template root inside the repository clone.
openplate init https://github.com/my-org/template-catalog.git?path=templates/net-api#v1
If you wish for a specific template to be added to this project but not "cached" in the "template cache", specify the --no-cache argument.
openplate init --no-cache https://github.com/my-org/ot-sometemplate#0.0.9
This is useful when you have:
- a template which will use other templates in it's own files
- Needs to NOT send the files of some templates to the child project
- DOES need to pass on some of it's inherited files from particular templates to the child project