# @hagnerd/devto

> devto CLI

Latest version **0.1.1** (published 2019-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hagnerd/devto
pnpm add @hagnerd/devto
yarn add @hagnerd/devto
bun add @hagnerd/devto
```

Provides the command `devto`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-06-13 |
| First published | 2019-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 52.2 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | hagnerd |

## Links

- npm: https://www.npmjs.com/package/@hagnerd/devto
- Homepage: https://github.com/hagnerd/devto#readme
- npm.io page: https://npm.io/package/@hagnerd/devto

## Dependencies (6)

- [open](https://npm.io/package/open.md) ^6.3.0
- [axios](https://npm.io/package/axios.md) ^0.19.0
- [gluegun](https://npm.io/package/gluegun.md) ^2.1.0
- [ts-node](https://npm.io/package/ts-node.md) ^7.0.1
- [typescript](https://npm.io/package/typescript.md) 3.2.2
- [front-matter](https://npm.io/package/front-matter.md) ^3.0.2

## Recent versions

- 0.1.1 (latest) — 2019-06-13
- 0.0.4 (beta) — 2019-06-13
- 0.1.0 — 2019-06-13
- 0.0.3 — 2019-06-13
- 0.0.2 — 2019-06-13
- 0.0.1 — 2019-06-13

## README

# devto CLI

A simple CLI for posting to dev.to. This tool was inspired by [Dev.to VSCode Extension](https://github.com/timdeschryver/new-blog-post) made by Tim Deschryver.

## Who is it for?

Do you like to write articles? Are you a programmer? Do you want to make it dead simple to write and post to dev.to?

Then either the VSCode Extension, or this CLI will help you out!

## How to use this

You can:
1. Globally install the tool `npm install --global @hagnerd/devto` or `yarn
   global add @hagnerd/devto` and then use it in the command line with `devto
   <commang>`.
2. Use it with npx `npx @hagnerd/devto <command>` which avoids having to install
   it globally.

## Commands

### devto new [TITLE]

Generates a new blog post, which consists of a folder, a markdown file, and a .devto.json file which will be gitignored by default. This will contain the post id, url, and the path to the file to make publishing more ergonomic.

If you pass a title, make sure to wrap it in strings. If you do not pass a title, you will be prompted for one, in which case you do not need to wrap it in strings.

I know, not great, but this is a quick prototype and unfortunately this was the easiest way to get it to work.

### devto publish

If you are in a directory that has a .devto.json file with a valid path to a markdown file with at least a title field in the frontmatter, then it will attempt to push the article up to dev.to

It will prompt you for a dev.to API key the first time you publish and article, and after that it will save a global config with the key to a .devto file in your home directory. Make sure to globally ignore it in git if you are concerned with your API key getting out.

If you are NOT in a directory that has a .devto.json file or there isn't a valid path, you will be prompted to provide a relative path to a file that meets those requirements.

### devto dashboard

This command opens up dev.to/dashboard in your default browser.

### devto reset

Deletes your global config file (located at .devto in your home directory). The next time you attempt to publish an article, it will re-prompt you for your API key.

# License

MIT - see LICENSE

---
_Source: https://npm.io/package/@hagnerd/devto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
