Skip to main content

mr note share

Generate a share token for a note, making it readable via the public /s/<token> share URL without authentication. Calling share on a note that is already shared is idempotent: it returns the existing token rather than minting a new one, so previously issued share URLs keep working. To rotate the token, run note unshare first and then share again. The response contains both the raw token and the relative share URL for convenience. The deployment must be running the share server (-share-port / SHARE_PORT); without it the command fails with HTTP 503 and no token is minted.

Usage​

mr note share <id>

Positional arguments:

  • <id>

Examples​

Share note 42 and print the share URL

mr note share 42 --json | jq -r .shareUrl

Share and capture just the token for use elsewhere

TOKEN=$(mr note share 42 --json | jq -r .shareToken)

Flags​

This command has no local flags.

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Object with shareToken (string) and shareUrl (string path beginning with /s/)

Exit Codes​

0 on success; 1 on any error

See Also​