Repository: google/kf
Pull request #706 (2019-09-23 20:10:33)

Consolidate internal utils
<!-- Include the issue number below -->
Follow-up for https://github.com/google/kf/pull/684

## Proposed Changes

* Consolidate internal utils into pkg/kf/internal/utils

## Release Notes

<!-- kf follows the Keep A Changelog standard for release notes.

https://keepachangelog.com/en/1.0.0/

Changelog entries should be one per line and start with one of the following
words:

`Added` for new features.
`Changed` for changes in existing functionality.
`Deprecated` for soon-to-be removed features.
`Removed` for now removed features.
`Fixed` for any bug fixes.
`Security` in case of vulnerabilities.

If one of the changes is breaking include that as a second word e.g.

  Removed BREAKING support for manifests v1
-->

```release-note

```



Patch:
diff --git a/pkg/kf/commands/apps/app.go b/pkg/kf/commands/apps/app.go
index 6e4cc8e..593c7df 100644
--- a/pkg/kf/commands/apps/app.go
+++ b/pkg/kf/commands/apps/app.go
@@ -23,8 +23,8 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 	"k8s.io/cli-runtime/pkg/genericclioptions"
 )
diff --git a/pkg/kf/commands/apps/apps.go b/pkg/kf/commands/apps/apps.go
index ac963e5..68e130c 100644
--- a/pkg/kf/commands/apps/apps.go
+++ b/pkg/kf/commands/apps/apps.go
@@ -22,8 +22,8 @@ import (
 
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 	corev1 "k8s.io/api/core/v1"
 )
diff --git a/pkg/kf/commands/apps/delete.go b/pkg/kf/commands/apps/delete.go
index 930428b..fa636d6 100644
--- a/pkg/kf/commands/apps/delete.go
+++ b/pkg/kf/commands/apps/delete.go
@@ -20,7 +20,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/env.go b/pkg/kf/commands/apps/env.go
index 0303f10..d39e2cb 100644
--- a/pkg/kf/commands/apps/env.go
+++ b/pkg/kf/commands/apps/env.go
@@ -18,8 +18,8 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/logs.go b/pkg/kf/commands/apps/logs.go
index 709dbfa..c11a14a 100644
--- a/pkg/kf/commands/apps/logs.go
+++ b/pkg/kf/commands/apps/logs.go
@@ -20,8 +20,7 @@ import (
 
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
-	kfi "github.com/google/kf/pkg/kf/internal/kf"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/logs"
 	"github.com/spf13/cobra"
 )
@@ -65,7 +64,7 @@ func NewLogsCommand(p *config.KfParams, tailer logs.Tailer) *cobra.Command {
 				logs.WithTailNumberLines(numberLines),
 				logs.WithTailFollow(shouldFollow),
 			); err != nil {
-				cmd.SilenceUsage = !kfi.ConfigError(err)
+				cmd.SilenceUsage = !utils.ConfigError(err)
 				return fmt.Errorf("failed to tail logs: %s", err)
 			}
 
diff --git a/pkg/kf/commands/apps/proxy.go b/pkg/kf/commands/apps/proxy.go
index b0b01c8..f15e149 100644
--- a/pkg/kf/commands/apps/proxy.go
+++ b/pkg/kf/commands/apps/proxy.go
@@ -22,7 +22,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/istio"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/apps/push.go b/pkg/kf/commands/apps/push.go
index aa70209..f98a05b 100644
--- a/pkg/kf/commands/apps/push.go
+++ b/pkg/kf/commands/apps/push.go
@@ -28,8 +28,7 @@ import (
 	"github.com/google/kf/pkg/internal/envutil"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
-	kfi "github.com/google/kf/pkg/kf/internal/kf"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/manifest"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/spf13/cobra"
@@ -366,7 +365,7 @@ func NewPushCommand(
 
 				err = pusher.Push(app.Name, pushOpts...)
 
-				cmd.SilenceUsage = !kfi.ConfigError(err)
+				cmd.SilenceUsage = !utils.ConfigError(err)
 
 				if err != nil {
 					return err
diff --git a/pkg/kf/commands/apps/restage.go b/pkg/kf/commands/apps/restage.go
index 9f63f43..1ed2b6b 100644
--- a/pkg/kf/commands/apps/restage.go
+++ b/pkg/kf/commands/apps/restage.go
@@ -20,7 +20,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/restart.go b/pkg/kf/commands/apps/restart.go
index ba48cfb..efa12fc 100644
--- a/pkg/kf/commands/apps/restart.go
+++ b/pkg/kf/commands/apps/restart.go
@@ -20,7 +20,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/scale.go b/pkg/kf/commands/apps/scale.go
index 25fdb86..b341bb7 100644
--- a/pkg/kf/commands/apps/scale.go
+++ b/pkg/kf/commands/apps/scale.go
@@ -22,8 +22,8 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/set_env.go b/pkg/kf/commands/apps/set_env.go
index 59153ba..5ef6d47 100644
--- a/pkg/kf/commands/apps/set_env.go
+++ b/pkg/kf/commands/apps/set_env.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 	corev1 "k8s.io/api/core/v1"
 )
diff --git a/pkg/kf/commands/apps/start.go b/pkg/kf/commands/apps/start.go
index 9dca7c9..6a8f179 100644
--- a/pkg/kf/commands/apps/start.go
+++ b/pkg/kf/commands/apps/start.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/stop.go b/pkg/kf/commands/apps/stop.go
index 839c78c..2fd55e5 100644
--- a/pkg/kf/commands/apps/stop.go
+++ b/pkg/kf/commands/apps/stop.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/apps/unset_env.go b/pkg/kf/commands/apps/unset_env.go
index af3871d..5474887 100644
--- a/pkg/kf/commands/apps/unset_env.go
+++ b/pkg/kf/commands/apps/unset_env.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/buildpacks/buildpacks.go b/pkg/kf/commands/buildpacks/buildpacks.go
index 2760df9..510e32f 100644
--- a/pkg/kf/commands/buildpacks/buildpacks.go
+++ b/pkg/kf/commands/buildpacks/buildpacks.go
@@ -20,9 +20,8 @@ import (
 
 	"github.com/google/kf/pkg/kf/buildpacks"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
-	"github.com/google/kf/pkg/kf/internal/kf"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
@@ -53,7 +52,7 @@ func NewBuildpacksCommand(p *config.KfParams, l buildpacks.Client) *cobra.Comman
 
 			bps, err := l.List(space.Spec.BuildpackBuild.BuilderImage)
 			if err != nil {
-				cmd.SilenceUsage = !kf.ConfigError(err)
+				cmd.SilenceUsage = !utils.ConfigError(err)
 				return err
 			}
 
diff --git a/pkg/kf/commands/buildpacks/stacks.go b/pkg/kf/commands/buildpacks/stacks.go
index ade7205..96d9d1d 100644
--- a/pkg/kf/commands/buildpacks/stacks.go
+++ b/pkg/kf/commands/buildpacks/stacks.go
@@ -20,9 +20,8 @@ import (
 
 	"github.com/google/kf/pkg/kf/buildpacks"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
-	"github.com/google/kf/pkg/kf/internal/kf"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
@@ -53,7 +52,7 @@ func NewStacksCommand(p *config.KfParams, l buildpacks.Client) *cobra.Command {
 
 			stacks, err := l.Stacks(space.Spec.BuildpackBuild.BuilderImage)
 			if err != nil {
-				cmd.SilenceUsage = !kf.ConfigError(err)
+				cmd.SilenceUsage = !utils.ConfigError(err)
 				return err
 			}
 
diff --git a/pkg/kf/commands/builds/list.go b/pkg/kf/commands/builds/list.go
index 6f05080..c063f17 100644
--- a/pkg/kf/commands/builds/list.go
+++ b/pkg/kf/commands/builds/list.go
@@ -20,8 +20,8 @@ import (
 
 	"github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/sources"
 	"github.com/spf13/cobra"
 	"k8s.io/apimachinery/pkg/api/meta/table"
diff --git a/pkg/kf/commands/builds/logs.go b/pkg/kf/commands/builds/logs.go
index 0c70a32..493c6d8 100644
--- a/pkg/kf/commands/builds/logs.go
+++ b/pkg/kf/commands/builds/logs.go
@@ -19,7 +19,7 @@ import (
 
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/sources"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/routes/create_route.go b/pkg/kf/commands/routes/create_route.go
index 8eb5a1f..cea4954 100644
--- a/pkg/kf/commands/routes/create_route.go
+++ b/pkg/kf/commands/routes/create_route.go
@@ -21,7 +21,7 @@ import (
 
 	"github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/routeclaims"
 	"github.com/spf13/cobra"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/kf/commands/routes/delete_route.go b/pkg/kf/commands/routes/delete_route.go
index 7014657..0937375 100644
--- a/pkg/kf/commands/routes/delete_route.go
+++ b/pkg/kf/commands/routes/delete_route.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/kf/algorithms"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/routeclaims"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/routes/map_route.go b/pkg/kf/commands/routes/map_route.go
index a0329ec..2278da2 100644
--- a/pkg/kf/commands/routes/map_route.go
+++ b/pkg/kf/commands/routes/map_route.go
@@ -21,7 +21,7 @@ import (
 	"github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/routes/proxy_route.go b/pkg/kf/commands/routes/proxy_route.go
index cca9679..e66e77e 100644
--- a/pkg/kf/commands/routes/proxy_route.go
+++ b/pkg/kf/commands/routes/proxy_route.go
@@ -21,7 +21,7 @@ import (
 
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/istio"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/routes/routes.go b/pkg/kf/commands/routes/routes.go
index 9c674d9..98e33ab 100644
--- a/pkg/kf/commands/routes/routes.go
+++ b/pkg/kf/commands/routes/routes.go
@@ -24,8 +24,8 @@ import (
 	"github.com/google/kf/pkg/kf/algorithms"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/routeclaims"
 	"github.com/google/kf/pkg/kf/routes"
 	"github.com/spf13/cobra"
diff --git a/pkg/kf/commands/routes/unmap_route.go b/pkg/kf/commands/routes/unmap_route.go
index 24a837c..bf63c09 100644
--- a/pkg/kf/commands/routes/unmap_route.go
+++ b/pkg/kf/commands/routes/unmap_route.go
@@ -23,7 +23,7 @@ import (
 	"github.com/google/kf/pkg/kf/algorithms"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 )
 
diff --git a/pkg/kf/commands/service-bindings/bind-service.go b/pkg/kf/commands/service-bindings/bind-service.go
index a87d551..432f6d9 100644
--- a/pkg/kf/commands/service-bindings/bind-service.go
+++ b/pkg/kf/commands/service-bindings/bind-service.go
@@ -19,7 +19,7 @@ import (
 	"fmt"
 
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/spf13/cobra"
diff --git a/pkg/kf/commands/service-bindings/bindings.go b/pkg/kf/commands/service-bindings/bindings.go
index 614f4dc..5b2e5e6 100644
--- a/pkg/kf/commands/service-bindings/bindings.go
+++ b/pkg/kf/commands/service-bindings/bindings.go
@@ -20,8 +20,8 @@ import (
 
 	kfv1alpha1 "github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/service-bindings/unbind-service.go b/pkg/kf/commands/service-bindings/unbind-service.go
index 6312e44..d4fb3d9 100644
--- a/pkg/kf/commands/service-bindings/unbind-service.go
+++ b/pkg/kf/commands/service-bindings/unbind-service.go
@@ -18,7 +18,7 @@ import (
 	"fmt"
 
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/service-bindings/vcap_services.go b/pkg/kf/commands/service-bindings/vcap_services.go
index 97b3fa4..8a62e69 100644
--- a/pkg/kf/commands/service-bindings/vcap_services.go
+++ b/pkg/kf/commands/service-bindings/vcap_services.go
@@ -19,7 +19,7 @@ import (
 	"fmt"
 
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/client-go/kubernetes"
diff --git a/pkg/kf/commands/service-brokers/create-service-broker.go b/pkg/kf/commands/service-brokers/create-service-broker.go
index 7054604..f936a67 100644
--- a/pkg/kf/commands/service-brokers/create-service-broker.go
+++ b/pkg/kf/commands/service-brokers/create-service-broker.go
@@ -19,7 +19,7 @@ import (
 
 	servicecatalogclient "github.com/google/kf/pkg/client/servicecatalog/clientset/versioned"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicecatalogv1beta1 "github.com/poy/service-catalog/pkg/apis/servicecatalog/v1beta1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
diff --git a/pkg/kf/commands/service-brokers/delete-service-broker.go b/pkg/kf/commands/service-brokers/delete-service-broker.go
index 103f6c4..e716c44 100644
--- a/pkg/kf/commands/service-brokers/delete-service-broker.go
+++ b/pkg/kf/commands/service-brokers/delete-service-broker.go
@@ -21,7 +21,7 @@ import (
 	servicecatalogclient "github.com/google/kf/pkg/client/servicecatalog/clientset/versioned"
 	"github.com/google/kf/pkg/kf/commands/config"
 	installutil "github.com/google/kf/pkg/kf/commands/install/util"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/spf13/cobra"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
diff --git a/pkg/kf/commands/services/create-service.go b/pkg/kf/commands/services/create-service.go
index 9e903b1..035092a 100644
--- a/pkg/kf/commands/services/create-service.go
+++ b/pkg/kf/commands/services/create-service.go
@@ -20,8 +20,8 @@ import (
 
 	servicecatalogclient "github.com/google/kf/pkg/client/servicecatalog/clientset/versioned"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	servicecatalogv1beta1 "github.com/poy/service-catalog/pkg/apis/servicecatalog/v1beta1"
 	"github.com/spf13/cobra"
diff --git a/pkg/kf/commands/services/delete-service.go b/pkg/kf/commands/services/delete-service.go
index 8762ee1..150ff96 100644
--- a/pkg/kf/commands/services/delete-service.go
+++ b/pkg/kf/commands/services/delete-service.go
@@ -18,7 +18,7 @@ import (
 	"fmt"
 
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/services/marketplace.go b/pkg/kf/commands/services/marketplace.go
index a2b23c7..cb20a24 100644
--- a/pkg/kf/commands/services/marketplace.go
+++ b/pkg/kf/commands/services/marketplace.go
@@ -19,8 +19,8 @@ import (
 	"io"
 
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	servicecatalog "github.com/poy/service-catalog/pkg/svcat/service-catalog"
 	"github.com/spf13/cobra"
diff --git a/pkg/kf/commands/services/service.go b/pkg/kf/commands/services/service.go
index 18d2191..2ca4670 100644
--- a/pkg/kf/commands/services/service.go
+++ b/pkg/kf/commands/services/service.go
@@ -16,8 +16,8 @@ package services
 
 import (
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/services/services.go b/pkg/kf/commands/services/services.go
index e2251c4..ba98e59 100644
--- a/pkg/kf/commands/services/services.go
+++ b/pkg/kf/commands/services/services.go
@@ -22,8 +22,8 @@ import (
 	"github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
 	"github.com/google/kf/pkg/kf/describe"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/commands/spaces/delete.go b/pkg/kf/commands/spaces/delete.go
index dfa821c..fddaa8a 100644
--- a/pkg/kf/commands/spaces/delete.go
+++ b/pkg/kf/commands/spaces/delete.go
@@ -19,7 +19,7 @@ import (
 
 	"github.com/google/kf/pkg/kf/commands/completion"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/spaces"
 	"github.com/spf13/cobra"
 )
diff --git a/pkg/kf/internal/kf/utils.go b/pkg/kf/internal/kf/utils.go
deleted file mode 100644
index 500cb09..0000000
--- a/pkg/kf/internal/kf/utils.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package kf
-
-// ConfigErr is used to indicate that the returned error is due to a user's
-// invalid configuration.
-type ConfigErr struct {
-	// Reason holds the error message.
-	Reason string
-}
-
-// Error implements error.
-func (e ConfigErr) Error() string {
-	return e.Reason
-}
-
-// ConfigError returns true if the error is due to user error.
-func ConfigError(err error) bool {
-	_, ok := err.(ConfigErr)
-	return ok
-}
diff --git a/pkg/kf/commands/utils/utils.go b/pkg/kf/internal/utils/cli/utils.go
similarity index 92%
rename from pkg/kf/commands/utils/utils.go
rename to pkg/kf/internal/utils/cli/utils.go
index 4a8b8a9..7c60bc3 100644
--- a/pkg/kf/commands/utils/utils.go
+++ b/pkg/kf/internal/utils/cli/utils.go
@@ -41,6 +41,24 @@ const (
 	AsyncLogSuffix = "\n(This is an asynchronous operation. See https://github.com/google/kf/issues/599 for updates on work to support synchronous commands.)\n"
 )
 
+// ConfigErr is used to indicate that the returned error is due to a user's
+// invalid configuration.
+type ConfigErr struct {
+	// Reason holds the error message.
+	Reason string
+}
+
+// Error implements error.
+func (e ConfigErr) Error() string {
+	return e.Reason
+}
+
+// ConfigError returns true if the error is due to user error.
+func ConfigError(err error) bool {
+	_, ok := err.(ConfigErr)
+	return ok
+}
+
 // KfParams stores everything needed to interact with the user and Knative.
 type KfParams struct {
 	Output    io.Writer


Test patch:
diff --git a/pkg/kf/commands/apps/apps_test.go b/pkg/kf/commands/apps/apps_test.go
index a7d7b08..16792ee 100644
--- a/pkg/kf/commands/apps/apps_test.go
+++ b/pkg/kf/commands/apps/apps_test.go
@@ -24,7 +24,7 @@ import (
 	v1alpha1 "github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/kf/commands/apps/delete_test.go b/pkg/kf/commands/apps/delete_test.go
index 38abad9..953be72 100644
--- a/pkg/kf/commands/apps/delete_test.go
+++ b/pkg/kf/commands/apps/delete_test.go
@@ -23,7 +23,7 @@ import (
 	"github.com/golang/mock/gomock"
 	"github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 )
 
 func TestDeleteCommand(t *testing.T) {
diff --git a/pkg/kf/commands/apps/logs_test.go b/pkg/kf/commands/apps/logs_test.go
index b1df86c..5124619 100644
--- a/pkg/kf/commands/apps/logs_test.go
+++ b/pkg/kf/commands/apps/logs_test.go
@@ -22,8 +22,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
-	"github.com/google/kf/pkg/kf/internal/kf"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/logs"
 	"github.com/google/kf/pkg/kf/logs/fake"
 	"github.com/google/kf/pkg/kf/testutil"
@@ -69,7 +68,7 @@ func TestLogsCommand(t *testing.T) {
 			Setup: func(t *testing.T, fake *fake.FakeTailer) {
 				fake.EXPECT().
 					Tail(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
-					Return(kf.ConfigErr{Reason: "some-error"})
+					Return(utils.ConfigErr{Reason: "some-error"})
 			},
 			Assert: func(t *testing.T, cmd *cobra.Command, err error) {
 				testutil.AssertEqual(t, "SilenceUsage", false, cmd.SilenceUsage)
diff --git a/pkg/kf/commands/apps/push_test.go b/pkg/kf/commands/apps/push_test.go
index c3f3e63..56efa61 100644
--- a/pkg/kf/commands/apps/push_test.go
+++ b/pkg/kf/commands/apps/push_test.go
@@ -28,7 +28,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	appsfake "github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	svbFake "github.com/google/kf/pkg/kf/service-bindings/fake"
 	"github.com/google/kf/pkg/kf/testutil"
 	"github.com/poy/service-catalog/pkg/apis/servicecatalog/v1beta1"
diff --git a/pkg/kf/commands/apps/set_env_test.go b/pkg/kf/commands/apps/set_env_test.go
index 1d750b9..98f3e36 100644
--- a/pkg/kf/commands/apps/set_env_test.go
+++ b/pkg/kf/commands/apps/set_env_test.go
@@ -25,7 +25,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps"
 	"github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )
 
diff --git a/pkg/kf/commands/apps/unset_env_test.go b/pkg/kf/commands/apps/unset_env_test.go
index 44734e4..0f89f0f 100644
--- a/pkg/kf/commands/apps/unset_env_test.go
+++ b/pkg/kf/commands/apps/unset_env_test.go
@@ -19,7 +19,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 
 	"github.com/golang/mock/gomock"
 	"github.com/google/kf/pkg/internal/envutil"
diff --git a/pkg/kf/commands/buildpacks/buildpacks_test.go b/pkg/kf/commands/buildpacks/buildpacks_test.go
index 9555087..c500e54 100644
--- a/pkg/kf/commands/buildpacks/buildpacks_test.go
+++ b/pkg/kf/commands/buildpacks/buildpacks_test.go
@@ -24,7 +24,7 @@ import (
 	"github.com/google/kf/pkg/kf/buildpacks/fake"
 	cbuildpacks "github.com/google/kf/pkg/kf/commands/buildpacks"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )
 
diff --git a/pkg/kf/commands/buildpacks/stacks_test.go b/pkg/kf/commands/buildpacks/stacks_test.go
index b4ac11a..2d0f2ff 100644
--- a/pkg/kf/commands/buildpacks/stacks_test.go
+++ b/pkg/kf/commands/buildpacks/stacks_test.go
@@ -23,7 +23,7 @@ import (
 	"github.com/google/kf/pkg/kf/buildpacks/fake"
 	cbuildpacks "github.com/google/kf/pkg/kf/commands/buildpacks"
 	"github.com/google/kf/pkg/kf/commands/config"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )
 
diff --git a/pkg/kf/commands/routes/create_route_test.go b/pkg/kf/commands/routes/create_route_test.go
index fd56c66..0545c59 100644
--- a/pkg/kf/commands/routes/create_route_test.go
+++ b/pkg/kf/commands/routes/create_route_test.go
@@ -23,7 +23,7 @@ import (
 	"github.com/google/kf/pkg/apis/kf/v1alpha1"
 	"github.com/google/kf/pkg/kf/commands/config"
 	"github.com/google/kf/pkg/kf/commands/routes"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	routesfake "github.com/google/kf/pkg/kf/routeclaims/fake"
 	"github.com/google/kf/pkg/kf/testutil"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/kf/commands/routes/delete_route_test.go b/pkg/kf/commands/routes/delete_route_test.go
index 74e73a2..01bb97b 100644
--- a/pkg/kf/commands/routes/delete_route_test.go
+++ b/pkg/kf/commands/routes/delete_route_test.go
@@ -25,7 +25,7 @@ import (
 	fakeapp "github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
 	"github.com/google/kf/pkg/kf/commands/routes"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	fakerouteclaims "github.com/google/kf/pkg/kf/routeclaims/fake"
 	"github.com/google/kf/pkg/kf/testutil"
 )
diff --git a/pkg/kf/commands/routes/map_route_test.go b/pkg/kf/commands/routes/map_route_test.go
index fa68fa1..eecc7c2 100644
--- a/pkg/kf/commands/routes/map_route_test.go
+++ b/pkg/kf/commands/routes/map_route_test.go
@@ -25,7 +25,7 @@ import (
 	appsfake "github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
 	"github.com/google/kf/pkg/kf/commands/routes"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )
 
diff --git a/pkg/kf/commands/routes/unmap_route_test.go b/pkg/kf/commands/routes/unmap_route_test.go
index 50f331b..32c92fc 100644
--- a/pkg/kf/commands/routes/unmap_route_test.go
+++ b/pkg/kf/commands/routes/unmap_route_test.go
@@ -25,7 +25,7 @@ import (
 	"github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
 	"github.com/google/kf/pkg/kf/commands/routes"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )
 
diff --git a/pkg/kf/commands/service-bindings/bind-service_test.go b/pkg/kf/commands/service-bindings/bind-service_test.go
index db1012f..a2087cc 100644
--- a/pkg/kf/commands/service-bindings/bind-service_test.go
+++ b/pkg/kf/commands/service-bindings/bind-service_test.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	servicebindingscmd "github.com/google/kf/pkg/kf/commands/service-bindings"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/google/kf/pkg/kf/service-bindings/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/service-bindings/bindings_test.go b/pkg/kf/commands/service-bindings/bindings_test.go
index be8fdf5..ab9e455 100644
--- a/pkg/kf/commands/service-bindings/bindings_test.go
+++ b/pkg/kf/commands/service-bindings/bindings_test.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	servicebindingscmd "github.com/google/kf/pkg/kf/commands/service-bindings"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	servicebindings "github.com/google/kf/pkg/kf/service-bindings"
 	"github.com/google/kf/pkg/kf/service-bindings/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/service-bindings/unbind-service_test.go b/pkg/kf/commands/service-bindings/unbind-service_test.go
index 21627ae..70e5212 100644
--- a/pkg/kf/commands/service-bindings/unbind-service_test.go
+++ b/pkg/kf/commands/service-bindings/unbind-service_test.go
@@ -16,7 +16,7 @@ package servicebindings_test
 
 import (
 	"errors"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"testing"
 
 	"github.com/golang/mock/gomock"
diff --git a/pkg/kf/commands/service-bindings/vcap_services_test.go b/pkg/kf/commands/service-bindings/vcap_services_test.go
index fc95d9e..112fab5 100644
--- a/pkg/kf/commands/service-bindings/vcap_services_test.go
+++ b/pkg/kf/commands/service-bindings/vcap_services_test.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/google/kf/pkg/kf/commands/config"
 	servicebindings "github.com/google/kf/pkg/kf/commands/service-bindings"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 	corev1 "k8s.io/api/core/v1"
 	k8sfake "k8s.io/client-go/kubernetes/fake"
diff --git a/pkg/kf/commands/services/create-service_test.go b/pkg/kf/commands/services/create-service_test.go
index 856c064..5e01b15 100644
--- a/pkg/kf/commands/services/create-service_test.go
+++ b/pkg/kf/commands/services/create-service_test.go
@@ -24,7 +24,7 @@ import (
 	servicecatalogclientfake "github.com/google/kf/pkg/client/servicecatalog/clientset/versioned/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
 	servicescmd "github.com/google/kf/pkg/kf/commands/services"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 	servicecatalogv1beta1 "github.com/poy/service-catalog/pkg/apis/servicecatalog/v1beta1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/kf/commands/services/delete-service_test.go b/pkg/kf/commands/services/delete-service_test.go
index d570e31..65f2ed1 100644
--- a/pkg/kf/commands/services/delete-service_test.go
+++ b/pkg/kf/commands/services/delete-service_test.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	servicescmd "github.com/google/kf/pkg/kf/commands/services"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/google/kf/pkg/kf/services/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/services/marketplace_test.go b/pkg/kf/commands/services/marketplace_test.go
index 79a9dc9..f26b91c 100644
--- a/pkg/kf/commands/services/marketplace_test.go
+++ b/pkg/kf/commands/services/marketplace_test.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	servicescmd "github.com/google/kf/pkg/kf/commands/services"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/google/kf/pkg/kf/services/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/services/service_test.go b/pkg/kf/commands/services/service_test.go
index 5c59c85..0019ede 100644
--- a/pkg/kf/commands/services/service_test.go
+++ b/pkg/kf/commands/services/service_test.go
@@ -20,7 +20,7 @@ import (
 
 	"github.com/golang/mock/gomock"
 	servicescmd "github.com/google/kf/pkg/kf/commands/services"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/google/kf/pkg/kf/services/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/services/services_test.go b/pkg/kf/commands/services/services_test.go
index 59f3760..052e0e6 100644
--- a/pkg/kf/commands/services/services_test.go
+++ b/pkg/kf/commands/services/services_test.go
@@ -23,7 +23,7 @@ import (
 	fakeapps "github.com/google/kf/pkg/kf/apps/fake"
 	"github.com/google/kf/pkg/kf/commands/config"
 	servicescmd "github.com/google/kf/pkg/kf/commands/services"
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/services"
 	"github.com/google/kf/pkg/kf/services/fake"
 	"github.com/google/kf/pkg/kf/testutil"
diff --git a/pkg/kf/commands/utils/prefix_filter.go b/pkg/kf/internal/utils/cli/prefix_filter.go
similarity index 100%
rename from pkg/kf/commands/utils/prefix_filter.go
rename to pkg/kf/internal/utils/cli/prefix_filter.go
diff --git a/pkg/kf/commands/utils/prefix_filter_test.go b/pkg/kf/internal/utils/cli/prefix_filter_test.go
similarity index 96%
rename from pkg/kf/commands/utils/prefix_filter_test.go
rename to pkg/kf/internal/utils/cli/prefix_filter_test.go
index 794fcd2..781c618 100644
--- a/pkg/kf/commands/utils/prefix_filter_test.go
+++ b/pkg/kf/internal/utils/cli/prefix_filter_test.go
@@ -19,7 +19,7 @@ import (
 	"io"
 	"testing"
 
-	"github.com/google/kf/pkg/kf/commands/utils"
+	utils "github.com/google/kf/pkg/kf/internal/utils/cli"
 	"github.com/google/kf/pkg/kf/testutil"
 )