Skip to content
Back to search

defang

Defang Deploy CLI. Develop Once, Deploy Anywhere. Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/DefangLabs/defang with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/DefangLabs/defang'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/defanglabs--defang/badge.svg)](/listings/defanglabs--defang)

HTML

<a href="/listings/defanglabs--defang"><img src="/api/listings/defanglabs--defang/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

- Read our [Getting Started](https://docs.defang.io/docs/getting-started) page - Follow the installation instructions from the [Installing](https://docs.defang.io/docs/getting-started/installing) page - Take a look at our [Samples](https://github.com/DefangLabs/samples) in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them - Try the AI integration by running `defang generate` - Start your new service with `defang compose up`

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 34 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "defang-skills",
  3. "owner": {
  4. "name": "DefangLabs",
  5. "email": "support@defang.io"
  6. },
  7. "metadata": {
  8. "description": "Official Defang plugin for Claude Code — deploy Docker Compose apps to AWS, GCP, or DigitalOcean."
  9. },
  10. "plugins": [
  11. {
  12. "name": "defang",
  13. "source": "./claude-plugin",
  14. "description": "Deploy Docker Compose apps to your own cloud account using Defang. Includes /defang:deploy, /defang:estimate, and /defang:debug skills and Defang MCP server integration.",
  15. "version": "1.0.0",
  16. "author": {
  17. "name": "DefangLabs"
  18. },
  19. "homepage": "https://defang.io",
  20. "repository": "https://github.com/DefangLabs/defang",
  21. "license": "Apache-2.0",
  22. "category": "infrastructure",
  23. "keywords": [
  24. "deploy",
  25. "cloud",
  26. "aws",
  27. "gcp",
  28. "digitalocean",
  29. "docker",
  30. "compose"
  31. ]
  32. }
  33. ]
  34. }
README.md · README · 310 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![Go package](https://github.com/DefangLabs/defang/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/DefangLabs/defang/actions/workflows/go.yml)
  2. [![Discord](https://img.shields.io/discord/1233224785450897561)](https://s.defang.io/discord)
  3. ![GitHub Release](https://img.shields.io/github/v/release/DefangLabs/defang)
  4. [![MCP Toplist](https://mcptoplist.com/badge/mcp.so%2Fdefang%2FDefangLabs.svg)](https://mcptoplist.com/server/mcp.so%2Fdefang%2FDefangLabs)
  5. ### ![Defang](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Element_Wordmark_Slogan/JPG/Dark_Colour_Glow.jpg)
  6. ## Develop Once, Deploy Anywhere.
  7. Take your app from Compose to a secure and scalable deployment on your favorite cloud in minutes.
  8. ### How It Works
  9. ```mermaid
  10. flowchart LR
  11. subgraph local["Your Machine or CI/CD"]
  12. compose["compose.yaml"] --> cli["Defang CLI"]
  13. end
  14. subgraph defang["Defang Backend"]
  15. fabric["Fabric API (gRPC)"]
  16. end
  17. subgraph cloud["Your Cloud Account"]
  18. secrets["Config & Secrets"]
  19. cd["Defang CD Task"]
  20. logs["Logs"]
  21. runtime["Load Balancer, Containers, DB, Cache, LLM, DNS, Roles"]
  22. end
  23. %% control plane
  24. cli <-.-> fabric
  25. %% deploy
  26. cli --> secrets
  27. cli --> cd
  28. cd --> runtime
  29. %% observability
  30. cli -.-> logs
  31. ```
  32. 1. **You write** a standard Docker **Compose** file
  33. 2. **Defang CLI** validates your Compose project and uploads the project to storage in your AWS/GCP account
  34. 3. **CD runs in your cloud** — a deployment task spins up in your AWS/GCP account
  35. 4. **Infrastructure is created** — containers, DNS, load balancing, and roles are provisioned
  36. 5. **Monitor** the deployment and tail or query runtime logs with the Defang CLI
  37. Your code and secrets never leave your cloud account. Defang orchestrates the deployment, but everything runs in your infrastructure.
  38. ## Defang CLI
  39. The Defang Command-Line Interface [(CLI)](https://docs.defang.io/docs/getting-started) is designed for developers who prefer to manage their workflows directly from the terminal. It offers full access to Defang’s capabilities, allowing you to build, test, and deploy applications efficiently to the cloud.
  40. ### Deploying with Defang
  41. If you already have a Docker Compose file, create a new [stack](https://docs.defang.io/docs/concepts/stacks) and then deploy it. For example:
  42. ```shell
  43. $ defang stack new
  44. ? Which cloud provider do you want to deploy to? AWS
  45. ? Which AWS region do you want to deploy to? us-west-2
  46. ? Which deployment mode do you want to use? AFFORDABLE
  47. ? What do you want to call this stack? awsuswest2
  48. * Created new stack configuration file: `.defang/awsuswest2`. Check this file into version control. You can now deploy this stack using `defang up --stack=awsuswest2`
  49. $ defang up --stack=awsuswest2
  50. ```
  51. ## Defang MCP Server
  52. [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_defang-0098FF?style=flat&logo=visualstudiocode&logoColor=ffffff)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22defang%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22defang%40latest%22%2C%22mcp%22%2C%22serve%22%2C%22--client%3Dvscode%22%5D%7D)
  53. [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_defang-24bfa5?style=flat&logo=visualstudiocode&logoColor=ffffff)](https://insiders.vscode.dev/redirect?url=vscode-insiders:mcp/install?%7B%22name%22%3A%22defang%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22defang%40latest%22%2C%22mcp%22%2C%22serve%22%2C%22--client%3Dvscode-insiders%22%5D%7D)
  54. [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=defang&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IC15IGRlZmFuZyBtY3Agc2VydmUgLS1jbGllbnQgY3Vyc29yIn0%3D)
  55. [![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=defang&config=%7B%22command%22%3A%20%22npx%22%2C%20%22args%22%3A%20%5B%22-y%22%2C%20%22defang%40latest%22%2C%20%22mcp%22%2C%20%22serve%22%2C%20%22--client%3Dkiro%22%5D%2C%20%22disabled%22%3A%20false%2C%20%22autoApprove%22%3A%20%5B%5D%7D)
  56. The Defang Model Context Protocol [(MCP)](https://docs.defang.io/docs/concepts/mcp) Server is tailored for developers who work primarily within integrated development environments (IDEs). It enables seamless cloud deployment from supported editors such as Cursor, Windsurf, VS Code, VS Code Insiders and Claude delivering a fully integrated experience without leaving your development environment.
  57. ## Claude Code Plugin
  58. Install the Defang plugin for [Claude Code](https://claude.ai/code) to deploy directly from any Claude Code session — no CLI required upfront:
  59. ```shell
  60. /plugin marketplace add DefangLabs/defang
  61. /plugin install defang@defang-skills
  62. ```
  63. After installing, use `/defang:deploy` to guide you through deploying your project. The Defang MCP server activates automatically once the Defang CLI is installed.
  64. ## This repo includes:
  65. - Public releases of the Defang CLI; [click here](https://github.com/DefangLabs/defang/releases/latest/) for the latest version
  66. - Built-in support for MCP Server — the Defang MCP Server makes cloud deployment as easy as a single prompt. [Learn more](https://docs.defang.io/docs/concepts/mcp)
  67. - Samples that show how to deploy an app using the [Defang Pulumi Provider](https://github.com/DefangLabs/pulumi-defang).
  68. ## Getting started
  69. - Read our [Getting Started](https://docs.defang.io/docs/getting-started) page
  70. - Follow the installation instructions from the [Installing](https://docs.defang.io/docs/getting-started/installing) page
  71. - Take a look at our [Samples](https://github.com/DefangLabs/samples) in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them
  72. - Try the AI integration by running `defang generate`
  73. - Start your new service with `defang compose up`
  74. ## Installing
  75. Install the Defang CLI from one of the following sources:
  76. - Using the [Homebrew](https://brew.sh) package manager [DefangLabs/defang tap](https://github.com/DefangLabs/homebrew-defang):
  77. ```
  78. brew install DefangLabs/defang/defang
  79. ```
  80. - Using a shell script:
  81. ```
  82. eval "$(curl -fsSL s.defang.io/install)"
  83. ```
  84. - Using [Go](https://go.dev):
  85. ```
  86. go install github.com/DefangLabs/defang/src/cmd/cli@latest
  87. ```
  88. - Using the [Nix package manager](https://nixos.org):
  89. - with Nix-Env:
  90. ```
  91. nix-env -if https://github.com/DefangLabs/defang/archive/main.tar.gz
  92. ```
  93. - or with Flakes:
  94. ```
  95. nix profile install github:DefangLabs/defang#defang-cli --refresh
  96. ```
  97. Released tags are available from our [Cachix](https://cachix.org) binary cache, so
  98. you can download the CLI instead of compiling it. If you have Cachix installed, run
  99. `cachix use defanglabs`; otherwise add these lines to `/etc/nix/nix.conf` (or
  100. `~/.config/nix/nix.conf` if you are a [trusted user](https://nix.dev/manual/nix/stable/command-ref/conf-file#conf-trusted-users)):
  101. ```nix
  102. extra-substituters = https://defanglabs.cachix.org
  103. extra-trusted-public-keys = defanglabs.cachix.org-1:mTXLTfYprWDrIK50Kz34fhOTreeKlQRZFQcKL7HtHx0=
    • Dismissed after review: Contains a long base64-looking blob — not necessarily malicious, but worth inspecting what it decodes to
    • Line 144 on GitHub
  104. ```
  105. Then install a tagged version, e.g. `nix profile install github:DefangLabs/defang/v3.14.1#defang-cli`.
  106. The cache holds `x86_64-linux` and `aarch64-darwin` builds. Other platforms, and
  107. builds from `main`, compile from source as before.
  108. - Using [winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/):
  109. ```
  110. winget install defang
  111. ```
  112. - Using a PowerShell script:
  113. ```
  114. iwr https://s.defang.io/defang_win_amd64.zip -OutFile defang.zip
  115. Expand-Archive defang.zip . -Force
  116. ```
  117. - Using the [official image from Docker Hub](https://hub.docker.com/r/defangio/defang-cli):
  118. ```
  119. docker run -it defangio/defang-cli help
  120. ```
  121. - Using [NPX](https://docs.npmjs.com/cli/v9/commands/npx):
  122. ```
  123. npx defang@latest help
  124. ```
  125. - or download the [latest binary](https://github.com/DefangLabs/defang/releases/latest/) of the Defang CLI.
  126. ## Support
  127. - File any issues [here](https://github.com/DefangLabs/defang/issues)
  128. ## Command completion
  129. The Defang CLI supports command completion for Bash, Zsh, Fish, and Powershell. To get the shell script for command completion, run the following command:
  130. ```
  131. defang completion [bash|zsh|fish|powershell]
  132. ```
  133. If you're using Bash, you can add the following to your `~/.bashrc` file:
  134. ```
  135. source <(defang completion bash)
  136. ```
  137. If you're using Zsh, you can add the following to your `~/.zshrc` file:
  138. ```
  139. source <(defang completion zsh)
  140. ```
  141. or pipe the output to a file called `_defang` in the directory with the completions.
  142. If you're using Fish, you can add the following to your `~/.config/fish/config.fish` file:
  143. ```
  144. defang completion fish | source
  145. ```
  146. If you're using Powershell, you can add the following to your `$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` file:
  147. ```
  148. Invoke-Expression -Command (defang completion powershell | Out-String)
  149. ```
  150. ## Environment Variables
  151. The Defang CLI recognizes the following environment variables:
  152. - `COMPOSE_DISABLE_ENV_FILE` - Whether to disable loading environment variables from a `.env` file in the current directory; defaults to `false`
  153. - `COMPOSE_ENV_FILES` - A comma-separated list of environment file(s) to use for interpolation instead of `.env`; overridden by the `--env-file` flag
  154. - `COMPOSE_FILE` - The Compose file(s) to use; defaults to `compose.yaml`, `compose.yml`, `docker-compose.yaml`, or `docker-compose.yml` in the current directory
  155. - `COMPOSE_PATH_SEPARATOR` - The path separator to use for `COMPOSE_FILE`; defaults to `:` on Unix/MacOS and `;` on Windows
  156. - `COMPOSE_PROJECT_NAME` - The name of the project to use; overrides the `name` in the Compose file
  157. - `DEFANG_ACCESS_TOKEN` - The access token to use for authentication; if not specified, uses token from `defang login`
  158. - `DEFANG_ALLOW_UPGRADE` - If set to `true`, allows upgrading the CD image and Pulumi version to the latest available; defaults to `false`, ie. previously deployed versions will be used to avoid unexpected upgrades
  159. - `DEFANG_AWS_APN_ID` - The AWS APN ID to use for attribution, eg. use `pc:123456789abcdefgh` for AWS Marketplace products
  160. - `DEFANG_BUILD_CONTEXT_LIMIT` - The maximum size of the build context when building container images; defaults to `100MiB`
  161. - `DEFANG_CD_BUCKET` - The S3 bucket to use for the BYOC CD pipeline; defaults to `defang-cd-bucket-…`
  162. - `DEFANG_CD_IMAGE` - The image to use for the Continuous Deployment (CD) pipeline; defaults to `public.ecr.aws/defang-io/cd:public-beta`
  163. - `DEFANG_DEBUG` - set this to `1` or `true` to enable debug logging
  164. - `DEFANG_DISABLE_ANALYTICS` - If set to `true`, disables sending analytics to Defang; defaults to `false`
  165. - `DEFANG_EDITOR` - The editor to launch after new project generation; defaults to `code` (VS Code)
  166. - `DEFANG_FABRIC` - The address of the Defang Fabric to use; defaults to `fabric-prod1.defang.dev`
  167. - `DEFANG_JSON` - If set to `true`, outputs JSON instead of human-readable output; defaults to `false`
  168. - `DEFANG_HIDE_HINTS` - If set to `true`, hides hints in the CLI output; defaults to `false`
  169. - `DEFANG_HIDE_UPDATE` - If set to `true`, hides the update notification; defaults to `false`
  170. - `DEFANG_ISSUER` - The OAuth2 issuer to use for authentication; defaults to `https://auth.defang.io`
  171. - `DEFANG_MODEL_ID` - The model ID of the LLM to use for the generate/debug AI integration (Pro users only)
  172. - `DEFANG_NO_CACHE` - If set to `true`, disables pull-through caching of container images; defaults to `false`
  173. - `DEFANG_PREFIX` - The prefix to use for all BYOC resources; defaults to `Defang`
  174. - `DEFANG_PROVIDER` - The name of the cloud provider to use, `auto` (default), `aws`, `azure`, `digitalocean`, `gcp`, or `defang`
  175. - `DEFANG_PULUMI_BACKEND` - The Pulumi backend URL or `"pulumi-cloud"`; defaults to a self-hosted backend
  176. - `DEFANG_PULUMI_DEBUG` - If set to `true`, enables debug logging for Pulumi operations; defaults to `false`
  177. - `DEFANG_PULUMI_DIFF` - If set to `true`, shows the Pulumi diff during deployments; defaults to `false`
  178. - `DEFANG_PULUMI_DIR` - Run Pulumi from this folder, instead of spawning a cloud task; requires `--debug` (BYOC only)
  179. - `DEFANG_PULUMI_VERSION` - Override the version of the Pulumi image to use (`aws` provider only)
  180. - `DEFANG_RECIPE` - The deployment mode / recipe to use; defaults to `AFFORDABLE`
  181. - `DEFANG_STACK` - The name of the stack to use
  182. - `DEFANG_SUFFIX` - The suffix to use for all BYOC resources; defaults to the stack name, or `beta` if unset.
  183. - `DEFANG_WORKSPACE` - The workspace (name or ID) to use; preferred way to select which workspace the CLI uses
  184. - `GCP_PROJECT_ID` - The Google Cloud project ID for the `gcp` provider; must be a real shell environment variable (e.g. `export GCP_PROJECT_ID=my-project-id`), not set via `defang config set`. Also recognized: `GOOGLE_PROJECT`, `GOOGLE_CLOUD_PROJECT`, `GCLOUD_PROJECT`, `CLOUDSDK_CORE_PROJECT`
  185. - `NO_COLOR` - If set to any value, disables color output; by default, color output is enabled depending on the terminal
  186. - `PULUMI_ACCESS_TOKEN` - The Pulumi access token to use for authentication to Pulumi Cloud; see `DEFANG_PULUMI_BACKEND`
  187. - `PULUMI_CONFIG_PASSPHRASE` - Passphrase used to generate a unique key for your stack, and configuration and encrypted state values
  188. - `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local`
  189. - `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state`
  190. Environment variables will be loaded from a `.defang` file in the current directory, if it exists. This file follows
  191. the same format as a `.env` file: `KEY=VALUE` pairs on each line, lines starting with `#` are treated as comments and ignored.
  192. ### Compose interpolation
  193. After selecting a stack, the CLI makes the resolved `DEFANG_PROVIDER` and `DEFANG_STACK` values available for Compose
  194. interpolation. They are not injected into services automatically; reference them explicitly where needed:
  195. ```yaml
  196. services:
  197. app:
  198. environment:
  199. PUBLISH_PROVIDER: "${DEFANG_PROVIDER}"
  200. PUBLISH_STACK: "${DEFANG_STACK}"
  201. ```
  202. The resolved values take precedence over values with the same names in Compose env files. Fields that Compose must decode
  203. before stack selection should provide a default, such as `${DEFANG_PROVIDER:-auto}`.
  204. ## Development
  205. At Defang we use the [Nix package manager](https://nixos.org) for our dev environment, in conjunction with [DirEnv](https://direnv.net).
  206. To get started quickly, install Nix and DirEnv, then create a `.envrc` file to automatically load the Defang developer environment:
  207. ```sh
  208. echo use flake >> .envrc
  209. direnv allow
  210. ```
  211. ### Adding cloud support
  212. At a high-level, support for a specific cloud lives in three repositories:
  213. - In [this CLI repository](https://github.com/DefangLabs/defang)
  214. - an implementation of the [client.Provider](src/pkg/cli/client/byoc) interface under the [`byoc` package](src/pkg/cli/client/byoc)
  215. - low-level cloud helpers ("driver") under the [`clouds` package](src/pkg/clouds)
  216. - authenticate with the cloud
  217. - start a CD container (task/job)
  218. - monitor the CD container's status and logs
  219. - stream/query logs from deployed services
  220. - set/list config (secrets/parameters)
  221. - In the [Defang Pulumi Provider repository](https://github.com/DefangLabs/pulumi-defang)
  222. - Pulumi **component** resources under the `provider` folder
  223. - `Project` component
  224. - `Service` component
  225. - `Postgres` component
  226. - `Redis` component
  227. - a Pulumi **custom** resource for `Build`
  228. - an implementation of the `ConfigProvider` interface to read config (secrets/parameters) at deploy time
  229. - In the [Defang Docs repository](https://github.com/DefangLabs/defang-docs)
  230. - under the [`providers` section](https://docs.defang.io/docs/providers), documentation for how to set up credentials and permissions for the cloud, and any cloud-specific features

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.