Skip to content
Framework

Workflow

project_create_from_layers()

Create a Project from a Layers File

Reads a .framework/layers.json file (the format framework.pub sends), resolves it with spec_resolve(), and creates the project in path. This is the entry point the framework.pub GitHub Action runs, and it can also be used locally.

Usage

project_create_from_layers(layers_file, path = ".", interactive = FALSE)

Arguments

Name Default Description
layers_file

Path to a layers file (see inst/schema/layers.v1.json).

path "."

Directory to create the project in (default: current directory).

interactive FALSE

If FALSE, run headless as described above.

Value

Invisibly, a list with success, path, and the resolved spec.

Details

With interactive = FALSE it runs headless, for automation: it never prompts, does not initialize git or make a commit (the caller owns the repository), does not add the project to the local registry, and refuses to write under .github/workflows/. In that mode path may be an existing git checkout that contains only .git/, .github/, .framework/, README.md, and LICENSE. Anything else in it is an error, so a misconfigured run cannot overwrite real work.

Examples

Not run

if (FALSE) {
# In the framework.pub GitHub Action
project_create_from_layers(".framework/layers.json", path = ".", interactive = FALSE)
}

Related reference

Search guides and reference for R, Python, Stata, the CLI, and Framework Cloud.