Skip to content

Nova.js CLI

Add React hooks to your project from the terminal.

init

Use the init command to add all available hooks from Nova.js to a new project.

The init command does not install any dependencies. It automatically detects whether the project uses TypeScript or JavaScript and identifies the tech stack. Supported stacks include:

  • Vite + React
  • Astro + React
  • Remix
  • Next.js App Router
  • Next.js Pages Router
  • Gatsby
sh
npx @novajslabs/cli init
sh
npx @novajslabs/cli init
sh
pnpm dlx @novajslabs/cli init

Options

Usage: @novajslabs/cli init [options]

add React hooks to your Vite, Next.js, Astro, Remix and Gatsby project

Options:
  -o, --overwrite    overwrite existing files
  -p, --path <path>  the path to add the hook to
  -h, --help         display help for command

add

Use the add command to add hooks to your project.

sh
npx @novajslabs/cli add [hook]
sh
npx @novajslabs/cli add [hook]
sh
pnpm dlx @novajslabs/cli add [hook]

If you omit the hook name you will be presented with a list of hooks to choose from:

Which hooks would you like to add? » Space to select. A to toggle all. Enter to submit.
( )   useArray
( )   useAudio
( )   useBattery
( )   useClipboard
( )   useCountdown
( )   useCountup
( )   useDebounce
( )   useDownload
( )   useEventListener
( ) ↓ useFavicon

Options

Usage: @novajslabs/cli add [options] [hooks...]

add React hooks to your Vite, Next.js, Astro, Remix and Gatsby project

Arguments:
  hooks              the hooks to add

Options:
  -o, --overwrite    overwrite existing files
  -a, --all          add all available hooks (default: false)
  -p, --path [path]  the path to add the hook to
  -t, --typescript   add hook in typescript
  -h, --help         display help for command