Quick Start
Get started with Hydra AI in your project using the CLI
Installation
The hydra init
command helps you set up Hydra AI in your Next.js project. Here's how to get started:
Prerequisites
- A Node.js project with a valid
package.json
- Command must be run from your project root
Basic Usage
Options
--srcdir
: Source directory to scan for components (defaults tosrc
)
What Happens During Installation
Documentation for Hydra AI CLI Initialization Process
This guide will walk you through the init
command of the Hydra AI CLI tool, explaining each step and showing what the process would look like in a terminal.
Step 1: Validate Root Directory
Description: The command checks if a valid package.json
file exists in the root directory.
Terminal Output:
If validation is successful:
Step 2: Authenticate User
Description: Ensures the user is authenticated before continuing. If not already logged in, prompts for authentication.
Terminal Output:
Step 3: Select or Create Project
Description: Fetches existing projects or prompts the user to create a new one.
Terminal Output (when projects exist):
Terminal Output (when no projects exist):
Step 4: Generate and Save API Key
Description: Generates a new API key and saves it in a .env
file.
Terminal Output:
Step 5: Install Hydra AI Package
Description: Checks if the hydra-ai
package is installed and prompts the user to install it if not.
Terminal Output:
After successful installation:
Step 6: Scan for Components
Description: Scans the src
directory for components to register.
Terminal Output:
Step 7: Extract and Register Components
Description: Extracts component details and registers them in a hydra-config.ts
file.
Terminal Output:
Sample hydra-config.ts
Output
Final Output
Once the process completes, you should see:
Need Help?
Having trouble? We're here to help!