Skip to content

v0.1.36 - Command Usage Discovery (2025-12-13)

What Changed?

This release adds a new usage command that displays all queryable commands supported by the device. Users can now explore available commands with their arguments and descriptions without consulting external documentation. The feature integrates seamlessly with existing output formats and the mock device for testing.


What's New

Main Feature: kazunoko usage Command

What it does: Queries the device for a complete list of all queryable commands, including command names, required arguments, and descriptions. This helps users discover which commands are available and how to use them.

How to use it:

# Display all available commands (default: flattened JSONL format)
kazunoko usage

# Display as formatted table
kazunoko usage --format table

# Display as pretty-printed JSON
kazunoko usage --format json

# Filter specific commands with jq
kazunoko usage --format json | jq '.commands[] | select(.command | contains("GNSS"))'

# With verbose output to see connection details
kazunoko usage -v

# Using mock device for testing
kazunoko usage --mock

Code example (using the library):

from kazunoko import connect, Command

with connect() as device:
    cmd = Command(device)
    response = cmd.usage()
    print(response.commands)  # List of all available commands

    # Format as table
    from kazunoko import ResponseView, ResponseFormatter
    rv = ResponseView(raw=response)
    fmt = ResponseFormatter(rv.flat)
    fmt.display(format='table')

Installation

Quick Start

# Get the release
git checkout v0.1.36

# Setup
uv sync

# Run CLI
kazunoko usage --mock

What's Different from the Last Version?

✅ Added

  • New CLI command: kazunoko usage - Display queryable commands from device with full argument/description details
  • New Command method: Command.usage() - Library method to query device for available commands
  • MockDevice support: GET_USAGE command handler in MockDevice for testing without real hardware
  • Support for all standard output formats (table, JSONL, JSON, CSV, SSV, TSV, LTSV)
  • --use-flat option for compact, scriptable output

🔧 Changed

  • None (backward compatible)

🐛 Fixed

  • None

Is It Safe to Upgrade?

Backward Compatible: Yes

  • No changes to existing commands or behavior
  • usage is a new command that doesn't affect any existing functionality
  • All existing CLI commands, library methods, and features remain unchanged

Tests Passed

  • ✅ Builds without errors
  • ✅ Ruff linting passed
  • kazunoko usage --mock returns valid response
  • ✅ All output formats working (table, jsonl, json, csv, etc.)
  • ✅ Mock device returns 40 commands with proper structure

Release Details

  • Date: 2025-12-13
  • Version: v0.1.36
  • Files Changed: 3
  • Key Changes:
  • src/kazunoko/command.py - Added usage() method
  • src/kazunoko/cli.py - Added usage() command
  • src/kazunoko/mock.py - Added GET_USAGE mock response

Next Steps

Potential future enhancements:

  • Add filtering/searching for commands by category or pattern
  • Include command usage frequency statistics from device
  • Add man page generation from command definitions