Skip to contents

Creates .gptr/ with settings.json, skills/, agents/, prompts/, and (by default) the project-instructions file vignette.Rmd and .gitignore. Existing files are never overwritten, so calling it again is safe. There is no default path: without path gptr asks Create .gptr/ in <project>? [y/N] when you can answer, and signals an error otherwise. Creating the workspace is consent to write there; it is not trust: gptr then asks separately whether to trust the project (see gptr_trust()). In a package source it offers the ^\.gptr$ line for .Rbuildignore and never writes it silently.

Usage

gptr_init(path, instructions = TRUE, gitignore = TRUE)

Arguments

path

The project directory (it must exist).

instructions

Write vignette.Rmd from the template when it is absent.

gitignore

Write .gptr/.gitignore from the template when it is absent.

Value

The absolute path of .gptr/, invisibly (NULL when you declined).

Examples

d = tempfile("proj")
dir.create(d)
gptr_init(d)
list.files(file.path(d, ".gptr"), all.files = TRUE)
#> [1] "."             ".."            ".gitignore"    "agents"       
#> [5] "prompts"       "settings.json" "skills"        "vignette.Rmd" 
unlink(d, recursive = TRUE)