### Getting Started with DevSpace Commands Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli.md Shows the basic commands to get started with DevSpace: initialize a project, develop an existing application, and use a custom configuration file. ```bash devspace init ``` ```bash # Develop an existing application devspace dev ``` ```bash DEVSPACE_CONFIG=other-config.yaml devspace dev ``` -------------------------------- ### Example plugin.yaml with commands, hooks, vars, and binaries Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/plugins/README.mdx Example plugin.yaml defining plugin commands, hooks, predefined variables, and binaries. Commands add new DevSpace subcommands (e.g., devspace login, devspace list env) with baseArgs prepended to the plugin binary. Hooks trigger on events like print and root, calling the plugin binary with specified baseArgs. Variables resolve by invoking the plugin binary and reading stdout. Binaries are selected by OS/arch; if no binary matches the current runtime, the plugin is not installed. ```yaml name: devspace-plugin-example version: 0.0.1 commands: # This will add the command devspace login - name: "login" # these args are prepended to the plugin binary, so when a user will call 'devspace login test test2 --flag 123' # devspace will call the plugin binary with 'plugin-binary other command test test2 --flag 123' baseArgs: ["other", "command"] usage: "short description of command" description: "long description of command" # You can also add commands under already existing devspace subcommands # This will add the devspace command: devspace list env - name: "env" baseArgs: ["list", "env"] subCommand: "list" # Hooks are called before certain already existing commands are executed # in devspace, for example devspace dev hooks: # will be executed when devspace print is run by the user - event: print # this will call the plugin binary before devspace print is called with: 'plugin-binary list env' baseArgs: ["list", "env"] # root is executed before any other event and command execution except for other plugin commands - event: root baseArgs: ["login"] # You can also add predefined variables for the config via plugins vars: # the name of the predefined variable # that can be used within any devspace.yaml - name: EXAMPLE_USER # this will call the plugin binary when resolving this variable and expects the variable # output on stdout. baseArgs: ["print", "env", "USER"] - name: EXAMPLE_HOME baseArgs: [ "print", "env", "HOME" ] # In this section the plugin binaries (or scripts) and their locations are defined # if devspace cannot find a binary for the current runtime.GOOS and runtime.GOARCH # it will not install the plugin binaries: - os: darwin arch: amd64 # can be either an URL or local path path: ./main - os: linux arch: amd64 path: main - os: linux arch: "386" path: main - os: windows arch: amd64 path: path/to/main.exe - os: windows arch: "386" path: https://my-domain.url/path/to/windows.exe ``` -------------------------------- ### devspace add plugin usage example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_add_plugin.md Displays the full usage example for adding a plugin, including the command banner and an example URL. ```bash ####################################################### ############### devspace add plugin ################### ####################################################### Adds a new plugin to devspace devspace add plugin https://github.com/my-plugin/plugin ####################################################### ``` -------------------------------- ### Example: Replacing the command for the kaniko build container Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration showing the command option replacing the starting command with 'kaniko-custom'. ```yaml images: backend: image: john/appbackend kaniko: command: - kaniko-custom ``` -------------------------------- ### Start custom project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Placeholder for a custom command to start your own project. ```bash # Whatever command is needed to start your application ``` -------------------------------- ### devspace use context command syntax and example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_use_context.md Shows the command syntax and a banner with an example for switching the current kube-context. The example uses 'devspace use context my-context'. ```bash devspace use context [flags] ``` ```bash ####################################################### ############### devspace use context ################## ####################################################### Switches the current kube-context Example: devspace use context my-context ####################################################### ``` -------------------------------- ### Run DevSpace dev with namespace flag Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/ide-integration/visual-studio-code.mdx Quick start commands to clone the example project, navigate into it, and start DevSpace with the -n flag to open Visual Studio Code in a container. ```bash # Clone the example project git clone https://github.com/loft-sh/devspace-vscode-example.git # Switch to the folder cd devspace-vscode-example # Open Visual Studio Code in a Container devspace dev -n my-namespace ``` -------------------------------- ### Start local development server with yarn start Source: https://github.com/devspace-sh/devspace/blob/main/docs/README.md Starts a local development server and opens a browser window. Changes are reflected live without restarting the server. ```bash yarn start ``` -------------------------------- ### devspace reset dependencies example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_reset_dependencies.md Displays the command's purpose and an example usage. ```bash ####################################################### ############ devspace reset dependencies ############## ####################################################### Deletes the complete dependency cache Examples: devspace reset dependencies ####################################################### ``` -------------------------------- ### devspace open banner and example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_open.md Displays the banner and example for the devspace open command. ```bash ####################################################### #################### devspace open #################### ####################################################### Opens the space domain in the browser Example: devspace open ####################################################### ``` -------------------------------- ### Clone the example project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/ide-integration/visual-studio-code.mdx Clone the example Golang project and switch to its directory. This is the first step before configuring DevSpace. ```bash # Clone the example project git clone https://github.com/loft-sh/devspace-vscode-example.git # Switch to the folder cd devspace-vscode-example ``` -------------------------------- ### Start Java application Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start a Java application using the build script. ```bash ./build.sh run ``` -------------------------------- ### devspace list plugins example output Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_list_plugins.md Example output when running the command, showing the header and the command itself. ```bash ####################################################### ############# devspace list plugins ################## ####################################################### Lists all installed plugins devspace list plugins ####################################################### ``` -------------------------------- ### Start developing with DevSpace Source: https://github.com/devspace-sh/devspace/blob/main/examples/kind/README.md Runs 'devspace dev' with the namespace 'test-1' to start the development environment, including building the image, deploying the Helm chart, and starting port forwarding and sync. ```sh devspace dev -n test-1 ``` -------------------------------- ### Set command and args in devspace.yaml Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/dev/modifications/entrypoint.mdx Use `command` and `args` under the `dev` section to override the container's entrypoint. The example starts the dev container with `npm run start`. ```yaml dev: backend: imageSelector: ghcr.io/org/project/image devImage: ghcr.io/loft-sh/devspace-containers/python:3-alpine # highlight-start command: ["npm"] args: ["run", "start"] # highlight-end ``` -------------------------------- ### Start ASP.NET application Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start an ASP.NET application using the dotnet run command. ```bash dotnet run ``` -------------------------------- ### Clone Golang quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for Golang and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-golang cd devspace-quickstart-golang ``` -------------------------------- ### Define dev pipeline in devspace.yaml Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/getting-started/development.mdx Example 'dev' pipeline in devspace.yaml that runs three commands: deploy dependencies, create deployments, and start dev mode. The pipeline uses emulated bash syntax that works on any OS. ```yaml # This is a list of `pipelines` that DevSpace can execute (you can define your own) pipelines: # This is the pipeline for the main command: `devspace dev` (or `devspace run-pipeline dev`) dev: run: |- run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies") create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments" start_dev app # 3. Start dev mode "app" (see "dev" section) ``` -------------------------------- ### Start Node.js application Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start a Node.js application in development mode. The command runs npm start, with alternatives npm run dev or yarn start. ```bash npm start # or: npm run dev # or: yarn start ``` -------------------------------- ### Example: Passing Args to kaniko Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration showing the args option with flags --cache-dir=/tmp and --verbosity=debug. ```yaml images: backend: image: john/appbackend kaniko: args: - --cache-dir=/tmp - --verbosity=debug ``` -------------------------------- ### devspace purge example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_purge.md Displays the banner and example usage for the devspace purge command. The example shows the basic command to delete deployed Kubernetes resources. ```bash ####################################################### ################### devspace purge #################### ####################################################### Deletes the deployed kubernetes resources: devspace purge ####################################################### ``` -------------------------------- ### devspace list contexts help banner and example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_list_contexts.md Displays the help banner and an example invocation for the devspace list contexts command. ```bash ####################################################### ############## devspace list contexts ################# ####################################################### Lists all available kube contexts Example: devspace list contexts ####################################################### ``` -------------------------------- ### Clone ASP.NET quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for ASP.NET and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-asp-dotnet cd devspace-quickstart-asp-dotnet ``` -------------------------------- ### Clone Java quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for Java and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-java cd devspace-quickstart-java ``` -------------------------------- ### Start Python application Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start a Python application by running the main.py script. ```bash python main.py ``` -------------------------------- ### Example: Specify environment variables for the kaniko container Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that sets initImage and initEnv for the Kaniko build pod. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: initImage: alpine initEnv: AZURE_CLIENT_ID: XXXXXXXX ``` -------------------------------- ### Install DevSpace on Windows via PowerShell Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/install-cli.mdx Downloads and installs the DevSpace binary on Windows using PowerShell. Creates the installation directory, downloads the executable, and adds it to the user's PATH. ```powershell md -Force "$Env:APPDATA\devspace"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'; Invoke-WebRequest -URI "https://github.com/loft-sh/devspace/releases/latest/download/devspace-windows-amd64.exe" -o $Env:APPDATA\devspace\devspace.exe; $env:Path += ";" + $Env:APPDATA + "\devspace"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User); ``` -------------------------------- ### DevSpace init: Quickstart Project Prompt Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/getting-started/initialize-project.mdx Interactive prompt from the DevSpace initialization wizard asking whether the project is a DevSpace Quickstart project. DevSpace can detect when you're using a quickstart project. ```text ? Is this a DevSpace Quickstart project? [Use arrows to move, type to filter] > Yes No ``` -------------------------------- ### Install dependencies with yarn Source: https://github.com/devspace-sh/devspace/blob/main/docs/README.md Run this command to install the project dependencies. It is the first step after cloning the repository. ```bash yarn ``` -------------------------------- ### devspace deploy banner example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_deploy.md Displays a banner with example invocations of `devspace deploy`, including using a namespace and a kube-context. ```bash ####################################################### ################## devspace deploy #################### ####################################################### Deploys the current project to a Space or namespace: devspace deploy devspace deploy -n some-namespace devspace deploy --kube-context=deploy-context ####################################################### ``` -------------------------------- ### devspace sync usage examples Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_sync.md Provides example invocations of the devspace sync command, demonstrating various options such as specifying paths, image selectors, exclusions, and pod/container selection. ```bash ############################################################################# ################### devspace sync ########################################### ############################################################################# Starts a bi-directional(default) sync between the target container path and local path: devspace sync --path=.:/app # localPath is current dir and remotePath is /app devspace sync --path=.:/app --image-selector nginx:latest devspace sync --path=.:/app --exclude=node_modules,test devspace sync --path=.:/app --pod=my-pod --container=my-container ############################################################################# ``` -------------------------------- ### Clone PHP quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for PHP and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-php cd devspace-quickstart-php ``` -------------------------------- ### Example: Use Different Kaniko Image/Version Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that uses a different Kaniko image version. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: image: gcr.io/kaniko-project/executor:v1.6.0 ``` -------------------------------- ### Clone Node.js quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for Node.js and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-nodejs cd devspace-quickstart-nodejs ``` -------------------------------- ### Install Ginkgo for e2e tests Source: https://github.com/devspace-sh/devspace/blob/main/e2e/README.md Install the Ginkgo test framework locally before running the e2e tests. ```bash go get github.com/onsi/ginkgo/ginkgo ``` -------------------------------- ### devspace restart synopsis with examples Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_restart.md Shows the command synopsis with examples of restarting containers, including using a namespace flag. ```bash ####################################################### ################## devspace restart ################### ####################################################### Restarts containers where the sync restart helper is injected: devspace restart devspace restart -n my-namespace ####################################################### ``` -------------------------------- ### Example: Building Images with kaniko (cache) Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration showing the cache option for two images. The backend image uses the build cache, while the frontend image does not. ```yaml images: backend: image: john/appbackend kaniko: cache: true frontend: image: john/appfrontend kaniko: cache: false ``` -------------------------------- ### Clone Ruby quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for Ruby and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-ruby cd devspace-quickstart-ruby ``` -------------------------------- ### Example: Add labels to kaniko build pods Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that adds a label to the Kaniko build pod. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: labels: app: kaniko ``` -------------------------------- ### Clone Python quickstart project Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/choose-project.mdx Clones the DevSpace quickstart repository for Python and changes into the project directory. ```bash git clone https://github.com/loft-sh/devspace-quickstart-python cd devspace-quickstart-python ``` -------------------------------- ### Example: Building Images with kaniko (snapshotMode) Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration showing the snapshotMode option for two images. The backend image uses full filesystem snapshots, while the frontend image uses mtime-based snapshots. ```yaml images: backend: image: john/appbackend kaniko: snapshotMode: full frontend: image: john/appfrontend kaniko: snapshotMode: time ``` -------------------------------- ### List installed plugins with devspace list plugins Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/plugins/README.mdx Lists all installed DevSpace plugins. ```bash devspace list plugins ``` -------------------------------- ### Banner and usage examples for devspace set var Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_set_var.md Displays the command banner and two usage examples: setting a single key=value pair and setting multiple pairs. ```bash ####################################################### ################# devspace set var #################### ####################################################### Sets a specific variable Examples: devspace set var key=value devspace set var key=value key2=value2 ####################################################### ``` -------------------------------- ### Example: Specify environment variables for the kaniko container Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that sets an environment variable for the Kaniko container. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: env: AZURE_CLIENT_ID: XXXXXXXX ``` -------------------------------- ### Start Ruby on Rails server Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start a Ruby on Rails server on port 3000, binding to all interfaces. ```bash bundle exec rails server -p 3000 -b 0.0.0.0 ``` -------------------------------- ### Start PHP application Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/start-app.mdx Start a PHP application. The application may already be running; open the browser on localhost to access it. You can also run other commands like php, composer, or ps aux. ```bash # Your application may already be running # Try to open the browser on localhost to access it # You can also run other commands now: php ... composer ... ps aux ``` -------------------------------- ### Clone the DevSpace example project Source: https://github.com/devspace-sh/devspace/blob/main/examples/kind/README.md Clones the DevSpace repository and changes into the 'examples/kind' directory, which contains the example application and DevSpace configuration. ```sh git clone git@github.com:loft-sh/devspace.git cd examples/kind ``` -------------------------------- ### Example: Add generateName to kaniko build pods Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that sets a custom generateName for the Kaniko build pod. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: generateName: devspace-build-kaniko-backend- ``` -------------------------------- ### devspace run usage banner and examples Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_run.md Displays the command banner and three usage examples: running a command with an argument, running a command with multiple arguments, and running a command from a dependency. ```bash ####################################################### ##################### devspace run #################### ####################################################### Executes a predefined command from the devspace.yaml Examples: devspace run mycommand --myarg 123 devspace run mycommand2 1 2 3 devspace --dependency my-dependency run any-command --any-command-flag ####################################################### ``` -------------------------------- ### Example: Add annotations to kaniko build pods Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that adds an annotation to the Kaniko build pod. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: annotations: app: kaniko ``` -------------------------------- ### Example: Push to Insecure Registry With kaniko Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration showing the insecure option for an image pushed to an insecure registry at 123.456.789.0:5000. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: insecure: false ``` -------------------------------- ### Example: Skip Build for Dependency Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/dependency-skipBuild.mdx Example configuration for a dependency that sets skipBuild to true, skipping the image building process for that dependency. Useful when you want to use tags defined in deployment files. ```yaml dependencies: - source: git: https://github.com/my-api-server skipBuild: true ``` -------------------------------- ### Equivalent kubectl apply commands Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/deployments/kubectl/manifests.mdx Shows the kubectl apply commands that DevSpace executes for the example configuration. ```bash kubectl apply -f backend/ kubectl apply -f backend-extra/ kubectl apply -f frontend/manifest.yaml ``` -------------------------------- ### run_watch example YAML configuration Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/command_run_watch.mdx Example YAML that overwrites the 'dev' command to use run_watch, watching devspace.yaml and *.go files, then running 'devspace run-pipeline dev'. ```yaml commands: # Overwrites dev dev: |- run_watch -p devspace.yaml -p *.go -- devspace run-pipeline dev $@ ``` -------------------------------- ### DevSpace init: Select Deployment Method Prompt Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/getting-started/initialize-project.mdx Interactive prompt from the DevSpace initialization wizard asking how to deploy the project. The example selects 'helm', but kubectl and kustomize are also options. ```text ? How do you want to deploy this project? [Use arrows to move, type to filter] > helm kubectl kustomize ``` -------------------------------- ### devspace list plugins command synopsis Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_list_plugins.md Shows the command syntax for listing installed plugins. ```bash devspace list plugins [flags] ``` -------------------------------- ### devspace attach usage examples Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_attach.md Shows usage examples for the devspace attach command, including selecting a pod with --pick, specifying a container with -c, and setting a namespace with -n. ```bash ####################################################### ################# devspace attach ##################### ####################################################### Attaches to a running container devspace attach devspace attach --pick # Select pod to enter devspace attach -c my-container devspace attach -n my-namespace ####################################################### ``` -------------------------------- ### devspace enter usage examples Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_enter.md Displays a banner with multiple usage examples for `devspace enter`, including selecting a pod, specifying a container, namespace, label selector, and image selector. ```bash ####################################################### ################## devspace enter ##################### ####################################################### Execute a command or start a new terminal in your devspace: devspace enter devspace enter --pick # Select pod to enter devspace enter bash devspace enter -c my-container devspace enter bash -n my-namespace devspace enter bash -l release=test devspace enter bash --image-selector nginx:latest devspace enter bash --image-selector "${runtime.images.app.image}:${runtime.images.app.tag}" ####################################################### ``` -------------------------------- ### Example Go web server (main.go) Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/ide-integration/visual-studio-code.mdx Simple web server that runs on port 9000 and returns a 'Hello World!' message. This is the application code that will be synced into the container. ```go package main import ( "fmt" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World!") } func main() { fmt.Println("Started server on :9000") http.HandleFunc("/", handler) http.ListenAndServe(":9000", nil) } ``` -------------------------------- ### Install DevSpace with Homebrew Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/install-cli.mdx Installs DevSpace using Homebrew on macOS. This is the default installation method shown in the tabbed interface. ```bash brew install devspace ``` -------------------------------- ### Install DevSpace on Linux via curl Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/install-cli.mdx Downloads and installs the DevSpace binary on Linux using curl and sudo install. Provides separate commands for AMD64 and ARM64 architectures. ```bash # AMD64 curl -L -o devspace "https://github.com/loft-sh/devspace/releases/latest/download/devspace-linux-amd64" && sudo install -c -m 0755 devspace /usr/local/bin # ARM64 curl -L -o devspace "https://github.com/loft-sh/devspace/releases/latest/download/devspace-linux-arm64" && sudo install -c -m 0755 devspace /usr/local/bin ``` -------------------------------- ### Install DevSpace on macOS via curl Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/install-cli.mdx Downloads and installs the DevSpace binary on macOS using curl and sudo install. Provides separate commands for AMD64/Intel and ARM64/Silicon Mac architectures. ```bash # AMD64 / Intel curl -L -o devspace "https://github.com/loft-sh/devspace/releases/latest/download/devspace-darwin-amd64" && sudo install -c -m 0755 devspace /usr/local/bin # ARM64 / Silicon Mac curl -L -o devspace "https://github.com/loft-sh/devspace/releases/latest/download/devspace-darwin-arm64" && sudo install -c -m 0755 devspace /usr/local/bin ``` -------------------------------- ### Equivalent kubectl create command with custom args Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/deployments/kubectl/manifests.mdx Shows the kubectl create command that DevSpace would execute for the example with custom args. ```bash kubectl create --dry-run --output yaml --validate=false --recursive -f backend/ ``` -------------------------------- ### Install Loft plugin for DevSpace Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/kube-context.mdx Install the Loft plugin for DevSpace to enable multi-tenancy features. ```bash devspace add plugin https://github.com/loft-sh/loft-devspace-plugin ``` -------------------------------- ### Delay container start with startContainer: true Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/dev/connections/file-sync.mdx Delays starting the container until sync has finished uploading all files initially. Requires command to be set. If multiple sync paths have startContainer, DevSpace waits for all to finish before starting the container. ```yaml deployments: app-backend: helm: values: containers: - image: ghcr.io/org/project/image dev: my-dev: imageSelector: ghcr.io/org/project/image # required as DevSpace otherwise doesn't know # what to start. command: ["entrypoint", "to", "container"] sync: - path: ./ startContainer: true # Will start the container after sync is done ``` -------------------------------- ### DevSpace init: Container Image Build Prompt Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/getting-started/initialize-project.mdx Interactive prompt from the DevSpace initialization wizard asking how to build the container image. The example selects the existing Dockerfile in the root folder. ```text ? How should DevSpace build the container image for this project? [Use arrows to move, type to filter] > Use this existing Dockerfile: ./Dockerfile Use a different Dockerfile (e.g. ./backend/Dockerfile) Use alternative build tool (e.g. jib, bazel) Skip / I don't know ``` -------------------------------- ### Install DevSpace with Scoop Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/install-cli.mdx Installs DevSpace using Scoop on Windows. This is an alternative to the PowerShell download method. ```powershell scoop install devspace ``` -------------------------------- ### Initialize a DevSpace Project with devspace init Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/getting-started/initialize-project.mdx Run this command in your project directory to create a devspace.yaml config file for your project. ```bash devspace init ``` -------------------------------- ### Example: Kustomize Deployment Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/kubectl-kustomize.mdx Configures a DevSpace deployment to use Kustomize by setting `kustomize: true`. All `manifests` must be paths to Kustomizations; to mix plain manifests and Kustomizations, create separate deployments. ```yaml deployments: backend: kubectl: kustomize: true manifests: - kustomization1/ - glob/path/to/more/kustomizations/ ``` -------------------------------- ### devspace dev banner Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_dev.md Displays a banner that is printed when the command starts. It indicates that the project is being started in development mode. ```bash ####################################################### ################### devspace dev ###################### ####################################################### Starts your project in development mode ####################################################### ``` -------------------------------- ### devspace init command synopsis Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_init.md Shows the basic usage of the `devspace init` command with its flags placeholder. ```bash devspace init [flags] ``` -------------------------------- ### devspace reset vars banner example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_reset_vars.md Displays the command banner and an example invocation: `devspace reset vars`. ```bash ####################################################### ############### devspace reset vars ################### ####################################################### Resets the saved variables of the current config Examples: devspace reset vars ####################################################### ``` -------------------------------- ### Require Installed Plugins Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/require/README.mdx Defines required plugins and their versions under `require.plugins`. Each listed plugin must be installed in the specified version. ```yaml # Each plugin that is defined under plugins needs to be installed # in the required version. require: plugins: - name: loft version: ">= 1.11.0" ``` -------------------------------- ### devspace use namespace help text Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_use_namespace.md Displays the command help text, including a description and an example of setting the default namespace to 'my-namespace'. ```bash ####################################################### ############## devspace use namespace ################# ####################################################### Sets the default namespace to deploy to Example: devspace use namespace my-namespace ####################################################### ``` -------------------------------- ### Equivalent kubectl create Command Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/deployments/kubectl/kustomizations.mdx Deploying the above example would roughly be equivalent to this command, which includes the --recursive flag and the default flags. ```bash kubectl create --dry-run --output yaml --validate=false --recursive -f backend/ ``` -------------------------------- ### devspace build synopsis Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_build.md The synopsis shows the basic command syntax and a banner that describes the command's purpose. Use this command to build all defined images and push them. ```bash devspace build [flags] ``` ```text ####################################################### ################## devspace build ##################### ####################################################### Builds all defined images and pushes them ####################################################### ``` -------------------------------- ### Example: Specify environment variables for the kaniko container using a secret Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/images/build-engines/kaniko.mdx Example configuration that sets an environment variable from a secret using secretMapKeyRef. ```yaml images: backend: image: 123.456.789.0:5000/john/appbackend kaniko: envFrom: AZURE_CLIENT_ID: secretMapKeyRef: name: azure-creds key: AZURE_CLIENT_ID ``` -------------------------------- ### devspace run-pipeline banner with example commands Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_run-pipeline.md Displays a banner with example invocations of the run-pipeline command, such as 'devspace run-pipeline my-pipeline' and 'devspace run-pipeline dev'. ```bash ####################################################### ############## devspace run-pipeline ################## ####################################################### Execute a pipeline: devspace run-pipeline my-pipeline devspace run-pipeline dev ####################################################### ``` -------------------------------- ### Example: Ignore Dependencies of Dependency Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/dependency-ignoreDependencies.mdx Example configuration that sets ignoreDependencies to true for a dependency sourced from a git repository, preventing its dependencies from being resolved and deployed. ```yaml dependencies: - source: git: https://github.com/my-api-server ignoreDependencies: true ``` -------------------------------- ### Start Development Mode with devspace dev Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/configuration/dev/README.mdx Starts the development mode, which turns the deployed containers into dev containers and applies the modifications defined in the dev configuration. ```bash devspace dev ``` -------------------------------- ### devspace remove context help example Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/cli/devspace_remove_context.md Displays the help text for the devspace remove context command, including an example invocation: devspace remove context myspace. ```bash ####################################################### ############# devspace remove context ################# ####################################################### Removes a kubectl-context Example: devspace remove context myspace ####################################################### ``` -------------------------------- ### Reuse configuration from file with --from-file Source: https://github.com/devspace-sh/devspace/blob/main/docs/pages/_partials/config-overwrite-flags.mdx Reuses an existing configuration from a file by providing the file path. ```bash devspace [command] --from-file=[path to existing configuration file] ```