Integration · no API key
Publish from the command line
Upload a file from the command line and get a link back: one npx command shares a file or folder and prints only the URL, ready for scripts, CI and agents.
Share a file or a whole folder (dist/, build/, out/). Prints the link; run login once to keep links in your account.
npx @anyshare/cli ./dist- No account to publish
- No API key
- Keep links 30 days with a free account
How the CLI works
One file is uploaded as it is. A folder is zipped in memory and becomes a website if it has an index.html, or a browsable file list if it doesn’t. Several paths become one link, keeping their paths relative to their common parent folder.
The link is the only thing printed to stdout; progress goes to stderr. That makes it easy to capture: URL=$(npx -y @anyshare/cli ./dist -q). It needs Node.js 20 or newer and nothing else. Run it with npx, or npm install -g @anyshare/cli to get the anyshare command.
Reference
Commands
Everything the CLI does, in six snippets.
Share
One file, a folder, or several paths under one link.
npx @anyshare/cli report.html
npx @anyshare/cli ./dist --slug q3-report --title "Q3 report"
npx @anyshare/cli screenshot.png notes.mdScripts
-q prints only the URL; status lines go to stderr.
URL=$(npx -y @anyshare/cli ./dist -q)
echo "Preview: $URL"JSON
The full response, including the update token and expiresAt.
npx -y @anyshare/cli ./dist --jsonUpdate & delete
After npm install -g @anyshare/cli. Tokens come from ~/.config/anyshare/sites.json.
anyshare update sunny-otter-4821 ./dist
anyshare delete sunny-otter-4821
anyshare list
anyshare open sunny-otter-4821
anyshare claim sunny-otter-4821Single-page app
Serve index.html for unknown paths. Usually detected automatically.
npx @anyshare/cli ./dist --spaMCP
Starts the local MCP server on stdio for Claude Code, Codex, Cursor and other agents.
npx -y @anyshare/cli mcpWhen it’s shared
What your link shows
Whatever you point it at gets the right viewer: HTML runs as a site, source files get syntax highlighting with line numbers, Markdown gets a reading page.
- Folders become websites
- Code with line numbers
- Markdown as a reading page
- Several files under one link
How it works
Three commands you’ll use
- Step 1:
Share
npx @anyshare/cli ./distuploads the folder and prints the URL. Add--slug q3-reportto choose the address. - Step 2:
Use the URL
It’s printed on stdout, with a claim link on stderr: without an account the link lasts 1 hour unless you keep it.
--copyputs it on the clipboard and--openopens it in your browser. - Step 3:
Update later
anyshare update <slug> ./distreplaces the content and keeps the URL. The token comes from~/.config/anyshare/sites.json.
The details
Built for scripts and agents
Safe folder uploads
node_modules,.git, caches, OS junk and secrets (.env*,.dev.vars,.npmrc,.netrc, SSH keys,*.pem,.ssh/,.aws/) are never uploaded. Naming a secret file directly is refused.Catches unbuilt source
A folder with a
package.jsonbut noindex.htmlgets a warning that points at the build folder, because anyshare never runs your build.Checks limits first
Free uploads are limited to 50 MB and 1,000 files, and the CLI checks before sending anything.
Retries without duplicates
Network failures and
429/5xxresponses are retried with backoff and the sameIdempotency-Key, so a retry never creates a second link. Exit codes:0success,1API or network error,2usage error.Tokens and sign-in handled for you
Every link’s token is saved in
~/.config/anyshare/sites.json(mode 0600); on another machine, pass--tokenor setANYSHARE_TOKEN.anyshare loginsaves an account API key, so new links go straight into your free account.Points anywhere
ANYSHARE_API_URLsends uploads to another server, such as a local development instance.
FAQ
Questions, answered.
Do I need to log in or create an API key?
anyshare login once (it opens the browser to approve a code) and new links are saved to your account automatically.Why isn’t it just `npx anyshare`?
anyshare name on npm belongs to an unrelated package, so the CLI is published as @anyshare/cli. After a global install, the command it gives you is anyshare.What gets left out when I share a folder?
node_modules, .git, .next, .turbo, .cache, __pycache__, .venv), OS junk, and anything that looks like a secret. Skipped secrets are listed in a warning.How do I use it in CI?
npx -y so npx doesn’t stop to ask, and -q to capture just the URL. Set ANYSHARE_API_KEY to your account’s key so the links last 30 days instead of 1 hour. The GitHub Actions recipe shows a full workflow that comments the link on a pull request.What happens if an upload fails halfway?
429/5xx responses with backoff, reusing the same Idempotency-Key, so you never end up with two links. If it gives up, it exits with code 1 and prints the API’s message.Give your agent a URL for any file.
One step to connect, no account or API key. It hands you back a link anyone can open, and a claim link to keep it.



