Initialize
The init command is a tool that allows you to initialize a new Hyper-Fetch project. It will create a new project with
the default configuration.
npx @hyper-fetch/cli@latest init
Purpose
By using the init command, you can:
- Guided Setup: Initialize your project with an interactive wizard.
- Centralized Configuration: Create an
api.jsonto manage all code generation settings. - Path Aliases: Automatically detect and configure TypeScript/JavaScript path aliases.
- Foundation for Codegen: Prepare your project for the
generatecommand.
Usage
You can use it by going through wizard which will ask you about the project's configuration.
To use the wizard, run the following command:
npx @hyper-fetch/cli@latest init
It will guide you through the process of generating the api.json configuration. This file will be used by other
commands and will allow us to generate files in the correct locations with correct imports paths.
Generate a client
Learn how to generate code from your api with the `generate` command.
Available arguments
Run the following command to see the available arguments:
npx @hyper-fetch/cli@latest init --help
Congratulations!
You've learned how to initialize a Hyper-fetch project!
- You can use the wizard to guide you through the setup process.
- Your project now has an
api.jsonfile to store configuration. - You're ready to use other commands like
generate.