Skip to content

Advanced Usage

Nolly edited this page Jan 23, 2025 · 1 revision

⚙️ Advanced Usage of Create Nolly CLI

Unlock the full potential of Create Nolly CLI with advanced tips and tricks for optimizing your workflow! 🚀


🧩 Combining Commands

Quickly Create and Navigate to a Project

You can chain commands to create a new project and navigate to it in one go:

create-nolly new my-app && cd my-app

Using the clear-cache Command

When to Use clear-cache

The clear-cache command is helpful in the following scenarios:

  • You suspect cached template data is outdated.
  • The CLI is behaving unexpectedly after an update.

Run the command:

create-nolly clear-cache

Expected output:

🧹 Cache cleared successfully!

📦 Auto-Updates

Keep Your CLI Up-to-Date

The CLI automatically checks for updates every 24 hours. If a new version is available, you’ll be prompted:

⚠️ Update available: 0.2.0 (current: 0.1.0). Do you want to update now?

You can skip the update, and the CLI won't ask again for 24 hours:

⚠️ Update skipped. You won't be asked again for 24 hours.

To manually update, use:

npm install -g create-nolly
# Or use yarn/pnpm depending on your setup

🔗 Integrating with CI/CD

Automate Project Initialization

You can automate project creation with Create Nolly CLI in CI/CD pipelines. For example:

name: Initialize Project

on:
  push:
    branches:
      - main

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18

      - name: Install Create Nolly CLI
        run: npm install -g create-nolly

      - name: Create Project
        run: create-nolly new my-ci-project --type fullstack

🛡️ Security Best Practices

  • Avoid running the CLI with elevated privileges (sudo) unless necessary.
  • Use the latest version of Node.js to ensure security patches are applied.
  • If you encounter a vulnerability, report it immediately. See the Security Policy.

🌟 Tips & Tricks

Use Aliases for Convenience

Save time by creating an alias for the CLI:

alias cn="create-nolly"

Now you can run:

cn new my-project

Integrate with Scripts

Use the CLI within your custom scripts:

#!/bin/bash

PROJECT_NAME=$1
TEMPLATE_TYPE=$2

create-nolly new $PROJECT_NAME --type $TEMPLATE_TYPE

Thank you for exploring advanced features! 💡
If you have questions or ideas, visit the Discord page.