Skip to content

Enhanced CLI features: interactive mode, watch mode, and batch processing #165

@psmman

Description

@psmman

Hey team,

The CLI is already pretty solid, but there are a few workflow improvements that could make it way more useful for daily development and batch processing scenarios.

Ideas for enhancements

Interactive mode

  • Start a REPL-like session for quick conversions
  • Paste JSON, get TOON output immediately
  • Great for experimentation and learning the format

Watch mode

  • Monitor files/directories for changes
  • Auto-convert when source files are modified
  • Useful for development workflows

Batch processing improvements

  • Process entire directory trees recursively
  • Parallel processing for multiple files
  • Progress bars for long operations
  • Resume capability for interrupted batch jobs

Better output control

  • Choose output format (pretty-printed, minified, etc.)
  • Custom delimiter preferences
  • Dry-run mode to preview changes
  • Verbose mode showing token savings

Example usage

# Interactive mode
toon --interactive

# Watch mode
toon watch ./src --output ./dist --format toon

# Batch with progress
toon convert ./data/**/*.json --parallel --progress

# Dry run
toon convert input.json --dry-run --verbose

Implementation

Could extend the existing CLI structure:

  • Add new commands using the citty framework
  • Reuse existing conversion logic
  • Add file watching with chokidar
  • Progress bars with cli-progress

Why this would be helpful

  • Make TOON more practical for build pipelines
  • Better developer experience for experimentation
  • Handle large-scale data conversion projects
  • Reduce friction for adopting TOON in existing workflows

The current CLI already handles the core use cases well. These additions would make it more powerful for production scenarios and daily development.

Anyone have other CLI features they'd find useful?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions