diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c862e8e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,57 @@ +Change log +========== + +## [0.4](https://github.com/writeas/writeas-cli/compare/v0.3...v0.4) - 2015-12-10 + +### Added + +* `--font [value]` option for creating and updating posts + +### Changed + +* Use SSL for all requests + +### Fixed + +* `--code` flag not working on `writeas --code` command + +## [0.3](https://github.com/writeas/writeas-cli/compare/v0.2...v0.3) - 2015-09-08 + +### Added + +* Compose new posts in default text editor with `writeas new` +* Automatically copy URL to clipboard when publishing a new post +* Status messages when updating, deleting, or fetching posts + +### Changed + +* More helpful help on `writeas add` command +* More error messages when something goes wrong + +### Fixed + +* Error on `writeas list` when there are no saved posts +* User-Agent header missing on most requests to backend + +## [0.2](https://github.com/writeas/writeas-cli/compare/v0.1.1...v0.2) - 2015-05-11 + +### Added + +* Update posts with `writeas update` +* Add posts locally with `writeas add` + +### Changed + +* Post font is now _monospace_ + +## [0.1.1](https://github.com/writeas/writeas-cli/compare/v0.1...v0.1.1) - 2015-04-12 + +### Fixed + +* Post fetching + +## 0.1 - 2015-04-11 + +### Added + +* Initial release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8c14a19 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# How to contribute + +We're happy you're considering contributing to the Write.as command-line client! + +It won't take long to get up to speed on this. Here are our development resources: + +* We do our project management in [Phabricator](https://phabricator.write.as/tag/write.as_cli/). +* We accept and respond to bugs here on [GitHub](https://github.com/writeas/writeas-cli/issues). +* We're usually in #writeas on freenode, but if not, find us on our [Slack channel](http://slack.write.as). + +## Testing + +We try to write tests for all parts of the CLI, but aren't there yet. While not required, including tests with your new code will bring us closer to where we want to be and speed up our review. + +## Submitting changes + +Please send a [pull request](https://github.com/writeas/writeas-cli/compare) with a clear list of what you've done. + +Please follow our coding conventions below and make sure all of your commits are atomic. Larger changes should have commits with more detailed information on what changed, any impact on existing code, rationales, etc. + +## Coding conventions + +We strive for consistency above all. Reading the small codebase should give you a good idea of the conventions we follow. + +* We use `go fmt` before committing anything +* We aim to document all exported entities +* Go files are broken up into logical functional components +* General functions are extracted into modules when possible + +## Design conventions + +We maintain a few high-level design principles in all decisions we make. Keep these in mind while devising new functionality: + +* Updates should be backwards compatible or provide a seamless migration path from *any* previous version +* Each subcommand should perform one action and do it well +* Each subcommand will ideally work well in a script +* Avoid clever functionality and assume each function will be used in ways we didn't imagine diff --git a/README.md b/README.md index 538c513..765b2a8 100644 --- a/README.md +++ b/README.md @@ -1,84 +1,123 @@ writeas-cli =========== ![MIT license](https://img.shields.io/github/license/writeas/writeas-cli.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/writeas/writeas-cli)](https://goreportcard.com/report/github.com/writeas/writeas-cli) [![#writeas on freenode](https://img.shields.io/badge/freenode-%23writeas-blue.svg)](http://webchat.freenode.net/?channels=writeas) [![Public Slack discussion](http://slack.write.as/badge.svg)](http://slack.write.as/) Command line interface for [Write.as](https://write.as) and [Write.as on Tor](http://writeas7pm7rcdqg.onion/). Works on Windows, OS X, and Linux. Like the [Android app](https://play.google.com/store/apps/details?id=com.abunchtell.writeas), the command line client keeps track of the posts you make, so future editing / deleting is easier than [doing it with cURL](http://cmd.write.as/). The goal is for this to serve as the backend for any future GUI app we build for the desktop. It is currently **alpha**, so a) functionality is basic and b) everything is subject to change — i.e., watch the [changelog](https://write.as/changelog-cli.html). ## Download [![Latest release](https://img.shields.io/github/release/writeas/writeas-cli.svg)](https://github.com/writeas/writeas-cli/releases/latest) ![Total downloads](https://img.shields.io/github/downloads/writeas/writeas-cli/total.svg) Get the latest version for your operating system as a standalone executable. **Windows**: [64-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_windows_amd64.zip) – [32-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_windows_386.zip) **OS X**: [64-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_darwin_amd64.zip) – [32-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_darwin_386.zip) **Linux**: [64-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_linux_amd64.tar.gz) – [32-bit](https://github.com/writeas/writeas-cli/releases/download/v0.4/writeas_0.4_linux_386.tar.gz) ### Go get it `go get github.com/writeas/writeas-cli/writeas` ## Usage ``` writeas [global options] command [command options] [arguments...] COMMANDS: post Alias for default action: create post from stdin new Compose a new post from the command-line and publish delete Delete a post update Update (overwrite) a post get Read a raw post add Add an existing post locally list List local posts help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --tor, -t Perform action on Tor hidden service --tor-port "9150" Use a different port to connect to Tor --help, -h show help --version, -v print the version ``` ### Examples These are a few common uses for `writeas`. If you get stuck or want to know more, run `writeas [command] --help`. If you still have questions, [ask us](https://write.as/contact). #### Share something Without any flags, `writeas` creates a post with a `monospace` typeface that doesn't word wrap (scrolls horizontally): ```bash $ echo "Hello world!" | writeas Posting... Copied to clipboard. https://write.as/aaaaaaaaaaaa ``` This is generally more useful for posting terminal output or code, like so (the `--code` flag turns on syntax highlighting): OS X / *nix: `cat writeas/cli.go | writeas --code` Windows: `type writeas/cli.go | writeas.exe --code` -#### Composing posts +#### Output a post + +This outputs any Write.as post with the given ID. + +```bash +$ writeas get aaaaaaaaaaaa +Getting... +Hello world! +``` + +#### List all published posts + +This lists all posts you've published from your device. Pass the `--url` flag to show the list with full URLs. + +```bash +$ writeas list +aaaaaaaaaaaa +``` + +#### Delete a post + +This permanently deletes a post you own. + +```bash +$ writeas delete aaaaaaaaaaaa +Deleting... +Post deleted. +``` + +#### Update a post + +This completely overwrites an existing post you own. + +```bash +$ echo "See you later!" | writeas update aaaaaaaaaaaa +Updating... +Post updated. +``` + +### Composing posts If you simply have a penchant for never leaving your keyboard, `writeas` is great for composing new posts from the command-line. Just use the `new` subcommand. `writeas new` will open your favorite command-line editor, as specified by your `WRITEAS_EDITOR` or `EDITOR` environment variables (in that order), falling back to `vim` on OS X / *nix. Customize your post's appearance with the `--font` flag: | Argument | Appearance (Typeface) | Word Wrap? | | -------- | --------------------- | ---------- | | `sans` | Sans-serif (Open Sans) | Yes | | `serif` | Serif (Lora) | Yes | | `wrap` | Monospace | Yes | | `mono` | Monospace | No | | `code` | Syntax-highlighted monospace | No | Put it all together, e.g. publish with a sans-serif font: `writeas new --font sans`