npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

init-consoleiq

v1.0.3

Published

CLI to initialize ConsoleIQ logging in a React app

Readme

ConsoleIQ Setup CLI

🧠 Intelligent Logging for Developers - Streamline your JavaScript/TypeScript project setup with ConsoleIQ's powerful logging and monitoring capabilities.

🚀 Quick Start

Get up and running with ConsoleIQ in your project with just one command:

npx init-consoleiq

This interactive setup will guide you through configuring ConsoleIQ for your project, handling authentication, and automatically integrating the SDK into your codebase.

📋 Table of Contents

✨ Features

  • 🎯 One-Command Setup - Initialize ConsoleIQ in any JavaScript/TypeScript project
  • 🔐 Integrated Authentication - Built-in account creation and login flows
  • 🔍 Smart Detection - Automatically detects project structure and entry files
  • ⚙️ Flexible Configuration - Customize log levels, environment, and app settings
  • 📦 Auto-Installation - Installs required dependencies automatically
  • 🎨 Interactive & Silent Modes - Choose between guided setup or automated configuration
  • 🌐 Multi-Environment - Supports both browser and Node.js environments
  • 📝 TypeScript Ready - Automatic TypeScript detection and configuration

💻 Installation

No installation required! Run directly with npx:

npx init-consoleiq

Or install globally for repeated use:

npm install -g init-consoleiq
init-consoleiq

🎮 Usage

Interactive Mode (Recommended)

Run the setup wizard that guides you through the entire process:

npx init-consoleiq

The interactive mode will:

  1. Check if you have an existing API key or need to create an account
  2. Handle authentication (login/registration with OTP verification)
  3. Configure your app settings (name, log levels, environment)
  4. Auto-detect your project structure
  5. Install dependencies and integrate ConsoleIQ

Silent Mode

For automated setups or CI/CD pipelines:

npx init-consoleiq --apiKey your_api_key --appName "MyApp" --silent

🛠 Command Line Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --apiKey | -k | Your ConsoleIQ API key | - | | --appName | -n | Application name for logs | Interactive prompt | | --levels | -l | Comma-separated log levels | log,error,warn,info | | --environment | -e | Target environment (browser/node) | browser | | --email | - | Email for account creation/login | - | | --password | - | Password for account creation/login | - | | --register | - | Force account registration flow | - | | --login | - | Force login flow | - | | --silent | -s | Run without prompts, use defaults | false | | --help | -h | Show help message | - |

Log Levels

Customize which console methods are captured:

  • log - Standard console.log output
  • error - Error messages and stack traces
  • warn - Warning messages
  • info - Informational messages
  • debug - Debug-level logging
  • trace - Detailed trace information

📚 Examples

Basic Setup with API Key

npx init-consoleiq --apiKey abc123xyz --appName "My Awesome App"

Full Configuration

npx init-consoleiq \
  --apiKey abc123xyz \
  --appName "ProductionApp" \
  --levels "error,warn,info" \
  --environment node \
  --silent

Account Registration

npx init-consoleiq \
  --email [email protected] \
  --password mySecurePassword123 \
  --appName "MyApp" \
  --register

Account Login

npx init-consoleiq \
  --email [email protected] \
  --password mySecurePassword123 \
  --login

Node.js Environment Setup

npx init-consoleiq \
  --apiKey abc123xyz \
  --appName "BackendAPI" \
  --environment node \
  --levels "error,warn,info"

🔐 Authentication

ConsoleIQ Setup CLI supports multiple authentication methods:

1. Existing API Key

If you already have an API key from the ConsoleIQ dashboard:

npx init-consoleiq --apiKey your_existing_key

2. Account Login

Log in with existing ConsoleIQ credentials:

npx init-consoleiq --email [email protected] --password yourpassword --login

3. New Account Registration

Create a new account with OTP verification:

npx init-consoleiq --email [email protected] --password yourpassword --register

Note: Registration requires email verification via OTP (One-Time Password) sent to your email address.

🏗 Project Integration

The CLI automatically handles project integration:

File Detection

Automatically detects and integrates with common entry files:

  • main.tsx/ts/jsx/js
  • index.tsx/ts/jsx/js
  • app.ts/js
  • server.js/ts
  • api.js

Module System Detection

  • ES Modules: Uses import statements
  • CommonJS: Uses require() statements
  • TypeScript: Creates .ts files when tsconfig.json is detected

Generated Files

The CLI creates a consoleiq.js or consoleiq.ts file in your project:

// Example generated file (consoleiq.js)
import { createConsoleIQ } from 'consoleiq';

createConsoleIQ({
  apiKey: 'your_api_key',
  name: 'MyApp',
  allowedLevels: ['log', 'error', 'warn', 'info'],
  environment: 'browser'
});

⚙️ Configuration

Environment Types

Browser Environment (--environment browser)

  • Captures frontend console output
  • Tracks client-side errors and logs
  • Ideal for React, Vue, Angular, vanilla JS apps

Node.js Environment (--environment node)

  • Captures server-side console output
  • Monitors backend application logs
  • Perfect for Express, Fastify, NestJS, and other Node.js frameworks

Directory Structure

The CLI intelligently places files based on your project structure:

your-project/
├── src/                    # If src/ exists, files go here
│   ├── consoleiq.ts       # Generated config file
│   └── main.ts            # Auto-injected import
├── package.json
└── tsconfig.json          # Triggers TypeScript mode

🔧 Manual Integration

If automatic integration fails, you can manually add ConsoleIQ to your project:

ES Modules (TypeScript/Modern JS)

import './consoleiq.js'; // Add to your entry file

CommonJS (Node.js)

require('./consoleiq.js'); // Add to your entry file

🐛 Troubleshooting

Common Issues

🔴 "API Key Invalid"

  • Verify your API key is correct
  • Check if your account is properly verified
  • Try logging in again with --login flag

🔴 "Entry File Not Found"

  • Manually specify entry file when prompted
  • Add the import statement manually to your main file

🔴 "Installation Failed"

  • Run npm install consoleiq axios prompt-sync --save manually
  • Check your npm configuration and permissions

🔴 "OTP Not Received"

  • Check your spam/junk folder
  • Ensure email address is correct
  • Wait a few minutes and try again

Getting Help

If you encounter issues:

  1. Run with --help to see all available options
  2. Check the ConsoleIQ documentation
  3. Contact support through the ConsoleIQ dashboard

📖 What Happens After Setup?

Once setup is complete:

  1. 🔄 Restart your development server - This ensures ConsoleIQ is loaded
  2. 📊 Check your dashboard - Visit consoleiq.io to see incoming logs
  3. 🧪 Test logging - Add some console.log() statements to verify capture
  4. ⚡ Start monitoring - ConsoleIQ will now capture and analyze your application logs

🔗 Links

📝 Advanced Usage

Custom Entry File Integration

If you have a non-standard project structure:

npx init-consoleiq --apiKey abc123 --appName MyApp
# When prompted for entry file, provide your custom path
# Example: ./app/bootstrap.js

CI/CD Integration

For automated deployments:

npx init-consoleiq \
  --apiKey $CONSOLEIQ_API_KEY \
  --appName $APP_NAME \
  --environment $NODE_ENV \
  --silent

Multiple Environment Setup

Set up different configurations for different environments:

# Development
npx init-consoleiq --apiKey dev_key --appName "MyApp-Dev" --levels "log,error,warn,info,debug"

# Production  
npx init-consoleiq --apiKey prod_key --appName "MyApp-Prod" --levels "error,warn"

🤝 Contributing

This is a setup utility for the ConsoleIQ logging service. For feature requests or bug reports related to the ConsoleIQ platform itself, please visit the main ConsoleIQ website.


Ready to supercharge your logging? Get started with npx init-consoleiq today! 🚀