pushbag
Use cases

Turn an HTML file into a link from the terminal

Upload a local HTML file with pushbag upload to get a stable URL. Share the artifact URL for a living report or its version URL for a snapshot.

Last updated:

Set up a publisher

Install the npm package with npm install -g @pushbag/cli, then run pushbag auth login. Open the printed page in your browser, create an Artifacts key and store it locally with pushbag auth set YOUR_KEY. Substitute the value from the key page. For a build process, set PUSHBAG_API_KEY in its environment. Run pushbag whoami in the same shell that will read the file.

Start with HTML that works when opened away from your project directory. Put the styles in a style element and keep local screenshot files in the locations referenced by the markup. The CLI can inline supported local images. A relative link to a second HTML page does not publish that page. For a report with several sections, headings and same-page anchors work without additional files.

Publish a page you can open

Authenticate the CLI with an Artifacts key. This sample creates a small public page in a temporary directory.

report_dir=$(mktemp -d)
printf '%s\n' '<!doctype html><title>Build report</title><h1>Build passed</h1>' > "$report_dir/report.html"
pushbag upload "$report_dir/report.html" --public --json

The JSON array contains one entry for the file. Copy url to share the latest revision, versionUrl to cite this revision, and keep id to update the page. With your own file, replace the temporary path with its filename.

Keep a record of the upload

For an automated publish, save standard output to a file and inspect it only after the command succeeds. Progress messages go to a separate stream. Joining both streams in one file can break a JSON parser, which leaves the report published but the build without a usable link.

pushbag upload "$report_dir/report.html" --private --json > "$report_dir/private-upload.json" &&
jq -e '.[0] | {id, version, visibility, versionUrl}' "$report_dir/private-upload.json"

This creates a separate private copy. In the projected object, expect a numeric version, the visibility string private, and a version URL ending in that same number. Check these fields before copying a link to a decision log. If you meant to revise the public sample, use the original ID instead.

After editing the temporary file, run pushbag upload "$report_dir/report.html" --artifact "$ARTIFACT_ID" with the original public ID in ARTIFACT_ID. For a personal document, choose --private on the first upload. Public artifact pages are served with a noindex directive, but anyone with the public URL can still open them.

With jq installed, pipe the JSON output from an upload to jq -r '.[0] | .id, .url, .versionUrl'. The first line is the identifier for future writes. The second looks like https://<id>.pushbag.dev. The third ends in /v/1 for the first revision. Copy the version link into a review request if the reviewer needs to record exactly what they approved.

Open a public link in a signed-out browser. Check the headline, images and links there before sending it to a colleague. For private review, open the page as its signed-in owner. Someone else with the ordinary private URL cannot use it as proof of ownership. A time-limited grant URL is different, so keep it out of build logs.

Publish the next draft

If you ran the temporary-directory example, edit the report inside that same directory and keep using its full path. To revise two independent reports, run one update per artifact ID. Combining both paths with one ID produces --artifact adds a version to one artifact, so it takes one file. Match each filename to the ID printed when it was created.

If the next draft needs a phone review, use a Both key for the publisher, then add --notify --title "Draft ready for review" to the update. Personal is the default destination. Use a channel ID explicitly when the intended recipient follows a shared channel, and confirm the artifact visibility is appropriate for that reader.

Frequently asked questions

Do I have to upload screenshots separately?

For images referenced by local relative paths in your HTML, the CLI can inline the files during upload. Keep them beside the report when publishing.

Will the same filename update my shared page?

Keep the ID from the first upload and pass it to --artifact on the next one. The filename alone does not select the original artifact.

Can I publish an HTML file with a linked stylesheet?

Put the required CSS in a style element before uploading. The HTML checks reject linked stylesheets.

How can I open a private HTML page in a script?

Use pushbag open with the artifact ID to print a time-limited grant URL. Fetch it while the grant is valid and treat that URL as a credential.