DocsPrivacyTerms

CLI Installation

Installation Methods

The Branded Barber CLI can be installed in two ways: as a global npm package or run directly from the Nx monorepo during development.

Method 1: Global Installation (Recommended)

1

Configure npm Registry

The CLI is published to GitHub Packages. Configure your .npmrc file to point to the GitHub Packages registry:

@studio-symmetries:registry=https://npm.pkg.github.com
Note: You may need to authenticate with GitHub Packages. Create a personal access token with read:packages permission and configure npm authentication.
2

Install the CLI

Install the CLI globally using npm or yarn:

# Using npm
npm install -g @studio-symmetries/branded-barber-cli

# Using yarn
yarn global add @studio-symmetries/branded-barber-cli
3

Verify Installation

Verify the installation by checking the CLI version:

branded-barber --version

You should see the version number displayed. If the command is not found, ensure your global npm/yarn bin directory is in your PATH.

Method 2: Development Mode (Nx Monorepo)

If you're working within the Nx monorepo, you can run the CLI directly without installing it globally:

# Run any CLI command via Nx
nx run branded-barber-cli:cli -- [command] [options]

# Example: Check connection
nx run branded-barber-cli:cli -- doctor connection -t tenant-1
Tip: This method is ideal for development and testing. The CLI will use the TypeScript source files directly.

Environment Configuration

The CLI requires environment variables to connect to your database and API. Create a .env file in your working directory or set these variables in your shell:

# Database Connection
MONGO_URI=mongodb://localhost:27017/branded-barber

# API Configuration (if using remote API)
API_URL=https://your-api.railway.app/api/v1

# Cloudinary (for Instagram import)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

# Instagram (for import feature)
INSTAGRAM_ACCESS_TOKEN=your-instagram-token
Security: Never commit your .env file to version control. Add it to your .gitignore file.

Building from Source

To build the CLI as a standalone executable from the monorepo:

# Build for production
nx build branded-barber-cli --configuration=production

# The output will be at:
# dist/apps/branded-barber-cli/main.js

# Run the built CLI
node dist/apps/branded-barber-cli/main.js doctor connection

Next Steps

Once installed, explore the available commands:

  • Read the Commands Guide to learn about available operations
  • Set up Instagram Import to sync your portfolio
  • Run branded-barber doctor connection to verify your setup