My Dev.to CLI Got Its First Community PR. Image Uploads From Terminal.
说明与用途
devpub 现在允许用户直接从终端上传图片到 Dev.to,省去了使用网页编辑器的步骤。
问题
The Forem API V1 has no image upload endpoint, so devpub could not provide a terminal command to upload images for Dev.to articles.
结果
The PR by Harish added a robust image upload module, comprehensive tests, and user guidance for session credentials, enabling devpub users to upload images from the terminal and simplifying their workflow.
工作流
- 1. Install devpub v0.3 via pip
- 2. Add
DEVPUB_SESSION_COOKIEandDEVPUB_CSRF_TOKENto.devpub/.env - 3. Run
devpub upload <image>to upload a single image - 4. Run
devpub upload *.png --markdownto get Markdown tags for multiple images - 5. (Optional) Use
--dry-runto validate files before uploading
证据
The Forem API V1 has no image upload endpoint, so devpub could not provide a terminal command to upload images for Dev.to articles.
devpub upload needs your browser session (not API key).
devpub upload cover.png now gives you this: ... Uploaded Images table
- 记录日期: 2026-10-01T12:55:49.978Z