|
1 | 1 | [](https://github.com/defang-io/defang/actions/workflows/go.yml)
|
2 | 2 |
|
3 | 3 | # Defang
|
| 4 | + |
4 | 5 | Defang is a radically simpler way for developers to create, deploy, and manage cloud applications.
|
5 | 6 |
|
6 | 7 | This repo includes:
|
7 |
| -* Public releases of the Defang CLI; [click here](https://github.com/defang-io/defang/releases/latest/) for the latest version |
8 |
| -* Samples in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them to the DOP using a Docker Compose file using the Defang CLI. |
9 |
| -* Samples that show how to deploy an app using the [Defang Pulumi Provider](https://github.com/defang-io/pulumi-defang). |
| 8 | + |
| 9 | +- Public releases of the Defang CLI; [click here](https://github.com/defang-io/defang/releases/latest/) for the latest version |
| 10 | +- Samples in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them to the DOP using a Docker Compose file using the Defang CLI. |
| 11 | +- Samples that show how to deploy an app using the [Defang Pulumi Provider](https://github.com/defang-io/pulumi-defang). |
10 | 12 |
|
11 | 13 | ## Getting started
|
12 |
| -* Read our [Getting Started](https://docs.defang.io/docs/getting-started) page |
13 |
| -* Follow the installation instructions from the [Installing](https://docs.defang.io/docs/getting-started/installing) page |
14 |
| -* Take a look at our [Samples folder](https://github.com/defang-io/defang/tree/main/samples) for example projects in various programming languages. |
15 |
| -* Try the AI integration by running `defang generate` |
16 |
| -* Start your new service with `defang compose up` |
| 14 | + |
| 15 | +- Read our [Getting Started](https://docs.defang.io/docs/getting-started) page |
| 16 | +- Follow the installation instructions from the [Installing](https://docs.defang.io/docs/getting-started/installing) page |
| 17 | +- Take a look at our [Samples folder](https://github.com/defang-io/defang/tree/main/samples) for example projects in various programming languages. |
| 18 | +- Try the AI integration by running `defang generate` |
| 19 | +- Start your new service with `defang compose up` |
17 | 20 |
|
18 | 21 | ## Installing
|
| 22 | + |
19 | 23 | Install the Defang CLI from one of the following sources:
|
20 |
| -* Using the [Homebrew](https://brew.sh) package manager [defang-io/defang tap](https://github.com/defang-io/homebrew-defang): |
| 24 | + |
| 25 | +- Using the [Homebrew](https://brew.sh) package manager [defang-io/defang tap](https://github.com/defang-io/homebrew-defang): |
21 | 26 | ```
|
22 | 27 | brew install defang-io/defang/defang
|
23 | 28 | ```
|
24 |
| -* Using a shell script: |
| 29 | +- Using a shell script: |
25 | 30 | ```
|
26 | 31 | . <(curl -Ls https://s.defang.io/install)
|
27 | 32 | ```
|
28 |
| -* Using [Go](https://go.dev): |
| 33 | +- Using [Go](https://go.dev): |
29 | 34 | ```
|
30 | 35 | go install github.com/defang-io/defang/src/cmd/cli@latest
|
31 | 36 | ```
|
32 |
| -* Using the [Nix package manager](https://nixos.org): |
33 |
| - * with Nix-Env: |
| 37 | +- Using the [Nix package manager](https://nixos.org): |
| 38 | + - with Nix-Env: |
34 | 39 | ```
|
35 | 40 | nix-env -if https://github.com/defang-io/defang/archive/main.tar.gz
|
36 | 41 | ```
|
37 |
| - * or with Flakes: |
| 42 | + - or with Flakes: |
38 | 43 | ```
|
39 | 44 | nix profile install github:defang-io/defang#defang-bin --refresh
|
40 | 45 | ```
|
41 |
| -* Download the [latest binary](https://github.com/defang-io/defang/releases/latest/) of the Defang CLI. For this beta, MacOS users will have to explicitly allow running of downloaded programs in the OS security settings. |
| 46 | +- Download the [latest binary](https://github.com/defang-io/defang/releases/latest/) of the Defang CLI. For this beta, MacOS users will have to explicitly allow running of downloaded programs in the OS security settings. |
42 | 47 |
|
43 | 48 | ## Support
|
44 |
| -* File any issues [right here on GitHub](https://github.com/defang-io/defang/issues) |
| 49 | +
|
| 50 | +- File any issues [right here on GitHub](https://github.com/defang-io/defang/issues) |
45 | 51 |
|
46 | 52 | ## Command completion
|
| 53 | +
|
47 | 54 | The Defang CLI supports command completion for Bash, Zsh, Fish, and Powershell. To get the shell script for command completion, run the following command:
|
| 55 | +
|
48 | 56 | ```
|
49 | 57 | defang completion [bash|zsh|fish|powershell]
|
50 | 58 | ```
|
51 | 59 |
|
52 | 60 | If you're using Bash, you can add the following to your `~/.bashrc` file:
|
| 61 | +
|
53 | 62 | ```
|
54 | 63 | source <(defang completion bash)
|
55 | 64 | ```
|
56 | 65 |
|
57 | 66 | If you're using Zsh, you can add the following to your `~/.zshrc` file:
|
| 67 | +
|
58 | 68 | ```
|
59 | 69 | source <(defang completion zsh)
|
60 | 70 | ```
|
| 71 | +
|
61 | 72 | or pipe the output to a file called `_defang` in the directory with the completions.
|
62 | 73 |
|
63 | 74 | If you're using Fish, you can add the following to your `~/.config/fish/config.fish` file:
|
| 75 | +
|
64 | 76 | ```
|
65 | 77 | defang completion fish | source
|
66 | 78 | ```
|
67 | 79 |
|
68 | 80 | If you're using Powershell, you can add the following to your `$HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` file:
|
| 81 | +
|
69 | 82 | ```
|
70 | 83 | Invoke-Expression -Command (defang completion powershell | Out-String)
|
71 | 84 | ```
|
72 | 85 |
|
73 | 86 | ## Environment Variables
|
| 87 | +
|
74 | 88 | The Defang CLI recognizes the following environment variables:
|
75 |
| -* `COMPOSE_PROJECT_NAME` - The name of the project to use; overrides the name in the `compose.yaml` file |
76 |
| -* `DEFANG_ACCESS_TOKEN` - The access token to use for authentication; if not specified, uses token from `defang login` |
77 |
| -* `DEFANG_CD_BUCKET` - The S3 bucket to use for the BYOC CD pipeline; defaults to `defang-cd-bucket-…` |
78 |
| -* `DEFANG_CD_IMAGE` - The image to use for the Continuous Deployment (CD) pipeline; defaults to `public.ecr.aws/defang-io/cd:public-beta` |
79 |
| -* `DEFANG_DEBUG` - set this to `1` or `true` to enable debug logging |
80 |
| -* `DEFANG_DISABLE_ANALYTICS` - If set to `true`, disables sending analytics to Defang; defaults to `false` |
81 |
| -* `DEFANG_FABRIC` - The address of the Defang Fabric to use; defaults to `fabric-prod1.defang.dev` |
82 |
| -* `DEFANG_HIDE_HINTS` - If set to `true`, hides hints in the CLI output; defaults to `false` |
83 |
| -* `DEFANG_HIDE_UPDATE` - If set to `true`, hides the update notification; defaults to `false` |
84 |
| -* `DEFANG_PROVIDER` - The name of the cloud provider to use, `auto` (default), `aws`, or `defang` |
85 |
| -* `NO_COLOR` - If set to any value, disables color output; by default, color output is enabled depending on the terminal |
86 |
| -* `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local` |
87 |
| -* `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state` |
| 89 | +
|
| 90 | +- `COMPOSE_PROJECT_NAME` - The name of the project to use; overrides the name in the `compose.yaml` file |
| 91 | +- `DEFANG_ACCESS_TOKEN` - The access token to use for authentication; if not specified, uses token from `defang login` |
| 92 | +- `DEFANG_CD_BUCKET` - The S3 bucket to use for the BYOC CD pipeline; defaults to `defang-cd-bucket-…` |
| 93 | +- `DEFANG_CD_IMAGE` - The image to use for the Continuous Deployment (CD) pipeline; defaults to `public.ecr.aws/defang-io/cd:public-beta` |
| 94 | +- `DEFANG_DEBUG` - set this to `1` or `true` to enable debug logging |
| 95 | +- `DEFANG_DISABLE_ANALYTICS` - If set to `true`, disables sending analytics to Defang; defaults to `false` |
| 96 | +- `DEFANG_FABRIC` - The address of the Defang Fabric to use; defaults to `fabric-prod1.defang.dev` |
| 97 | +- `DEFANG_HIDE_HINTS` - If set to `true`, hides hints in the CLI output; defaults to `false` |
| 98 | +- `DEFANG_HIDE_UPDATE` - If set to `true`, hides the update notification; defaults to `false` |
| 99 | +- `DEFANG_PROVIDER` - The name of the cloud provider to use, `auto` (default), `aws`, or `defang` |
| 100 | +- `NO_COLOR` - If set to any value, disables color output; by default, color output is enabled depending on the terminal |
| 101 | +- `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local` |
| 102 | +- `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state` |
0 commit comments