Tools
Krabovye Palochki
Token-efficient OpenClaw plugin — wraps ffmpeg, ffprobe & MKVToolNix as compact LLM tools
Install
npm install &&
README
# krabovye-palochki
Token-efficient [OpenClaw](https://github.com/openclaw/openclaw) plugin — wraps ffmpeg, ffprobe & MKVToolNix as compact LLM tools.
## The Problem
OpenClaw's `exec` tool dumps raw command output into the LLM conversation context. A single `ffprobe` call returns ~70KB of JSON. In a media repack workflow with 60+ tool calls, each re-sending the full conversation, this balloons to 13M+ input tokens per session — blowing through TPM rate limits even on paid tiers.
## The Solution
Purpose-built OpenClaw plugin tools that:
- Run the same binaries (`ffprobe`, `ffmpeg`, `mkvmerge`, `mkvextract`, `mkvpropedit`)
- Capture and parse stdout internally
- Return only a compact summary to the agent
**70,000 bytes → 150 bytes.** The agent gets what it needs. The context stays lean.
## Tools
### ff\_\* family (ffmpeg/ffprobe)
| Tool | Wraps | What it does |
| ------------------ | ------- | --------------------------------------------- |
| `ff_probe` | ffprobe | analyze tracks (codec, lang, channels) |
| `ff_audio_analyze` | ffprobe | audio stream details (LUFS, volume, silence) |
| `ff_video_analyze` | ffprobe | video stream details (crop, interlace, black) |
| `ff_transcode` | ffmpeg | transcode with progress tracking |
| `ff_remux` | ffmpeg | container remux (stream copy) |
| `ff_bitstream` | ffmpeg | apply bitstream filters (dca_core, etc.) |
| `ff_metadata` | ffmpeg | edit metadata tags and dispositions |
| `ff_subtitle` | ffmpeg | extract/convert/embed subtitles |
| `ff_thumbnail` | ffmpeg | extract thumbnail frames |
### mkv\_\* family (MKVToolNix)
| Tool | Wraps | What it does |
| -------------- | ----------- | -------------------------------- |
| `mkv_identify` | mkvmerge -J | identify container structure |
| `mkv_merge` | mkvmerge | merge/remux with track selection |
| `mkv_split` | mkvmerge | split by chapters/size/time |
| `mkv_extract` | mkvextract | extract tracks/chapters/tags |
| `mkv_propedit` | mkvpropedit | in-place property editing |
## Installation
Requires [OpenClaw](https://github.com/openclaw/openclaw) with plugin support.
```bash
# Clone and build
git clone https://github.com/david2tm/krabovye-palochki.git
cd krabovye-palochki
npm install && npm run build
# Install into OpenClaw (production — copies files)
openclaw plugins install .
# Or link for development (changes reflect immediately after rebuild)
openclaw plugins install -l .
```
## Development
```bash
npm install
npm run build # compile TypeScript
npm run test # vitest (run once)
npm run lint # oxlint
npm run format:check # oxfmt
npm run check # lint + format + build + test (full CI)
```
## Requirements
- **Node.js** >= 24 LTS
- **Host binaries** (must be available in the OpenClaw container):
- `ffprobe` / `ffmpeg`
- `mkvmerge` / `mkvextract` / `mkvpropedit` (MKVToolNix)
## Name
krabovye-palochki (крабовые палочки) — "crab sticks". Cheap, versatile, gets the job done.
## License
MIT
tools
Comments
Sign in to leave a comment