Write in your editor. Publish to Dev.to. Track what works.
Project description
The Dev.to CLI that uses 98% of the API. Competitors use 20%.
๐ Getting Started | ๐ Commands | โ๏ธ Configuration | ๐ค Contributing
devpub is a command-line tool for developers who write on Dev.to. Write articles in your favorite editor, version control them with Git, publish with one command, and track analytics, all from the terminal.
It uses 98% of the Dev.to API surface, including endpoints no other tool touches: semantic search, ML-powered content concepts, and full analytics.
๐ Why devpub?
Existing Dev.to tools are either abandoned, broken, or only cover basic publishing. devpub is different:
| Feature | devpub | devto-cli | slinkity | dev-to-git |
|---|---|---|---|---|
| Publish from CLI | โ | โ | โ | โ |
| Pull articles to local | โ | โ | โ | โ |
| Terminal analytics | โ | โ | โ | โ |
| Semantic search | โ | โ | โ | โ |
| Trend discovery | โ | โ | โ | โ |
| Article validation | โ | โ | โ | โ |
| Rate limiting | โ | โ | N/A | โ |
| Actively maintained | โ | โ (2y stale) | โ | โ (3y stale) |
๐ฆ Installation
From source (recommended during beta):
git clone https://github.com/simplynadaf/devpub.git
cd devpub
pip install -e .
With pip (once published to PyPI):
pip install devpub
Requirements: Python 3.10 or higher.
๐ Quick Start
# 1. Set your API key (get it at https://dev.to/settings/extensions)
export DEVPUB_API_KEY=your_key_here
# 2. Initialize a project
devpub init
# 3. Create your first article
devpub new "My Article Title"
# 4. Edit the article in your editor, then publish
devpub push -f articles/my-article-title.md
# 5. Check how it's performing
devpub stats
๐ Commands
โ๏ธ Writing
| Command | Description |
|---|---|
devpub init |
Initialize a devpub project (creates .devpub/ config and articles/ directory) |
devpub new "Title" |
Create a new article from a template |
devpub new "Title" -t tutorial |
Use a specific template (default, til, tutorial, comparison, experience) |
devpub validate |
Check articles for issues before publishing |
devpub validate -f path.md |
Validate a specific file |
๐ Publishing
| Command | Description |
|---|---|
devpub push -f article.md |
Publish or update a specific article |
devpub push --all |
Push all articles in your project |
devpub push --dry-run |
Preview what would be published |
devpub pull |
Download your published articles from Dev.to |
devpub pull --all |
Include drafts |
devpub status |
Show sync state (local vs Dev.to) |
๐ Analytics
| Command | Description |
|---|---|
devpub stats |
Lifetime totals (views, reactions, comments, followers) |
devpub stats --referrers |
Traffic sources |
devpub stats --followers |
Follower engagement |
devpub dashboard |
Complete analytics with top articles table |
๐ Discovery
| Command | Description |
|---|---|
devpub trends |
Trending topics on Dev.to right now |
devpub search "query" |
Keyword search for articles |
devpub search "query" --semantic |
AI-powered search by meaning (not just keywords) |
๐ง Utilities
| Command | Description |
|---|---|
devpub whoami |
Show your Dev.to profile |
devpub doctor |
Check API connectivity and config |
devpub --version |
Show version |
โ๏ธ Configuration
devpub looks for your API key in this order:
- Environment variable:
DEVPUB_API_KEYorDEVTO_API_KEY - Project-level:
.devpub/.env - Global:
~/.devpub/.env
๐ Get your API key at: https://dev.to/settings/extensions
๐ Project Structure
After devpub init, your project looks like:
my-blog/
.devpub/
.env # Your API key (gitignored)
config.yml # Project settings
articles/
my-post.md # Your articles with frontmatter
๐ Article Frontmatter
---
title: "Your Article Title"
published: false
description: "Brief description for SEO"
tags: python, tutorial, beginners
cover_image: https://example.com/image.png
series: "My Series Name"
canonical_url: https://myblog.com/original-post
---
Your article content in Markdown...
๐งช Project Status
devpub is in beta. Core functionality works and is tested against the live Dev.to API, but:
- โ ๏ธ The API surface is large and some edge cases may not be handled
- โ ๏ธ Error messages could be more specific in some situations
- โ ๏ธ Performance for accounts with 500+ articles could be improved
We follow semantic versioning. Until v1.0, minor versions may include breaking changes (documented in CHANGELOG.md).
๐ค Contributing
We welcome contributions of all kinds! See CONTRIBUTING.md for details.
Quick version:
git clone https://github.com/simplynadaf/devpub.git
cd devpub
pip install -e ".[dev]"
pytest
Ways to contribute
- ๐ Report bugs -- open an issue
- ๐ก Request features -- open an issue
- ๐ง Fix bugs -- check good first issues
- ๐ Improve docs -- README, docstrings, examples
- โ Add tests -- especially for edge cases
Before submitting a PR
- Fork the repo and create a branch
- Make your changes
- Run
pytestandruff check src/ tests/ - Open a PR with a clear description
๐ Security
If you discover a security vulnerability, please report it responsibly. See SECURITY.md for details. Do not open a public issue for security vulnerabilities.
๐ License
MIT -- use it however you want.
๐ Acknowledgments
- Built on the Forem API that powers Dev.to
- CLI powered by Click
- Terminal output by Rich
- HTTP by httpx
Made with โค๏ธ by Sarvar Nadaf
โญ If devpub saves you time, consider giving it a star!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devpub-0.1.0.tar.gz.
File metadata
- Download URL: devpub-0.1.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1246fa9326b9b47098abed73f5f70646ee20d7cf764eeb79834f03ba26ef5660
|
|
| MD5 |
272f67bebb0ecaac7d6bd91aa8e91edf
|
|
| BLAKE2b-256 |
6659a6895a298811a1029d07e3312f3320bf8f43da231a46e5ef5e095734ea04
|
File details
Details for the file devpub-0.1.0-py3-none-any.whl.
File metadata
- Download URL: devpub-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97197773e5f6df4c01dfacac342eb258da6c11b672ae990cf53b7989ca3897b4
|
|
| MD5 |
e663d68d6e7680879bb52b53e1ec2494
|
|
| BLAKE2b-256 |
441fcd7119d2f43de286cac747db4faf1f17603510e39a6ed6ba798110fbcf43
|