Skip to content

Support custom file processors with external commands #933

@yamadashy

Description

@yamadashy

Allow running external commands on files before packing, enabling transformations like JSON to TOON format conversion.

Configuration Example

{
  "fileProcessors": {
    "**/*.json": "npx @toon-format/cli {file}"
  }
}

Implementation

  • Match files with glob patterns
  • Write content to temp file, replace `{file}` placeholder
  • Execute command and capture stdout
  • Use transformed output in packed result

Use Cases

  • JSON to TOON format (token reduction for LLMs)
  • SVG minification
  • Custom file preprocessing

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions