Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Dev.to CLI Image Upload via Terminal

说明与用途

DevPub 的 devpub upload 命令让用户可以直接从终端上传图片到 Dev.to,取代了手动使用网页编辑器的流程。

问题

The Forem API lacks an image upload endpoint, forcing Dev.to users to manually upload images through the web editor and copy URLs into markdown.

结果

The PR added a robust, well‑tested image uploader that handles authentication via session cookie and CSRF token, validates files before network calls, and parses varied response shapes. Users can now upload images from the terminal in a single command.

工作流

  • 1. Install devpub v0.3
  • 2. Export session cookie and CSRF token to .devpub/.env
  • 3. Run devpub upload cover.png to upload a single image
  • 4. Run devpub upload *.png --markdown to get markdown tags
  • 5. Optionally use --dry-run to validate paths

证据

devpub upload cover.png

来源

Uploaded: cover.png

Uploaded Images
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

来源

  • 记录日期: 2026-09-07T18:22:42.567Z