Skip to content

Add CLI adapter, examples, tests, and docs#9

Open
liquid-releasing wants to merge 2 commits intoedger477:mainfrom
liquid-releasing:contrib/cli-and-docs
Open

Add CLI adapter, examples, tests, and docs#9
liquid-releasing wants to merge 2 commits intoedger477:mainfrom
liquid-releasing:contrib/cli-and-docs

Conversation

@liquid-releasing
Copy link

Summary

This PR adds a cli.py adapter layer and supporting resources that make the restim processor accessible from the command line and programmatically — without changing any existing processor code.

  • cli.py — stable public API + argparse CLI; wraps RestimProcessor, Funscript, and ConfigManager so callers never import upstream classes directly
  • examples/ — bash and Python examples for a default processing run, plus a minimal sample.funscript for testing
  • tests/ — full pytest test suite covering all public functions (TestLoadFile, TestProcess, TestListOutputs, TestPreviewElectrodePath, TestPreviewFrequencyBlend, TestPreviewPulseShape, TestPreviewOutput)
  • docs/CLI_REFERENCE.md — complete command reference with flags, examples, and output file table

CLI commands added

python cli.py info <file>                    # inspect a funscript
python cli.py process <file> [--config ...]  # run the full pipeline
python cli.py list-outputs <dir> <stem>      # find generated outputs
python cli.py algorithms                     # list available algorithms
python cli.py config show                    # dump default config as JSON
python cli.py config save <output.json>      # save config template
python cli.py preview electrode-path [...]   # electrode path data (--json)
python cli.py preview frequency-blend [...]  # blend data (--json)
python cli.py preview pulse-shape [...]      # pulse shape data (--json)

Design intent

cli.py is intentionally a thin adapter — it owns the stable function signatures while all processing logic stays in the existing files. The goal is to let downstream tools (scripts, UIs, CI pipelines) call load_file() / process() / preview_*() without coupling to internal class structures. When you update the processor internals, only cli.py needs updating.

No existing files changed

This PR only adds new files. No changes to processor.py, funscript.py, config_manager.py, or any other existing file.


Built on top of edger477's excellent restim processor. Standing on the shoulders of giants.

🤖 Generated with Claude Code

liquid-releasing and others added 2 commits March 14, 2026 08:47
Adds a stable cli.py adapter layer that wraps the restim processor
behind a clean public API (load_file, process, list_outputs, preview_*).
Includes bash/Python examples, a full pytest test suite, and CLI reference
documentation. The adapter isolates upstream internals so callers never
import processor or config classes directly.

- cli.py: public API + argparse CLI (info, process, list-outputs, algorithms,
  config show/save, preview electrode-path/frequency-blend/pulse-shape)
- examples/: process_default.sh, process_default.py, sample.funscript, README
- tests/: test_cli.py (8 test classes, pytest + unittest), conftest.py
- docs/CLI_REFERENCE.md: full command reference with --help text and examples

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Explains what each of the 10 output files controls in terms of sensation,
translates the three main creative decisions (algorithm, frequency blend,
pulse shape) into physical terms without requiring signal processing knowledge,
and shows toolchain automation patterns including batch processing and
--json piping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant