Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@mira/cli

npm License: AGPL-3.0

Zero-install CLI for the MIRA research API. Enqueues a research job, polls until it completes, and prints the result.


Usage

No install needed:

npx @mira/cli research "<query>"

Or install globally:

npm install -g @mira/cli
mira research "<query>"

Commands

research

mira research "<query>" [options]

Options:
  --depth   quick | deep     Research depth (default: quick)
  --sources <csv>            Comma-separated source list (default: all)
  --help                     Show help

Examples:
  mira research "CRM pain points for small teams"
  mira research "Notion alternatives" --depth deep
  mira research "invoicing frustrations" --sources reddit,hackernews
  mira research "B2B SaaS pricing anxiety" --depth deep --sources reddit

What it does:

  1. POST /api/v1/research — enqueues the job and prints the job ID
  2. Polls GET /api/v1/research/:jobId every 2 seconds (dots printed to show progress)
  3. Prints the full ResearchResult JSON when the job completes (or exits 1 on failure)
  4. Times out after 5 minutes

Sample session:

$ mira research "indie founders switching from Stripe" --depth quick

Queuing research: "indie founders switching from Stripe" (depth: quick)
Job queued: clxyz123abc
Waiting..........

--- Result ---
{
  "query": "indie founders switching from Stripe",
  "summary": "Founders cite dispute resolution and webhook reliability as...",
  "painPoints": [...],
  ...
}

Configuration

API endpoint

By default the CLI talks to http://localhost:3000. Override with:

MIRA_API_URL=https://your-mira-instance.example.com mira research "..."

Or export it in your shell profile:

export MIRA_API_URL=https://your-mira-instance.example.com

Depth

--depth What changes
quick (default) 25 Reddit posts/subreddit, 20 HN stories
deep 50 Reddit posts/subreddit, 40 HN stories

Sources

Comma-separated list of source slugs. Built-in sources: reddit, hackernews, news.

mira research "query" --sources reddit
mira research "query" --sources hackernews,news

Requirements

The CLI requires a running MIRA API. Spin one up locally in under 2 minutes:

git clone https://github.com/mira-js/mira-api-core.git
cd mira-core && cp .env.example .env
# set OPENAI_API_KEY in .env
docker compose up

Then use the CLI from anywhere.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages