CLI Installation
The BugSpark CLI lets you manage projects and bug reports directly from your terminal — no browser needed.
Prerequisites
- Node.js 18+ installed on your machine
- A BugSpark account (sign up at the Dashboard)
Install
Install the CLI globally using npm, pnpm, or yarn:
npm install -g @bugspark/clipnpm add -g @bugspark/cliyarn global add @bugspark/cliAfter installing, verify it works:
bugspark --versionYou should see 0.1.0 (or the latest version).
First-Time Setup
Run these two commands to get started:
# Step 1 — Log in (opens browser to create a token)
bugspark login
# Step 2 — Set up your project (interactive)
bugspark initThat's it! Read on for a detailed walkthrough of each step.
Step 1: Create a Personal Access Token
Before the CLI can talk to BugSpark, you need a Personal Access Token (PAT).
- Go to Dashboard → Settings → Personal Access Tokens
- Click "Create Token"
- Give it a name (e.g.
My Laptop CLI) - Choose an expiry (or "Never")
- Click Create
- Copy the token immediately — it starts with
bsk_pat_and will only be shown once
Save your token!
The full token is only displayed once when you create it. If you lose it, you'll need to create a new one.
Step 2: Log In
Run the login command:
bugspark loginThe CLI will:
- Ask for your API URL (press Enter to use the default
https://bugspark-api.onrender.com/api/v1) - Try to open your browser to the token creation page
- Ask you to paste your token (
bsk_pat_...) - Verify the token by calling the API
- Save your credentials to
~/.bugspark/config.json
Once you see ✓ Logged in as Your Name, you're ready to go.
Config file
Your token is stored at ~/.bugspark/config.json with restrictive file permissions (600). Only your user account can read it.
Step 3: Initialize a Project
bugspark initThis interactive command will:
- Show your existing projects (if any)
- Let you select an existing project or create a new one
- Display the widget installation snippet with your API key pre-filled
Example output:
🐛⚡ BugSpark Project Setup
? Select a project or create a new one
❯ My Web App (bsk_pub_abc...)
Another Project (bsk_pub_def...)
+ Create new projectAfter selecting or creating a project, you'll see ready-to-paste installation code for both script tag and npm.
Next Steps
- CLI Commands — Full list of available commands
- CLI Authentication — How token auth works under the hood
- Widget Installation — Install the bug reporting widget