實際影片長度:9:49.000。原文、繁中、雙語可點擊句子跳轉影片。
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
今天我要教大家如何在終端機中使用 Cloud Code。
0:04.560–0:07.360
首先,讓我展示如何安裝 Cloud Code。
0:07.520–0:10.840
我會與大家分享這個頁面的連結,位於本影片下方。
0:11.320–0:14.660
現在,如果你使用的是 Mac OS,請複製第一行命令列指令
0:14.660–0:17.780
然後打開終端機,並將它貼上。
0:18.120–0:19.550
或者如果你使用的是 Windows,
0:19.550–0:22.160
你可以複製 Windows PowerShell 的命令列指令。
0:23.040–0:24.660
接著執行 PowerShell。
0:26.480–0:28.080
然後將指令貼上。
0:28.080–0:29.320
接著按下 Enter 鍵。
0:30.000–0:32.780
它就會開始安裝 Cloud Code 終端機。
0:33.200–0:35.680
所以當安裝完成時,你會看到「安裝完成」的訊息。
0:35.820–0:39.740
要進行檢查,你可以輸入 cloud space --version
0:39.740–0:43.740
並按下 Enter 鍵,確認你已安裝 Cloud Code。
0:44.160–0:46.500
接下來,讓我展示如何使用 Cloud Code。
0:46.840–0:48.900
首先,讓我們建立一個新資料夾。
0:49.180–0:52.660
請在你的電腦上任意位置建立一個新的空資料夾。
0:53.140–0:54.920
所以我將以此作為範例。
0:55.760–0:58.800
然後在終端機中啟動 Cloud Code 之前,
0:58.800–1:00.600
你需要切換到該資料夾。
1:00.600–1:02.680
所以只需輸入 CD 空格。
1:03.540–1:06.480
你可以直接將資料夾拖曳至此。
1:06.760–1:08.680
它會自動為你填入路徑。
1:08.940–1:10.700
或者你也可以按右鍵。
1:11.160–1:13.280
然後複製路徑。
1:13.420–1:15.620
接著像這樣將它貼上。
1:15.720–1:16.540
然後按下 Enter 鍵。
1:17.040–1:19.500
現在,我已經進入我建立的新資料夾。
1:19.740–1:20.820
我現在可以執行 Cloud。
1:21.160–1:21.960
所以我輸入 Cloud。
1:22.080–1:22.940
然後按下 Enter 鍵。
1:22.940–1:25.140
然後第一次執行 Cloud Code 時,
1:25.280–1:26.420
它會詢問你權限。
1:26.900–1:27.860
所以我按下 Enter 鍵。
1:28.300–1:31.360
首先,你需要登入以連接你的 Cloud 帳戶。
1:31.660–1:34.600
你可以輸入 /login 並按下 Enter 鍵。
1:35.080–1:36.680
然後你可以選擇第一個選項
1:36.680–1:39.800
其中你可以連接具有訂閱方案的 Cloud 帳戶。
1:40.300–1:43.980
所以你需要至少是 Pro 方案才能使用 Cloud Code。
1:44.280–1:45.140
所以我按下 Enter 鍵。
1:46.140–1:47.640
接著它會開啟瀏覽器。
1:47.900–1:50.440
如果沒有開啟,你只要複製這個連結。
1:50.700–1:52.440
所以我就像這樣複製它。
1:52.600–1:54.100
我按下 C 來複製。
1:54.600–1:57.100
所以當你前往該頁面時,你會看到類似這樣的畫面。
1:57.180–2:00.500
你可以點擊「授權」來將 Cloud Code 連接到你的帳戶。
2:00.980–2:03.360
接下來,你要將這個貼到 Cloud Code 中。
2:03.480–2:04.440
所以你要複製這個。
2:04.520–2:05.900
你可以點擊「複製代碼」。
2:06.520–2:07.820
然後我們回到 Cloud Code。
2:08.260–2:09.440
然後我把它貼上。
2:09.760–2:10.720
接著我按下 Enter。
2:11.680–2:13.340
你會看到登入成功。
2:13.680–2:14.760
按下 Enter 繼續。
2:15.860–2:18.220
從這裡開始,我們就可以使用 Cloud Code 了。
2:18.600–2:22.440
所以你可以做的第一件事是選擇你想使用的模型。
2:22.600–2:24.040
所以輸入斜線 model。
2:24.600–2:25.460
然後按下 Enter。
2:25.900–2:30.340
你可以選擇是否要使用 Sonnet、Fable、Opus 或 Haiku。
2:30.740–2:32.768
現在如果你不確定要使用哪個模型,
2:32.768–2:34.260
先從 Sonnet 開始就好。
2:34.360–2:36.240
對於許多任務來說,它已經足夠好了。
2:36.340–2:39.020
現在如果你想要製作更複雜的東西,
2:39.020–2:43.700
那麼你可以嘗試更強大的模型,像是 Opus 甚至 Fable。
2:44.180–2:47.620
現在 Haiku 是一個更快的模型,但就目前來說它相當過時。
2:47.800–2:48.979
所以如果你不確定,
2:48.979–2:51.600
我建議你先從 Sonnet 開始。
2:51.920–2:53.440
接下來,你可以選擇努力程度。
2:53.640–2:55.180
所以輸入斜線 effort。
2:55.720–2:56.280
按下 Enter。
2:56.800–2:59.040
然後你可以選擇努力程度等級。
2:59.280–3:03.920
所以有低、中、高、超高和最大。
3:03.920–3:06.352
所以當你使用較高的努力程度等級時,
3:06.352–3:09.020
AI 代理會花更多時間思考。
3:09.500–3:12.600
但這意味著它會比較慢,你會等待更久,
3:12.840–3:15.640
而且你會更快地耗盡你的使用額度。
3:15.960–3:19.860
如果你使用較低的努力程度等級,它會更快也更便宜。
3:20.160–3:24.900
但這意味著品質可能不如較高的努力程度等級。
3:24.900–3:26.218
所以如果你不確定,
3:26.218–3:29.220
你可以先從中等努力程度等級開始。
3:29.380–3:32.460
接著,如果你發現它無法運作,或者效果不夠好,
3:32.460–3:34.480
如果它無法執行你想要的功能,
3:34.620–3:37.140
那麼你可以嘗試更高的努力等級。
3:37.400–3:40.380
所以這取決於任務的複雜程度。
3:40.740–3:43.320
所以如果你不確定,先從中等等級開始。
3:43.760–3:44.620
所以我按下 Enter。
3:45.120–3:48.480
接下來,讓我展示如何在 Cloud Code 中切換模式。
3:48.720–3:51.700
所以如果你按下 Shift 並點擊鍵盤上的某個鍵,
3:51.700–3:53.980
然後你看左下角,
3:54.180–3:56.440
你會看到我可以切換到不同的模式。
3:56.940–3:58.980
首先,有「接受編輯」模式。
3:59.100–4:03.520
這意味著它會自動接受 Cloud Code 想要進行的任何編輯,
4:03.520–4:07.760
這樣你就不需要逐一批准每一次編輯。
4:08.060–4:12.340
不過,對於某些操作,它仍會請求你的許可。
4:12.820–4:14.640
接下來,還有「計畫模式」。
4:14.880–4:18.920
這意味著 Cloud Code 會在開始建構任何東西之前先進行計畫。
4:18.920–4:21.740
接著還有「自動模式」。
4:22.060–4:25.800
使用這個模式,只要通過安全檢查,它會自動為你批准大部分事項,
4:25.800–4:28.460
除非未通過安全檢查。
4:28.780–4:29.843
接著還有
4:29.843–4:32.560
「手動模式」,在這種模式下你不會看到這裡有任何自動動作。
4:32.860–4:36.080
這意味著無論何時 Cloud Code 想要進行任何編輯,
4:36.280–4:39.160
它都會要求你逐一手動批准。
4:39.500–4:43.340
所以通常建議你先進行計畫。
4:43.460–4:44.720
所以我按下 Shift-Tab。
4:44.940–4:46.320
我要進入「計畫模式」。
4:46.320–4:49.040
現在讓我們建構一個簡單的應用程式。
4:49.240–4:55.260
我可以說,建構一個待辦事項應用程式,我可以建立任務,
4:55.560–4:57.660
編輯它們,並刪除它們。
4:57.940–4:58.820
然後我按下 Enter。
4:59.380–5:01.540
現在 Cloud Code 會開始撰寫計畫。
5:02.260–5:06.260
所以在「計畫模式」下,Cloud Code 可能會詢問你想要什麼。
5:06.620–5:09.320
這裡它說,這應該是什麼類型的應用程式?
5:09.540–5:11.080
所以我可以選擇我想要的那一個。
5:11.440–5:12.960
所以我選擇了第一個。
5:13.260–5:15.560
然後它問,任務是否應該永久保存?
5:15.560–5:17.600
所以請根據問題相應回答。
5:18.400–5:19.820
然後你提交你的答案。
5:20.700–5:21.220
所以完成了。
5:21.320–5:24.580
它說雲端已撰寫好計畫並準備執行。
5:24.820–5:25.880
您是否要繼續進行?
5:26.060–5:26.805
接著從這裡,
5:26.805–5:29.440
您可以選擇不同的方式繼續進行。
5:29.840–5:32.140
因此,在繼續之前,您可以閱讀該計畫。
5:32.340–5:36.520
在這裡,我可以向下捲動以閱讀 Cloud Code 撰寫的計畫。
5:36.720–5:38.840
如果一切沒問題,我可以繼續進行。
5:38.840–5:42.460
所以我選擇第一個選項「是」,並使用自動模式(Auto Mode)。
5:42.600–5:45.753
這樣做可以自動核准編輯內容,
5:45.753–5:46.680
以及相關權限。
5:47.060–5:47.680
所以我按下 Enter 鍵。
5:48.140–5:51.220
您可以看到它已自動進入自動模式。
5:51.500–5:54.740
這樣,Cloud Code 就會開始建立檔案。
5:54.900–5:57.560
它會開始編輯這些檔案並撰寫程式碼。
5:57.560–6:00.738
不需要我逐一核准每項編輯,
6:00.738–6:04.060
也不需要逐一核准不同的權限。
6:05.220–6:06.300
這樣就完成了。
6:06.400–6:08.760
這花了 2 分 34 秒。
6:08.760–6:10.880
它為我建立了這些檔案。
6:11.100–6:13.180
它也教導我如何使用它。
6:13.260–6:15.420
只要雙擊 index.html。
6:15.660–6:17.040
所以讓我們開啟資料夾。
6:17.500–6:20.760
在這裡您可以看到它為我建立了這些新檔案。
6:20.960–6:23.740
所以我可以直接雙擊這個檔案來執行這個應用程式。
6:23.940–6:25.240
這就是它的樣子。
6:25.240–6:26.520
所以我們可以測試一下。
6:26.640–6:27.960
也許我會新增一些任務。
6:28.560–6:29.220
購買 groceries(生鮮食品)。
6:29.960–6:30.800
洗衣服。
6:31.740–6:32.800
澆灌植物。
6:33.340–6:35.020
假設我已經完成了這項任務。
6:35.120–6:36.620
我可以將其標記為已完成。
6:37.060–6:39.080
現在假設我想對這個應用程式進行變更。
6:39.160–6:41.920
也許我想為每個任務新增到期日。
6:41.920–6:43.700
所以我可以回到 Cloud Code。
6:43.820–6:48.340
我可以說為每個任務新增到期日功能。
6:49.300–6:50.180
這樣就完成了。
6:50.280–6:52.240
這花了 1 分 29 秒。
6:52.460–6:53.520
現在讓我們來看看。
6:53.520–6:57.300
所以如果我重新整理頁面,我現在可以為任務新增日期。
6:57.640–6:58.580
所以讓我們試試看。
6:58.740–7:00.960
假設我有一個牙醫預約。
7:02.360–7:03.580
接著我會選擇一個日期。
7:04.020–7:04.940
而且它運作正常。
7:05.260–7:07.068
所以無論你想進行什麼變更,
7:07.068–7:09.720
你只需繼續指示 Cloud Code 為你執行即可。
7:10.000–7:13.340
現在有個小建議,你希望定期清除對話記錄。
7:13.340–7:19.371
所以如果你接下來要處理的任務與之前正在進行的工作無關,
7:19.371–7:21.140
你就需要輸入 /clear(清除)。
7:21.300–7:24.340
這樣你將開始一個擁有空聯絡人列表的新工作階段。
7:24.680–7:26.448
現在假設我想新增一個按鈕,以便
7:26.448–7:29.700
讓我能在此應用程式中切換深色和淺色主題。
7:29.700–7:32.292
這與之前的工作無關,
7:32.292–7:34.380
之前的工作是關於建立到期日。
7:34.580–7:35.460
所以這是一個全新的任務。
7:35.660–7:38.260
因此我會使用 clear 來清除對話記錄。
7:38.760–7:40.560
現在我可以繼續進行下一個任務。
7:40.820–7:45.200
所以你在不同任務之間希望定期執行 /clear。
7:45.200–7:52.560
現在我可以告訴 Cloud 新增一個切換按鈕,用於在深色和淺色模式之間切換。
7:54.180–7:55.180
所以完成了。
7:55.280–7:57.820
你可以看到這花了 1 分 4 秒。
7:58.100–7:59.860
現在讓我重新整理頁面。
8:00.320–8:06.240
在這裡我看到一個切換按鈕,我可以點擊它來切換深色主題和淺色主題。
8:06.540–8:09.760
所以我們只需告訴 Cloud Code 為你進行任何變更即可。
8:09.760–8:13.980
現在假設你不喜歡某個變更,並且想要復原你的變更。
8:14.180–8:15.420
你可以回到 Cloud Code。
8:15.600–8:17.860
你可以輸入 /rewind(倒帶)。
8:18.380–8:20.434
接著它會將程式碼和
8:20.434–8:22.420
對話記錄還原到之前的某個狀態。
8:22.620–8:23.873
所以如果我發送 rewind,
8:23.873–8:28.180
我現在可以選擇要回到對話記錄的哪一部分。
8:28.580–8:30.340
所以目前我在這裡。
8:30.500–8:34.140
如果我想回到之前的訊息,我只需向上移動。
8:34.260–8:35.280
然後我按下 Enter。
8:35.280–8:38.544
接著我可以選擇是否要還原程式碼和
8:38.544–8:41.740
對話記錄,或者只還原對話記錄,或者只還原程式碼。
8:42.040–8:44.780
現在如果只是還原對話記錄,那麼程式碼就不會改變。
8:45.000–8:46.760
這意味著這個東西仍然會存在。
8:46.960–8:49.840
然後如果是還原程式碼,它只會還原程式碼。
8:50.000–8:53.900
但對話記錄仍會停留在我要求新增按鈕的那個狀態。
8:54.100–8:55.681
所以我會說,在大多數情況下,
8:55.681–8:59.040
你可能只會選擇還原程式碼和對話。
8:59.300–9:01.580
將一切恢復到之前的狀態。
9:01.820–9:02.700
所以我們來做這個。
9:02.780–9:04.340
還原程式碼和對話。
9:04.340–9:08.240
現在我回到我要求切換按鈕的那個部分。
9:08.560–9:12.560
現在如果我回到這個應用程式,如果我重新整理,你可以看到它已經消失了。
9:12.720–9:16.480
所以這就是如何撤銷你不想要的任何變更。
9:16.760–9:19.680
所以還有許多更多的命令你可以在 Cloud Code 中使用。
9:19.820–9:22.140
所以當你有的時候,你可以輸入斜線幫助。
9:22.380–9:23.100
按下 Enter。
9:23.560–9:24.860
然後你可以閱讀這些內容。
9:25.020–9:26.860
然後你也可以前往命令。
9:27.160–9:28.240
按下你的右方向鍵。
9:28.640–9:32.580
這些都是你可以在 Cloud Code 中使用的不同命令。
9:32.580–9:34.060
所以它們相當多。
9:34.480–9:36.660
你不需要學習每一個。
9:37.020–9:39.100
你可以當你有時間的時候去瀏覽。
9:39.540–9:44.220
然後你會習慣在 Cloud Code 中可以使用的不同命令。
9:44.220–9:47.300
所以這就是如何在 Terminal 中使用 Cloud Code。
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。

影片筆記:How to Use Claude Code Terminal for Beginners

一句話總結

本影片教學如何在終端機(Terminal)中安裝、設定並使用 Claude Code,涵蓋從環境配置、模型選擇、操作模式切換,到透過自然語言指令建立與修改應用程式(如待辦事項清單)的完整流程,並介紹了對話管理與復原變更的技巧。

核心重點

  1. 安裝與驗證:支援 Mac OS 與 Windows PowerShell,安裝完成後需透過 cloud space dash dash version 驗證。
  2. 登入授權:需具備 Pro plan 訂閱,透過瀏覽器授權並複製代碼至終端機完成登入。
  3. 模型與效能設定
  • 模型選擇:建議一般任務使用 Sonnet,複雜任務使用 Opus 或 Fable,Haiku 速度較快但較過時。
  • 努力程度(Effort):建議從 medium 開始,高努力程度品質較高但消耗額度快且速度慢。
  1. 操作模式
  • 透過 Shift + Tab 切換模式。
  • 建議從 Plan Mode 開始規劃,確認計劃後可切換至 Auto Mode 自動執行。
  • 其他模式包含 Accept Edits On、Manual Mode。
  1. 實作流程
  • 透過自然語言指令建立 To-do list app。
  • 可透過追加指令擴充功能(如增加截止日期、深色/淺色主題)。
  • 使用 /clear 清除上下文以開始新任務。
  1. 復原與幫助
  • 使用 /rewind 可回滾代碼與對話。
  • 使用 /help 查看所有可用命令。

詳細大綱

一、安裝與驗證

  1. 安裝步驟
  • Mac OS 用戶:複製第一行命令列,開啟 Terminal 貼上並執行。
  • Windows 用戶:複製 Windows PowerShell 命令列,開啟 PowerShell 貼上並按 Enter。
  • 安裝完成後會顯示 "installation complete"。
  1. 驗證安裝
  • 輸入 cloud space dash dash version 並按 Enter 檢查是否安裝成功。

二、初始化與登入

  1. 進入專案資料夾
  • 建立新的空資料夾。
  • 在 Terminal 使用 CD 命令切換至該資料夾(可透過拖曳資料夾或複製路徑貼上)。
  1. 啟動 Cloud Code
  • 輸入 Cloud 並按 Enter。
  • 首次執行會請求權限,按 Enter 繼續。
  1. 帳號登入流程
  • 輸入 /login 並按 Enter。
  • 選擇第一個選項連接具備訂閱的 Cloud 帳號(需至少為 Pro plan)。
  • 系統會開啟瀏覽器,若未開啟則需手動複製連結。
  • 在網頁點擊 "Authorize" 連接帳號。
  • 點擊 "Copy Code" 複製代碼。
  • 回到 Cloud Code 終端機貼上代碼並按 Enter,顯示 "login successful"。

三、模型與效能設定

  1. 選擇模型 (/model)
  • 可選模型:Sonnet, Fable, Opus, Haiku。
  • 建議
  • 一般任務:從 Sonnet 開始。
  • 複雜任務:嘗試更強大的 OpusFable
  • Haiku:速度較快,但目前較過時。
  1. 選擇努力程度 (/effort)
  • 選項:low, medium, high, extra high, max。
  • 高努力程度:AI 思考時間較長,速度較慢,消耗使用額度較快,但品質較高。
  • 低努力程度:速度快、便宜,但品質可能較低。
  • 建議:從 medium 開始,若效果不佳再調高。

四、操作模式切換

透過 Shift + Tab 切換底部左側的模式:

  1. Accept Edits On:自動接受 Cloud Code 的編輯,但仍需對特定動作授權。
  2. Plan Mode:先規劃再執行。
  3. Auto Mode On:通過安全檢查後,自動批准大部分事項。
  4. Manual Mode:手動模式,每次編輯需逐一手動批准。
  • 建議:從 Plan Mode 開始規劃。

五、實作演示:建立應用程式

  1. 建立初始應用
  • 指令:建立一個可創建、編輯、刪除任務的 To-do list app。
  • 在 Plan Mode 下,AI 會提問(如應用類型、任務是否永久保存),回答後提交。
  • AI 寫好計劃並準備執行,選擇 "yes, and use Auto Mode"。
  • 系統自動進入 Auto Mode,自動創建檔案、編輯代碼。
  • 完成時間約 2 分 34 秒,生成 index.html 等檔案。
  1. 測試與修改
  • 雙擊 index.html 運行應用。
  • 測試功能:添加任務、標記完成。
  • 新增功能:要求增加 "due date"(截止日期)功能。
  • 完成時間約 1 分 29 秒,刷新頁面後可見新選項。
  1. 對話管理
  • 若新任務與前文無關,建議使用 /clear 清除對話,開始新會話。
  • 實例:新增深色/淺色主題切換按鈕(與截止日期無關),故先使用 /clear
  • 完成時間約 1 分 4 秒,頁面出現切換按鈕。

六、復原與幫助

  1. 復原變更 (/rewind)
  • 若不喜歡某項變更,輸入 /rewind
  • 可選擇回退至對話中的特定訊息。
  • 選項包括:
  • 恢復代碼與對話(Restore code and conversation)。
  • 僅恢復對話(代碼不變)。
  • 僅恢復代碼(對話保留在請求按鈕時)。
  • 通常建議選擇「恢復代碼與對話」以完全回退。
  1. 查看命令 (/help)
  • 輸入 /help 並按 Enter 查看所有可用命令。
  • 可使用右箭頭鍵瀏覽命令列表,無需記住所有命令,隨用隨查。

工具 / 模型 / 名詞整理

  • Cloud Code:影片主要介紹的終端機工具。
  • Terminal:Mac OS 下的終端機環境。
  • Windows PowerShell:Windows 下的命令列環境。
  • Mac OS:作業系統。
  • Cloud account:雲端帳號。
  • Pro plan:雲端服務的訂閱方案等級。
  • 模型名稱
  • Sonnet
  • Fable
  • Opus
  • Haiku
  • 檔案名稱
  • index.html
  • 操作模式
  • Accept Edits On
  • Plan Mode
  • Auto Mode On
  • Manual Mode
  • 指令前綴
  • /login
  • /model
  • /effort
  • /clear
  • /rewind
  • /help
  • 網頁按鈕文字
  • Authorise
  • Copy Code
  • 應用程式類型
  • To-do list app

操作流程整理

  1. 安裝階段
  • 根據作業系統(Mac 或 Windows)複製對應的安裝命令。
  • 在終端機執行安裝命令。
  • 執行 cloud space dash dash version 驗證安裝。
  1. 設定階段
  • 建立專案資料夾並使用 CD 命令進入。
  • 輸入 Cloud 啟動程式。
  • 輸入 /login 進行登入:
  • 選擇具備 Pro plan 的帳號。
  • 在瀏覽器點擊 "Authorize"。
  • 複製代碼並貼回終端機。
  • 輸入 /model 選擇模型(建議 Sonnet 或 Opus)。
  • 輸入 /effort 設定努力程度(建議 medium)。
  1. 開發階段
  • 使用 Shift + Tab 切換至 Plan Mode
  • 輸入自然語言指令描述需求(例如:建立 To-do list app)。
  • 回答 AI 的提問。
  • 確認計劃後,選擇 "yes, and use Auto Mode"。
  • 等待系統自動創建檔案與編輯代碼。
  • 測試生成的應用程式(如雙擊 index.html)。
  • 若需新增功能(如 due date),直接輸入指令,系統會自動修改。
  • 若需處理無關的新任務,先輸入 /clear 清除上下文。
  1. 維護階段
  • 若對變更不滿,輸入 /rewind 選擇回滾選項。
  • 若忘記指令,輸入 /help 查看列表。

值得注意的限制或風險

  1. 模型選擇影響
  • Haiku 模型被描述為「速度較快,但目前較過時」。
  • 高努力程度會消耗較快的使用額度,且速度較慢。
  1. 訂閱門檻
  • 登入步驟中明確指出需具備至少為 Pro plan 的訂閱才能連接帳號。
  1. 操作模式風險
  • Auto Mode On 雖自動批准大部分事項,但仍需通過安全檢查。
  • Manual Mode 需逐一手動批准,效率較低但控制權較高。
  1. 版本檢查指令疑義
  • 影片提及的驗證指令為 cloud space dash dash version,與常見慣例 cloud --version 不同,需嚴格遵循影片指示。

逐字稿辨識疑點

  • cloud space dash dash version:逐字稿中描述為輸入此指令,通常版本檢查指令為 cloud --version,此處保留逐字稿描述。
  • Cloud Code Terminal:逐字稿提及安裝 "Cloud Code Terminal",保留原稱。
  • slash login:指代輸入 /login 指令。
  • slash model:指代輸入 /model 指令。
  • slash effort:指代輸入 /effort 指令。
  • slash clear:指代輸入 /clear 指令。
  • slash rewind:指代輸入 /rewind 指令。
  • slash help:指代輸入 /help 指令。
  • Shift-Tab:指代按鍵組合 Shift + Tab
  • Accept Edits On:模式名稱。
  • Plan Mode:模式名稱。
  • Auto Mode On:模式名稱。
  • Manual Mode:模式名稱。
  • Authorise:網頁按鈕文字,逐字稿拼寫為 "Authorise"。
  • Copy Code:網頁按鈕文字。
  • To-do list app:應用程式類型描述。

可延伸追問

  1. 在 Plan Mode 下,AI 提問的具體內容有哪些範例?
  2. Auto Mode 通過安全檢查的具體標準是什麼?
  3. /rewind 回滾後,之前的對話歷史是否會完全消失?
  4. 不同模型(Sonnet, Opus, Fable, Haiku)在價格與速度上的具體差異數據為何?
  5. 若瀏覽器未自動開啟授權連結,手動複製連結的具體步驟為何?

生字列表

生字讀音類型中文
installインストール動詞安裝
command lineコマンドライン名詞命令列
Terminalターミナル名詞終端機
PowerShellパワーシェル名詞PowerShell
permissionパーミッション名詞權限
subscriptionサブスクリプション名詞訂閱方案
browserブラウザ名詞瀏覽器
modelモデル名詞模型
agentエージェント名詞代理程式
limit制限名詞額度/限制
effort努力名詞努力程度
toggle切り替え動詞/名詞切換
restore復元する動詞還原
conversation会話名詞對話
undo取り消す動詞復原/撤銷
commandコマンド名詞命令

生字解說

install インストール

動詞 · N4

意思:安裝

解說:指將軟體或硬體設置到電腦系統中,使其可以運用的過程。

影片原句
First, let me show you how to install Cloud Code.
首先,讓我展示如何安裝 Cloud Code。
延伸例句
このアプリをインストールしました。
我安裝了這個應用程式。

command line コマンドライン

名詞 · N3

意思:命令列

解說:一種透過輸入文字指令來操作電腦系統的方式,而非使用圖形介面。

影片原句
you copy the first command line
請複製第一行命令列指令
延伸例句
コマンドラインで操作します。
我在命令列中進行操作。

Terminal ターミナル

名詞 · N3

意思:終端機

解說:電腦作業系統中用於執行命令列指令的應用程式視窗。

影片原句
and then you open Terminal and then you paste this in.
然後打開終端機,並將它貼上。
延伸例句
ターミナルを起動します。
我啟動了終端機。

PowerShell パワーシェル

名詞 · N3

意思:PowerShell

解說:微軟開發的任務自動化與配置管理架構,包含命令列殼層與腳本語言。

影片原句
you can copy the Windows PowerShell command line.
你可以複製 Windows PowerShell 的命令列指令。
延伸例句
PowerShellを使ってスクリプトを実行します。
我使用 PowerShell 執行腳本。

permission パーミッション

名詞 · N3

意思:權限

解說:系統賦予用戶或程式對特定資源進行讀取、寫入或執行的許可。

影片原句
it will ask you for permissions.
它會詢問你權限。
延伸例句
ファイルへのアクセス許可が必要です。
需要檔案的存取權限。

subscription サブスクリプション

名詞 · N3

意思:訂閱方案

解說:定期付費以獲得服務或產品使用的權利。

影片原句
where you can connect your Cloud account with subscription.
其中你可以連接具有訂閱方案的 Cloud 帳戶。
延伸例句
このサービスはサブスクリプション制です。
這個服務是訂閱制。

browser ブラウザ

名詞 · N4

意思:瀏覽器

解說:用於存取和顯示網頁內容的軟體,如 Chrome、Safari 等。

影片原句
Then it will open the browser.
接著它會開啟瀏覽器。
延伸例句
ブラウザを更新してください。
請更新瀏覽器。

model モデル

名詞 · N3

意思:模型

解說:在此語境下指人工智慧(AI)的特定版本或類型,具有不同的能力與特性。

影片原句
So the first thing you can do is to select which model you want to use.
所以你可以做的第一件事是選擇你想使用的模型。
延伸例句
この車のモデルは最新です。
這款車的型號是最新的。

agent エージェント

名詞 · N3

意思:代理程式

解說:指能自動執行任務的軟體系統,在此指能思考並執行程式碼生成的 AI。

影片原句
the AI agent will take more time to think.
AI 代理會花更多時間思考。
延伸例句
カスタマーエージェントが対応します。
由客戶服務代理進行處理。

limit 制限

名詞 · N4

意思:額度/限制

解說:允許使用的最大數量或範圍,常指免費或付費方案中的使用上限。

影片原句
and you will use up your usage limits faster.
而且你會更快地耗盡你的使用額度。
延伸例句
データ使用量の制限を超えました。
超過了數據使用量的限制。

effort 努力

名詞 · N4

意思:努力程度

解說:在此指 AI 生成內容時所投入的計算資源與思考深度,影響速度與品質。

影片原句
Next, you can select the effort.
接下來,你可以選擇努力程度。
延伸例句
彼は努力を惜しまない。
他不吝惜付出努力。

toggle 切り替え

動詞/名詞 · N3

意思:切換

解說:在兩種狀態之間來回切換的功能或按鈕。

影片原句
So now I can tell Cloud to add a toggle button to toggle between dark and light mode.
現在我可以告訴 Cloud 新增一個切換按鈕,用於在深色和淺色模式之間切換。
延伸例句
モードを切り替えます。
切換模式。

restore 復元する

動詞 · N3

意思:還原

解說:將系統、資料或狀態恢復到之前的某個時間點。

影片原句
And then it will restore the code and conversation to a previous point.
接著它會將程式碼和對話記錄還原到之前的某個狀態。
延伸例句
データを復元します。
還原資料。

conversation 会話

名詞 · N4

意思:對話

解說:在此指使用者與 AI 之間的互動記錄或聊天歷史。

影片原句
Now a tip is you want to regularly clear the conversation.
現在有個小建議,你希望定期清除對話記錄。
延伸例句
会話が弾む。
對話很熱烈。

undo 取り消す

動詞 · N4

意思:復原/撤銷

解說:取消最近執行的操作,使狀態回到操作前。

影片原句
Now say you don't like a change and you want to undo your change.
現在假設你不喜歡某個變更,並且想要復原你的變更。
延伸例句
入力を取り消します。
取消輸入。

command コマンド

名詞 · N3

意思:命令

解說:指示電腦執行特定動作的指令。

影片原句
So there are many more commands that you can use in Cloud Code.
所以還有許多更多的命令你可以在 Cloud Code 中使用。
延伸例句
コマンドを入力してください。
請輸入命令。

句型解說(含實例)

~how to ~

意思:如何~

接續:how to + 動詞原形

解說:用於詢問或說明進行某項活動的方法或步驟。

影片原句
Today I'll be teaching you how to use Cloud Code in Terminal.
今天我要教大家如何在終端機中使用 Cloud Code。
實例
  1. 私は日本語を話す方法を学びました。
    我學會了如何說日語。
  2. これはカメラの使い方を説明しています。
    這是在說明如何使用相機。

let me ~

意思:讓我~

接續:let me + 動詞原形

解說:委婉地表示說話者將執行某個動作,常見於教學或演示情境。

影片原句
First, let me show you how to install Cloud Code.
首先,讓我展示如何安裝 Cloud Code。
實例
  1. Let me help you with that.
    讓我來幫你處理那個。
  2. Let me check the schedule.
    讓我確認一下行程。

if you are ~, then you ~

意思:如果你是~,那麼你就~

接續:if + 條件節, then + 結果節

解說:表示條件與結果的關係,用於提供不同情況下的操作指引。

影片原句
Now, if you are using Mac OS, then you copy the first command line
現在,如果你使用的是 Mac OS,請複製第一行命令列指令
實例
  1. もし雨が降ったら、傘を持ってください。
    如果下雨的話,請帶傘。
  2. もし時間があれば、来てください。
    如果你有時間的話,請來。

want to ~

意思:想要~

接續:want to + 動詞原形

解說:表達說話者的意願或需求。

影片原句
you want to change to that folder.
你需要切換到該資料夾。
實例
  1. 私は旅行に行きたいです。
    我想要去旅行。
  2. あなたはもっと勉強したいですか。
    你想要更努力學習嗎?

before you ~, you ~

意思:在你~之前,你要~

接續:before + 動詞原形, + 主詞 + 動詞

解說:表示某個動作必須在另一個動作發生之前完成。

影片原句
Then before you launch Cloud Code in your terminal, you want to change to that folder.
然後在終端機中啟動 Cloud Code 之前,你需要切換到該資料夾。
實例
  1. 寝る前に歯を磨いてください。
    在睡覺之前請刷牙。
  2. 食事をする前に手を洗ってください。
    在吃飯之前請洗手。

~depending on ~

意思:取決於~

接續:depending on + 名詞/動名詞

解說:表示某事的結果或狀態隨另一件事的變化而變化。

影片原句
So this depends on how complex the task is.
所以這取決於任務的複雜程度。
實例
  1. 価格は品質に依存します。
    價格取決於品質。
  2. 天気によって予定が変わります。
    計畫取決於天氣。

~so that ~

意思:以便~/這樣~

接續:so that + 主詞 + 助動詞/動詞

解說:表示目的或結果,說明為什麼要執行某個動作。

影片原句
That means it will automatically accept any edits that Cloud Code wants to make so that you don't have to approve every single edit one by one.
這意味著它會自動接受 Cloud Code 想要進行的任何編輯,這樣你就不需要逐一批准每一次編輯。
實例
  1. 早く着くように走ります。
    我跑步以便能早點到達。
  2. 説明書を読んで、正しく使ってください。
    請閱讀說明書以便正確使用。

~where ~

意思:在那裡~/其中~

接續:where + 關係子句

解說:用於修飾地點或情境,說明在該處發生的事情或具備的條件。

影片原句
where you can connect your Cloud account with subscription.
其中你可以連接具有訂閱方案的 Cloud 帳戶。
實例
  1. 公園は子供たちが遊ぶ場所です。
    公園是孩子們玩耍的地方。
  2. 図書館は本を借りる場所です。
    圖書館是借書的地方。