You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/generate-new-code-using-ai.mdx
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,31 +8,35 @@ sidebar_position: 50
8
8
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.
9
9
<iframewidth="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>
10
10
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
18
12
19
13
```text
20
-
defang login
21
14
defang generate
22
15
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]
24
17
> Nodejs
25
18
Golang
26
19
Python
27
20
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]
29
25
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
30
29
```
31
30
32
31
This will generate the different files required to start your project based on your prompt and the language selected.
33
32
34
-
35
33
## Step 3 - Review the Code
34
+
35
+
Change into the new project folder:
36
+
```shell
37
+
cd project1
38
+
```
39
+
36
40
You can open the files in a code editor to review or make changes as needed before deploying the service.
0 commit comments