Files
cmdparse/app/README.md
7000pctAUTO 2f1045a0fc
Some checks failed
CI / test (push) Has been cancelled
fix: resolve CI linting and type checking issues
2026-02-04 02:18:56 +00:00

59 lines
1.0 KiB
Markdown

# cmdparse
A CLI tool that parses unstructured CLI command output into structured formats.
## Features
- Auto-detect output format from CLI commands
- Support for multiple output formats: JSON, YAML, CSV, raw
- Extract specific fields using dot notation
- Custom configuration support
- Built-in patterns for common CLI outputs
## Installation
```bash
pip install cmdparse
```
## Usage
```bash
# Parse CLI output with auto-detection
cmdparse < input.txt
# Specify output format
cmdparse -o yaml < input.txt
# Extract specific fields
cmdparse -e field1 -e field2 < input.txt
# Use custom config
cmdparse -c custom.yaml < input.txt
```
## Supported Formats
- Tabular output (with/without borders)
- Key-value pairs (colon or equals delimiter)
- Delimited text (CSV, TSV, semicolon-separated)
- JSON-like output
- Raw/unstructured text
## Configuration
Create a `.cmdparse.yaml` file in your home directory or project root:
```yaml
parsers:
- name: custom
pattern: your_regex
fields:
- field1
- field2
```
## License
MIT