Skip to content

Commit e69d73c

Browse files
[Workers] Add documentation for cf-tutor tool (#17627)
* Add documentation for cf-tutor tool * Add beta tag * Add beta tag. * Fix links to cf-tutor docs * Fix links * Update download from browser steps * Add full stop * Fix beta tag * Update src/content/docs/workers/get-started/cf-tutor.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/workers/get-started/cf-tutor.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/partials/workers/cf-tutor.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/partials/workers/cf-tutor.mdx Co-authored-by: Jun Lee <[email protected]> --------- Co-authored-by: Jun Lee <[email protected]>
1 parent d18ba42 commit e69d73c

File tree

6 files changed

+99
-12
lines changed

6 files changed

+99
-12
lines changed

src/content/docs/d1/get-started.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,4 +533,5 @@ If you have any feature requests or notice any bugs, share your feedback directl
533533

534534
- See supported [Wrangler commands for D1](/workers/wrangler/commands/#d1).
535535
- Learn how to use the [D1 client API](/d1/build-with-d1/d1-client-api/) within your Worker.
536+
- Learn the basics of using Workers with D1 and CLI development in a guided learning experience with [Cloudflare CLI tutor](/workers/get-started/cf-tutor/).
536537
- Explore [community projects built on D1](/d1/reference/community-projects/).

src/content/docs/r2/get-started.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ sidebar:
66
head:
77
- tag: title
88
content: Get started guide
9-
109
---
1110

12-
import { Render } from "~/components"
11+
import { Render } from "~/components";
1312

1413
Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.
1514

16-
<div style="position: relative; padding-top: 56.25%;"><iframe src="https://customer-6qw1mjlclhl2mqdy.cloudflarestream.com/c247ba8eb4b61355184867bec9e5c532/iframe?poster=https%3A%2F%2Fcustomer-6qw1mjlclhl2mqdy.cloudflarestream.com%2Fc247ba8eb4b61355184867bec9e5c532%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600" style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true"></iframe></div>
15+
<div style="position: relative; padding-top: 56.25%;">
16+
<iframe
17+
src="https://customer-6qw1mjlclhl2mqdy.cloudflarestream.com/c247ba8eb4b61355184867bec9e5c532/iframe?poster=https%3A%2F%2Fcustomer-6qw1mjlclhl2mqdy.cloudflarestream.com%2Fc247ba8eb4b61355184867bec9e5c532%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600"
18+
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
19+
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
20+
allowfullscreen="true"
21+
></iframe>
22+
</div>
1723

1824
## 1. Install and authenticate Wrangler
1925

@@ -51,6 +57,10 @@ You will receive a confirmation message after a successful upload.
5157

5258
Cloudflare provides multiple ways for developers to access their R2 buckets:
5359

54-
* [Workers Runtime API](/r2/api/workers/workers-api-usage/)
55-
* [S3 API compatibility](/r2/api/s3/api/)
56-
* [Public buckets](/r2/buckets/public-buckets/)
60+
- [Workers Runtime API](/r2/api/workers/workers-api-usage/)
61+
- [S3 API compatibility](/r2/api/s3/api/)
62+
- [Public buckets](/r2/buckets/public-buckets/)
63+
64+
## Related resources
65+
66+
- [Cloudflare CLI tutor](/workers/get-started/cf-tutor/) - Learn the basics of using Workers with R2 and CLI development in a guided learning experience.

src/content/docs/workers-ai/get-started/workers-wrangler.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ By finishing this tutorial, you have created a Worker, connected it to Workers A
135135

136136
- [Cloudflare Developers community on Discord](https://discord.cloudflare.com) - Submit feature requests, report bugs, and share your feedback directly with the Cloudflare team by joining the Cloudflare Discord server.
137137
- [Models](/workers-ai/models/) - Browse the Workers AI models catalog.
138+
- [Cloudflare CLI tutor](/workers/get-started/cf-tutor/) - Learn the basics of Workers AI and CLI development in a guided learning experience.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: CLI guided learning
3+
pcx_content_type: get-started
4+
sidebar:
5+
order: 2
6+
badge:
7+
text: Beta
8+
head:
9+
- tag: title
10+
content: Get started - CLI guided learning
11+
---
12+
13+
import { Badge, Render } from "~/components";
14+
15+
Cloudflare CLI tutor, or `cf-tutor`, is a guided learning experience within your terminal. If you are unfamiliar with Workers, or are new to command line interface (CLI) based development, cf-tutor offers an introduction on how to use Workers with other Cloudflare products through your terminal.
16+
17+
`cf-tutor` is currently a beta application in pre-release. To download the application, you can use the `git clone` in your terminal, or download the application from the releases page on the project repo.
18+
19+
## Prerequisites
20+
21+
<Render file="prereqs" product="workers" />
22+
23+
## How to run
24+
25+
<Render file="cf-tutor" product="workers" />
26+
27+
## Next steps
28+
29+
To do more:
30+
31+
- Visit the [Cloudflare dashboard](https://dash.cloudflare.com/) for simpler editing.
32+
- Learn how to [test and debug](/workers/testing/) your Workers.
33+
- Read about [Workers limits and pricing](/workers/platform/).

src/content/docs/workers/get-started/guide.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ cd my-first-worker
4848

4949
In your project directory, C3 will have generated the following:
5050

51-
* `wrangler.toml`: Your [Wrangler](/workers/wrangler/configuration/#sample-wranglertoml-configuration) configuration file.
52-
* `index.js` (in `/src`): A minimal `'Hello World!'` Worker written in [ES module](/workers/reference/migrate-to-module-workers/) syntax.
53-
* `package.json`: A minimal Node dependencies configuration file.
54-
* `package-lock.json`: Refer to [`npm` documentation on `package-lock.json`](https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json).
55-
* `node_modules`: Refer to [`npm` documentation `node_modules`](https://docs.npmjs.com/cli/v7/configuring-npm/folders#node-modules).
51+
- `wrangler.toml`: Your [Wrangler](/workers/wrangler/configuration/#sample-wranglertoml-configuration) configuration file.
52+
- `index.js` (in `/src`): A minimal `'Hello World!'` Worker written in [ES module](/workers/reference/migrate-to-module-workers/) syntax.
53+
- `package.json`: A minimal Node dependencies configuration file.
54+
- `package-lock.json`: Refer to [`npm` documentation on `package-lock.json`](https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json).
55+
- `node_modules`: Refer to [`npm` documentation `node_modules`](https://docs.npmjs.com/cli/v7/configuring-npm/folders#node-modules).
5656

5757
</Details>
5858

@@ -191,7 +191,7 @@ Preview your Worker at `<YOUR_WORKER>.<YOUR_SUBDOMAIN>.workers.dev`.
191191

192192
<Details header="Seeing 523 errors?">
193193

194-
If you see [`523` errors](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-523-origin-is-unreachable) when pushing your `*.workers.dev` subdomain for the first time, wait a minute or so and the errors will resolve themselves.
194+
If you see [`523` errors](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-523-origin-is-unreachable) when pushing your `*.workers.dev` subdomain for the first time, wait a minute or so and the errors will resolve themselves.
195195

196196
</Details>
197197

@@ -201,6 +201,7 @@ To do more:
201201

202202
- Visit the [Cloudflare dashboard](https://dash.cloudflare.com/) for simpler editing.
203203
- Review our [Examples](/workers/examples/) and [Tutorials](/workers/tutorials/) for inspiration.
204+
- Learn the basics of developing Cloudflare applications through a CLI with our [Cloudflare CLI tutor tool](/workers/get-started/cf-tutor/).
204205
- Set up [bindings](/workers/runtime-apis/bindings/) to allow your Worker to interact with other resources and unlock new functionality.
205206
- Learn how to [test and debug](/workers/testing/) your Workers.
206207
- Read about [Workers limits and pricing](/workers/platform/).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
{}
3+
---
4+
5+
import { TabItem, Tabs } from "~/components";
6+
7+
<Tabs>
8+
9+
<TabItem label="Git clone HTTPS">
10+
11+
1. Open a terminal window.
12+
2. In your terminal, navigate to the folder you wish to install cf-tutor. You can change directory by using the `cd` command followed by the folder path. You can either enter the full path such as `cd Documents/Projects/ ` or you can use `cd` multiple times to go folder by folder. To see the files and folders in the directory you are currently in, run `ls`.
13+
3. Run the command `git clone https://github.com/db-cloudflare/cf-tutor.git` to download cf-tutor.
14+
4. Run the command `cd cf-tutor` to enter the application folder.
15+
5. Run the command `npm i` to install all dependendant packages.
16+
6. Once the dependencies have installed, run `npm start ` to run the application
17+
18+
</TabItem>
19+
20+
<TabItem label="Git clone SSH">
21+
22+
The following steps require an SSH key. Vist [GitHub documentation on Connecting with SSH to learn more](https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
23+
24+
1. Open a terminal window.
25+
2. In your terminal, navigate to the folder you wish to install cf-tutor. You can change directory by using the `cd` command followed by the folder path. You can either enter the full path such as `cd Documents/Projects/ ` or you can use `cd` multiple times to go folder by folder. To see the files and folders in the directory you are currently in, run `ls`.
26+
3. Run the command `git clone [email protected]:db-cloudflare/cf-tutor.git` and enter your SSH key to download cf-tutor.
27+
4. Run the command `cd cf-tutor` to enter the application folder.
28+
5. Run the command `npm i` to install all dependendant packages.
29+
6. Once the dependencies have installed, run `npm start ` to run the application
30+
31+
</TabItem>
32+
33+
<TabItem label="Download from browser">
34+
35+
1. Open [cf-tutor releases](https://github.com/db-cloudflare/cf-tutor/releases).
36+
2. Download the cf-tutor.zip file and extract the folder inside it into your desired location.
37+
3. In your terminal, navigate to the cf-tutor folder. You can change directory by using the `cd` command followed by the folder path. You can either enter the full path such as `cd Documents/Projects/cf-tutor` or you can use `cd` multiple times to go folder by folder. To see the files and folders in the directory you are currently in, run `ls`.
38+
4. Run the command `npm i` to install all dependendant packages.
39+
5. Once the dependencies have installed, run `npm start ` to run the application.
40+
41+
</TabItem> </Tabs>

0 commit comments

Comments
 (0)