https://github.com/writeas/cmd
Simple command line pastebin.
https://github.com/writeas/cmd
go pastebin-service
Last synced: 8 months ago
JSON representation
Simple command line pastebin.
- Host: GitHub
- URL: https://github.com/writeas/cmd
- Owner: writeas
- License: mit
- Created: 2015-02-06T00:55:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-23T04:05:56.000Z (about 10 years ago)
- Last Synced: 2025-04-09T02:12:58.928Z (about 1 year ago)
- Topics: go, pastebin-service
- Language: Go
- Homepage: http://cmd.write.as
- Size: 7.81 KB
- Stars: 12
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Write.as
========
[](https://travis-ci.org/writeas/cmd) [](http://webchat.freenode.net/?channels=writeas) [](http://slack.write.as/)
This is a simple HTTP-based interface for publishing text. Users POST whatever they want to publish using the `w` parameter. When the request finishes, a URL is returned — this is the publicly-accessible address to the post on the web.
## Try it
```
echo "Hello world, by $USER" | curl -F 'w=<-' http://cmd.write.as
```
## Run it yourself
```
Usage:
cmd [options]
Options:
--debug
Enables garrulous debug logging.
-o
Directory where text files will be stored. If not supplied, will try to
use database for storage (see Environment Variables).
-s
Directory where required static files exist (like the banner).
-p
Port to listen on.
Environment Variables:
WA_USER
Database user.
WA_PASSWORD
Database password.
WA_HOST
Database host. Default: localhost
WA_DB
Database name.
```
The default configuration (without any flags) is essentially the following line. **You'll need to supply the `-o` flag or database env variables to store posts**.
```
cmd -s ./static -p 8080
```
## How it works
The user's input is simply written to a flat file in a given directory. To provide web access, a web server (sold separately) serves all files in this directory as `plain/text`. That's it!
## License
This project is licensed under the MIT open source license.