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

@eidra-bloodline/cli

v0.2.0

Published

`@eidra-bloodline/cli` is the command-line interface for working with Bloodline from a terminal, shell script, CI job, or local automation. It wraps the public Bloodline API and authentication flow so you can search companies, run saved filters, inspect c

Readme

@eidra-bloodline/cli

@eidra-bloodline/cli is the command-line interface for working with Bloodline from a terminal, shell script, CI job, or local automation. It wraps the public Bloodline API and authentication flow so you can search companies, run saved filters, inspect company-level details, and fetch timeline events without writing a custom client.

This package is aimed at operators, analysts, internal tooling, and scripts that need a stable command surface with machine-readable output.

What The CLI Can Do

  • Authenticate with Bloodline using the device login flow.
  • Discover which tenants are available to the current user.
  • Search companies by name or org number.
  • Narrow company search results with financial filters such as revenue, EBITDA, employee count, country, and industry.
  • Fetch a single company record.
  • Fetch a company timeline by org number.
  • List saved filters and run them with pagination.
  • Fetch company details for one company or many company IDs from a file.
  • Return output as table, json, ndjson, or csv depending on whether the target is a human or another program.

Installation

Install globally:

pnpm add -g @eidra-bloodline/cli

Alternative package managers:

npm install -g @eidra-bloodline/cli
yarn global add @eidra-bloodline/cli

Verify the binary is available:

bloodline --help

Quick Start

Authenticate first:

bloodline auth login

Inspect your current session and config:

bloodline auth status
bloodline auth debug

Search companies:

bloodline companies search "Eidra"

Search by org number instead of company name:

bloodline companies search "SE5592282270" --orgnr --format json

Fetch a timeline for a company:

bloodline companies timeline SE5592282270 --limit 25 --format json

Shell Completions

The CLI can generate shell completion scripts. Add one of the following to your shell profile:

# zsh (~/.zshrc)
eval "$(bloodline --completions zsh)"

# bash (~/.bashrc)
eval "$(bloodline --completions bash)"

# fish (~/.config/fish/config.fish)
bloodline --completions fish | source

Command Overview

Top-level commands:

  • bloodline auth
  • bloodline filters
  • bloodline companies
  • bloodline company-details
  • bloodline health

The CLI also normalizes arguments so options can be written before or after positionals in supported subcommands. Conventional ordering is still recommended in documentation and scripts.

Configuration

The CLI resolves configuration from three places, in this order:

  1. Environment variables.
  2. A JSON config file.
  3. Built-in defaults.

Default Paths

  • Config file: ~/.bloodline/config.json
  • Token file: ~/.bloodline/tokens.json

Environment Variables

These variables are supported by the CLI and underlying public client:

  • BLOODLINE_API_BASE_URL Bloodline API base URL. Default: https://bloodline-api.eidra.com
  • BLOODLINE_AUTH_BASE_URL FusionAuth base URL. Default: https://bloodline-iam.eidra.com
  • BLOODLINE_AUTH_CLIENT_ID Optional auth client ID override.
  • BLOODLINE_AUTH_CLIENT_SECRET Optional auth client secret override. Only needed when your auth policy requires it.
  • BLOODLINE_AUTH_SCOPES Space-delimited OAuth scopes. If omitted, the CLI builds a default scope set from openid offline_access plus any extra scopes in BLOODLINE_SCOPES.
  • BLOODLINE_SCOPES Comma-delimited extra scopes merged into the default set.
  • BLOODLINE_SCHEMA_VERSION Optional schema version override.
  • BLOODLINE_CONFIG_FILE Path to the JSON config file.
  • BLOODLINE_TOKEN_FILE Path to the token store file.

Config File Example

Minimal example:

{
  "apiBaseUrl": "http://localhost:3102",
  "authBaseUrl": "https://bloodline-iam.eidra.com"
}

Full example:

{
  "apiBaseUrl": "http://localhost:3102",
  "authBaseUrl": "https://bloodline-iam.eidra.com",
  "authClientId": "my-client-id",
  "authClientSecret": "my-client-secret",
  "authScopes": "openid offline_access profile",
  "schemaVersion": "v0",
  "mcpPort": 3000,
  "tokenFilePath": "/Users/alice/.bloodline/tokens.json"
}

Local Development Example

If you are pointing the CLI at a local API:

export BLOODLINE_API_BASE_URL=http://localhost:3102
export BLOODLINE_AUTH_BASE_URL=https://bloodline-iam.eidra.com

To use a custom config file for a project or test environment:

export BLOODLINE_CONFIG_FILE="$PWD/.bloodline.config.json"

Inspect Effective Configuration

To see the exact config, auth state, endpoints, and active tenants the CLI is using:

bloodline auth debug

This is the first command to run if the CLI is talking to the wrong API, using the wrong auth base URL, or reading the wrong token/config file.

Authentication

The CLI uses device-based authentication.

bloodline auth login

Starts login.

bloodline auth login

What happens:

  • The CLI fetches the list of active clients or tenants.
  • If there is exactly one active tenant, it uses it automatically.
  • If there are multiple tenants and the terminal is interactive, it prompts you to choose one.
  • If there are multiple tenants and the session is non-interactive, you must pass --tenant-id.
  • The CLI prints a JSON object containing the device flow information and a verification URL.

Login with an explicit tenant:

bloodline auth login --tenant-id 605d1740-6f43-4ef8-9bc7-28aa2c7dc36c

Typical automation-safe usage:

bloodline auth login --tenant-id <tenantId>

bloodline auth status

Shows whether you are authenticated and prints a token preview.

bloodline auth status

This is useful in scripts before issuing data queries.

bloodline auth debug

Prints:

  • Effective config.
  • Which environment variables are overriding defaults.
  • Which API and auth endpoints are in use.
  • The list of active clients.
  • Current auth status and token preview.
bloodline auth debug

bloodline auth logout

Clears the stored token set.

bloodline auth logout

Companies

The companies group supports search, direct lookup, and timeline retrieval.

bloodline companies search

Searches companies by name by default.

bloodline companies search "ai infrastructure" --limit 50 --format json

Supported options:

  • --orgnr Treats the query as an org number lookup instead of a name search.
  • --where <value> Legacy opaque filter string passed through to the API. Use only if you already know the server-side contract.
  • --sort <value> Opaque sort payload passed through to the API.
  • --limit <number> Maximum rows returned for this page. Default: 100
  • --cursor <value> Cursor for paginated search.
  • --format <table|json|ndjson|csv> Output format.
  • --min-revenue <number> Minimum revenue filter.
  • --max-revenue <number> Maximum revenue filter.
  • --min-employees <number> Minimum employee count filter.
  • --max-employees <number> Maximum employee count filter.
  • --min-ebitda <number> Minimum EBITDA filter.
  • --max-ebitda <number> Maximum EBITDA filter.
  • --country <value> Country code filter.
  • --industry <value> Industry filter.

Examples:

Search by name:

bloodline companies search "Eidra"

Search by org number:

bloodline companies search "SE5592282270" --orgnr --format json

Search with financial constraints:

bloodline companies search "software" \
  --min-revenue 1000000 \
  --max-revenue 500000000 \
  --min-employees 10 \
  --country SE \
  --limit 25 \
  --format json

Paginate manually:

bloodline companies search "fintech" --limit 100 --cursor 100 --format json

Pipe into other tools:

bloodline companies search "Eidra" --format ndjson | jq .

bloodline companies get

Fetches a single company record by company ID.

In practice, this is typically an org number or a company identifier returned by companies search.

bloodline companies get SE5592282270 --format json

Supported options:

  • --format <table|json|ndjson|csv>

bloodline companies timeline

Fetches a timeline for a company by org number.

bloodline companies timeline SE5592282270 --limit 25 --format json

Supported options:

  • --limit <number> Maximum number of events returned by the CLI output. Default: 100
  • --format <table|json|ndjson|csv>

Current timeline output contains:

  • orgnr
  • companyName
  • eventCount
  • events

The underlying API can return event types such as:

  • news_article
  • annual_report_insight
  • annual_report_filing
  • company_move
  • linkedin_snapshot
  • job_posting

Examples:

bloodline companies timeline SE5592282270 --format json
bloodline companies timeline SE5592282270 --limit 10 --format ndjson

A company timeline can legitimately be empty. In that case, the CLI still returns a valid response with eventCount: 0 and an empty events array.

Filters

The filters group lets you inspect and execute saved Bloodline filters.

bloodline filters list

Lists available filters.

bloodline filters list --format table

Supported options:

  • --format <table|json|ndjson|csv>

bloodline filters run

Runs a saved filter by ID.

bloodline filters run <filterId> --limit 100 --format ndjson

Supported options:

  • --since <timestamp> Optional lower-bound timestamp.
  • --limit <number> Rows to return for the current page. Default: 100
  • --cursor <value> Cursor for pagination.
  • --format <table|json|ndjson|csv>

Examples:

bloodline filters list --format json
bloodline filters run 94a6f5c1-aaaa-bbbb-cccc-123456789abc --limit 250 --format csv
bloodline filters run 94a6f5c1-aaaa-bbbb-cccc-123456789abc \
  --since 2026-01-01T00:00:00Z \
  --limit 100 \
  --format ndjson

Company Details

The company-details group fetches extended values for one or more companies.

bloodline company-details get

Fetch for one company:

bloodline company-details get SE5592282270 --columns intent_score,buying_stage --format json

Fetch for many companies from a file:

bloodline company-details get --file ids.txt --columns intent_score,buying_stage --format ndjson

Supported options:

  • --file <path> Read company IDs from a file instead of providing a single positional companyId.
  • --columns <comma,separated,list> Restrict the returned columns.
  • --format <table|json|ndjson|csv>

Behavior notes:

  • If --file is provided, the positional companyId is not required.
  • The file should contain one company ID per line.
  • Blank lines are ignored.
  • In file mode, the CLI returns an array of records.

Example ids.txt:

SE5592282270
SE5566778899
SE1122334455

Output Formats

All data commands support four output formats:

  • table
  • json
  • ndjson
  • csv

table

Best for interactive terminal use.

  • Arrays render as a simple text table.
  • Empty arrays render as (no rows).
  • Nested objects are stringified into a single cell.

Example:

bloodline filters list --format table

json

Best for inspection, debugging, and piping into tools that expect a single JSON value.

bloodline companies get SE5592282270 --format json | jq .

ndjson

Best for line-oriented processing when each row should be handled independently.

bloodline companies search "Eidra" --format ndjson

csv

Best for spreadsheets and flat exports.

bloodline company-details get --file ids.txt --columns intent_score --format csv

Notes on CSV output:

  • CSV columns are taken from the keys of the first row.
  • Nested objects are JSON-stringified into a cell.
  • null and undefined values become empty strings.

Automation Patterns

Fail Fast On Auth Before Running Data Commands

bloodline auth status >/dev/null && bloodline companies search "Eidra" --format json

Use JSON Or NDJSON In Scripts

Prefer json or ndjson over table for scripts.

bloodline companies search "Eidra" --format json | jq '.[0].companyId'
bloodline filters run <filterId> --format ndjson | jq .companyId

Use Explicit Tenant IDs In CI

Interactive tenant selection requires a TTY. CI jobs usually do not have one.

bloodline auth login --tenant-id <tenantId>

Pin Local API Targets Explicitly

If you are testing locally, export the API base URL instead of relying on shell history or implicit defaults.

export BLOODLINE_API_BASE_URL=http://localhost:3102
bloodline auth debug

Common Workflows

Find A Company And Inspect It

bloodline companies search "Eidra" --limit 5 --format json
bloodline companies get SE5592282270 --format json

Search By Financial Profile

bloodline companies search "software" \
  --min-revenue 5000000 \
  --min-employees 20 \
  --max-ebitda 100000000 \
  --country SE \
  --format json

Run A Saved Filter And Export Results

bloodline filters run <filterId> --limit 500 --format csv > filter-results.csv

Enrich A Known Company List

bloodline company-details get \
  --file ids.txt \
  --columns intent_score,buying_stage,employee_count \
  --format ndjson

Fetch Timeline Data For Review

bloodline companies timeline SE5592282270 --limit 50 --format json | jq .events

Troubleshooting

The CLI Is Pointing To The Wrong API

Run:

bloodline auth debug

Check:

  • effectiveConfig.apiBaseUrl
  • envOverrides.apiBaseUrl
  • effectiveConfig.configFilePath

Login Fails In CI Or Non-Interactive Shells

If there are multiple available tenants, interactive selection will fail without a TTY.

Use:

bloodline auth login --tenant-id <tenantId>

No Companies Or Timeline Events Are Returned

Possible reasons:

  • The query is too strict.
  • The org number is malformed.
  • The company exists but there are no timeline events yet.
  • You are pointed at the wrong environment.

Check with:

bloodline auth debug
bloodline companies search "<value>" --format json

Company Details File Import Fails

Check that:

  • The file exists.
  • It is readable by the current user.
  • It contains one company ID per line.
  • There are no unexpected separators.

Output Is Hard To Parse In Scripts

Use json, ndjson, or csv, not table.

Package Development

If you are working on the CLI package itself inside this repository:

pnpm -C packages/cli typecheck
pnpm -C packages/cli test
pnpm -C packages/cli build

Run the CLI from source in the monorepo:

pnpm -C packages/cli exec tsx src/main.ts auth debug
pnpm -C packages/cli exec tsx src/main.ts companies search "Eidra" --format json

Summary

Use the Bloodline CLI when you need Bloodline data from a terminal, script, or automation environment. Start with bloodline auth login, inspect configuration with bloodline auth debug, and prefer json or ndjson whenever another program needs to consume the results.