ZodulaZodula
Cli

Add Dependencies

Add dependencies to a specific app in your Zodula monorepo

Overview

The nailgun add command allows you to add dependencies to a specific app within your Zodula monorepo. This command provides an interactive way to select the target app and install packages using Bun.

Usage

nailgun add <packages...> [options]

Arguments

  • <packages...> - One or more package names to install

Options

  • -a, --app <app> - Specify the target app name (e.g., zodula, onlyagents)
  • -D, --dev - Install as a development dependency
  • -P, --peer - Install as a peer dependency

Examples

Add a production dependency

# Add a single package
nailgun add react

# Add multiple packages
nailgun add react react-dom @types/react

# Add to a specific app
nailgun add express --app zodula

Add development dependencies

# Add as dev dependency
nailgun add -D typescript @types/node

# Add as dev dependency to specific app
nailgun add -D jest --app onlyagents --dev

Add peer dependencies

# Add as peer dependency
nailgun add -P react react-dom

Interactive Mode

If you don't specify the --app option, the command will prompt you to select from available apps:

nailgun add lodash
# ? Select an app to add dependencies to: (Use arrow keys)
# ❯ zodula (/path/to/zodula)
#   onlyagents (/path/to/onlyagents)

How It Works

  1. App Discovery: The command scans your monorepo for available apps
  2. App Selection: Either uses the specified --app option or prompts for selection
  3. Dependency Installation: Runs bun add in the target app's directory
  4. Verification: Confirms successful installation or reports errors

Notes

  • The command uses Bun as the package manager
  • All dependency types (production, development, peer) are supported
  • The command automatically changes to the target app's directory before running bun add
  • If the specified app doesn't exist, the command will list available apps and exit with an error