Skip to content

v0.1.23 - Extended CLI Output Formatting (2025-12-07)

What Changed?

This release extends the flexible output formatting options introduced in v0.1.22 to the query and read commands. Both commands now support multiple output formats (table, JSONL, JSON, CSV) with the --use-flat option for consistent data structure control across all CLI commands. All formatting uses the unified ResponseFormatter class.


What's New

Extended Output Formatting for query and read Commands

What it does: The query and read commands now support the same flexible output formatting as the status command. Users can choose between table, JSONL, JSON, and CSV formats, with the --use-flat option to control data structure representation (flattened vs. nested).

How to use it:

query command with multiple formats:

# Default table display
kazunoko query GET_STATUS

# JSONL format (single-line JSON)
kazunoko query GET_STATUS --format jsonl

# Pretty-printed JSON
kazunoko query GET_STATUS --format json

# CSV format
kazunoko query GET_STATUS --format csv

# With flattened structure
kazunoko query GET_STATUS --format jsonl --use-flat

read command with multiple formats:

# Default JSONL with flattened structure
kazunoko read

# Read 10 events as CSV
kazunoko read --count 10 --format csv > events.csv

# Table format with raw nested structure
kazunoko read --format table --use-raw

# Pretty-printed JSON output
kazunoko read --format json

Installation

Quick Start

# Get the release
git checkout vX.Y.Z

# Setup
task env:setup

# Run CLI
uv run kazunoko --help

What's Different from the Last Version?

✅ Added

  • --format option to query command (table, jsonl, json, csv)
  • --format option to read command (jsonl, table, json, csv)
  • --use-flat option to query command for data structure control
  • --use-flat/--use-raw toggle to read command (default: flattened)

🔧 Changed

  • query command now uses ResponseFormatter for consistent output with other commands
  • read command now uses ResponseFormatter for consistent output with other commands
  • Removed redundant CSV formatting logic from read command

🐛 Fixed

  • Inconsistent output formatting between CLI commands

Is It Safe to Upgrade?

Backward Compatible: Yes

  • The --format option is optional and defaults to existing behavior (table for query, jsonl for read)
  • The --use-flat option is optional and does not affect existing scripts
  • Default behavior unchanged: scripts using query and read without format options will work as before
  • All existing CLI usage patterns continue to work without modification

Tests Passed

  • ✅ Builds without errors (uv sync)
  • ✅ Type checking passes (uvx mypy src/)
  • ✅ Linting passes (uvx ruff check src/)
  • ✅ All CLI commands functional with mock device
  • ✅ Query command output formats working (table, jsonl, json, csv)
  • ✅ Read command output formats working (jsonl, table, json, csv)
  • --use-flat and --use-raw options functioning correctly

Release Details

  • Date: 2025-12-07
  • Version: v0.1.23
  • Files Changed: 1 (cli.py)
  • Commits:
  • 00abdae feat: add --format and --use-flat options to read command with ResponseFormatter
  • 464fcf0 feat: add --format and --use-flat options to query command

Next Steps

  • Consider adding output format options to other CLI commands if needed
  • Add comprehensive test suite for all CLI output formatting combinations
  • Gather user feedback on the new formatting options
  • Explore additional output formats (XML, HTML) for future releases