Skip to main content

Deploy an outline using AI

Defang supports generating new project outlines using integration with an AI model. Using this feature, you can describe what you would like the service to do and the CLI will then generate a project outline with all the files required to make it work.

Step 1 - Create a new folder for the project

mkdir service1
cd service1

Step 2 - Use the CLI generate command

defang login
defang generate

? Choose the language you'd like to use: [Use arrows to move, type to filter]
> Nodejs
Golang
Python

? Please describe the service you'd like to build:
A basic service with 2 REST endpoints. The default endpoint will be for health check and should return a JSON object like this: { "status": "OK" }. The /echo endpoint will echo back all request parameters in the response.

This will generate the different files required to start your project based on your prompt and the language selected.

Step 3 - Review the Code

You can open the files in a code editor to review or make changes as needed before deploying the service.

Step 4 - Build and Deploy

defang compose up