Skip to content

Commit 1313263

Browse files
authored
Update generate-new-code-using-ai.mdx
new prompts
1 parent 484b40b commit 1313263

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/tutorials/generate-new-code-using-ai.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,35 @@ sidebar_position: 50
88
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.
99
<iframe width="560" height="315" src="https://www.youtube.com/embed/afglsBYieuc?si=GCvHhBu3H9ktMDHA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1010

11-
## Step 1 - Create a new folder for the project
12-
```text
13-
mkdir service1
14-
cd service1
15-
```
16-
17-
## Step 2 - Use the CLI generate command
11+
## Step 1 - Use the CLI generate command
1812

1913
```text
20-
defang login
2114
defang generate
2215
23-
? Choose the language you'd like to use: [Use arrows to move, type to filter]
16+
? Choose the language you'd like to use: [Use arrows to move, type to filter, ? for more help]
2417
> Nodejs
2518
Golang
2619
Python
2720
28-
? Please describe the service you'd like to build:
21+
? Choose a sample service:
22+
Generate with AI
23+
24+
? Please describe the service you'd like to build: [? for help]
2925
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.
26+
27+
? What folder would you like to create the service in? [? for help] (service1)
28+
project1
3029
```
3130

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

34-
3533
## Step 3 - Review the Code
34+
35+
Change into the new project folder:
36+
```shell
37+
cd project1
38+
```
39+
3640
You can open the files in a code editor to review or make changes as needed before deploying the service.
3741

3842
## Step 4 - Build and Deploy

0 commit comments

Comments
 (0)