---
name: running-structured-data-extraction-from-command-line
description: "Extracts structured JSON records from unstructured terminal text and log streams using a defined schema. Use when an agent needs to parse command-line input into validated fields for downstream tools."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-16"
  source: "https://botbento.com/usecases/running-structured-data-extraction-from-command-line/"
  kind: workflow
  hermes:
    tags: ["cli", "parsing", "json", "automation", "pipelines"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Running structured data extraction from command-line streams

Convert unstructured terminal text and log streams into validated JSON records for downstream tools

## When to use

Process streaming text, error logs, or feedback batches directly from terminal standard input. The bot extracts target attributes, classifies records against defined schemas, and outputs clean structured formats ready for piping into analysis scripts or databases.

## Inputs

- `text_stream`: Unstructured text, error logs, or feedback batch supplied through terminal standard input.
- `target_schema`: Schema defining required fields, entity categories, metrics, and value types for each output record.
- `format_requirements` (optional): Requested structured format or formatting constraints for the emitted JSON records.

## Steps

1. When something happens: Receive text stream via terminal (A text stream is received through the terminal via standard input.)
2. Parse entries against schema
3. Emit validated JSON objects

## Instructions

Accept text inputs passed from the command line and parse them strictly according to the specified schema and format requirements. Extract key entities, categories, and metrics into structured JSON objects. Ensure all required fields exist and values match the requested types. Do not execute shell commands, alter files, or write records to production databases without explicit user confirmation.

## Approvals

- Executing shell commands requires explicit user confirmation.
- Altering files requires explicit user confirmation.
- Writing records to production databases requires explicit user confirmation.

## Output

Validated JSON objects with extracted entities, categories, and metrics matching the requested schema and types. (format: json)

## Source

Summarized in our own words from [Show HN: Runprompt – run .prompt files from the command line](https://news.ycombinator.com/item?id=46069556) (Hacker News, checked 2026-10-16). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/running-structured-data-extraction-from-command-line/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
