Skip to main content
CLI Reference

CLI — Overview

The Extraktr CLI is a terminal surface for the same extraction engine that powers the workspace and the HTTP API—not a separate product. Use Extraktr in scripts, pipelines, or local workflows when you need structured output without opening the browser.

Same extraction engine. Browser, API, or terminal. The request contract matches Extraction Endpoint; output categories (tasks, decisions, risks, summary) align with Try Extraktr.

It is for:

  • Developers integrating Extraktr into tooling
  • Operators running repeatable extractions
  • Automation workflows and scheduled jobs
  • CI pipelines that validate or summarize thread exports
  • Terminal-first users who already work in a shell

Supported workflows (HTTP client or npm CLI; same contract):

  • File-backed thread text (--file)
  • Piped stdin (--stdin)
  • Optional Authorization: Bearer via --bearer / EXTRAKTR_BEARER
  • Explicit source_type (slack, gmail, discord, teams, generic)
  • JSON, plain text, or Markdown output via --format—renderings of the same result

Install

Published on npm. Install with npm install -g extraktr (Node.js 18+). Run extraktr --help or try npx extraktr --help without a global install. In environments without Node, use curl or any HTTP client against POST /api/extract.

Version and release notes follow the npm package; see What's New for product updates.

Quick Start

The extraktr command posts to the same /api/extract route as the website. Examples below target production; set EXTRAKTR_BASE_URL for other hosts.

npm package

Install globally, then run help and extract:

npm install -g extraktr
extraktr --help

Generic shell (file on disk):

extraktr extract --file ./thread.txt

PowerShell (Windows path):

extraktr extract --file C:\path\	o\	hread.txt

Stdin (PowerShell):

Get-Content C:\path\	o\	hread.txt | extraktr extract --stdin

JSON to stdout (valid JSON only—safe for jq):

extraktr extract --file ./thread.txt --format json

Write JSON to a file:

extraktr extract --file ./thread.txt --format json --output out.json

Bash: deterministic ResolvedActions JSON to stdout:

extraktr extract --file ./thread.txt --resolved-actions-json

Bash: include optional markdown summary in the same JSON payload:

extraktr extract --file ./thread.txt --resolved-actions-json --markdown-summary

PowerShell: deterministic ResolvedActions JSON to stdout:

extraktr extract --file C:\path\	o\	hread.txt --resolved-actions-json

PowerShell: include optional markdown summary in the same JSON payload:

extraktr extract --file C:\path\	o\	hread.txt --resolved-actions-json --markdown-summary

Without installing globally:

npx extraktr --help

curl (any machine)

curl -sS -X POST https://extraktr.com/api/extract \
  -H "Content-Type: application/json" \
  -d '{"raw_content":"Chris: Move the release to Friday?\nMorgan: Yes.","source_type":"slack"}'

From source (contributors)

To develop the CLI locally, clone the repo and run npm link from cli/; the extraktr command then points at your working tree.

Expected behavior

On success, the response is HTTP 200 with a JSON body matching the ExtractionResponse schema.

{
  "summary": "Team agreed to move release to Friday.",
  "tasks": [
    { "text": "Send the calendar invite", "owner": "Chris" }
  ],
  "decisions": [
    { "text": "Move the release to Friday" }
  ],
  "risks": [],
  "prompt_version": "v2",
  "schema_version": "1.0"
}

Commands

The npm package extraktr provides the extraktr command.

extraktr extract

Runs one extraction; body is POST /api/extract with raw_content and optional source_type.

Flags

  • --file <path> — read conversation text from a file
  • --stdin — read conversation text from piped stdin (not a TTY)
  • --source <type> — optional source_type: slack, gmail, discord, teams, generic
  • --format json|text|markdown — output shape (default text)
  • --resolved-actions-json — print deterministic ResolvedActions JSON to stdout
  • --markdown-summary — include markdown_summary (requires --resolved-actions-json)
  • --output <path> — write result to file instead of stdout
  • --bearer <token> — optional Authorization
  • --help / -h — usage

Input rules

  • Use exactly one of --file or --stdin; combining them is an error.
  • --stdin with an interactive TTY (no pipe) fails with a clear message.
  • Empty stdin is rejected before the request is sent.

Help

extraktr --help
extraktr extract --help
extraktr --version

Output Formats

JSON — raw structured response (same shape as the API). With --format json, stdout contains valid JSON only on success.

Text — human-readable sections for summary, tasks, decisions, and risks. Default format.

Markdown — same data as compact ## sections for reading or diffs.

Authentication

For scripts and the Node CLI (no cookies), send Authorization: Bearer … yourself. Use a CLI/API token to associate usage with your account and receive higher limits.

Generate a CLI/API token in Settings → CLI Token. Scripts should respect 429 responses and avoid embedding secrets in repositories.

Examples

Automation (npm CLI)

Pipe logs or exports into extraction as JSON:

cat logs.txt | extraktr extract --stdin --format json

Batch (bash)

Process many files (adjust paths as needed):

for f in ./threads/*.txt; do extraktr extract --file "$f" --format json --output "./out/$(basename "$f" .txt).json"; done

CI-style step

Write one JSON artifact per job:

extraktr extract --file thread.txt --format json --output extraction.json

Extract from a local file (curl)

curl -sS -X POST https://extraktr.com/api/extract \
  -H "Content-Type: application/json" \
  -d @./payload.json

CI / Automation

In pipelines, call the HTTP endpoint with curl or run extraktr with --format json --output.

  • Keep thread samples under the same size limits as production API requests.
  • Prefer --format json for machine parsing.
  • Avoid hard-coding credentials; use CI secrets when authentication is required.

Troubleshooting

  • No input — the CLI requires --file or piped --stdin; empty stdin is rejected.
  • Conflicting input — do not pass both --file and --stdin.
  • Invalid file path — --file must exist; --output must be writable.
  • Rate limits — 429; back off using Retry-After when present.
  • Network / TLS — non-zero exit; retry with connectivity checks.

Still have questions?

Reach out to our team or start extracting to see the platform in action.