Dev.to CLI Image Upload via Terminal
Описание и применение
CLI DevPub теперь позволяет загружать изображения в 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