Skip to main content
Version: v7.0.0

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:

  1. Guided Setup: Initialize your project with an interactive wizard.
  2. Centralized Configuration: Create an api.json to manage all code generation settings.
  3. Path Aliases: Automatically detect and configure TypeScript/JavaScript path aliases.
  4. Foundation for Codegen: Prepare your project for the generate command.

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!

  1. You can use the wizard to guide you through the setup process.
  2. Your project now has an api.json file to store configuration.
  3. You're ready to use other commands like generate.