From 1c916688ea42aba9189954f0c5d5484d6750d290 Mon Sep 17 00:00:00 2001 From: phani Date: Fri, 5 Sep 2025 16:18:25 -0400 Subject: [PATCH 1/6] Pagination application to deploy history and app history --- cmd/app.go | 50 +++++++++++++++++++++++--------- cmd/deploy.go | 21 ++++++++++---- go.mod | 2 ++ go.sum | 4 +-- scripts/go-mod-replace-kernel.sh | 8 ++--- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/cmd/app.go b/cmd/app.go index c7f484b..b2f5ab5 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -39,6 +39,9 @@ func init() { // Add optional filters for list appListCmd.Flags().String("name", "", "Filter by application name") appListCmd.Flags().String("version", "", "Filter by version label") + + // Limit rows returned for app history (0 = all) + appHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") } func runAppList(cmd *cobra.Command, args []string) error { @@ -109,6 +112,7 @@ func runAppList(cmd *cobra.Command, args []string) error { func runAppHistory(cmd *cobra.Command, args []string) error { client := getKernelClient(cmd) appName := args[0] + lim, _ := cmd.Flags().GetInt("limit") pterm.Debug.Printf("Fetching deployment history for app '%s'...\n", appName) @@ -117,13 +121,13 @@ func runAppHistory(cmd *cobra.Command, args []string) error { params.AppName = kernel.Opt(appName) } - deployments, err := client.Deployments.List(cmd.Context(), params) + page, err := client.Deployments.List(cmd.Context(), params) if err != nil { pterm.Error.Printf("Failed to list deployments: %v\n", err) return nil } - if deployments == nil || len(*deployments) == 0 { + if page == nil || len(page.Items) == 0 { pterm.Info.Println("No deployments found for this application") return nil } @@ -132,18 +136,36 @@ func runAppHistory(cmd *cobra.Command, args []string) error { {"Deployment ID", "Created At", "Region", "Status", "Entrypoint", "Reason"}, } - for _, dep := range *deployments { - created := dep.CreatedAt.Format(time.RFC3339) - status := string(dep.Status) - - tableData = append(tableData, []string{ - dep.ID, - created, - string(dep.Region), - status, - dep.EntrypointRelPath, - dep.StatusReason, - }) + rows := 0 + stop := false + for page != nil && !stop { + for _, dep := range page.Items { + created := dep.CreatedAt.Format(time.RFC3339) + status := string(dep.Status) + + tableData = append(tableData, []string{ + dep.ID, + created, + string(dep.Region), + status, + dep.EntrypointRelPath, + dep.StatusReason, + }) + + rows++ + if lim > 0 && rows >= lim { + stop = true + break + } + } + if stop { + break + } + page, err = page.GetNextPage() + if err != nil { + pterm.Error.Printf("Failed to fetch next page: %v\n", err) + break + } } printTableNoPad(tableData, true) diff --git a/cmd/deploy.go b/cmd/deploy.go index 3b26e3a..7f51b85 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -49,6 +49,7 @@ func init() { deployCmd.AddCommand(deployLogsCmd) deployHistoryCmd.Flags().Bool("all", false, "Show deployment history for all applications") + deployHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") deployCmd.AddCommand(deployHistoryCmd) } @@ -259,6 +260,7 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { client := getKernelClient(cmd) all, _ := cmd.Flags().GetBool("all") + lim, _ := cmd.Flags().GetInt("limit") var appNames []string if len(args) == 1 { @@ -288,16 +290,15 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { return nil } + rows := 0 table := pterm.TableData{{"Deployment ID", "Created At", "Region", "Status", "Entrypoint", "Reason"}} +AppsLoop: for _, appName := range appNames { params := kernel.DeploymentListParams{AppName: kernel.Opt(appName)} pterm.Debug.Printf("Listing deployments for app '%s'...\n", appName) - deployments, err := client.Deployments.List(cmd.Context(), params) - if err != nil { - pterm.Error.Printf("Failed to list deployments for '%s': %v\n", appName, err) - continue - } - for _, dep := range *deployments { + iter := client.Deployments.ListAutoPaging(cmd.Context(), params) + for iter.Next() { + dep := iter.Current() created := dep.CreatedAt.Format(time.RFC3339) status := string(dep.Status) table = append(table, []string{ @@ -308,6 +309,14 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { dep.EntrypointRelPath, dep.StatusReason, }) + rows++ + if lim > 0 && rows >= lim { + break AppsLoop + } + } + if iter.Err() != nil { + pterm.Error.Printf("Failed to list deployments for '%s': %v\n", appName, iter.Err()) + continue } } if len(table) == 1 { diff --git a/go.mod b/go.mod index cf07c5f..12a46d8 100644 --- a/go.mod +++ b/go.mod @@ -58,3 +58,5 @@ require ( golang.org/x/text v0.24.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/onkernel/kernel-go-sdk => github.com/onkernel/kernel-go-sdk v0.0.0-20250905180042-8cd5228e682b diff --git a/go.sum b/go.sum index a713339..0f56152 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/muesli/mango-pflag v0.1.0 h1:UADqbYgpUyRoBja3g6LUL+3LErjpsOwaC9ywvBWe github.com/muesli/mango-pflag v0.1.0/go.mod h1:YEQomTxaCUp8PrbhFh10UfbhbQrM/xJ4i2PB8VTLLW0= github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8= github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig= -github.com/onkernel/kernel-go-sdk v0.10.1-0.20250827184402-40919678c68e h1:5z9iNVA+zyzJZMRn4UGJkhP/ibPZr+/9pxoUK9KqgKk= -github.com/onkernel/kernel-go-sdk v0.10.1-0.20250827184402-40919678c68e/go.mod h1:q7wsAf+yjpY+w8jbAMciWCtCM0ZUxiw/5o2MSPTZS9E= +github.com/onkernel/kernel-go-sdk v0.0.0-20250905180042-8cd5228e682b h1:Nz8Zfkns0AcuujajJlltOrhs2SxnYoWjMCHkMbcC49g= +github.com/onkernel/kernel-go-sdk v0.0.0-20250905180042-8cd5228e682b/go.mod h1:q7wsAf+yjpY+w8jbAMciWCtCM0ZUxiw/5o2MSPTZS9E= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/scripts/go-mod-replace-kernel.sh b/scripts/go-mod-replace-kernel.sh index 7a0adfe..9657b11 100755 --- a/scripts/go-mod-replace-kernel.sh +++ b/scripts/go-mod-replace-kernel.sh @@ -28,9 +28,9 @@ ref="$1" commit="" tmp_dir="/tmp/kernel-go" -# Clone the stainless-sdks/kernel-go repo at the provided commit (shallow clone for speed) +# Clone the onkernel/kernel-go-sdk repo at the provided commit (shallow clone for speed) rm -rf "$tmp_dir" -git clone --filter=blob:none --quiet git@github.com:stainless-sdks/kernel-go "$tmp_dir" +git clone --filter=blob:none --quiet git@github.com:onkernel/kernel-go-sdk.git "$tmp_dir" # Determine the commit hash corresponding to the provided ref (commit hash or branch name) pushd "$tmp_dir" >/dev/null @@ -63,8 +63,8 @@ fi # Remove any existing replace directive for the SDK (ignore error if it doesn't exist) # Then add the new replace directive pointing at the desired commit go mod edit -dropreplace=github.com/onkernel/kernel-go-sdk 2>/dev/null || true -go mod edit -replace=github.com/onkernel/kernel-go-sdk=github.com/stainless-sdks/kernel-go@"$gomod_version" +go mod edit -replace=github.com/onkernel/kernel-go-sdk=github.com/onkernel/kernel-go-sdk@"$gomod_version" go mod tidy -echo "go.mod updated to use github.com/stainless-sdks/kernel-go @ $gomod_version" +echo "go.mod updated to use github.com/onkernel/kernel-go-sdk @ $gomod_version" From 7997b8c18a5a08c94e8878b41013f9c9bc20918d Mon Sep 17 00:00:00 2001 From: phani Date: Mon, 8 Sep 2025 15:50:23 -0400 Subject: [PATCH 2/6] pr bugs fixed --- README.md | 4 ++++ cmd/app.go | 10 +++++++++ cmd/deploy.go | 60 +++++++++++++++++++++++++++++++-------------------- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 1387731..7739083 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,8 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com). - `kernel deploy history [app_name]` - Show deployment history - `--all` - Show deployment history for all applications + - `--limit ` - Max rows to return (default: 100; 0 = all) + - `--offset ` - Number of rows to skip from the start ### App Management @@ -133,6 +135,8 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com). - `--version ` - Filter by version - `kernel app history ` - Show deployment history for an app + - `--limit ` - Max rows to return (default: 100; 0 = all) + - `--offset ` - Number of rows to skip from the start ### Logs diff --git a/cmd/app.go b/cmd/app.go index b2f5ab5..6da9c0a 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -42,6 +42,7 @@ func init() { // Limit rows returned for app history (0 = all) appHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") + appHistoryCmd.Flags().Int("offset", 0, "Number of rows to skip from the start") } func runAppList(cmd *cobra.Command, args []string) error { @@ -113,6 +114,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error { client := getKernelClient(cmd) appName := args[0] lim, _ := cmd.Flags().GetInt("limit") + offset, _ := cmd.Flags().GetInt("offset") pterm.Debug.Printf("Fetching deployment history for app '%s'...\n", appName) @@ -137,9 +139,16 @@ func runAppHistory(cmd *cobra.Command, args []string) error { } rows := 0 + seen := 0 stop := false for page != nil && !stop { for _, dep := range page.Items { + // apply offset before collecting + if offset > 0 && seen < offset { + seen++ + continue + } + created := dep.CreatedAt.Format(time.RFC3339) status := string(dep.Status) @@ -153,6 +162,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error { }) rows++ + seen++ if lim > 0 && rows >= lim { stop = true break diff --git a/cmd/deploy.go b/cmd/deploy.go index 7f51b85..85cee1c 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -50,6 +50,7 @@ func init() { deployHistoryCmd.Flags().Bool("all", false, "Show deployment history for all applications") deployHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") + deployHistoryCmd.Flags().Int("offset", 0, "Number of rows to skip from the start") deployCmd.AddCommand(deployHistoryCmd) } @@ -261,6 +262,7 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { all, _ := cmd.Flags().GetBool("all") lim, _ := cmd.Flags().GetInt("limit") + offset, _ := cmd.Flags().GetInt("offset") var appNames []string if len(args) == 1 { @@ -275,13 +277,13 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { appNames = append(appNames, a.AppName) } // de-duplicate app names - seen := map[string]struct{}{} + seenApps := map[string]struct{}{} uniq := make([]string, 0, len(appNames)) for _, n := range appNames { - if _, ok := seen[n]; ok { + if _, ok := seenApps[n]; ok { continue } - seen[n] = struct{}{} + seenApps[n] = struct{}{} uniq = append(uniq, n) } appNames = uniq @@ -291,33 +293,45 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { } rows := 0 + seen := 0 table := pterm.TableData{{"Deployment ID", "Created At", "Region", "Status", "Entrypoint", "Reason"}} AppsLoop: for _, appName := range appNames { params := kernel.DeploymentListParams{AppName: kernel.Opt(appName)} pterm.Debug.Printf("Listing deployments for app '%s'...\n", appName) - iter := client.Deployments.ListAutoPaging(cmd.Context(), params) - for iter.Next() { - dep := iter.Current() - created := dep.CreatedAt.Format(time.RFC3339) - status := string(dep.Status) - table = append(table, []string{ - dep.ID, - created, - string(dep.Region), - status, - dep.EntrypointRelPath, - dep.StatusReason, - }) - rows++ - if lim > 0 && rows >= lim { - break AppsLoop - } - } - if iter.Err() != nil { - pterm.Error.Printf("Failed to list deployments for '%s': %v\n", appName, iter.Err()) + page, err := client.Deployments.List(cmd.Context(), params) + if err != nil { + pterm.Error.Printf("Failed to list deployments for '%s': %v\n", appName, err) continue } + for page != nil { + for _, dep := range page.Items { + if offset > 0 && seen < offset { + seen++ + continue + } + created := dep.CreatedAt.Format(time.RFC3339) + status := string(dep.Status) + table = append(table, []string{ + dep.ID, + created, + string(dep.Region), + status, + dep.EntrypointRelPath, + dep.StatusReason, + }) + rows++ + seen++ + if lim > 0 && rows >= lim { + break AppsLoop + } + } + page, err = page.GetNextPage() + if err != nil { + pterm.Error.Printf("Failed to fetch next page for '%s': %v\n", appName, err) + break + } + } } if len(table) == 1 { pterm.Info.Println("No deployments found") From 8f7bb90e90dac188bf3bee1c2d404f35f2bc2f8c Mon Sep 17 00:00:00 2001 From: phani Date: Tue, 9 Sep 2025 11:49:42 -0400 Subject: [PATCH 3/6] pr review changes applied --- README.md | 6 ++---- cmd/app.go | 12 +----------- cmd/deploy.go | 10 +--------- go.mod | 4 +--- 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 7739083..35b951e 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com). - `kernel deploy history [app_name]` - Show deployment history - `--all` - Show deployment history for all applications - - `--limit ` - Max rows to return (default: 100; 0 = all) - - `--offset ` - Number of rows to skip from the start + - `--limit ` - Max deployments to return (default: 100; 0 = all) ### App Management @@ -135,8 +134,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com). - `--version ` - Filter by version - `kernel app history ` - Show deployment history for an app - - `--limit ` - Max rows to return (default: 100; 0 = all) - - `--offset ` - Number of rows to skip from the start + - `--limit ` - Max deployments to return (default: 100; 0 = all) ### Logs diff --git a/cmd/app.go b/cmd/app.go index 333eeeb..30b7a80 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -41,8 +41,7 @@ func init() { appListCmd.Flags().String("version", "", "Filter by version label") // Limit rows returned for app history (0 = all) - appHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") - appHistoryCmd.Flags().Int("offset", 0, "Number of rows to skip from the start") + appHistoryCmd.Flags().Int("limit", 100, "Max deployments to return (default 100)") } func runAppList(cmd *cobra.Command, args []string) error { @@ -114,7 +113,6 @@ func runAppHistory(cmd *cobra.Command, args []string) error { client := getKernelClient(cmd) appName := args[0] lim, _ := cmd.Flags().GetInt("limit") - offset, _ := cmd.Flags().GetInt("offset") pterm.Debug.Printf("Fetching deployment history for app '%s'...\n", appName) @@ -139,14 +137,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error { } rows := 0 - seen := 0 for _, dep := range *deployments { - // apply offset before collecting - if offset > 0 && seen < offset { - seen++ - continue - } - created := util.FormatLocal(dep.CreatedAt) status := string(dep.Status) @@ -160,7 +151,6 @@ func runAppHistory(cmd *cobra.Command, args []string) error { }) rows++ - seen++ if lim > 0 && rows >= lim { break } diff --git a/cmd/deploy.go b/cmd/deploy.go index 9e43173..d20e681 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -49,8 +49,7 @@ func init() { deployCmd.AddCommand(deployLogsCmd) deployHistoryCmd.Flags().Bool("all", false, "Show deployment history for all applications") - deployHistoryCmd.Flags().Int("limit", 100, "Max rows to return (default 100)") - deployHistoryCmd.Flags().Int("offset", 0, "Number of rows to skip from the start") + deployHistoryCmd.Flags().Int("limit", 100, "Max deployments to return (default 100)") deployCmd.AddCommand(deployHistoryCmd) } @@ -262,7 +261,6 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { all, _ := cmd.Flags().GetBool("all") lim, _ := cmd.Flags().GetInt("limit") - offset, _ := cmd.Flags().GetInt("offset") var appNames []string if len(args) == 1 { @@ -293,7 +291,6 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { } rows := 0 - seen := 0 table := pterm.TableData{{"Deployment ID", "Created At", "Region", "Status", "Entrypoint", "Reason"}} AppsLoop: for _, appName := range appNames { @@ -305,10 +302,6 @@ AppsLoop: continue } for _, dep := range *deployments { - if offset > 0 && seen < offset { - seen++ - continue - } created := dep.CreatedAt.Format(time.RFC3339) status := string(dep.Status) table = append(table, []string{ @@ -320,7 +313,6 @@ AppsLoop: dep.StatusReason, }) rows++ - seen++ if lim > 0 && rows >= lim { break AppsLoop } diff --git a/go.mod b/go.mod index 80884fd..3032472 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/charmbracelet/fang v0.2.0 github.com/golang-jwt/jwt/v5 v5.2.2 github.com/joho/godotenv v1.5.1 - github.com/onkernel/kernel-go-sdk v0.11.0 + github.com/onkernel/kernel-go-sdk v0.11.1 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/pterm/pterm v0.12.80 github.com/samber/lo v1.51.0 @@ -58,5 +58,3 @@ require ( golang.org/x/text v0.24.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/onkernel/kernel-go-sdk => github.com/onkernel/kernel-go-sdk v0.11.0 From 60db5d7bdc9464e624fb54bb499947e9babb13cb Mon Sep 17 00:00:00 2001 From: phani Date: Tue, 9 Sep 2025 12:11:57 -0400 Subject: [PATCH 4/6] deployment.items fix --- cmd/app.go | 4 ++-- cmd/deploy.go | 4 ++-- go.sum | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/app.go b/cmd/app.go index 30b7a80..7c4dba8 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -127,7 +127,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error { return nil } - if deployments == nil || len(*deployments) == 0 { + if deployments == nil || len(deployments.Items) == 0 { pterm.Info.Println("No deployments found for this application") return nil } @@ -137,7 +137,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error { } rows := 0 - for _, dep := range *deployments { + for _, dep := range deployments.Items { created := util.FormatLocal(dep.CreatedAt) status := string(dep.Status) diff --git a/cmd/deploy.go b/cmd/deploy.go index d20e681..5ab21be 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -301,8 +301,8 @@ AppsLoop: pterm.Error.Printf("Failed to list deployments for '%s': %v\n", appName, err) continue } - for _, dep := range *deployments { - created := dep.CreatedAt.Format(time.RFC3339) + for _, dep := range deployments.Items { + created := util.FormatLocal(dep.CreatedAt) status := string(dep.Status) table = append(table, []string{ dep.ID, diff --git a/go.sum b/go.sum index 0e9577d..f9360bc 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,8 @@ github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8= github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig= github.com/onkernel/kernel-go-sdk v0.11.0 h1:7KUKHiz5t4jdnNCwA8NM1dTtEYdk/AV/RIe8T/HjJwg= github.com/onkernel/kernel-go-sdk v0.11.0/go.mod h1:q7wsAf+yjpY+w8jbAMciWCtCM0ZUxiw/5o2MSPTZS9E= +github.com/onkernel/kernel-go-sdk v0.11.1 h1:gTxhXtsXrJcrM7KEobEVXa8mPPtRFMlxQwNqkyoCrDI= +github.com/onkernel/kernel-go-sdk v0.11.1/go.mod h1:q7wsAf+yjpY+w8jbAMciWCtCM0ZUxiw/5o2MSPTZS9E= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From d5acca375a88e427ef6afe6548494c9984297b43 Mon Sep 17 00:00:00 2001 From: phani Date: Tue, 9 Sep 2025 14:54:11 -0400 Subject: [PATCH 5/6] --all flag removed and readme.md updated --- README.md | 1 - cmd/deploy.go | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 35b951e..46b6d5d 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com). - `--with-timestamps`, `-t` - Include timestamps in each log line - `kernel deploy history [app_name]` - Show deployment history - - `--all` - Show deployment history for all applications - `--limit ` - Max deployments to return (default: 100; 0 = all) ### App Management diff --git a/cmd/deploy.go b/cmd/deploy.go index 5ab21be..fae6b68 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -48,7 +48,6 @@ func init() { deployLogsCmd.Flags().BoolP("with-timestamps", "t", false, "Include timestamps in each log line") deployCmd.AddCommand(deployLogsCmd) - deployHistoryCmd.Flags().Bool("all", false, "Show deployment history for all applications") deployHistoryCmd.Flags().Int("limit", 100, "Max deployments to return (default 100)") deployCmd.AddCommand(deployHistoryCmd) } @@ -259,13 +258,12 @@ func runDeployLogs(cmd *cobra.Command, args []string) error { func runDeployHistory(cmd *cobra.Command, args []string) error { client := getKernelClient(cmd) - all, _ := cmd.Flags().GetBool("all") lim, _ := cmd.Flags().GetInt("limit") var appNames []string if len(args) == 1 { appNames = []string{args[0]} - } else if all { + } else { apps, err := client.Apps.List(cmd.Context(), kernel.AppListParams{}) if err != nil { pterm.Error.Printf("Failed to list applications: %v\n", err) @@ -285,9 +283,6 @@ func runDeployHistory(cmd *cobra.Command, args []string) error { uniq = append(uniq, n) } appNames = uniq - } else { - pterm.Error.Println("Either provide an app name or use --all") - return nil } rows := 0 From 8f50b60e2bf33673c26c761da142d2a6f2574fa4 Mon Sep 17 00:00:00 2001 From: phani Date: Wed, 10 Sep 2025 11:04:29 -0400 Subject: [PATCH 6/6] new line fix --- scripts/go-mod-replace-kernel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/go-mod-replace-kernel.sh b/scripts/go-mod-replace-kernel.sh index d9f33a0..c671cdd 100755 --- a/scripts/go-mod-replace-kernel.sh +++ b/scripts/go-mod-replace-kernel.sh @@ -66,4 +66,4 @@ go mod edit -dropreplace=github.com/onkernel/kernel-go-sdk 2>/dev/null || true go mod edit -replace=github.com/onkernel/kernel-go-sdk=github.com/stainless-sdks/kernel-go@"$gomod_version" go mod tidy -echo "go.mod updated to use github.com/stainless-sdks/kernel-go @ $gomod_version" \ No newline at end of file +echo "go.mod updated to use github.com/stainless-sdks/kernel-go @ $gomod_version"