Skip to content

Commit 5403313

Browse files
authored
Merge pull request #451 from depot/DEP-0-rename-compute-to-sandbox
[DEP-0] feat(sandbox): rename compute -> sandbox
2 parents 4f2273d + 2740cb1 commit 5403313

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

pkg/cmd/root/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
cargoCmd "github.com/depot/cli/pkg/cmd/cargo"
1313
ciCmd "github.com/depot/cli/pkg/cmd/ci"
1414
claudeCmd "github.com/depot/cli/pkg/cmd/claude"
15-
computeCmd "github.com/depot/cli/pkg/cmd/compute"
1615
dockerCmd "github.com/depot/cli/pkg/cmd/docker"
1716
"github.com/depot/cli/pkg/cmd/exec"
1817
"github.com/depot/cli/pkg/cmd/gocache"
@@ -27,6 +26,7 @@ import (
2726
"github.com/depot/cli/pkg/cmd/pulltoken"
2827
"github.com/depot/cli/pkg/cmd/push"
2928
"github.com/depot/cli/pkg/cmd/registry"
29+
sandboxCmd "github.com/depot/cli/pkg/cmd/sandbox"
3030
versionCmd "github.com/depot/cli/pkg/cmd/version"
3131
"github.com/depot/cli/pkg/config"
3232
)
@@ -84,7 +84,7 @@ func NewCmdRoot(version, buildDate string) *cobra.Command {
8484
cmd.AddCommand(gocache.NewCmdGoCache())
8585
cmd.AddCommand(exec.NewCmdExec())
8686
cmd.AddCommand(ciCmd.NewCmdCI())
87-
cmd.AddCommand(computeCmd.NewCmdCompute())
87+
cmd.AddCommand(sandboxCmd.NewCmdSandbox())
8888

8989
return cmd
9090
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package compute
1+
package sandbox
22

33
import (
44
"context"
@@ -13,17 +13,17 @@ import (
1313
"github.com/spf13/cobra"
1414
)
1515

16-
func newComputeExecPipe() *cobra.Command {
16+
func newSandboxExecPipe() *cobra.Command {
1717
cmd := &cobra.Command{
1818
Use: "exec-pipe [flags]",
1919
Short: "Execute a command within the compute, then stream bytes to stdin",
2020
Long: "Execute a command within the compute, then stream bytes to stdin",
2121
Example: `
2222
# Pipe text into a file in the compute
23-
echo "Hello Depot" | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
23+
echo "Hello Depot" | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
2424
2525
# Pipe a tarball into the compute
26-
tar czf - ./src | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
26+
tar czf - ./src | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
2727
`,
2828
Args: cobra.MinimumNArgs(1),
2929
RunE: func(cmd *cobra.Command, args []string) error {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package compute
1+
package sandbox
22

33
import (
44
"fmt"
@@ -11,20 +11,20 @@ import (
1111
"github.com/spf13/cobra"
1212
)
1313

14-
func newComputeExec() *cobra.Command {
14+
func newSandboxExec() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "exec [flags]",
1717
Short: "Execute a command within the compute",
1818
Long: "Execute a command within the compute",
1919
Example: `
2020
# execute command within the compute
21-
depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami
21+
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami
2222
2323
# execute command with timeout (30 seconds)
24-
depot compute exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami
24+
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami
2525
2626
# execute complex command
27-
depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done'
27+
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done'
2828
`,
2929
Args: cobra.MinimumNArgs(1),
3030
RunE: func(cmd *cobra.Command, args []string) error {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package compute
1+
package sandbox
22

33
import (
44
"context"
@@ -17,20 +17,20 @@ import (
1717
"golang.org/x/term"
1818
)
1919

20-
func newComputePty() *cobra.Command {
20+
func newSandboxPty() *cobra.Command {
2121
cmd := &cobra.Command{
2222
Use: "pty [flags]",
2323
Short: "Open a pseudo-terminal within the compute",
2424
Long: "Open a pseudo-terminal within the compute",
2525
Example: `
2626
# open a pseudo-terminal within the compute
27-
depot compute pty --sandbox-id 1234567890 --session-id 1234567890
27+
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890
2828
2929
# set terminal workdir
30-
depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp
30+
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp
3131
3232
# set terminal environment variables
33-
depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO
33+
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO
3434
`,
3535
RunE: func(cmd *cobra.Command, args []string) error {
3636
ctx := cmd.Context()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !windows
22

3-
package compute
3+
package sandbox
44

55
import (
66
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package compute
1+
package sandbox
22

33
import (
44
"context"
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package compute
1+
package sandbox
22

33
import (
44
"github.com/spf13/cobra"
55
)
66

7-
func NewCmdCompute() *cobra.Command {
7+
func NewCmdSandbox() *cobra.Command {
88
cmd := &cobra.Command{
9-
Use: "compute [flags] [compute args...]",
9+
Use: "sandbox [flags] [compute args...]",
1010
Short: "Manage Depot compute",
1111
Long: `Compute is the building block of Depot CI.
1212
@@ -20,9 +20,9 @@ Subcommands:
2020

2121
cmd.PersistentFlags().String("token", "", "Depot API token")
2222

23-
cmd.AddCommand(newComputeExec())
24-
cmd.AddCommand(newComputePty())
25-
cmd.AddCommand(newComputeExecPipe())
23+
cmd.AddCommand(newSandboxExec())
24+
cmd.AddCommand(newSandboxPty())
25+
cmd.AddCommand(newSandboxExecPipe())
2626

2727
return cmd
2828
}

0 commit comments

Comments
 (0)