Command-line Publishing Workflow

Hey everyone, I’m looking for feedback from people who use the command-line interface to publish to Write.as.

  • What’s your publishing workflow with the CLI look like right now?
  • What would you like it to look like?

I ask because we have some changes in development right now that are focused on making your local workflow go more smoothly. If you’d like to try them out, you can follow the instructions below to do so. These changes let you:

  • log in
  • download / sync posts to your machine
  • publish to your blogs
  • easily publish individual files

If you’d like to try it out and give your feedback, you can get the latest changes by installing Go and then doing:

go get github.com/writeas/writeas-cli/cmd/writeas
cd $GOPATH/src/github.com/writeas/writeas-cli/cmd/writeas
git checkout local-workflow
go get -d
go install

Now you can run:

writeas auth <username>

Enter your password, and if that works, run this to download your posts:

writeas fetch

This will prompt you for a folder where you want your Write.as posts
stored as text files locally. Right now this is only for storing posts you’ve published – not keeping track of drafts or unpublished posts. So it should be a new folder without anything else in it.

To publish a post from a local file, you’ll run:

writeas publish <filename>

Or, to publish to a blog:

writeas publish -c <blog_name> <filename>

Note that you can’t update or delete blog posts right now. Updating or deleting still needs to be done with the post’s ID.

So I’d like to know what you think:

  • Does this fit with your publishing workflow? If not, why?
  • Did something happen along the way that you didn’t expect?
  • What’s missing that you still really need to be able to do (e.g. updating, deleting, pinning posts)?

Is it possible to use writeas-cli with an account on another instance than write.as ?

Did a little hacking on this and made a few changes to allow hosts basing off of these changes.
Seems that the post endpoint doesn’t like the authentication. Still looking at that.
Taking me a bit to get my head wrapped around everything.

Although after messing around with all of that… I realize a better way might be to add host when doing auth. Then maybe preserving host in the configuration? :thinking: