up

package
v1.14.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MPL-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MountConsistencyConsistent = "consistent"
	MountConsistencyCached     = "cached"
	MountConsistencyDelegated  = "delegated"

	UpdateRemoteUserUIDOn  = "on"
	UpdateRemoteUserUIDOff = "off"
)

Variables

This section is empty.

Functions

func NewUpCmd

func NewUpCmd(f *flags.GlobalFlags) *cobra.Command

NewUpCmd creates a new up command.

func RunFromOptions

func RunFromOptions(ctx context.Context, g *flags.GlobalFlags, opts Options) error

RunFromOptions runs the up logic without cobra. Callers own ctx cancellation; WithSignals is intentionally skipped.

func RunHeadless added in v1.10.0

func RunHeadless(
	ctx context.Context,
	client client2.BaseWorkspaceClient,
	opts HeadlessOptions,
) (*config2.Result, error)

func WithSignals

func WithSignals(ctx context.Context) (context.Context, func())

WithSignals returns a context cancelled on the first shutdown signal so deferred cleanup can run, and forces exit on a second signal. The returned func must be called to release the signal handler.

Types

type HeadlessOptions added in v1.10.0

type HeadlessOptions struct {
	GlobalFlags        *flags.GlobalFlags
	DevsyConfig        *config.Config
	CLIOptions         provider2.CLIOptions
	ProviderOptions    []string
	SecretsFile        string
	FeatureSecretsFile string
}

type Options

type Options struct {
	Source           string // git URL, local path, image, or workspace name
	Name             string // explicit workspace ID override
	Provider         string // provider name override
	IDE              string // ide name; "none" to skip launching
	DevcontainerPath string // path to devcontainer.json, relative to project
	// DevContainerSource overrides devcontainer discovery (e.g. "image:<ref>"),
	// used by snapshot restore to run the committed image directly.
	DevContainerSource string
	// RunArgs are extra `docker run` arguments to apply when DevContainerSource
	// suppresses the project devcontainer.json, so runArgs it would have set
	// (e.g. --add-host) still take effect. Used by snapshot restore to replay
	// the original devcontainer.json's runArgs.
	RunArgs []string
	// ContainerEnv are extra container environment variables to apply under
	// the same suppressed-discovery circumstances as RunArgs. Used by
	// snapshot restore to replay the original devcontainer.json's containerEnv.
	ContainerEnv map[string]string
}

Options is the structured input form of the up command.

type UpCmd

type UpCmd struct {
	provider2.CLIOptions
	*flags.GlobalFlags

	Machine string

	ProviderOptions []string

	FromSnapshot string // snapshot ref to restore from, e.g. ghcr.io/acme/s:my-ws-20260731150405-abcxyz

	ConfigureSSH       bool
	GPGAgentForwarding bool
	SSHTunnelMode      bool
	IDELaunch          opener.IDELaunchMode
	Reconfigure        bool

	SSHConfigPath      string
	SecretsFile        string
	FeatureSecretsFile string
	WorkspaceFolder    string

	DotfilesSource        string
	DotfilesScript        string
	DotfilesTargetPath    string
	DotfilesScriptEnv     []string // Key=Value to pass to install script
	DotfilesScriptEnvFile []string // Paths to files containing Key=Value pairs to pass to install script

	// See cmd.runDetached.
	Detach bool

	// Out receives result/error JSON envelopes; nil falls back to os.Stdout.
	Out io.Writer
	// contains filtered or unexported fields
}

UpCmd holds the up cmd flags.

func (*UpCmd) Run

func (cmd *UpCmd) Run(
	ctx context.Context,
	devsyConfig *config.Config,
	client client2.BaseWorkspaceClient,
	args []string,
) error

Run runs the command logic.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL