Files
mytoolkit/README.md
T

97 lines
3.2 KiB
Markdown

# mytoolkit
Personal CLI toolkit — unified entry point for everyday file conversion, format wrangling, and project chores.
## Install
```bash
make install # builds + symlinks ~/.local/bin/mytoolkit
mytoolkit --version
mytoolkit templates register ~/workspace/templates # one-time, points at template root
```
## Update
The installed Python package is **not** refreshed automatically when the source tree changes. After editing source files, or after `git pull` / `git submodule update`, rerun:
```bash
make install # or: mytoolkit update
mytoolkit --version # verify the new version is active
```
## Top-level commands
```bash
mytoolkit --help
```
| Command | What it does |
|---------|--------------|
| `convert` | Universal format conversion (md/img/pdf/eps/avi/bib → pdf/docx/tiff/mp4/md). Auto-detects from extensions. |
| `pdf` | `compress` / `crop` / `merge` / `bookmark` / `to-tiff` |
| `image` | `compress` / `eps-fix` / `eps-to-pdf` / `jpg-to-pdf` / `tiff-to-pdf` / `tiff-compress` / `generate` (Doubao/Seedream) |
| `latex` | `compile` / `count` |
| `bib` | `to-markdown` / `cv-update` |
| `video` | `avi-to-mp4` |
| `webpage` | Docusaurus build/list/rebuild/push |
| `mail` | IMAP/SMTP client (read/draft/forward/reply, no auto-send) |
| `templates` | Register and inspect external template root |
| `env` | Manage stored vars (api keys, paths, feishu app credentials) |
| `ssh` | `list` / `connect` / `tunnel` / `cmd` |
| `git` | `proxy` (set/unset/list/status) |
| `server` | Manage dev/serve servers |
| `update` | Reinstall from local repo |
| `uninstall` | Uninstall |
For any subcommand: `mytoolkit <cmd> --help`.
## Templates
`mytoolkit convert -t <name>` reads templates from an external directory you register (templates are not bundled). Layout:
```
<root>/md-to-pdf/<name>/template.typ
<root>/md-to-docx/<name>/template.docx
```
```bash
mytoolkit templates register /path/to/templates
mytoolkit templates list # lists each template with its absolute path
```
Registry is stored at `~/.mytoolkit/templates.json` (or `$MYTOOLKIT_HOME/templates.json`).
## User config
All user-level config lives under `~/.mytoolkit/` (override with `$MYTOOLKIT_HOME`):
| File | Owner | Purpose |
|------|-------|---------|
| `env.json` | `mytoolkit env` | API keys, paths, feishu credentials (flat key/value) |
| `mail.json` | `mytoolkit mail` | IMAP/SMTP server settings |
| `templates.json` | `mytoolkit templates` | Pointer to external template root |
Manage env vars via the CLI — no need to hand-edit:
```bash
mytoolkit env list # show all (Storage path printed at top, secrets masked)
mytoolkit env get apikey_ark # read one
mytoolkit env set apikey_ark <value> # write one
mytoolkit env set apikey_ark --secret # prompt for value, hidden input
mytoolkit env remove apikey_ark # delete one
mytoolkit env export # print MYCLI_FOO=... export statements
eval "$(mytoolkit env export)" # load into current shell
```
Legacy `bin/config.json` (in the source dir) is auto-migrated to `~/.mytoolkit/env.json` on first run after upgrade.
## Uninstall
```bash
mytoolkit uninstall
# or
make uninstall
```
User config under `~/.mytoolkit/` is left in place.