{"modulePath":"github.com/windsorcli/cli","version":"v0.10.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package project\n\n## Types\n\n```go\ntype Project struct {\n\tRuntime *runtime.Runtime\n\n\tProvisioner *provisioner.Provisioner\n\tComposer    *composer.Composer\n\tWorkstation *workstation.Workstation\n\t// contains filtered or unexported fields\n}\n```\nProject holds the runtime, composer, provisioner and workstation of one context.\n\n```go\nfunc NewProject(contextName string, opts ...*Project) *Project\n```\nNewProject creates a Project for contextName and creates the runtime, composer and provisioner. It uses the current context, or \"local\", when contextName is empty. A non-empty contextName also sets the context of the config handler. It creates the Workstation only for a dev context. EnsureWorkstation creates it for other contexts after Configure. The fields of an optional Project in opts replace the default objects. Tests use this to inject mocks. It panics when the runtime has no config handler.\n\n```go\nfunc (p *Project) Bootstrap(ctx context.Context, confirm provisioner.BootstrapConfirmFn) (*blueprintv1alpha1.Blueprint, bool, bool, error)\n```\nBootstrap is the first run of Up. It calls confirm with a blueprint summary before it starts the workstation. When the operator declines, no privileged work or terraform work runs. The provisioner applies with a local backend and then migrates the state to the configured backend. It returns the blueprint, an applied flag, a halt flag and an error. applied is false when confirm declines.\n\n```go\nfunc (p *Project) ComposeBlueprint(blueprintURL ...string) error\n```\nComposeBlueprint generates the context ID and loads the blueprint from blueprintURL or the default sources. It does not write files or generate infrastructure. Use it when only the composed blueprint is necessary.\n\n```go\nfunc (p *Project) Configure(flagOverrides map[string]any) error\n```\nConfigure resolves the configuration of the project with flagOverrides and loads the environment variables. It returns an error when resolution or the environment load fails.\n\n```go\nfunc (p *Project) EnsureWorkstation()\n```\nEnsureWorkstation creates the Workstation when it is nil and workstation.runtime is set. Call it before code that uses p.Workstation.\n\n```go\nfunc (p *Project) Initialize(overwrite bool, blueprintURL ...string) error\n```\nInitialize prepares the workstation, loads the blueprint, saves the config and generates the infrastructure files. Then it prepares the tools and loads the environment. overwrite lets the generate step replace existing files. blueprintURL is an optional OCI URL or local .tar.gz path. It returns an error when a step fails.\n\n```go\nfunc (p *Project) PerformCleanup() error\n```\nPerformCleanup removes the artifacts of the context. It cleans the config state and removes the .kube and .talos directories under contexts/\\\u003ccontext\u003e. It removes the contents of .windsor/contexts/\\\u003ccontext\u003e, but keeps workstation.yaml. It returns an error if a step fails. When .windsor/contexts/\\\u003ccontext\u003e is a file, the error has a remediation hint.\n\n```go\nfunc (p *Project) PlanRun(command, to string, continuing bool) (*provisioner.RunPlan, error)\n```\nPlanRun builds the run plan for --to and --continue and gives it to the provisioner for the next Up. It returns nil when both are unset. It runs before any work starts, so a bad --to value or a missing record fails before the workstation starts or the config changes.\n\n```go\nfunc (p *Project) SetToolRequirements(reqs tools.Requirements)\n```\nSetToolRequirements sets the tool families that Initialize checks. When it is not called, Initialize checks all tool families. A command that does not use a tool calls it, so the operator does not have to install that tool.\n\n```go\nfunc (p *Project) Up(ctx context.Context) (*blueprintv1alpha1.Blueprint, bool, error)\n```\nUp generates the blueprint, starts the workstation when it exists and runs the provisioner. Before the provisioner runs, it restores the host route to a cluster that holds the Terraform state. It returns the blueprint, a halt flag and an error. The halt flag is true when an apply hook stops the run cleanly, or when the host route needs a privileged step. The caller then shows the deferred work and exits without an error.\n\n","path":"github.com/windsorcli/cli/pkg/project","name":"project","synopsis":"","isRedistributable":true}
