The official CLI tools are confusing (C3 / Wrangler) among documents and message on CLI
Which Cloudflare product does this pertain to?
Workers
Existing documentation URL(s)
https://developers.cloudflare.com/workers/get-started/quickstarts/
What changes are you suggesting?
- wrangler saying about C3 by itself without any explaination.
- this message let me think about below questions
- q. wrangler is about to be no longger support?
- q. what are differents between
npm create cloudflareandnpx wrangler
PS > npx wrangler generate .
⛅️ wrangler 3.28.2 (update available 3.28.3)
-------------------------------------------------------
Using npm as package manager.
▲ [WARNING] The `init` command is no longer supported. Please use `npm create cloudflare\@2 -- .` instead.
The `init` command will be removed in a future version.
Additional information
No response
https://developers.cloudflare.com/workers/get-started/guide/
Open a terminal window and run C3 to create your Worker project:
npm create cloudflare@latest
https://developers.cloudflare.com/workers/get-started/quickstarts/
Quickstarts are GitHub repositories that are designed to be a starting point for building a new Cloudflare Workers project. To start any of the projects below, run:
npx wrangler generate <NEW_PROJECT_NAME> <GITHUB_REPO_URL>
https://developers.cloudflare.com/workers/wrangler/commands/#init
Create a new project via the create-cloudflare-cli (C3) tool. A variety of web frameworks are available to choose from as well as templates. Dependencies are installed by default, with the option to deploy your project immediately.
Hiya @hdformat , these updates will be published as part of a larger effort to educate users on C3 but to answer your questions directly:
wrangler saying about C3 by itself without any explaination.
Context: C3 is "a command-line tool designed to help you set up and deploy new applications to Cloudflare." So you'll only use C3 to start new projects. When you run C3, C3 installs the latest version of Wrangler, which is used to do many things depending on your use case (adding secrets, deleting secrets, deleting projects, deploying projects, etc.)
This is the fundamental difference. C3 = create new projects, Wrangler = do tasks on your project.
q. wrangler is about to be no longger support?
Answer: Wrangler is still being supported! The 'deprecation' message that you are seeing only has to do with the init and generate commands which are being deprecated in favor of C3's npm create cloudflare@latest command.
q. what are differents between npm create cloudflare and npx wrangler
Answer: npm, when fixed in front of a command, calls npm to do something - it is used for installing a package.
npx runs a command within that package.
Reasoning behind this was published here: https://developers.cloudflare.com/workers/wrangler/commands/#how-to-run-wrangler-commands