0:00.000–0:04.340
Today I'll be teaching you how to use Cloud Code in Terminal.
0:04.560–0:07.360
First, let me show you how to install Cloud Code.
0:07.520–0:10.840
I will share with you the link to this page below this video.
0:11.320–0:14.660
Now, if you are using Mac OS, then you copy the first command line
0:14.660–0:17.780
and then you open Terminal and then you paste this in.
0:18.120–0:19.550
Or if you are using Windows,
0:19.550–0:22.160
you can copy the Windows PowerShell command line.
0:23.040–0:24.660
Then you run PowerShell.
0:26.480–0:28.080
Then you paste in the line.
0:28.080–0:29.320
Then you press Enter.
0:30.000–0:32.780
And it will start to install Cloud Code Terminal.
0:33.200–0:35.680
So when it's done, you will see installation complete.
0:35.820–0:39.740
To check, you can type cloud space dash dash version
0:39.740–0:43.740
and press Enter to check that you have installed Cloud Code.
0:44.160–0:46.500
Next, let me show you how to use Cloud Code.
0:46.840–0:48.900
So first, let's create a new folder.
0:49.180–0:52.660
So create a new empty folder on your computer anywhere.
0:53.140–0:54.920
So I'll just use this as an example.
0:55.760–0:58.800
Then before you launch Cloud Code in your terminal,
0:58.800–1:00.600
you want to change to that folder.
1:00.600–1:02.680
So just type CD space.
1:03.540–1:06.480
You can just drag this in like this.
1:06.760–1:08.680
It will automatically fill it up for you.
1:08.940–1:10.700
Or you can also right click.
1:11.160–1:13.280
Then you copy the path.
1:13.420–1:15.620
Then you can paste it in like this.
1:15.720–1:16.540
Then you press Enter.
1:17.040–1:19.500
So right now, I'm in the new folder that I created.
1:19.740–1:20.820
I can now run Cloud.
1:21.160–1:21.960
So I type Cloud.
1:22.080–1:22.940
Then I press Enter.
1:22.940–1:25.140
And then the first time you run Cloud Code,
1:25.280–1:26.420
it will ask you for permissions.
1:26.900–1:27.860
So I press Enter.
1:28.300–1:31.360
So first, you need to log in to connect your Cloud account.
1:31.660–1:34.600
You can type slash login and press Enter.
1:35.080–1:36.680
Then you can select the first option
1:36.680–1:39.800
where you can connect your Cloud account with subscription.
1:40.300–1:43.980
So you need to be at least on the pro plan to use Cloud Code.
1:44.280–1:45.140
So I press Enter.
1:46.140–1:47.640
Then it will open the browser.
1:47.900–1:50.440
If it didn't open, you just copy this link.
1:50.700–1:52.440
So I'll just copy it like this.
1:52.600–1:54.100
I press C to copy.
1:54.600–1:57.100
So when you go to that page, you will see something like this.
1:57.180–2:00.500
You can click on Authorize to connect Cloud Code to your account.
2:00.980–2:03.360
Next, you want to paste this into Cloud Code.
2:03.480–2:04.440
So you want to copy this.
2:04.520–2:05.900
You can click on Copy Code.
2:06.520–2:07.820
Then we go back to Cloud Code.
2:08.260–2:09.440
And then I paste it in.
2:09.760–2:10.720
Then I press Enter.
2:11.680–2:13.340
And you'll see login successful.
2:13.680–2:14.760
Press Enter to continue.
2:15.860–2:18.220
And from here, we can start using Cloud Code.
2:18.600–2:22.440
So the first thing you can do is to select which model you want to use.
2:22.600–2:24.040
So type slash model.
2:24.600–2:25.460
Then press Enter.
2:25.900–2:30.340
You can select if you want to use Sonnet, Fable, Opus, or Haiku.
2:30.740–2:32.768
Now if you're not sure which model to use,
2:32.768–2:34.260
just start with Sonnet first.
2:34.360–2:36.240
It's good enough for many tasks.
2:36.340–2:39.020
Now if you want to make something that's more complicated,
2:39.020–2:43.700
then you can try a more powerful model like Opus or even Fable.
2:44.180–2:47.620
Now Haiku is a faster model, but it is quite outdated for now.
2:47.800–2:48.979
So if you're not sure,
2:48.979–2:51.600
I recommend you to just start with Sonnet first.
2:51.920–2:53.440
Next, you can select the effort.
2:53.640–2:55.180
So type slash effort.
2:55.720–2:56.280
Press Enter.
2:56.800–2:59.040
And then you can select the effort level.
2:59.280–3:03.920
So there is low, medium, high, extra high, and max.
3:03.920–3:06.352
So when you use a higher effort level,
3:06.352–3:09.020
the AI agent will take more time to think.
3:09.500–3:12.600
But then this means it will be slower, you'll wait longer,
3:12.840–3:15.640
and you will use up your usage limits faster.
3:15.960–3:19.860
And if you use a lower effort level, it will be faster and cheaper.
3:20.160–3:24.900
But then the quality might not be as good as a higher effort level.
3:24.900–3:26.218
So if you're not sure,
3:26.218–3:29.220
you can start off with medium effort level first.
3:29.380–3:32.460
And then if you find that it's not working, it's not good enough,
3:32.460–3:34.480
if you cannot do the things you want it to do,
3:34.620–3:37.140
then you can try a higher effort level.
3:37.400–3:40.380
So this depends on how complex the task is.
3:40.740–3:43.320
So if you're not sure, just start off with medium first.
3:43.760–3:44.620
So I press Enter.
3:45.120–3:48.480
Next, let me show you how to change the mode in Cloud Code.
3:48.720–3:51.700
So if you press Shift and tap on your keyboard,
3:51.700–3:53.980
and then you look in the bottom left corner,
3:54.180–3:56.440
you can see I can change to a different mode.
3:56.940–3:58.980
So first, there's Accept Edits On.
3:59.100–4:03.520
That means it will automatically accept any edits that Cloud Code wants to make
4:03.520–4:07.760
so that you don't have to approve every single edit one by one.
4:08.060–4:12.340
Now for this, it will still ask you for permissions for certain actions.
4:12.820–4:14.640
Next, there's also Plan Mode.
4:14.880–4:18.920
This means Cloud Code will plan first before it starts to build anything.
4:18.920–4:21.740
And then there's also Auto Mode On.
4:22.060–4:25.800
So with this, it will automatically approve most of the things for you
4:25.800–4:28.460
as long as it passes a safety check.
4:28.780–4:29.843
And then there's also
4:29.843–4:32.560
the Manual Mode where you don't see anything over here.
4:32.860–4:36.080
This means anytime Cloud Code wants to make any edits,
4:36.280–4:39.160
it will ask you to approve manually one by one.
4:39.500–4:43.340
So it's usually recommended that you start off by planning first.
4:43.460–4:44.720
So I'll do Shift-Tab.
4:44.940–4:46.320
I'm going to Plan Mode.
4:46.320–4:49.040
And now let's build a simple app.
4:49.240–4:55.260
So I could say, build a to-do list app where I can create tasks,
4:55.560–4:57.660
edit them, and delete them.
4:57.940–4:58.820
Then I'll press Enter.
4:59.380–5:01.540
And now Cloud Code will start to write a plan.
5:02.260–5:06.260
So in Plan Mode, Cloud Code might ask you questions on what you want.
5:06.620–5:09.320
So here it's saying, what kind of app should this be?
5:09.540–5:11.080
So I can choose which one I want.
5:11.440–5:12.960
So there I go with the first one.
5:13.260–5:15.560
Then it asks, should tasks be saved permanently?
5:15.560–5:17.600
So just answer the questions accordingly.
5:18.400–5:19.820
And then you submit your answers.
5:20.700–5:21.220
So it's done.
5:21.320–5:24.580
It says Cloud has written up a plan and is ready to execute.
5:24.820–5:25.880
Would you like to proceed?
5:26.060–5:26.805
Then from here,
5:26.805–5:29.440
you have different choices on how you want to continue.
5:29.840–5:32.140
So before you continue, you can read the plan.
5:32.340–5:36.520
So here I can scroll down to read the plan that Cloud Code wrote.
5:36.720–5:38.840
And if all is good, I can proceed.
5:38.840–5:42.460
So I'll go with the first option, yes, and use Auto Mode.
5:42.600–5:45.753
So that this way, it will automatically approve the edits and
5:45.753–5:46.680
the permissions.
5:47.060–5:47.680
So I press Enter.
5:48.140–5:51.220
And you can see it automatically went into Auto Mode on.
5:51.500–5:54.740
So this way, Cloud Code will start to create the files.
5:54.900–5:57.560
It will start to edit them and start to write the code.
5:57.560–6:00.738
Without me having to approve every edit one by one and
6:00.738–6:04.060
without having to approve the different permissions.
6:05.220–6:06.300
So it's done.
6:06.400–6:08.760
This took 2 minutes and 34 seconds.
6:08.760–6:10.880
And it created these files for me.
6:11.100–6:13.180
And it also teaches me to use it.
6:13.260–6:15.420
Just double click index.html.
6:15.660–6:17.040
So let's open the folder.
6:17.500–6:20.760
And here you can see it created these new files for me.
6:20.960–6:23.740
So I could just double click on this to run this app.
6:23.940–6:25.240
So this is what it looks like.
6:25.240–6:26.520
So I could test it out.
6:26.640–6:27.960
Maybe I'll add a few tasks.
6:28.560–6:29.220
Buy groceries.
6:29.960–6:30.800
Do the laundry.
6:31.740–6:32.800
Water the plants.
6:33.340–6:35.020
And let's say I've done this task.
6:35.120–6:36.620
I can mark this as completed.
6:37.060–6:39.080
Now say I want to make a change to this app.
6:39.160–6:41.920
Maybe I want to add a due date to each task.
6:41.920–6:43.700
So I could come back to Cloud Code.
6:43.820–6:48.340
I could say add a due date feature for each task.
6:49.300–6:50.180
So it's done.
6:50.280–6:52.240
It took 1 minute and 29 seconds.
6:52.460–6:53.520
Now let's take a look.
6:53.520–6:57.300
So if I refresh the page, I can now add a date to the task.
6:57.640–6:58.580
So let's try it out.
6:58.740–7:00.960
So say I have a dentist appointment.
7:02.360–7:03.580
Then I'll select a date.
7:04.020–7:04.940
And it works.
7:05.260–7:07.068
So whatever change you want to make,
7:07.068–7:09.720
you just continue telling Cloud Code to do it for you.
7:10.000–7:13.340
Now a tip is you want to regularly clear the conversation.
7:13.340–7:19.371
So if the next task you want to make is not related to the previous things you are working on,
7:19.371–7:21.140
you want to do slash clear.
7:21.300–7:24.340
So you will start a new session with empty contacts.
7:24.680–7:26.448
Now say I want to add a button so
7:26.448–7:29.700
that I can change this app between dark and light theme.
7:29.700–7:32.292
This is not relevant to the previous thing,
7:32.292–7:34.380
which is about creating due dates.
7:34.580–7:35.460
So it's a new thing.
7:35.660–7:38.260
So I will use clear to clear the conversation.
7:38.760–7:40.560
And now I can move on to the next thing.
7:40.820–7:45.200
So you want to regularly do slash clear between your tasks.
7:45.200–7:52.560
So now I can tell Cloud to add a toggle button to toggle between dark and light mode.
7:54.180–7:55.180
So it's done.
7:55.280–7:57.820
You can see it took 1 minute and 4 seconds.
7:58.100–7:59.860
And now let me refresh the page.
8:00.320–8:06.240
And here I see a toggle button where I can click to toggle between a dark theme and a light theme.
8:06.540–8:09.760
So we can just tell Cloud Code to make any changes for you.
8:09.760–8:13.980
Now say you don't like a change and you want to undo your change.
8:14.180–8:15.420
You can go back to Cloud Code.
8:15.600–8:17.860
You can type slash rewind.
8:18.380–8:20.434
And then it will restore the code and
8:20.434–8:22.420
conversation to a previous point.
8:22.620–8:23.873
So if I send rewind,
8:23.873–8:28.180
I can now choose which part of the conversation I want to go back to.
8:28.580–8:30.340
So right now I'm over here.
8:30.500–8:34.140
If I want to go back to my previous message, I can just go up.
8:34.260–8:35.280
Then I press enter.
8:35.280–8:38.544
And then I can choose whether I want to restore the code and
8:38.544–8:41.740
conversation or just the conversation or just the code.
8:42.040–8:44.780
Now if it's just conversation, then the code won't change.
8:45.000–8:46.760
Which means this thing will still be here.
8:46.960–8:49.840
And then if it's restore code, it will restore just the code.
8:50.000–8:53.900
But then the conversation will still be at the point where I ask for the button.
8:54.100–8:55.681
So I will say most of the time,
8:55.681–8:59.040
you'll probably just go with restore code and conversation.
8:59.300–9:01.580
To just bring back everything back in time.
9:01.820–9:02.700
So let's do this.
9:02.780–9:04.340
Restore the code and conversation.
9:04.340–9:08.240
So now I go back to the part where I ask for the toggle button.
9:08.560–9:12.560
Now if I go back to this app, if I refresh, you can see it's gone.
9:12.720–9:16.480
So this is how you undo any changes that you don't want.
9:16.760–9:19.680
So there are many more commands that you can use in Cloud Code.
9:19.820–9:22.140
So when you have the time, you can type slash help.
9:22.380–9:23.100
Press enter.
9:23.560–9:24.860
And you can read through this.
9:25.020–9:26.860
And then you can also go to commands.
9:27.160–9:28.240
Press your right arrow key.
9:28.640–9:32.580
These are all of the different commands that you can use in Cloud Code.
9:32.580–9:34.060
So there's quite a lot of them.
9:34.480–9:36.660
You don't have to learn every single one of them.
9:37.020–9:39.100
You can just go through when you have the time.
9:39.540–9:44.220
And then you get used to the different commands that you can use in Cloud Code.
9:44.220–9:47.300
So that's how to use Cloud Code in Terminal.
0:00.000–0:04.340
Today I'll be teaching you how to use Cloud Code in Terminal.
今天我要教大家如何在終端機中使用 Cloud Code。
0:04.560–0:07.360
First, let me show you how to install Cloud Code.
首先,讓我展示如何安裝 Cloud Code。
0:07.520–0:10.840
I will share with you the link to this page below this video.
我會與大家分享這個頁面的連結,位於本影片下方。
0:11.320–0:14.660
Now, if you are using Mac OS, then you copy the first command line
現在,如果你使用的是 Mac OS,請複製第一行命令列指令
0:14.660–0:17.780
and then you open Terminal and then you paste this in.
然後打開終端機,並將它貼上。
0:18.120–0:19.550
Or if you are using Windows,
或者如果你使用的是 Windows,
0:19.550–0:22.160
you can copy the Windows PowerShell command line.
你可以複製 Windows PowerShell 的命令列指令。
0:23.040–0:24.660
Then you run PowerShell.
接著執行 PowerShell。
0:26.480–0:28.080
Then you paste in the line.
然後將指令貼上。
0:28.080–0:29.320
Then you press Enter.
接著按下 Enter 鍵。
0:30.000–0:32.780
And it will start to install Cloud Code Terminal.
它就會開始安裝 Cloud Code 終端機。
0:33.200–0:35.680
So when it's done, you will see installation complete.
所以當安裝完成時,你會看到「安裝完成」的訊息。
0:35.820–0:39.740
To check, you can type cloud space dash dash version
要進行檢查,你可以輸入 cloud space --version
0:39.740–0:43.740
and press Enter to check that you have installed Cloud Code.
並按下 Enter 鍵,確認你已安裝 Cloud Code。
0:44.160–0:46.500
Next, let me show you how to use Cloud Code.
接下來,讓我展示如何使用 Cloud Code。
0:46.840–0:48.900
So first, let's create a new folder.
首先,讓我們建立一個新資料夾。
0:49.180–0:52.660
So create a new empty folder on your computer anywhere.
請在你的電腦上任意位置建立一個新的空資料夾。
0:53.140–0:54.920
So I'll just use this as an example.
所以我將以此作為範例。
0:55.760–0:58.800
Then before you launch Cloud Code in your terminal,
然後在終端機中啟動 Cloud Code 之前,
0:58.800–1:00.600
you want to change to that folder.
你需要切換到該資料夾。
1:00.600–1:02.680
So just type CD space.
所以只需輸入 CD 空格。
1:03.540–1:06.480
You can just drag this in like this.
你可以直接將資料夾拖曳至此。
1:06.760–1:08.680
It will automatically fill it up for you.
它會自動為你填入路徑。
1:08.940–1:10.700
Or you can also right click.
或者你也可以按右鍵。
1:11.160–1:13.280
Then you copy the path.
然後複製路徑。
1:13.420–1:15.620
Then you can paste it in like this.
接著像這樣將它貼上。
1:15.720–1:16.540
Then you press Enter.
然後按下 Enter 鍵。
1:17.040–1:19.500
So right now, I'm in the new folder that I created.
現在,我已經進入我建立的新資料夾。
1:19.740–1:20.820
I can now run Cloud.
我現在可以執行 Cloud。
1:21.160–1:21.960
So I type Cloud.
所以我輸入 Cloud。
1:22.080–1:22.940
Then I press Enter.
然後按下 Enter 鍵。
1:22.940–1:25.140
And then the first time you run Cloud Code,
然後第一次執行 Cloud Code 時,
1:25.280–1:26.420
it will ask you for permissions.
它會詢問你權限。
1:26.900–1:27.860
So I press Enter.
所以我按下 Enter 鍵。
1:28.300–1:31.360
So first, you need to log in to connect your Cloud account.
首先,你需要登入以連接你的 Cloud 帳戶。
1:31.660–1:34.600
You can type slash login and press Enter.
你可以輸入 /login 並按下 Enter 鍵。
1:35.080–1:36.680
Then you can select the first option
然後你可以選擇第一個選項
1:36.680–1:39.800
where you can connect your Cloud account with subscription.
其中你可以連接具有訂閱方案的 Cloud 帳戶。
1:40.300–1:43.980
So you need to be at least on the pro plan to use Cloud Code.
所以你需要至少是 Pro 方案才能使用 Cloud Code。
1:44.280–1:45.140
So I press Enter.
所以我按下 Enter 鍵。
1:46.140–1:47.640
Then it will open the browser.
接著它會開啟瀏覽器。
1:47.900–1:50.440
If it didn't open, you just copy this link.
如果沒有開啟,你只要複製這個連結。
1:50.700–1:52.440
So I'll just copy it like this.
所以我就像這樣複製它。
1:52.600–1:54.100
I press C to copy.
我按下 C 來複製。
1:54.600–1:57.100
So when you go to that page, you will see something like this.
所以當你前往該頁面時,你會看到類似這樣的畫面。
1:57.180–2:00.500
You can click on Authorize to connect Cloud Code to your account.
你可以點擊「授權」來將 Cloud Code 連接到你的帳戶。
2:00.980–2:03.360
Next, you want to paste this into Cloud Code.
接下來,你要將這個貼到 Cloud Code 中。
2:03.480–2:04.440
So you want to copy this.
所以你要複製這個。
2:04.520–2:05.900
You can click on Copy Code.
你可以點擊「複製代碼」。
2:06.520–2:07.820
Then we go back to Cloud Code.
然後我們回到 Cloud Code。
2:08.260–2:09.440
And then I paste it in.
然後我把它貼上。
2:09.760–2:10.720
Then I press Enter.
接著我按下 Enter。
2:11.680–2:13.340
And you'll see login successful.
你會看到登入成功。
2:13.680–2:14.760
Press Enter to continue.
按下 Enter 繼續。
2:15.860–2:18.220
And from here, we can start using Cloud Code.
從這裡開始,我們就可以使用 Cloud Code 了。
2:18.600–2:22.440
So the first thing you can do is to select which model you want to use.
所以你可以做的第一件事是選擇你想使用的模型。
2:22.600–2:24.040
So type slash model.
所以輸入斜線 model。
2:24.600–2:25.460
Then press Enter.
然後按下 Enter。
2:25.900–2:30.340
You can select if you want to use Sonnet, Fable, Opus, or Haiku.
你可以選擇是否要使用 Sonnet、Fable、Opus 或 Haiku。
2:30.740–2:32.768
Now if you're not sure which model to use,
現在如果你不確定要使用哪個模型,
2:32.768–2:34.260
just start with Sonnet first.
先從 Sonnet 開始就好。
2:34.360–2:36.240
It's good enough for many tasks.
對於許多任務來說,它已經足夠好了。
2:36.340–2:39.020
Now if you want to make something that's more complicated,
現在如果你想要製作更複雜的東西,
2:39.020–2:43.700
then you can try a more powerful model like Opus or even Fable.
那麼你可以嘗試更強大的模型,像是 Opus 甚至 Fable。
2:44.180–2:47.620
Now Haiku is a faster model, but it is quite outdated for now.
現在 Haiku 是一個更快的模型,但就目前來說它相當過時。
2:47.800–2:48.979
So if you're not sure,
所以如果你不確定,
2:48.979–2:51.600
I recommend you to just start with Sonnet first.
我建議你先從 Sonnet 開始。
2:51.920–2:53.440
Next, you can select the effort.
接下來,你可以選擇努力程度。
2:53.640–2:55.180
So type slash effort.
所以輸入斜線 effort。
2:55.720–2:56.280
Press Enter.
按下 Enter。
2:56.800–2:59.040
And then you can select the effort level.
然後你可以選擇努力程度等級。
2:59.280–3:03.920
So there is low, medium, high, extra high, and max.
所以有低、中、高、超高和最大。
3:03.920–3:06.352
So when you use a higher effort level,
所以當你使用較高的努力程度等級時,
3:06.352–3:09.020
the AI agent will take more time to think.
AI 代理會花更多時間思考。
3:09.500–3:12.600
But then this means it will be slower, you'll wait longer,
但這意味著它會比較慢,你會等待更久,
3:12.840–3:15.640
and you will use up your usage limits faster.
而且你會更快地耗盡你的使用額度。
3:15.960–3:19.860
And if you use a lower effort level, it will be faster and cheaper.
如果你使用較低的努力程度等級,它會更快也更便宜。
3:20.160–3:24.900
But then the quality might not be as good as a higher effort level.
但這意味著品質可能不如較高的努力程度等級。
3:24.900–3:26.218
So if you're not sure,
所以如果你不確定,
3:26.218–3:29.220
you can start off with medium effort level first.
你可以先從中等努力程度等級開始。
3:29.380–3:32.460
And then if you find that it's not working, it's not good enough,
接著,如果你發現它無法運作,或者效果不夠好,
3:32.460–3:34.480
if you cannot do the things you want it to do,
如果它無法執行你想要的功能,
3:34.620–3:37.140
then you can try a higher effort level.
那麼你可以嘗試更高的努力等級。
3:37.400–3:40.380
So this depends on how complex the task is.
所以這取決於任務的複雜程度。
3:40.740–3:43.320
So if you're not sure, just start off with medium first.
所以如果你不確定,先從中等等級開始。
3:43.760–3:44.620
So I press Enter.
所以我按下 Enter。
3:45.120–3:48.480
Next, let me show you how to change the mode in Cloud Code.
接下來,讓我展示如何在 Cloud Code 中切換模式。
3:48.720–3:51.700
So if you press Shift and tap on your keyboard,
所以如果你按下 Shift 並點擊鍵盤上的某個鍵,
3:51.700–3:53.980
and then you look in the bottom left corner,
然後你看左下角,
3:54.180–3:56.440
you can see I can change to a different mode.
你會看到我可以切換到不同的模式。
3:56.940–3:58.980
So first, there's Accept Edits On.
首先,有「接受編輯」模式。
3:59.100–4:03.520
That means it will automatically accept any edits that Cloud Code wants to make
這意味著它會自動接受 Cloud Code 想要進行的任何編輯,
4:03.520–4:07.760
so that you don't have to approve every single edit one by one.
這樣你就不需要逐一批准每一次編輯。
4:08.060–4:12.340
Now for this, it will still ask you for permissions for certain actions.
不過,對於某些操作,它仍會請求你的許可。
4:12.820–4:14.640
Next, there's also Plan Mode.
接下來,還有「計畫模式」。
4:14.880–4:18.920
This means Cloud Code will plan first before it starts to build anything.
這意味著 Cloud Code 會在開始建構任何東西之前先進行計畫。
4:18.920–4:21.740
And then there's also Auto Mode On.
接著還有「自動模式」。
4:22.060–4:25.800
So with this, it will automatically approve most of the things for you
使用這個模式,只要通過安全檢查,它會自動為你批准大部分事項,
4:25.800–4:28.460
as long as it passes a safety check.
除非未通過安全檢查。
4:28.780–4:29.843
And then there's also
接著還有
4:29.843–4:32.560
the Manual Mode where you don't see anything over here.
「手動模式」,在這種模式下你不會看到這裡有任何自動動作。
4:32.860–4:36.080
This means anytime Cloud Code wants to make any edits,
這意味著無論何時 Cloud Code 想要進行任何編輯,
4:36.280–4:39.160
it will ask you to approve manually one by one.
它都會要求你逐一手動批准。
4:39.500–4:43.340
So it's usually recommended that you start off by planning first.
所以通常建議你先進行計畫。
4:43.460–4:44.720
So I'll do Shift-Tab.
所以我按下 Shift-Tab。
4:44.940–4:46.320
I'm going to Plan Mode.
我要進入「計畫模式」。
4:46.320–4:49.040
And now let's build a simple app.
現在讓我們建構一個簡單的應用程式。
4:49.240–4:55.260
So I could say, build a to-do list app where I can create tasks,
我可以說,建構一個待辦事項應用程式,我可以建立任務,
4:55.560–4:57.660
edit them, and delete them.
編輯它們,並刪除它們。
4:57.940–4:58.820
Then I'll press Enter.
然後我按下 Enter。
4:59.380–5:01.540
And now Cloud Code will start to write a plan.
現在 Cloud Code 會開始撰寫計畫。
5:02.260–5:06.260
So in Plan Mode, Cloud Code might ask you questions on what you want.
所以在「計畫模式」下,Cloud Code 可能會詢問你想要什麼。
5:06.620–5:09.320
So here it's saying, what kind of app should this be?
這裡它說,這應該是什麼類型的應用程式?
5:09.540–5:11.080
So I can choose which one I want.
所以我可以選擇我想要的那一個。
5:11.440–5:12.960
So there I go with the first one.
所以我選擇了第一個。
5:13.260–5:15.560
Then it asks, should tasks be saved permanently?
然後它問,任務是否應該永久保存?
5:15.560–5:17.600
So just answer the questions accordingly.
所以請根據問題相應回答。
5:18.400–5:19.820
And then you submit your answers.
然後你提交你的答案。
5:20.700–5:21.220
So it's done.
所以完成了。
5:21.320–5:24.580
It says Cloud has written up a plan and is ready to execute.
它說雲端已撰寫好計畫並準備執行。
5:24.820–5:25.880
Would you like to proceed?
您是否要繼續進行?
5:26.060–5:26.805
Then from here,
接著從這裡,
5:26.805–5:29.440
you have different choices on how you want to continue.
您可以選擇不同的方式繼續進行。
5:29.840–5:32.140
So before you continue, you can read the plan.
因此,在繼續之前,您可以閱讀該計畫。
5:32.340–5:36.520
So here I can scroll down to read the plan that Cloud Code wrote.
在這裡,我可以向下捲動以閱讀 Cloud Code 撰寫的計畫。
5:36.720–5:38.840
And if all is good, I can proceed.
如果一切沒問題,我可以繼續進行。
5:38.840–5:42.460
So I'll go with the first option, yes, and use Auto Mode.
所以我選擇第一個選項「是」,並使用自動模式(Auto Mode)。
5:42.600–5:45.753
So that this way, it will automatically approve the edits and
這樣做可以自動核准編輯內容,
5:45.753–5:46.680
the permissions.
以及相關權限。
5:47.060–5:47.680
So I press Enter.
所以我按下 Enter 鍵。
5:48.140–5:51.220
And you can see it automatically went into Auto Mode on.
您可以看到它已自動進入自動模式。
5:51.500–5:54.740
So this way, Cloud Code will start to create the files.
這樣,Cloud Code 就會開始建立檔案。
5:54.900–5:57.560
It will start to edit them and start to write the code.
它會開始編輯這些檔案並撰寫程式碼。
5:57.560–6:00.738
Without me having to approve every edit one by one and
不需要我逐一核准每項編輯,
6:00.738–6:04.060
without having to approve the different permissions.
也不需要逐一核准不同的權限。
6:05.220–6:06.300
So it's done.
這樣就完成了。
6:06.400–6:08.760
This took 2 minutes and 34 seconds.
這花了 2 分 34 秒。
6:08.760–6:10.880
And it created these files for me.
它為我建立了這些檔案。
6:11.100–6:13.180
And it also teaches me to use it.
它也教導我如何使用它。
6:13.260–6:15.420
Just double click index.html.
只要雙擊 index.html。
6:15.660–6:17.040
So let's open the folder.
所以讓我們開啟資料夾。
6:17.500–6:20.760
And here you can see it created these new files for me.
在這裡您可以看到它為我建立了這些新檔案。
6:20.960–6:23.740
So I could just double click on this to run this app.
所以我可以直接雙擊這個檔案來執行這個應用程式。
6:23.940–6:25.240
So this is what it looks like.
這就是它的樣子。
6:25.240–6:26.520
So I could test it out.
所以我們可以測試一下。
6:26.640–6:27.960
Maybe I'll add a few tasks.
也許我會新增一些任務。
6:28.560–6:29.220
Buy groceries.
購買 groceries(生鮮食品)。
6:29.960–6:30.800
Do the laundry.
洗衣服。
6:31.740–6:32.800
Water the plants.
澆灌植物。
6:33.340–6:35.020
And let's say I've done this task.
假設我已經完成了這項任務。
6:35.120–6:36.620
I can mark this as completed.
我可以將其標記為已完成。
6:37.060–6:39.080
Now say I want to make a change to this app.
現在假設我想對這個應用程式進行變更。
6:39.160–6:41.920
Maybe I want to add a due date to each task.
也許我想為每個任務新增到期日。
6:41.920–6:43.700
So I could come back to Cloud Code.
所以我可以回到 Cloud Code。
6:43.820–6:48.340
I could say add a due date feature for each task.
我可以說為每個任務新增到期日功能。
6:49.300–6:50.180
So it's done.
這樣就完成了。
6:50.280–6:52.240
It took 1 minute and 29 seconds.
這花了 1 分 29 秒。
6:52.460–6:53.520
Now let's take a look.
現在讓我們來看看。
6:53.520–6:57.300
So if I refresh the page, I can now add a date to the task.
所以如果我重新整理頁面,我現在可以為任務新增日期。
6:57.640–6:58.580
So let's try it out.
所以讓我們試試看。
6:58.740–7:00.960
So say I have a dentist appointment.
假設我有一個牙醫預約。
7:02.360–7:03.580
Then I'll select a date.
接著我會選擇一個日期。
7:04.020–7:04.940
And it works.
而且它運作正常。
7:05.260–7:07.068
So whatever change you want to make,
所以無論你想進行什麼變更,
7:07.068–7:09.720
you just continue telling Cloud Code to do it for you.
你只需繼續指示 Cloud Code 為你執行即可。
7:10.000–7:13.340
Now a tip is you want to regularly clear the conversation.
現在有個小建議,你希望定期清除對話記錄。
7:13.340–7:19.371
So if the next task you want to make is not related to the previous things you are working on,
所以如果你接下來要處理的任務與之前正在進行的工作無關,
7:19.371–7:21.140
you want to do slash clear.
你就需要輸入 /clear(清除)。
7:21.300–7:24.340
So you will start a new session with empty contacts.
這樣你將開始一個擁有空聯絡人列表的新工作階段。
7:24.680–7:26.448
Now say I want to add a button so
現在假設我想新增一個按鈕,以便
7:26.448–7:29.700
that I can change this app between dark and light theme.
讓我能在此應用程式中切換深色和淺色主題。
7:29.700–7:32.292
This is not relevant to the previous thing,
這與之前的工作無關,
7:32.292–7:34.380
which is about creating due dates.
之前的工作是關於建立到期日。
7:34.580–7:35.460
So it's a new thing.
所以這是一個全新的任務。
7:35.660–7:38.260
So I will use clear to clear the conversation.
因此我會使用 clear 來清除對話記錄。
7:38.760–7:40.560
And now I can move on to the next thing.
現在我可以繼續進行下一個任務。
7:40.820–7:45.200
So you want to regularly do slash clear between your tasks.
所以你在不同任務之間希望定期執行 /clear。
7:45.200–7:52.560
So now I can tell Cloud to add a toggle button to toggle between dark and light mode.
現在我可以告訴 Cloud 新增一個切換按鈕,用於在深色和淺色模式之間切換。
7:54.180–7:55.180
So it's done.
所以完成了。
7:55.280–7:57.820
You can see it took 1 minute and 4 seconds.
你可以看到這花了 1 分 4 秒。
7:58.100–7:59.860
And now let me refresh the page.
現在讓我重新整理頁面。
8:00.320–8:06.240
And here I see a toggle button where I can click to toggle between a dark theme and a light theme.
在這裡我看到一個切換按鈕,我可以點擊它來切換深色主題和淺色主題。
8:06.540–8:09.760
So we can just tell Cloud Code to make any changes for you.
所以我們只需告訴 Cloud Code 為你進行任何變更即可。
8:09.760–8:13.980
Now say you don't like a change and you want to undo your change.
現在假設你不喜歡某個變更,並且想要復原你的變更。
8:14.180–8:15.420
You can go back to Cloud Code.
你可以回到 Cloud Code。
8:15.600–8:17.860
You can type slash rewind.
你可以輸入 /rewind(倒帶)。
8:18.380–8:20.434
And then it will restore the code and
接著它會將程式碼和
8:20.434–8:22.420
conversation to a previous point.
對話記錄還原到之前的某個狀態。
8:22.620–8:23.873
So if I send rewind,
所以如果我發送 rewind,
8:23.873–8:28.180
I can now choose which part of the conversation I want to go back to.
我現在可以選擇要回到對話記錄的哪一部分。
8:28.580–8:30.340
So right now I'm over here.
所以目前我在這裡。
8:30.500–8:34.140
If I want to go back to my previous message, I can just go up.
如果我想回到之前的訊息,我只需向上移動。
8:34.260–8:35.280
Then I press enter.
然後我按下 Enter。
8:35.280–8:38.544
And then I can choose whether I want to restore the code and
接著我可以選擇是否要還原程式碼和
8:38.544–8:41.740
conversation or just the conversation or just the code.
對話記錄,或者只還原對話記錄,或者只還原程式碼。
8:42.040–8:44.780
Now if it's just conversation, then the code won't change.
現在如果只是還原對話記錄,那麼程式碼就不會改變。
8:45.000–8:46.760
Which means this thing will still be here.
這意味著這個東西仍然會存在。
8:46.960–8:49.840
And then if it's restore code, it will restore just the code.
然後如果是還原程式碼,它只會還原程式碼。
8:50.000–8:53.900
But then the conversation will still be at the point where I ask for the button.
但對話記錄仍會停留在我要求新增按鈕的那個狀態。
8:54.100–8:55.681
So I will say most of the time,
所以我會說,在大多數情況下,
8:55.681–8:59.040
you'll probably just go with restore code and conversation.
你可能只會選擇還原程式碼和對話。
8:59.300–9:01.580
To just bring back everything back in time.
將一切恢復到之前的狀態。
9:01.820–9:02.700
So let's do this.
所以我們來做這個。
9:02.780–9:04.340
Restore the code and conversation.
還原程式碼和對話。
9:04.340–9:08.240
So now I go back to the part where I ask for the toggle button.
現在我回到我要求切換按鈕的那個部分。
9:08.560–9:12.560
Now if I go back to this app, if I refresh, you can see it's gone.
現在如果我回到這個應用程式,如果我重新整理,你可以看到它已經消失了。
9:12.720–9:16.480
So this is how you undo any changes that you don't want.
所以這就是如何撤銷你不想要的任何變更。
9:16.760–9:19.680
So there are many more commands that you can use in Cloud Code.
所以還有許多更多的命令你可以在 Cloud Code 中使用。
9:19.820–9:22.140
So when you have the time, you can type slash help.
所以當你有的時候,你可以輸入斜線幫助。
9:22.380–9:23.100
Press enter.
按下 Enter。
9:23.560–9:24.860
And you can read through this.
然後你可以閱讀這些內容。
9:25.020–9:26.860
And then you can also go to commands.
然後你也可以前往命令。
9:27.160–9:28.240
Press your right arrow key.
按下你的右方向鍵。
9:28.640–9:32.580
These are all of the different commands that you can use in Cloud Code.
這些都是你可以在 Cloud Code 中使用的不同命令。
9:32.580–9:34.060
So there's quite a lot of them.
所以它們相當多。
9:34.480–9:36.660
You don't have to learn every single one of them.
你不需要學習每一個。
9:37.020–9:39.100
You can just go through when you have the time.
你可以當你有時間的時候去瀏覽。
9:39.540–9:44.220
And then you get used to the different commands that you can use in Cloud Code.
然後你會習慣在 Cloud Code 中可以使用的不同命令。
9:44.220–9:47.300
So that's how to use Cloud Code in Terminal.
所以這就是如何在 Terminal 中使用 Cloud Code。