Dev.to CLI Image Upload via Terminal
说明与用途
DevPub CLI 现在支持直接从终端上传图片到 Dev.to,省去了手动复制 URL 的步骤。
问题
The Forem API lacks an image upload endpoint, forcing users to manually upload images through the web editor and copy URLs into markdown.
结果
The PR added a robust image upload module that handles authentication via session cookie and CSRF token, validates files before network calls, parses various response shapes, and outputs a user‑friendly table of URLs. It reduced image upload friction for DevPub users.
工作流
- Set up session credentials in .devpub/.env
- Run
devpub upload <file>to upload one or more images - Optionally use
--markdownto get markdown tags - Copy the returned URL(s) into the article
证据
devpub upload needs your browser session (not API key).
Three weeks after launching devpub, I got a notification I wasn't expecting: a pull request from someone I'd never talked to.
- 记录日期: 2026-09-15T19:00:22.587Z