drawer-so
v0.16.0
Published
Drawer CLI — publish files and directories to drawer.so from the terminal.
Maintainers
Readme
drawer-so
Publish files and directories to Drawer from the terminal.
The CLI targets https://drawer.so by default; override with DRAWER_BASE_URL.
Install
npm install -g drawer-so
# verify
drawer --helpQuick start
# one-time: paste your drawer API key (drw_…)
drawer auth login
# create a new artifact from a single file (defaults to private)
drawer create ./report.html --title "Q3 report"
# create from a directory (zipped + uploaded as a multi-file artifact)
drawer create ./site --title "demo site"
# update an existing artifact in place (cannot change visibility — use publish)
drawer update art_abc1234567 ./report.html
# patch — surgical find/replace
drawer patch art_abc1234567 --find "Q3" --replace "Q4"
# flip visibility — public requires a y/N prompt (or --yes)
drawer publish art_abc1234567 --visibility unlisted
drawer publish art_abc1234567 --public --yes
# make private again
drawer unpublish art_abc1234567
# list / open
drawer list
drawer open art_abc1234567Config
API key + base URL are stored in ~/.config/drawer/cli-config.json (chmod 600).
Override per-invocation with env vars:
DRAWER_API_KEY— override the saved keyDRAWER_BASE_URL— override the base URL (defaulthttps://drawer.so)
Commands
drawer auth login Paste an API key and save it
drawer auth logout Delete saved key
drawer auth whoami Show stored key prefix + base URL
drawer create <file|dir> Create a new artifact (defaults to private)
--title <text> Title shown in the browser tab
--visibility <tier> private (default) | unlisted | public
--private / --unlisted / --public Shorthand visibility flags
--password <text> Gate the artifact (unlisted/public only)
--tag <name> Apply a tag (repeatable)
--tags <a,b,c> Comma-separated tags
drawer update <artifact_id> <file|dir> Push a new version (no visibility change)
--title <text> Update the title
--tag / --tags Replace the tag set
drawer publish <artifact_id> Flip visibility of an existing artifact
--visibility <tier> private | unlisted | public
--private / --unlisted / --public Shorthand visibility flags
--password <text> Set or rotate the password
--clear-password Remove the password modifier
--yes / -y Skip the public-visibility y/N prompt
drawer unpublish <artifact_id> Alias for `publish <id> --private`
drawer list List your artifacts
drawer get <artifact_id> Print artifact metadata as JSON
drawer open <artifact_id> Open the artifact URL in your default browser
drawer delete <artifact_id> [--yes] Permanently delete (asks first)
drawer patch <artifact_id> Find/replace surgical edit
--file <path> Defaults to the artifact's entry file
--find <text> Required
--replace <text> Required
--replace-all Replace every occurrence
drawer revert <artifact_id> [--to <ver>] Promote a prior version back to current
drawer diff <artifact_id> <from> [to] Unified diff between versionsNotes
- Uploads use the unified
/api/artifacts/uploadendpoint, which dispatches byContent-Type(single file vs. zip archive). - Directories are bundled into a zip in-memory and uploaded;
node_modulesand.gitare skipped by default. - Uploads cap at 100 MB raw / 200 MB extracted.
- All commands honor per-API-key rate limits (60 mutating requests/min, 1000/hour).
For maintainers — publishing
One-liner to publish a release from a clean checkout:
git pull && cd cli && npm install && npm run build && npm publish --access publicnpm loginis a one-time setup on the publishing machine.- Bumping versions:
npm version patch && git push --follow-tags && npm publish --access public(useminorormajoras appropriate). TheprepublishOnlyscript re-runs the build. - See PUBLISHING.md for the full pre-flight checklist.
