defang
v3.0.2
Published
CLI to take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes
Readme
Develop Once, Deploy Anywhere.
Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
Defang CLI
The Defang Command-Line Interface (CLI) 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.
Getting started
- Read our Getting Started page
- Follow the installation instructions from the Installing page
- Take a look at our Samples folder for example projects in various programming languages.
- Try the AI integration by running
defang generate - Start your new service with
defang compose up
Support
- File any issues here
Environment Variables
The Defang CLI recognizes the following environment variables:
COMPOSE_DISABLE_ENV_FILE- Whether to disable loading environment variables from a.envfile in the current directory; defaults tofalseCOMPOSE_FILE- The Compose file(s) to use; defaults tocompose.yaml,compose.yml,docker-compose.yaml, ordocker-compose.ymlin the current directoryCOMPOSE_PATH_SEPARATOR- The path separator to use forCOMPOSE_FILE; defaults to:on Unix/MacOS and;on WindowsCOMPOSE_PROJECT_NAME- The name of the project to use; overrides thenamein the Compose fileDEFANG_ACCESS_TOKEN- The access token to use for authentication; if not specified, uses token fromdefang loginDEFANG_BUILD_CONTEXT_LIMIT- The maximum size of the build context when building container images; defaults to100MiBDEFANG_CD_BUCKET- The S3 bucket to use for the BYOC CD pipeline; defaults todefang-cd-bucket-…DEFANG_CD_IMAGE- The image to use for the Continuous Deployment (CD) pipeline; defaults topublic.ecr.aws/defang-io/cd:public-betaDEFANG_DEBUG- set this to1ortrueto enable debug loggingDEFANG_DISABLE_ANALYTICS- If set totrue, disables sending analytics to Defang; defaults tofalseDEFANG_EDITOR- The editor to launch after new project generation; defaults tocode(VS Code)DEFANG_FABRIC- The address of the Defang Fabric to use; defaults tofabric-prod1.defang.devDEFANG_JSON- If set totrue, outputs JSON instead of human-readable output; defaults tofalseDEFANG_HIDE_HINTS- If set totrue, hides hints in the CLI output; defaults tofalseDEFANG_HIDE_UPDATE- If set totrue, hides the update notification; defaults tofalseDEFANG_ISSUER- The OAuth2 issuer to use for authentication; defaults tohttps://auth.defang.ioDEFANG_MODEL_ID- The model ID of the LLM to use for the generate/debug AI integration (Pro users only)DEFANG_NO_CACHE- If set totrue, disables pull-through caching of container images; defaults tofalseDEFANG_PREFIX- The prefix to use for all BYOC resources; defaults toDefangDEFANG_PROVIDER- The name of the cloud provider to use,auto(default),aws,digitalocean,gcp, ordefangDEFANG_PULUMI_BACKEND- The Pulumi backend URL or"pulumi-cloud"; defaults to a self-hosted backendDEFANG_PULUMI_DEBUG- If set totrue, enables debug logging for Pulumi operations; defaults tofalseDEFANG_PULUMI_DIFF- If set totrue, shows the Pulumi diff during deployments; defaults tofalseDEFANG_PULUMI_DIR- Run Pulumi from this folder, instead of spawning a cloud task; requires--debug(BYOC only)DEFANG_PULUMI_VERSION- Override the version of the Pulumi image to use (awsprovider only)DEFANG_SUFFIX- The suffix to use for all BYOC resources; defaults to the stack name, orbetaif unset.DEFANG_WORKSPACE- The workspace (name or ID) to use; preferred way to select which workspace the CLI usesNO_COLOR- If set to any value, disables color output; by default, color output is enabled depending on the terminalPULUMI_ACCESS_TOKEN- The Pulumi access token to use for authentication to Pulumi Cloud; seeDEFANG_PULUMI_BACKENDPULUMI_CONFIG_PASSPHRASE- Passphrase used to generate a unique key for your stack, and configuration and encrypted state valuesTZ- The timezone to use for log timestamps: an IANA TZ name likeUTCorEurope/Amsterdam; defaults toLocalXDG_STATE_HOME- The directory to use for storing state; defaults to~/.local/state
Environment variables will be loaded from a .defang file in the current directory, if it exists. This file follows
the same format as a .env file: KEY=VALUE pairs on each line, lines starting with # are treated as comments and ignored.
