Docs

Docs

CLI

The ashare command, for scripts, CI and agents that run shell commands. A thin layer over the REST API. Node.js 20 or newer.

Terminal
$ npx ashare-cli login
$ npx ashare-cli publish report.html

npm install -g ashare-cli gives you the ashare command. login asks for a key from your API page, checks it and keeps it in ~/.config/ashare/credentials.json, readable only by you. ASHARE_API_KEY wins over the saved key.

Commands

CommandWhat it does
login [--key <key>]Save an API key from your API page. Without --key it asks, or reads it from stdin.
publish <file|folder>Publish HTML, Markdown or a folder as a site and print the link. New documents are private. --title, --visibility, --expires, --password, --hide-history.
update <id> <file|folder>A new version at the same link. --base-version refuses to overwrite a newer one.
edit <id> --old <text> --new <text>Replace one fragment that occurs exactly once. --new "" deletes it.
listYour documents.
views <id>Who opened a private or company document: signed-in readers, how often, when.
get <id>The source of the current version, --version for another, -o to save it to a file.
comments <id>Open threads with the quoted text. --all adds resolved ones.
reply <id> <thread> <text>Reply in a thread as the agent. Quote the text.
resolve <id> <thread>Resolve a thread.
reopen <id> <thread>Open a resolved thread again.
share <id> <email>...Let people into a private or company document. --replace sets the whole list.
protect <id>Visibility, expiry, password, notifications, embedding and hidden history. Without options it shows the current settings.
delete <id>Delete a document with all its versions and comments.
open <id>Print the link and open it in the browser.
requests <id>Requests to open a private document. --all adds decided ones.
approve <id> <request>Let the person in; they get an email with the link.
deny <id> <request>Refuse a request.

Every command takes --json to print the API response as is, --base-url for another server and -h. ashare --help lists every option.

Examples

Terminal
$ ashare publish report.html --visibility public
$ ashare publish site/
$ ashare publish plan.md --visibility company --expires 7d
$ ashare edit <id> --old "100 USD" --new "200 USD" --base-version 1
$ ashare comments <id>
$ ashare reply <id> <thread> "Fixed in v3"
$ ashare resolve <id> <thread>
$ ashare share <id> masha@example.com
$ ashare protect <id> --password s3cret --expires 30d
$ ashare protect <id> --embed https://www.notion.so
$ ashare protect <id> --hide-history

The format comes from the extension: .html, .htm, .md, .markdown or .zip; otherwise pass --format. A folder goes up as a site of several files: the CLI packs it with the zip tool, so zip must be on your PATH.

Exit codes: 0 done, 1 an error from the API or the network with the message on stderr, 2 wrong arguments.