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
1 change: 0 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ depends = ["vendor"]
[tasks."lint"]
description = "Linting automatically checks code for errors and style issues"
run = "golangci-lint run"
depends = ["tidy"]

[tasks.test]
description = "Checks to verify code correctness"
Expand Down
18 changes: 9 additions & 9 deletions cmd/skpr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ func main() {
os.Exit(1)
}

// Experimental commands.
featureFlags, err := userConfig.LoadFeatureFlags()
if err != nil {
fmt.Println("Failed to load feature flags:", err)
os.Exit(1)
}

skprcommand.AddGroupsToCommand(cmd)

cmd.AddCommand(alias.NewCommand())
Expand All @@ -99,8 +106,8 @@ func main() {
cmd.AddCommand(login.NewCommand())
cmd.AddCommand(logout.NewCommand())
cmd.AddCommand(logs.NewCommand())
cmd.AddCommand(mysql.NewCommand())
cmd.AddCommand(pkg.NewCommand())
cmd.AddCommand(mysql.NewCommand(featureFlags.DockerClient))
cmd.AddCommand(pkg.NewCommand(featureFlags.DockerClient))
cmd.AddCommand(purge.NewCommand())
cmd.AddCommand(release.NewCommand())
cmd.AddCommand(restore.NewCommand())
Expand All @@ -117,13 +124,6 @@ func main() {
HiddenDefaultCmd: true,
}

// Experimental commands.
featureFlags, err := userConfig.LoadFeatureFlags()
if err != nil {
fmt.Println("Failed to load feature flags:", err)
os.Exit(1)
}

if featureFlags.Trace {
cmd.AddCommand(trace.NewCommand())
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/skpr/mysql/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (
img "github.com/skpr/cli/cmd/skpr/mysql/image"
"github.com/skpr/cli/cmd/skpr/mysql/restore"
skprcommand "github.com/skpr/cli/internal/command"
"github.com/skpr/cli/internal/docker"
)

var (
cmdLong = `Commands for interacting with the Skpr platforms MySQL features.`
)

// NewCommand creates a new cobra.Command for 'mysql' sub command
func NewCommand() *cobra.Command {
func NewCommand(clientId docker.DockerClientId) *cobra.Command {
cmd := &cobra.Command{
Use: "mysql",
DisableFlagsInUseLine: true,
Expand All @@ -23,7 +24,7 @@ func NewCommand() *cobra.Command {
GroupID: skprcommand.GroupDataStorage,
}

cmd.AddCommand(img.NewCommand())
cmd.AddCommand(img.NewCommand(clientId))
cmd.AddCommand(backup.NewCommand())
cmd.AddCommand(restore.NewCommand())

Expand Down
5 changes: 3 additions & 2 deletions cmd/skpr/mysql/image/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/skpr/cli/cmd/skpr/mysql/image/create"
"github.com/skpr/cli/cmd/skpr/mysql/image/list"
"github.com/skpr/cli/cmd/skpr/mysql/image/pull"
"github.com/skpr/cli/internal/docker"
)

var (
Expand All @@ -20,7 +21,7 @@ var (
)

// NewCommand creates a new cobra.Command for 'image' sub command
func NewCommand() *cobra.Command {
func NewCommand(clientId docker.DockerClientId) *cobra.Command {
cmd := &cobra.Command{
Use: "image",
DisableFlagsInUseLine: true,
Expand All @@ -31,7 +32,7 @@ func NewCommand() *cobra.Command {

cmd.AddCommand(create.NewCommand())
cmd.AddCommand(list.NewCommand())
cmd.AddCommand(pull.NewCommand())
cmd.AddCommand(pull.NewCommand(clientId))

return cmd
}
4 changes: 3 additions & 1 deletion cmd/skpr/mysql/image/pull/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"

v1pull "github.com/skpr/cli/internal/command/mysql/image/pull"
"github.com/skpr/cli/internal/docker"
)

var (
Expand All @@ -15,7 +16,7 @@ var (
)

// NewCommand creates a new cobra.Command for 'list' sub command
func NewCommand() *cobra.Command {
func NewCommand(clientId docker.DockerClientId) *cobra.Command {
command := v1pull.Command{}

cmd := &cobra.Command{
Expand All @@ -27,6 +28,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Params.Environment = args[0]
command.ClientId = clientId

if len(args) > 1 {
command.Params.Databases = args[1:]
Expand Down
9 changes: 7 additions & 2 deletions cmd/skpr/package/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

skprcommand "github.com/skpr/cli/internal/command"
v1package "github.com/skpr/cli/internal/command/package"
"github.com/skpr/cli/internal/docker"
)

var (
Expand All @@ -23,7 +24,7 @@ var (
)

// NewCommand creates a new cobra.Command for 'package' sub command
func NewCommand() *cobra.Command {
func NewCommand(clientId docker.DockerClientId) *cobra.Command {
command := v1package.Command{}

cmd := &cobra.Command{
Expand All @@ -37,6 +38,7 @@ func NewCommand() *cobra.Command {
GroupID: skprcommand.GroupLifecycle,
RunE: func(cmd *cobra.Command, args []string) error {
command.Params.Version = args[0]
command.ClientId = clientId
return command.Run(cmd.Context())
},
}
Expand All @@ -47,8 +49,11 @@ func NewCommand() *cobra.Command {
cmd.Flags().BoolVar(&command.PrintManifest, "print-manifest", command.PrintManifest, "Print the manifest to stdout.")
cmd.Flags().StringVar(&command.PackageDir, "dir", ".skpr/package", "The location of the package directory.")
cmd.Flags().StringSliceVar(&command.BuildArgs, "build-arg", []string{}, "Additional build arguments.")
cmd.Flags().StringVar(&command.Platform, "platform", "linux/amd64", "The platform to build for.")
cmd.Flags().BoolVar(&command.Debug, "debug", command.Debug, "Enable debug output.")

if clientId == docker.DockerClientIdDocker {
cmd.Flags().StringVar(&command.Params.IgnoreFile, "ignore-file", ".dockerignore", "A file containing patterns to exclude from the build context.")
}

return cmd
}
82 changes: 48 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ require (
charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/aquasecurity/table v1.11.0
github.com/aws/aws-sdk-go-v2 v1.40.1
github.com/aws/aws-sdk-go-v2/config v1.32.3
github.com/aws/aws-sdk-go-v2/credentials v1.19.3
github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.33.15
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.57.16
github.com/aws/aws-sdk-go-v2/service/ecr v1.54.2
github.com/aws/aws-sdk-go-v2 v1.41.0
github.com/aws/aws-sdk-go-v2/config v1.32.5
github.com/aws/aws-sdk-go-v2/credentials v1.19.5
github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.33.16
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.57.17
github.com/aws/aws-sdk-go-v2/service/ecr v1.54.4
github.com/charmbracelet/bubbletea v1.3.10
github.com/charmbracelet/fang v0.4.4
github.com/containerd/errdefs v1.0.0
github.com/docker/docker v28.5.2+incompatible
github.com/egym-playground/go-prefix-writer v0.0.0-20180609083313-7326ea162eca
github.com/fatih/color v1.18.0
github.com/fsouza/go-dockerclient v1.12.3
Expand All @@ -24,7 +26,9 @@ require (
github.com/jinzhu/now v1.1.5
github.com/jwalton/gchalk v1.3.0
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/notaryproject/notation-go v1.3.2
github.com/moby/go-archive v0.1.0
github.com/moby/moby/api v1.52.0
github.com/moby/patternmatcher v0.6.0
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0
github.com/pkg/errors v0.9.1
github.com/skpr/api v1.3.2
Expand All @@ -33,36 +37,36 @@ require (
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
github.com/tcnksm/go-input v0.0.0-20180404061846-548a7d7a8ee8
golang.org/x/crypto v0.45.0
golang.org/x/oauth2 v0.33.0
golang.org/x/crypto v0.46.0
golang.org/x/oauth2 v0.34.0
golang.org/x/sync v0.19.0
golang.org/x/term v0.37.0
golang.org/x/term v0.38.0
google.golang.org/grpc v1.77.0
gopkg.in/yaml.v2 v2.4.0
oras.land/oras-go/v2 v2.6.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.11 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect
github.com/aws/smithy-go v1.24.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/bubbles v0.21.0 // indirect
github.com/charmbracelet/colorprofile v0.4.0 // indirect
github.com/charmbracelet/colorprofile v0.4.1 // indirect
github.com/charmbracelet/lipgloss v1.1.0 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20251106190538-99ea45596692 // indirect
github.com/charmbracelet/x/ansi v0.11.2 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20251215102126-8518113293e1 // indirect
github.com/charmbracelet/x/ansi v0.11.3 // indirect
github.com/charmbracelet/x/cellbuf v0.0.14 // indirect
github.com/charmbracelet/x/exp/charmtone v0.0.0-20251215102626-e0db08df7383 // indirect
github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383 // indirect
Expand All @@ -72,29 +76,32 @@ require (
github.com/clipperhouse/displaywidth v0.6.2 // indirect
github.com/clipperhouse/stringish v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.6.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jwalton/go-supportscolor v1.2.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.1.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.1.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/mango v0.2.0 // indirect
Expand All @@ -110,10 +117,17 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/net v0.47.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect
go.opentelemetry.io/otel v1.39.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.39.0 // indirect
go.opentelemetry.io/otel/trace v1.39.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/protobuf v1.36.10 // indirect
golang.org/x/time v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading