Commit Graph
68 Commits
Author SHA1 Message Date
Zhengshou Lai 55c08cf937 refactor(config): migrate .claude/CLAUDE.md to .agents/AGENTS.md with compatibility symlinks 2026-07-07 23:34:12 +08:00
Zhengshou Lai 958a9f2f01 chore: 移除 resolve_key() 等 skill 端函数,更新 CLAUDE.md 配置描述 2026-07-06 21:18:04 +08:00
Zhengshou Lai 321dc57e30 refactor(config): 统一配置存储为 ~/.mytoolkit/config.json (keys.*)
- Config 类改用 config.json + keys.* 格式,废弃 env.json (自动迁移)
- 新增 resolve_key() / write_key_to_mytoolkit() 共享工具函数
- env CLI 文本更新 (vars → keys)
- 更新 CLAUDE.md / README.md 配置描述
2026-07-06 21:11:23 +08:00
Zhengshou Lai 1ee5a31ccf feat(completion): 自动安装 shell 补全,迁移旧配置并清理手动补全 2026-07-04 19:24:58 +08:00
Zhengshou Lai 9b7439fdc6 docs(mytoolkit): 更新 skill 分工表中的 mywebpage → mywebpages 2026-07-02 12:07:27 +08:00
Zhengshou Lai b755e0b2ce fix(scaffold/paper): black hyperlinks, add mathtools, and unify bold vector style 2026-06-29 08:40:06 +08:00
Zhengshou Lai 9b41b263f2 chore: rename claude.md to CLAUDE.md (case convention) 2026-06-29 00:49:06 +08:00
Zhengshou Lai f45b46073a feat(scaffold): redesign paper scaffold + clarify doc responsibilities
Scaffold (mytoolkit init paper):
- default to portable Elsevier elsarticle [review,3p,11pt] (was ctexart/Fandol)
- TeX Live Libertinus fonts (serif+math+mono), no system-font dependency
- xelatex one-engine via latexmk; figure/abstract/keyword frontmatter
- PDF bookmarks expand to two levels (bookmarksopenlevel=2)
- fix diffpreamble.dtx: define \DIFadd/\DIFdel (latexdiff highlighted now compiles)

Docs responsibility split:
- CLAUDE.md owns design decisions/constraints; exact scaffold specs live only
  in the generated main.tex header (self-documenting, no drift)
- README/SKILL point to those; README command table gains `voice`
- reconcile source-of-truth wording across CLAUDE.md / README / SKILL
2026-06-29 00:47:48 +08:00
Zhengshou Lai 587eac8837 feat: add journal submission kits + paper scaffold; restructure package
- init journal <elsevier|ieee|springer>: self-contained, make-buildable kits
  (Springer sn-jnl.cls + bst bundled; reuses project references.bib)
- init paper scaffold: ctexart + Fandol fonts, bib at root, latexdiff highlighted
- move templates/ under mytoolkit/, add info/references, relocate protocols
- migrate mytoolkit skill into submodule; update README/CLAUDE docs
2026-06-28 23:38:47 +08:00
Zhengshou Lai 75bb7dec32 feat(convert): template-driven docx postprocess + pdf table left align
- Move docx post-processing from convert.py to template-specific postprocess.py hooks
- Resolve relative markdown image paths before pandoc for docx and pdf
- Auto-generate centered figure captions (图 1, 图 2...) in docx
- Center tables and apply three-line table borders in docx
- Left-align tables in PDF via template.typ show rule
2026-06-28 11:27:14 +08:00
Zhengshou Lai 3ea86867e3 chore(server): remove cloudcli service entry 2026-06-28 00:17:45 +08:00
Zhengshou Lai c8081889b9 feat(server): add cloudcli service and per-service prebuild flag
Add a CloudCLI (claude-code-ui) service on port 3020, and a prebuild
flag so services backed by a global npm binary skip the Docusaurus-style
`npm run build` step before serve.
2026-06-27 21:44:11 +08:00
Zhengshou Lai fe4c280f7c refactor: rename bin/ package to mytoolkit/ 2026-06-26 22:57:55 +08:00
Zhengshou Lai ffaf7e58f2 fix(mail): improve attachment filename and reply body handling
- Use RFC 2047 encoded-word for non-ASCII attachment filenames instead of
  RFC 2231 filename* segments, which Coremail Web fails to display.
- Build multipart messages with MIMEMultipart when attachments are present
  to keep address headers and attachment filenames Coremail-compatible.
- Add --attach support to reply and forward commands.
- Quote the original message body in reply drafts for proper threading.
2026-06-23 10:24:23 +08:00
Zhengshou Lai 9d802aa54b chore(server): remove deprecated myslides service 2026-06-23 10:24:23 +08:00
Zhengshou Lai 37a3487fa9 docs(README): fix templates register path to contrib/mytoolkit 2026-06-09 14:57:49 +08:00
Zhengshou Lai 28d42eb74b docs(README): clarify update applies to source edits too 2026-06-09 14:52:05 +08:00
Zhengshou Lai 1c19654faa docs(README): add Update section warning about reinstall after git pull
Clarify that `git pull` / `git submodule update` only update the source
tree; `make install` or `mytoolkit update` must be rerun for changes to
take effect in the installed CLI.
2026-06-09 14:50:25 +08:00
Zhengshou Lai 0b8dc30154 chore: ignore tmp/ 2026-06-09 14:38:39 +08:00
Zhengshou Lai 322cd31bb2 style(template): enforce no first-line indent for table styles; default PDF indent 2em
- Set first-line-indent: 0 on all TABLE styles in default/review docx templates
  to prevent table cells from inheriting Normal paragraph indentation.
- Set default PDF template body first-line-indent to 2em (all: true).
- Change default PDF bookmark depth from 1 to 2 in CLI and build_pdf.
- Extend docx post-processing to copy Normal style typography from reference-doc,
  format headings/references, and handle BodyText paragraphs.
2026-06-09 14:38:35 +08:00
Zhengshou Lai fc4dab1629 feat(convert): apply reference-doc typography in docx post-processing
Extend _fix_docx_postprocess to copy Normal style paragraph properties
from the reference doc, convert BodyText to Normal, add heading spacing
before/after, and format reference entries with hanging-style spacing.
2026-06-09 14:38:30 +08:00
Zhengshou Lai 5d0ed21e07 feat(pdf): add pdf extract command with pdftotext/pypdf fallback
Add `mytoolkit pdf extract` to extract text from PDFs. Tries pdftotext
(poppler) first for layout quality, falls back to pypdf.
2026-06-09 14:38:24 +08:00
Zhengshou Lai 3f7c625781 refactor(self-mgmt): centralize manual file list for install/uninstall 2026-06-04 01:05:46 +08:00
Zhengshou Lai da52571a9c refactor(self-mgmt): adapt update/uninstall to system-python editable install 2026-06-04 00:59:55 +08:00
Zhengshou Lai 2d2ff45fca refactor: migrate all config paths to ~/.mytoolkit with MYTOOLKIT_HOME support 2026-06-04 00:52:25 +08:00
Zhengshou Lai 3a47e6963d refactor(config): remove legacy ~/.config/mytoolkit compatibility 2026-06-04 00:48:25 +08:00
Zhengshou Lai 953ea9231d feat(config): support MYTOOLKIT_HOME env var and migrate to ~/.mytoolkit 2026-06-04 00:33:44 +08:00
Zhengshou Lai 58a141416c fix(api): avoid circular import by deferring protocols import 2026-06-03 23:45:12 +08:00
Zhengshou Lai 334ff647fc feat(api): extract pure API clients for image generation and TTS
- Add bin/api/ package with generate_image() and synthesize_tts()
- Refactor bin/commands/image.py to call bin.api.image.generate_image
- Refactor bin/commands/voice.py to call bin.api.voice.synthesize_tts
- API layer is free of Click CLI dependencies, usable by external scripts
2026-06-03 23:43:28 +08:00
Zhengshou Lai ac605c2c17 feat(mytoolkit): add voice command and improve docx post-processing
- Add voice/TTS CLI command via Volcengine WebSocket API
- Inject suppressAutoHyphens into all docx paragraphs in post-process
- Apply post-process fixes to all templates (not just default)
- Update review template: Cambria+SimSun fonts, 11pt for headings
- Sync default/review docx template formatting
2026-05-27 16:17:47 +08:00
Zhengshou Lai 7600b558cd style(template): fix Heading3-5 font sizes and update demo
- Heading3: 12pt, Heading4-5: 11pt
- Update demo.md with comprehensive elements (title, headings, tables, lists, quotes, math)
- Regenerate demo.docx with auto post-processing
- Add python-docx dependency (used for template creation)
2026-05-19 23:08:37 +08:00
Zhengshou Lai 32834613dd feat(convert): auto post-process default docx template
Replace _fix_docx_hr_indent with _fix_docx_postprocess that runs
automatically after pandoc when template=default. Fixes include:

- Three-line table borders (1.5pt top/bottom, 0.75pt header)
- Remove tblStyle to prevent Word from overriding borders
- Remove first-line indent inside table cells
- Add 6pt spacing before paragraphs following tables
- Apply HorizontalRule style to '---' paragraphs (no indent)
- Remove indent from empty paragraphs
- Inject HorizontalRule style into styles.xml
2026-05-19 23:04:51 +08:00
Zhengshou Lai 149dcac97e style(template): add explicit no-indent to Title and Heading styles 2026-05-19 22:59:29 +08:00
Zhengshou Lai c40dc74b73 style(template): set Heading1-5 spacing before to 6pt 2026-05-19 22:55:47 +08:00
Zhengshou Lai 00aab61144 style(template): set Normal paragraph spacing before to 6pt 2026-05-19 22:52:59 +08:00
Zhengshou Lai 52c96c50fe style(template): set Title/Heading1-5 fonts to Cambria+SimSun, no indent 2026-05-19 22:50:07 +08:00
Zhengshou Lai 516bff335d style(template): set all margins to 2.54cm 2026-05-19 22:36:04 +08:00
Zhengshou Lai e6742d4e9e style(template): rewrite default docx template from scratch
- Create clean template with python-docx + lxml
- Normal: Cambria+SimSun, 12pt, firstLine=480, justify
- Title: centered
- Heading 1-5: left-aligned
- docDefaults: sz=24, kinsoku=1
2026-05-19 22:28:09 +08:00
Zhengshou Lai f9066d5bd8 style(template): change font size to 12pt and fix namespace prefix
- Normal style: sz 22→24 (11pt→12pt)
- docDefaults: sz/szCs 22→24
- Fix namespace prefix consistency (ns0→w) in styles.xml
2026-05-19 22:05:23 +08:00
Zhengshou Lai c18d6d7d1e fix(convert): auto-load default template for md-to-docx
Remove the hard-coded `template != \"default\"` guard so that
the default reference docx template is loaded automatically
when no --reference-doc is explicitly provided.
2026-05-19 21:52:20 +08:00
Zhengshou Lai 4fd4477a27 style(template): update default docx with kinsoku, three-line tables and spacing
- Enable kinsoku for Chinese punctuation wrap control
- Set first-line indent to 2 characters (304800 EMU)
- Configure three-line table borders (1.5pt top/bottom, 0.75pt header)
- Add 6pt spacing after tables
- Use Cambria + SimSun font pairing
2026-05-19 21:52:20 +08:00
Zhengshou Lai 11c0950d50 chore(webpage): remove deploy command 2026-05-08 22:52:33 +08:00
Zhengshou Lai 0317189623 refactor(templates): rename show to list for CLI consistency
Other subcommand groups (server, env, ssh, webpage, git proxy) use
`list` for enumeration; align templates with the same convention.
2026-05-08 20:56:14 +08:00
Zhengshou Lai 11f5635c94 feat(template): themed blockquotes, references, chapter-based numbering for textbook
- Add themed blockquote styles (课堂小实验, 关键洞察, etc.) via quote block
- Add #references() wrapper for bibliography formatting
- Implement chapter-based figure/table numbering (1-1, 2-1, ...)
- Start each chapter on a new page (except first)
- Increase list spacing to match long-form reading rhythm
- Fix first-line indent to apply on all paragraphs
2026-05-08 13:53:31 +08:00
Zhengshou Lai 9eafd7577f style(templates): increase list spacing for readability
Raise list/enum spacing to be ≥ leading line height across default
and manual templates, improving visual separation between items.
2026-05-08 13:53:24 +08:00
Zhengshou Lai 4cb1419720 feat(mail): add download command, stable UID fetch, MIME decode
- Add `mail download` to save attachments by IMAP UID
- Switch inbox/read/reply/forward to real IMAP UID (stable across sessions)
- Add MIME header decoding for non-ASCII filenames
- Add safe_filename() to prevent path traversal
- Use readonly mode for inbox/list/read to avoid marking unseen
2026-05-08 13:53:17 +08:00
Zhengshou Lai 4a05143bf3 fix(env): remove value masking in env list
Local-only tool; no need to hide API keys/secrets in list output.
2026-05-08 13:53:10 +08:00
Zhengshou Lai 02097a8527 feat(git): add proxy run command with auto-unset on exit
Add `git proxy run <name>` that sets proxy, runs the associated
command, and auto-restores/unsets proxy on exit or Ctrl-C.
Also fix click.Exit usage for Click 8.x compatibility.
2026-05-06 08:16:56 +08:00
Zhengshou Lai 2791a785ff feat: add document conversion templates
Add md-to-pdf and md-to-docx templates for mytoolkit convert command.
Migrated from workspace/templates.
2026-05-06 00:11:37 +08:00
Zhengshou Lai dea83774a5 feat(image): support arbitrary size and aspect ratio shortcuts for doubao generate
- --size now accepts free-form values (2K, 3K, 4K, 2304x1728, etc.)
  instead of a fixed [1K, 2K] choice.
- Add --ratio shortcut (1:1, 4:3, 3:4, 16:9, 9:16) mapping to pixel sizes.
- When both --size and --ratio are given, --size takes priority.
- Default remains 2K when neither is specified.
2026-05-05 23:43:58 +08:00
Zhengshou Lai e8ee5a4d0a feat(webpage): add server subcommand delegating to mytoolkit server
`mytoolkit webpage <project> server <action>` mirrors
`mytoolkit server <action> <project>`, so each Docusaurus project can
manage its own dev/serve lifecycle from the webpage namespace.
2026-05-05 23:31:38 +08:00
Zhengshou Lai 151b10000d refactor(webpage): swap project/action order to webpage <project> <action>
Each managed project becomes its own click subgroup, so commands now
read as `mytoolkit webpage mywebpage build` instead of
`mytoolkit webpage build mywebpage`. List remains project-agnostic.
2026-05-05 13:03:19 +08:00
Zhengshou Lai 92f8536604 feat(webpage): add push subcommand with -f flag
新增 `mytoolkit webpage push <name>` 用于推送项目源码仓库,
支持 `-f/--force` 选项(内部使用 --force-with-lease)。
2026-05-05 12:40:10 +08:00
Zhengshou Lai 55af210db7 feat(mycv): add mycv build/open commands with --lang-en option
- build: generate CV PDF from cv-zh.md / cv-en.md via Typst cv template
- open: open generated PDF with default application
- --lang-en flag switches between Chinese and English CV
2026-05-05 09:30:31 +08:00
Zhengshou Lai f2722176eb feat(webpage): add deploy, pdf subcommands and build --serve option
Migrate mywebpage/bin/mywebpage CLI features into mytoolkit:
- deploy: auto-infer GIT_USER from gh CLI or git origin
- pdf build/open: delegate to project's scripts/export-docs-pdf.py
- build --serve: serve built site after successful build
2026-05-05 09:15:19 +08:00
Zhengshou Lai c75cba9fee remove outdated commands: preflight, utils, self legacy group
preflight referenced non-existent work-order.md (replaced by agent-tasks.md).
utils only contained albany-cleanup (Albany supercomputer no longer used).
self was a legacy backward-compat group — update/uninstall are already top-level.
2026-05-05 00:19:25 +08:00
Zhengshou Lai 3e4cf618a8 refactor: restructure mytoolkit with new subcommands and md-to-pdf improvements
- Add new subcommands: convert, preflight, server, templates, webpage
- Migrate config from bin/config.json to ~/.config/mytoolkit
- Fix expand_bookmarks to modify writer objects instead of reader
- Improve md_to_pdf with CJK bookmark support
- Update README and project metadata
2026-05-04 17:19:32 +08:00
Zhengshou Lai 38328c28d0 fix(md_to_pdf): fix TOC links and bookmarks for CJK content
Three fixes:

1. Use pandoc -f markdown-citations to avoid @label citation parsing
   errors in Typst output.

2. Remove Pandoc auto-generated heading labels (<...>) from typst body.
   Without this, Typst creates named-destination links for outline
   entries. Named destinations with non-ASCII characters break in
   macOS Preview and other PDF readers.

3. Fix expand_bookmarks() to clone the full document (preserving all
   /Dest attributes) instead of rebuilding outline from scratch, which
   destroyed the bookmark hierarchy.

4. Add --root / to typst compile for consistent absolute path resolution.
2026-05-04 13:07:29 +08:00
Zhengshou Lai 7547053247 remove old config compat, use ~/.config/mytoolkit only 2026-04-26 10:50:40 +08:00
Zhengshou Lai 706286a303 migrate mail config from ~/.myclaude to ~/.config/mytoolkit 2026-04-26 10:48:35 +08:00
Zhengshou Lai 04cbd9786e add mail command (IMAP/SMTP client, no send, draft-only) 2026-04-26 10:47:38 +08:00
Zhengshou Lai c1df4098b3 refactor: rename package from mytoolkit to bin
- Move all source files from mytoolkit/ to bin/
- Update entry point and build config in pyproject.toml
- Add pillow and pypdf dependencies
- Update README and .gitignore paths
- Remove unused subprocess import in pdf.py
- Clean up duplicate imports in pdf merge command
2026-04-26 09:56:29 +08:00
Zhengshou Lai 3aeaf7cb64 init 2026-04-14 18:39:09 +08:00
Zhengshou Lai 00c608a3bd feat: add interactive config wizard
- Add mycli wizard command for guided configuration
- Interactive menus for paths, SSH, API keys, Feishu apps, git proxies
- User-friendly prompts with numbered choices
- Support add/edit/delete operations via wizard
- Hide sensitive input (API keys, secrets)
- Confirm before destructive operations
2026-04-13 11:53:27 +08:00
Zhengshou Lai 469aefb71f chore: remove config.json from git (contains secrets) 2026-04-13 11:42:01 +08:00
Zhengshou Lai bd167cfb6d feat: add API keys management and config CRUD operations
- Add api_keys and feishu_apps to config.json
- Add env export/init commands for shell integration
- Add config CRUD: list, set, delete, init
- Add config.json.example template
- Add config.json to .gitignore for security
- Update README with new commands

Usage:
  mycli env export              # Export all env vars
  mycli config set key value    # Set config value
  mycli config delete key       # Delete config key
2026-04-13 11:41:57 +08:00
Zhengshou Lai 5a55b4a60d Add .gitignore 2026-04-13 11:38:08 +08:00
Zhengshou Lai ab8067f0c5 Initial commit: mycli toolkit with all commands 2026-04-13 11:38:01 +08:00