feat: add interactive configuration menu

Running without a GIF argument (or with -i/--interactive) now launches a
questionary-based menu that selects a source GIF from the current directory
and configures every conversion parameter before running. Passing a GIF on
the command line behaves exactly as before.

- extract a unified run_conversion(ConversionConfig) pipeline shared by the
  CLI and the menu, removing the duplicated convert loop in main()
- make the gif positional optional and add -i/--interactive
- import questionary lazily inside the menu so plain CLI usage gains no hard
  dependency, with a clear install hint when it is missing
- add __version__ / --version (0.2.0) and document the menu in README/AGENTS

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 14:47:26 +08:00
parent aee4270235
commit 8b785616d8
4 changed files with 247 additions and 33 deletions

View File

@@ -11,13 +11,25 @@ python3 -m venv .venv
. .venv/bin/activate
```
然后安装 GIF 读取依赖:
然后安装依赖Pillow 用于读取 GIFquestionary 用于交互式菜单)
```bash
python3 -m pip install -r requirements.txt
```
然后传入 GIF 文件:
## 交互式菜单
不带任何参数运行,会进入交互式菜单:可以从当前目录选择源 GIF、逐项配置参数最后确认并执行转换
```bash
python3 EmbeddedAnimPacker.py
```
也可以用 `-i` / `--interactive` 显式进入菜单。菜单仅在进入时才需要 `questionary`;纯命令行用法不依赖它。
## 命令行
直接传入 GIF 文件即可(行为与以前一致):
```bash
python3 EmbeddedAnimPacker.py boot.gif