codespace

package
v2.49.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEVCONTAINER_PROMPT_DEFAULT = "Default Codespaces configuration"
)

Variables

View Source
var (
	DEFAULT_DEVCONTAINER_DEFINITIONS = []string{".devcontainer.json", ".devcontainer/devcontainer.json"}
)
View Source
var ErrTooManyArgs = errors.New("the command accepts no arguments")

Functions

func NewCmdCodespace added in v2.33.0

func NewCmdCodespace(f *cmdutil.Factory) *cobra.Command

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(io *iostreams.IOStreams, exe executable, apiClient apiClient, browser browser.Browser, remotes func() (clicontext.Remotes, error)) *App

func (*App) Copy added in v2.2.0

func (a *App) Copy(ctx context.Context, args []string, opts cpOptions) error

Copy copies files between the local and remote file systems. The mechanics are similar to 'ssh' but using 'scp'.

func (*App) Create

func (a *App) Create(ctx context.Context, opts createOptions) error

Create creates a new Codespace

func (*App) Delete

func (a *App) Delete(ctx context.Context, opts deleteOptions) (err error)

func (*App) Edit added in v2.6.0

func (a *App) Edit(ctx context.Context, opts editOptions) error

Edits a codespace

func (*App) ForwardPorts

func (a *App) ForwardPorts(ctx context.Context, selector *CodespaceSelector, ports []string) (err error)

func (*App) Jupyter added in v2.10.0

func (a *App) Jupyter(ctx context.Context, selector *CodespaceSelector) (err error)

func (*App) List

func (a *App) List(ctx context.Context, opts *listOptions, exporter cmdutil.Exporter) error

func (*App) ListPorts

func (a *App) ListPorts(ctx context.Context, selector *CodespaceSelector, exporter cmdutil.Exporter) (err error)

ListPorts lists known ports in a codespace.

func (*App) Logs

func (a *App) Logs(ctx context.Context, selector *CodespaceSelector, follow bool) (err error)

func (*App) Rebuild added in v2.18.0

func (a *App) Rebuild(ctx context.Context, selector *CodespaceSelector, full bool) (err error)

func (*App) RunWithProgress added in v2.24.1

func (a *App) RunWithProgress(label string, run func() error) error

func (*App) SSH

func (a *App) SSH(ctx context.Context, sshArgs []string, opts sshOptions) (err error)

SSH opens an ssh session or runs an ssh command in a codespace.

func (*App) Select added in v2.8.0

func (a *App) Select(ctx context.Context, opts selectOptions) (err error)

Hidden codespace `select` command allows to reuse existing codespace selection dialog by external GH CLI extensions. By default output selected codespace name into `stdout`. Pass `--file`(`-f`) flag along with a file path to output selected codespace name into a file instead.

## Examples

With `stdout` output:

```shell

gh codespace select

```

With `into-a-file` output:

```shell

gh codespace select --file /tmp/selected_codespace.txt

```

func (*App) StartProgressIndicatorWithLabel added in v2.2.0

func (a *App) StartProgressIndicatorWithLabel(s string)

StartProgressIndicatorWithLabel starts a progress indicator with a message.

func (*App) StopCodespace

func (a *App) StopCodespace(ctx context.Context, opts *stopOptions) error

func (*App) StopProgressIndicator added in v2.2.0

func (a *App) StopProgressIndicator()

StopProgressIndicator stops the progress indicator.

func (*App) UpdatePortVisibility added in v2.2.0

func (a *App) UpdatePortVisibility(ctx context.Context, selector *CodespaceSelector, args []string) (err error)

func (*App) VSCode

func (a *App) VSCode(ctx context.Context, selector *CodespaceSelector, useInsiders bool, useWeb bool) error

VSCode opens a codespace in the local VS VSCode application.

func (*App) ViewCodespace added in v2.31.0

func (a *App) ViewCodespace(ctx context.Context, opts *viewOptions) error

type CodespaceSelector added in v2.24.0

type CodespaceSelector struct {
	// contains filtered or unexported fields
}

func AddCodespaceSelector added in v2.24.0

func AddCodespaceSelector(cmd *cobra.Command, api apiClient) *CodespaceSelector

AddCodespaceSelector adds persistent flags for selecting a codespace to the given command and returns a CodespaceSelector which applies them

func (*CodespaceSelector) Select added in v2.24.0

func (cs *CodespaceSelector) Select(ctx context.Context) (codespace *api.Codespace, err error)

func (*CodespaceSelector) SelectName added in v2.24.0

func (cs *CodespaceSelector) SelectName(ctx context.Context) (string, error)

type NullableDuration added in v2.11.3

type NullableDuration struct {
	*time.Duration
}

func (*NullableDuration) Minutes added in v2.11.3

func (d *NullableDuration) Minutes() *int

func (*NullableDuration) Set added in v2.11.3

func (d *NullableDuration) Set(str string) error

func (*NullableDuration) String added in v2.11.3

func (d *NullableDuration) String() string

func (*NullableDuration) Type added in v2.11.3

func (d *NullableDuration) Type() string

type Prompter added in v2.42.1

type Prompter struct{}

func (*Prompter) Ask added in v2.42.1

func (p *Prompter) Ask(qs []*survey.Question, response interface{}) error

ask asks survey questions on the terminal, using standard options. It fails unless hasTTY, but ideally callers should avoid calling it in that case.

type SurveyPrompter added in v2.42.1

type SurveyPrompter interface {
	Ask(qs []*survey.Question, response interface{}) error
}

Jump to

Keyboard shortcuts

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