Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
cargoCmd "github.com/depot/cli/pkg/cmd/cargo"
ciCmd "github.com/depot/cli/pkg/cmd/ci"
claudeCmd "github.com/depot/cli/pkg/cmd/claude"
computeCmd "github.com/depot/cli/pkg/cmd/compute"
dockerCmd "github.com/depot/cli/pkg/cmd/docker"
"github.com/depot/cli/pkg/cmd/exec"
"github.com/depot/cli/pkg/cmd/gocache"
Expand All @@ -27,6 +26,7 @@ import (
"github.com/depot/cli/pkg/cmd/pulltoken"
"github.com/depot/cli/pkg/cmd/push"
"github.com/depot/cli/pkg/cmd/registry"
sandboxCmd "github.com/depot/cli/pkg/cmd/sandbox"
versionCmd "github.com/depot/cli/pkg/cmd/version"
"github.com/depot/cli/pkg/config"
)
Expand Down Expand Up @@ -84,7 +84,7 @@ func NewCmdRoot(version, buildDate string) *cobra.Command {
cmd.AddCommand(gocache.NewCmdGoCache())
cmd.AddCommand(exec.NewCmdExec())
cmd.AddCommand(ciCmd.NewCmdCI())
cmd.AddCommand(computeCmd.NewCmdCompute())
cmd.AddCommand(sandboxCmd.NewCmdSandbox())

return cmd
}
8 changes: 4 additions & 4 deletions pkg/cmd/compute/exec-pipe.go → pkg/cmd/sandbox/exec-pipe.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package compute
package sandbox

import (
"context"
Expand All @@ -13,17 +13,17 @@ import (
"github.com/spf13/cobra"
)

func newComputeExecPipe() *cobra.Command {
func newSandboxExecPipe() *cobra.Command {
cmd := &cobra.Command{
Use: "exec-pipe [flags]",
Short: "Execute a command within the compute, then stream bytes to stdin",
Long: "Execute a command within the compute, then stream bytes to stdin",
Example: `
# Pipe text into a file in the compute
echo "Hello Depot" | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
echo "Hello Depot" | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"

# Pipe a tarball into the compute
tar czf - ./src | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
tar czf - ./src | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
Comment on lines 19 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation.

The Short, Long, and Example descriptions should be updated:

Short: "Execute a command within the sandbox, then stream bytes to stdin",
Long:  "Execute a command within the sandbox, then stream bytes to stdin",
Example: `
  # Pipe text into a file in the sandbox
  echo "Hello Depot" | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"

  # Pipe a tarball into the sandbox
  tar czf - ./src | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
`,
Suggested change
Short: "Execute a command within the compute, then stream bytes to stdin",
Long: "Execute a command within the compute, then stream bytes to stdin",
Example: `
# Pipe text into a file in the compute
echo "Hello Depot" | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
echo "Hello Depot" | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
# Pipe a tarball into the compute
tar czf - ./src | depot compute exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
tar czf - ./src | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"
Short: "Execute a command within the sandbox, then stream bytes to stdin",
Long: "Execute a command within the sandbox, then stream bytes to stdin",
Example: `
# Pipe text into a file in the sandbox
echo "Hello Depot" | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tee /tmp/hello.txt"
# Pipe a tarball into the sandbox
tar czf - ./src | depot sandbox exec-pipe --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc "tar xzf - -C /workspace"

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/compute/exec.go → pkg/cmd/sandbox/exec.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package compute
package sandbox

import (
"fmt"
Expand All @@ -11,20 +11,20 @@ import (
"github.com/spf13/cobra"
)

func newComputeExec() *cobra.Command {
func newSandboxExec() *cobra.Command {
cmd := &cobra.Command{
Use: "exec [flags]",
Short: "Execute a command within the compute",
Long: "Execute a command within the compute",
Example: `
# execute command within the compute
Comment on lines 17 to 20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation.

Should be updated to:

Short: "Execute a command within the sandbox",
Long:  "Execute a command within the sandbox",
Example: `
  # execute command within the sandbox
Suggested change
Short: "Execute a command within the compute",
Long: "Execute a command within the compute",
Example: `
# execute command within the compute
Short: "Execute a command within the sandbox",
Long: "Execute a command within the sandbox",
Example: `
# execute command within the sandbox

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc whoami

# execute command with timeout (30 seconds)
depot compute exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 --timeout 30000 -- /bin/bash -lc whoami

# execute complex command
depot compute exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done'
depot sandbox exec --sandbox-id 1234567890 --session-id 1234567890 -- /bin/bash -lc 'for i in {1..10}; do echo $i; sleep 1; done'
`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/compute/pty.go → pkg/cmd/sandbox/pty.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package compute
package sandbox

import (
"context"
Expand All @@ -17,20 +17,20 @@ import (
"golang.org/x/term"
)

func newComputePty() *cobra.Command {
func newSandboxPty() *cobra.Command {
cmd := &cobra.Command{
Use: "pty [flags]",
Short: "Open a pseudo-terminal within the compute",
Long: "Open a pseudo-terminal within the compute",
Example: `
# open a pseudo-terminal within the compute
Comment on lines 23 to 26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation.

Should be updated to:

Short: "Open a pseudo-terminal within the sandbox",
Long:  "Open a pseudo-terminal within the sandbox",
Example: `
  # open a pseudo-terminal within the sandbox
Suggested change
Short: "Open a pseudo-terminal within the compute",
Long: "Open a pseudo-terminal within the compute",
Example: `
# open a pseudo-terminal within the compute
Short: "Open a pseudo-terminal within the sandbox",
Long: "Open a pseudo-terminal within the sandbox",
Example: `
# open a pseudo-terminal within the sandbox

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

depot compute pty --sandbox-id 1234567890 --session-id 1234567890
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890

# set terminal workdir
depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --cwd /tmp

# set terminal environment variables
depot compute pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO
depot sandbox pty --sandbox-id 1234567890 --session-id 1234567890 --env FOO=BAR --env BAR=FOO
`,
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !windows

package compute
package sandbox

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package compute
package sandbox

import (
"context"
Expand Down
12 changes: 6 additions & 6 deletions pkg/cmd/compute/compute.go → pkg/cmd/sandbox/sandbox.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package compute
package sandbox

import (
"github.com/spf13/cobra"
)

func NewCmdCompute() *cobra.Command {
func NewCmdSandbox() *cobra.Command {
cmd := &cobra.Command{
Use: "compute [flags] [compute args...]",
Use: "sandbox [flags] [compute args...]",
Short: "Manage Depot compute",
Long: `Compute is the building block of Depot CI.
Comment on lines +9 to 11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text still references "compute" instead of "sandbox". This creates inconsistent user-facing documentation.

Should be updated to:

Use:   "sandbox [flags] [sandbox args...]",
Short: "Manage Depot sandbox",
Long: `Sandbox is the building block of Depot CI.
Suggested change
Use: "sandbox [flags] [compute args...]",
Short: "Manage Depot compute",
Long: `Compute is the building block of Depot CI.
Use: "sandbox [flags] [sandbox args...]",
Short: "Manage Depot sandbox",
Long: `Sandbox is the building block of Depot CI.

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.


Expand All @@ -20,9 +20,9 @@ Subcommands:

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

cmd.AddCommand(newComputeExec())
cmd.AddCommand(newComputePty())
cmd.AddCommand(newComputeExecPipe())
cmd.AddCommand(newSandboxExec())
cmd.AddCommand(newSandboxPty())
cmd.AddCommand(newSandboxExecPipe())

return cmd
}
Loading