dev-to-git
dev-to-git copied to clipboard
One-command article creation
Thinking about how to extend dev-to-git so that it can automatically create an article without the manual step of going to dev.to
proposed command
dev-to-git create-article "My amazing new blog post"
I've raised #7 to better help with the creation of more complicated CLI commands
basically the way I see this working is
- command creates a new markdown file without saving it to disk
- Frontmatter is initialized with the title and empty values for all other fields
- dev.to POST api is invoked creating this new article
- response is analysed and the article ID is inserted into the frontmatter of the in-memory markdown article
- On success of all above steps, the article is written to disk
- If there is a .dev-to-git.json config file present (I'm planning on making this optional), the newly created article is appended.
By inserting the id into the frontmatter, this gives us the ability to update the article by simply reading the markdown file to be published.
sounds like a good idea 👍