CLI

Skaffold command-line interface provides the following commands:

End-to-end pipelines:

  • skaffold run - to build & deploy once
  • skaffold dev - to trigger the watch loop build & deploy workflow with cleanup on exit

Pipeline building blocks for CI/CD:

Getting started with a new project:

Utilities:

Global flags

Flag Description
-h, --help Prints the HELP file for the current command.
-v, --verbosity LOG-LEVEL Uses a specific log level. Available log levels are info, warn, error, fatal. Default value is warn.

Global environment variables

Flag Description
SKAFFOLD_UPDATE_CHECK Enables checking for latest version of the Skaffold binary. By default it’s true.

Skaffold commands

skaffold build

Builds the artifacts

Usage:
  skaffold build

Flags:
  -b, --build-image stringArray         Choose which artifacts to build. Artifacts with image names that contain the expression will be built only. Default is to build sources for all artifacts
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry stringArray   Target registries for built images which are not secure
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
  -o, --output *flags.TemplateFlag      Used in conjuction with --quiet flag. Format output with go-template. For full struct documentation, see https://godoc.org/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd#BuildOutput (default {{.}})
  -p, --profile stringArray             Activate profiles by name
  -q, --quiet                           Suppress the build output and print image built on success. See --output to format output.
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
      --toot                            Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_BUILD_IMAGE (same as --build-image)
  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_OUTPUT (same as --output)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_QUIET (same as --quiet)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TOOT (same as --toot)

skaffold completion SHELL

Output shell completion for the given shell (bash or zsh)

Usage:
  skaffold completion SHELL

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


skaffold config

A set of commands for interacting with the Skaffold config.

Usage:
  skaffold config [command]

Available Commands:
  list        List all values set in the global Skaffold config
  set         Set a value in the global Skaffold config
  unset       Unset a value in the global Skaffold config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")

Use "skaffold config [command] --help" for more information about a command.


skaffold config list

List all values set in the global Skaffold config

Usage:
  skaffold config list

Flags:
  -a, --all                   Show values for all kubecontexts
  -c, --config string         Path to Skaffold config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_ALL (same as --all)
  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold config set

Set a value in the global Skaffold config

Usage:
  skaffold config set

Flags:
  -c, --config string         Path to Skaffold config
  -g, --global                Set value for global config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_GLOBAL (same as --global)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold config unset

Unset a value in the global Skaffold config

Usage:
  skaffold config unset

Flags:
  -c, --config string         Path to Skaffold config
  -g, --global                Set value for global config
  -k, --kube-context string   Kubectl context to set values against

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CONFIG (same as --config)
  • SKAFFOLD_GLOBAL (same as --global)
  • SKAFFOLD_KUBE_CONTEXT (same as --kube-context)

skaffold debug

Runs a pipeline file in debug mode

Usage:
  skaffold debug

Flags:
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
      --cleanup                         Delete deployments after dev mode is interrupted (default true)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
      --experimental-gui                Experimental Graphical User Interface
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry stringArray   Target registries for built images which are not secure
  -l, --label stringArray               Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
      --port-forward                    Port-forward exposed container ports within pods (default true)
  -p, --profile stringArray             Activate profiles by name
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
      --tail                            Stream logs from deployed objects (default true)
      --toot                            Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_CLEANUP (same as --cleanup)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_EXPERIMENTAL_GUI (same as --experimental-gui)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_PORT_FORWARD (same as --port-forward)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold delete

Delete the deployed resources

Usage:
  skaffold delete

Flags:
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry stringArray   Target registries for built images which are not secure
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
  -p, --profile stringArray             Activate profiles by name
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
      --toot                            Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TOOT (same as --toot)

skaffold deploy

Deploys the artifacts

Usage:
  skaffold deploy

Flags:
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --images strings                  A list of pre-built images to deploy
      --insecure-registry stringArray   Target registries for built images which are not secure
  -l, --label stringArray               Add custom labels to deployed objects. Set multiple times for multiple labels.
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
  -p, --profile stringArray             Activate profiles by name
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
      --tail                            Stream logs from deployed objects
      --toot                            Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_IMAGES (same as --images)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold dev

Runs a pipeline file in development mode

Usage:
  skaffold dev

Flags:
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
      --cleanup                         Delete deployments after dev mode is interrupted (default true)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
      --experimental-gui                Experimental Graphical User Interface
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry stringArray   Target registries for built images which are not secure
  -l, --label stringArray               Add custom labels to deployed objects. Set multiple times for multiple labels
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
      --port-forward                    Port-forward exposed container ports within pods (default true)
  -p, --profile stringArray             Activate profiles by name
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
      --tail                            Stream logs from deployed objects (default true)
      --toot                            Emit a terminal beep after the deploy is complete
      --trigger string                  How are changes detected? (polling, manual or notify) (default "polling")
  -w, --watch-image stringArray         Choose which artifacts to watch. Artifacts with image names that contain the expression will be watched only. Default is to watch sources for all artifacts
  -i, --watch-poll-interval int         Interval (in ms) between two checks for file changes (default 1000)

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_CLEANUP (same as --cleanup)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_EXPERIMENTAL_GUI (same as --experimental-gui)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_PORT_FORWARD (same as --port-forward)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)
  • SKAFFOLD_TRIGGER (same as --trigger)
  • SKAFFOLD_WATCH_IMAGE (same as --watch-image)
  • SKAFFOLD_WATCH_POLL_INTERVAL (same as --watch-poll-interval)

skaffold diagnose

Run a diagnostic on Skaffold

Usage:
  skaffold diagnose

Flags:
  -f, --filename string       Filename or URL to the pipeline file (default "skaffold.yaml")
  -p, --profile stringArray   Activate profiles by name

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_PROFILE (same as --profile)

skaffold fix

Converts old Skaffold config to newest schema version

Usage:
  skaffold fix

Flags:
  -f, --filename string   Filename or URL to the pipeline file (default "skaffold.yaml")
      --overwrite         Overwrite original config with fixed config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_OVERWRITE (same as --overwrite)

skaffold init

Automatically generate Skaffold configuration for deploying an application

Usage:
  skaffold init

Flags:
      --analyze                Print all discoverable Dockerfiles and images in JSON format to stdout
  -a, --artifact stringArray   '='-delimited dockerfile/image pair to generate build artifact
                               (example: --artifact=/web/Dockerfile.web=gcr.io/web-project/image)
      --compose-file string    Initialize from a docker-compose file
  -f, --filename string        Filename or URL to the pipeline file (default "skaffold.yaml")
      --force                  Force the generation of the Skaffold config
      --skip-build             Skip generating build artifacts in Skaffold config

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_ANALYZE (same as --analyze)
  • SKAFFOLD_ARTIFACT (same as --artifact)
  • SKAFFOLD_COMPOSE_FILE (same as --compose-file)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_FORCE (same as --force)
  • SKAFFOLD_SKIP_BUILD (same as --skip-build)

skaffold run

Runs a pipeline file

Usage:
  skaffold run

Flags:
      --cache-artifacts                 Set to true to enable caching of artifacts.
      --cache-file string               Specify the location of the cache file (default $HOME/.skaffold/cache)
  -d, --default-repo string             Default repository value (overrides global config)
      --enable-rpc skaffold dev         Enable gRPC for exposing Skaffold events (true by default for skaffold dev)
  -f, --filename string                 Filename or URL to the pipeline file (default "skaffold.yaml")
      --insecure-registry stringArray   Target registries for built images which are not secure
  -l, --label stringArray               Add custom labels to deployed objects. Set multiple times for multiple labels.
  -n, --namespace string                Run deployments in the specified namespace
      --no-prune                        Skip removing images and containers built by Skaffold
  -p, --profile stringArray             Activate profiles by name
      --rpc-http-port int               tcp port to expose event REST API over HTTP (default 50052)
      --rpc-port int                    tcp port to expose event API (default 50051)
      --skip-tests                      Whether to skip the tests after building
  -t, --tag string                      The optional custom tag to use for images which overrides the current Tagger configuration
      --tail                            Stream logs from deployed objects
      --toot                            Emit a terminal beep after the deploy is complete

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_CACHE_ARTIFACTS (same as --cache-artifacts)
  • SKAFFOLD_CACHE_FILE (same as --cache-file)
  • SKAFFOLD_DEFAULT_REPO (same as --default-repo)
  • SKAFFOLD_ENABLE_RPC (same as --enable-rpc)
  • SKAFFOLD_FILENAME (same as --filename)
  • SKAFFOLD_INSECURE_REGISTRY (same as --insecure-registry)
  • SKAFFOLD_LABEL (same as --label)
  • SKAFFOLD_NAMESPACE (same as --namespace)
  • SKAFFOLD_NO_PRUNE (same as --no-prune)
  • SKAFFOLD_PROFILE (same as --profile)
  • SKAFFOLD_RPC_HTTP_PORT (same as --rpc-http-port)
  • SKAFFOLD_RPC_PORT (same as --rpc-port)
  • SKAFFOLD_SKIP_TESTS (same as --skip-tests)
  • SKAFFOLD_TAG (same as --tag)
  • SKAFFOLD_TAIL (same as --tail)
  • SKAFFOLD_TOOT (same as --toot)

skaffold version

Print the version information

Usage:
  skaffold version

Flags:
  -o, --output *flags.TemplateFlag   Format output with go-template. For full struct documentation, see https://godoc.org/github.com/GoogleContainerTools/skaffold/pkg/skaffold/version#Info (default {{.Version}}
                                     )

Global Flags:
      --color int          Specify the default output color in ANSI escape codes (default 34)
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic) (default "warning")


Env vars:

  • SKAFFOLD_OUTPUT (same as --output)