Skip to main content

Overview

continum init is an interactive CLI that sets up the Continum SDK in your project with zero configuration. It detects your existing framework, guides you through configuration, and generates all necessary files.

Usage

Run this command in your project directory (or an empty folder):
npx continum init
No installation required! The CLI will guide you through the entire setup process.

Features

πŸ” Smart Framework Detection

The CLI automatically detects your existing framework: Frontend:
  • Next.js (App Router & Pages Router)
  • Nuxt (Vue)
  • SvelteKit
  • Astro
  • React, Vue, Svelte
Backend:
  • NestJS
  • Fastify
  • Hono
  • Express
If no framework is detected, it offers to set one up for you!

πŸš€ Framework Setup

Start from scratch with your favorite framework:
mkdir my-ai-app
cd my-ai-app
npx continum init
The CLI will:
  1. Ask if you want to set up a framework
  2. Install and configure your chosen framework
  3. Set up Continum with your compliance requirements
  4. Generate example code to get you started

🎯 Smart Defaults

The CLI automatically:
  • Detects TypeScript vs JavaScript
  • Suggests appropriate presets based on your product type
  • Configures compliance frameworks
  • Sets up alert channels
  • Installs the SDK

πŸ”’ Secure by Default

  • API keys and webhooks stored in .env (not committed)
  • HTTPS validation for all webhook URLs
  • Environment variable references in config files

What It Creates

After running npx continum init, you’ll have:
  • βœ… continum.config.ts (or .js) - Your Continum configuration
  • βœ… .env - Updated with API key and alert webhooks
  • βœ… continum-example.ts (or .js) - Sample code to get started
  • βœ… @continum/sdk installed in your project

Interactive Prompts

1. Framework Setup (if no package.json)

β”Œ  Continum Setup
β”‚
β—‡  Set up a JavaScript framework first?
β”‚  Yes
β”‚
β—‡  What type of project are you building?
β”‚  🎨 Frontend (React, Vue, Svelte, etc.)
β”‚
β—‡  Choose a frontend framework:
β”‚  Next.js (App Router)

2. Product Type

β—‡  What kind of AI product are you building?
β”‚  πŸ’¬ Customer support bot
Options:
  • πŸ’¬ Customer support bot
  • πŸ’» Coding assistant
  • βš–οΈ Legal or research tool
  • πŸ₯ Healthcare application
  • πŸ’° Financial services
  • πŸ€– AI agent with tool use
  • ✍️ Content generation
  • πŸ”§ Internal team tool
  • πŸ“Š Data pipeline
  • πŸŽ“ Education tool

3. LLM Providers

β—‡  Which LLM providers are you using?
β”‚  β—Ό OpenAI
β”‚  β—Ό Anthropic
Options:
  • OpenAI (GPT-4o, GPT-4, o1, o3)
  • Anthropic (Claude Opus, Sonnet, Haiku)
  • Google Gemini (Gemini Pro, Flash)
  • Azure OpenAI
  • AWS Bedrock
  • Other

4. Compliance Frameworks

β—‡  Do you need to comply with any specific frameworks?
β”‚  β—Ό GDPR
β”‚  β—Ό SOC2
Options:
  • GDPR (EU data protection)
  • CCPA (California privacy)
  • SOC2 (Security & availability)
  • HIPAA (US healthcare data)
  • EU AI Act (EU AI regulation)
  • ISO 27001 (Information security)
  • FINRA (US financial services)
  • PCI DSS (Payment card security)
  • NIST AI RMF (AI risk management)

5. Alert Channels

β—‡  Set up real-time alerts for compliance violations?
β”‚  Yes
β”‚
β—‡  Which alert channels do you want to configure?
β”‚  β—Ό Slack
β”‚  β—Ό PagerDuty
β”‚
β—‡  Slack webhook URL (or press Enter to use env var):
β”‚  https://hooks.slack.com/services/...
Options:
  • Slack - Team notifications
  • PagerDuty - Critical incidents
  • Discord - Community alerts
  • Custom Webhook - Your own endpoint
All webhook URLs must use HTTPS for security.

Generated Files

continum.config.ts

import type { ContinumConfig } from '@continum/sdk';

const config: ContinumConfig = {
  apiKey: process.env.CONTINUM_API_KEY,
  preset: 'customer-support',
  comply: ['GDPR', 'SOC2'],
  alerts: {
    slack: process.env.SLACK_WEBHOOK_URL,
    pagerduty: process.env.PAGERDUTY_KEY,
  },
};

export default config;

.env

# Continum Configuration
CONTINUM_API_KEY=your_api_key_here
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
PAGERDUTY_KEY=YOUR_PAGERDUTY_INTEGRATION_KEY

continum-example.ts

import { protect } from '@continum/sdk';
import OpenAI from 'openai';

const openai = new OpenAI();

// Example 1: Basic usage with protect()
async function example1() {
  const response = await protect(
    () => openai.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: 'Hello!' }]
    }),
    {
      apiKey: process.env.CONTINUM_API_KEY!,
      preset: 'customer-support',
      comply: ['GDPR', 'SOC2'],
      alerts: {
        slack: process.env.SLACK_WEBHOOK_URL,
        pagerduty: process.env.PAGERDUTY_KEY,
      },
    }
  );

  console.log(response.choices[0].message.content);
}

// Example 2: Global configuration (recommended)
import { continum } from '@continum/sdk';

continum.configure({
  apiKey: process.env.CONTINUM_API_KEY!,
  preset: 'customer-support',
  comply: ['GDPR', 'SOC2'],
  alerts: {
    slack: process.env.SLACK_WEBHOOK_URL,
    pagerduty: process.env.PAGERDUTY_KEY,
  },
});

async function example2() {
  const response = await continum.protect(
    () => openai.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: 'Hello!' }]
    })
  );
}

// Example 3: Blocking mode
async function example3() {
  try {
    const response = await protect(
      () => openai.chat.completions.create({
        model: 'gpt-4',
        messages: [{ role: 'user', content: 'Process this payment' }]
      }),
      {
        apiKey: process.env.CONTINUM_API_KEY!,
        blockOn: 'HIGH' // Block if risk level is HIGH or CRITICAL
      }
    );
  } catch (error) {
    if (error.name === 'ContinumBlockedError') {
      console.error('Blocked:', error.signal.violations);
    }
  }
}

Example Sessions

Starting from Scratch

$ mkdir my-ai-app
$ cd my-ai-app
$ npx continum init

β”Œ  Continum Setup
β”‚
β—‡  Set up a JavaScript framework first?
β”‚  Yes
β”‚
β—‡  What type of project are you building?
β”‚  🎨 Frontend (React, Vue, Svelte, etc.)
β”‚
β—‡  Choose a frontend framework:
β”‚  Next.js (App Router)
β”‚
β—†  Setting up nextjs-app...
β”‚  βœ“ nextjs-app installed successfully!
β”‚
β—‡  Set up Continum AI compliance in your project?
β”‚  Yes
β”‚
β—‡  What kind of AI product are you building?
β”‚  πŸ’¬ Customer support bot
β”‚
β—‡  Which LLM providers are you using?
β”‚  β—Ό OpenAI
β”‚
β—‡  Do you need to comply with any specific frameworks?
β”‚  β—Ό GDPR
β”‚
β—‡  Set up real-time alerts for compliance violations?
β”‚  Yes
β”‚
β—‡  Which alert channels do you want to configure?
β”‚  β—Ό Slack
β”‚
β—‡  Slack webhook URL (or press Enter to use env var):
β”‚  https://hooks.slack.com/services/...
β”‚
β—‡  Install @continum/sdk now?
β”‚  Yes
β”‚
β—†  Installing @continum/sdk...
β”‚  βœ“ @continum/sdk installed!
β”‚
β—†  Setting up Continum...
β”‚
β”œ  Setup Complete
β”‚
β”‚  βœ“ Created continum.config.ts
β”‚  βœ“ Created .env with placeholder values
β”‚  βœ“ Created continum-example.ts with sample code
β”‚  βœ“ Installed @continum/sdk
β”‚
β””  Next steps:

   1. Add your API key to .env
   2. Wrap your first LLM call with protect()
   3. Check continum-example.ts for examples
   4. Run your app and view violations in the dashboard

   Docs: https://docs.continum.co/quickstart
   Dashboard: https://app.continum.co

Existing Project

$ cd my-existing-app
$ npx continum init

β”Œ  Continum Setup
β”‚
β„Ή  Detected framework: Next.js (App Router)
β”‚
β—‡  Set up Continum AI compliance in your project?
β”‚  Yes
β”‚
β—‡  What kind of AI product are you building?
β”‚  πŸ’¬ Customer support bot
β”‚
...

Requirements

Get Your API Key

Get your API key from the dashboard:
  1. Sign in with GitHub
  2. Create a customer account (Individual or Company)
  3. Generate an API key
  4. Save it securely (you won’t see it again)

Next Steps

After running npx continum init:
  1. Add your API key to .env
  2. Import and use the SDK in your code
  3. Check the example file for usage patterns
  4. View the dashboard at https://app.continum.co

Documentation

Support