writeas-cli icon indicating copy to clipboard operation
writeas-cli copied to clipboard

Using CLI with blog

Open thomasjsn opened this issue 6 years ago • 5 comments

I can't seem to get the CLI to play nice with collections/blogs. It posts as anonymous even when using the b argument.

$ writeas -b thomasjsn publish dev/uctrl-dev/content/about/index.md 
https://write.as/g7x6govygs3zf00l

$ writeas -b thomasjsn post 
test2
https://write.as/kfpxp2ic682y9m7f

Am I missing something?

Also — can I fetch a single or all posts from collections/blogs?

  • https://developers.write.as/docs/api/#retrieve-a-collection-post
  • https://developers.write.as/docs/api/#retrieve-collection-posts

I was hoping to use write.as with my workflow of using a local markdown editor and updating the blog using the CLI. Seems that might not be possible at this stage, without using the API directly of course.

thomasjsn avatar Aug 06 '19 10:08 thomasjsn

Can you try supplying the -b flag after the command (publish / post)? I.e.

writeas publish -b thomasjsn dev/uctrl-dev/content/about/index.md 

Unfortunately the argument parsing is a little picky -- something we should probably fix, either way.

thebaer avatar Aug 06 '19 12:08 thebaer

Hi @thomasjsn, did changing the placement of the flag fix this issue for you? It's only a work around but just want to check if there is not some other issue.

Also re: fetching, this is something that is planned. You should be able to get and update a post already. But listing all remote posts is not yet implemented, per blog or otherwise.

Have you seen the plans for a file based local workflow? T584? It might be of interest to you.

ghost avatar Sep 12 '19 15:09 ghost

Hey @robjloranger, I didn't do anymore testing unfortunately. As I did not end up using write.as as my platform.

thomasjsn avatar Sep 13 '19 06:09 thomasjsn

Publishing with the -b flag after publish works. But there is no way of listing posts that belong to a post? I'd like to have a directory of markdown files mirroring all posts I have published on a write.as blog.

bluebirch avatar Sep 22 '19 07:09 bluebirch

@bluebirch, that is correct. There is currently no way list published posts. Only drafts.

I think the file based workflow that was started would be of interest. https://phabricator.write.as/T584

ghost avatar Sep 22 '19 15:09 ghost