Skip to content

Repository files navigation

Snapifact CLI

CI Latest release MIT license

CLI for turning local artifacts into temporary browser links for human review. Snapifact is built for AI-agent developers who need to share files, Markdown, diffs, diagrams, comparisons, HTML, or CSV with a person without leaving the local workflow.

Quick start

The release installer is the primary installation path for supported Linux and macOS systems on amd64 or arm64:

curl -fsSL https://snapifact.dev/downloads/latest/install.sh | sh

The installer verifies the downloaded binary against its SHA-256 manifest and installs snapifact to $HOME/.local/bin by default. View the latest checksums before installing.

Alternatively, install the latest Go module version:

go install github.com/kuo77122/snapifact-cli/cmd/snapifact@latest

Create a review link:

snapifact markdown README.md --title "README review"

Trust boundary

  • No account: no signup, email, or API key is required.
  • Links are unlisted, not private: anyone with the link can view them.
  • Content is readable by the operator. Never upload secrets.
  • Snapshots expire after a seven-day expiry and can be deleted earlier with the local delete token.

Commands

Command Purpose Input
snapifact diff Upload a unified diff snapshot One file or stdin
snapifact compare Compare two UTF-8 files Two file paths
snapifact text Upload UTF-8 plain text or source code One file or stdin
snapifact markdown Upload a Markdown snapshot One file or stdin
snapifact mermaid Upload a Mermaid diagram snapshot One file or stdin
snapifact html Upload a sandboxed HTML snapshot One file or stdin
snapifact csv Upload a CSV snapshot One file or stdin
snapifact image Upload a PNG or JPEG image snapshot One file or stdin (8 MiB maximum)
snapifact pdf Upload an explicit PDF snapshot One PDF file or - (16 MiB maximum)
snapifact delete Delete a snapshot Snapshot ID or URL
snapifact version Print the CLI version

Global flags are also available:

  • snapifact --help or snapifact -h prints the command list.
  • snapifact --version prints the CLI version.

The upload and compare commands support these options:

  • --title TEXT sets a snapshot title.
  • --description-file PATH reads a Markdown description file. Use - to read the description from stdin when the artifact itself comes from a file.
  • --json prints the complete create response instead of only the review URL.
  • --password securely prompts for a password and confirmation from the controlling terminal. It requires SNAPIFACT_API_KEY; the password is never read from stdin, argv, environment, or a file. Passwords must be valid UTF-8 and 12–1024 bytes.

For image uploads, set the optional SNAPIFACT_API_KEY environment variable to apply a basic, pro, or admin API key to create requests, including image creation:

SNAPIFACT_API_KEY="$SNAPIFACT_API_KEY" snapifact image photo.png

To create a password-protected snapshot, add --password to any create or compare command. The API key is required and the CLI prompts twice without echoing the password:

SNAPIFACT_API_KEY="$SNAPIFACT_API_KEY" snapifact markdown README.md --password

The key is never sent on delete, view, or raw requests. Image input is limited to 8 MiB; the server remains authoritative for image validation.

PDF uploads use a dedicated byte-preserving multipart request. PDF type is never inferred from a filename, and the filename is display metadata only:

snapifact pdf report.pdf --title "Report review"
cat report.pdf | snapifact pdf - --comments-enabled=true

PDF options are --title TEXT, --description-file PATH|-, --comments-enabled=true|false, and --password-file PATH|-. Content is limited locally to 16 MiB and the completed multipart body to 17 MiB. The server rejects malformed or encrypted/password PDFs and enforces a 50-page maximum plus fixed page-box, dimension, and pixel bounds. The PDF command prints only the review URL and never retries an ambiguous create request.

PDF validation is structural, not sanitization and not a malware guarantee. The server stores the validated original bytes; viewing uses the canvas-only viewer, while raw download remains an exact-byte operation. Set SNAPIFACT_API_KEY only for a keyed PDF create; the key is sent only on that create request and never in metadata, output, view, or delete requests.

Content can be read from stdin with - or by omitting the path:

cat report.md | snapifact markdown -
cat photo.jpg | snapifact image
snapifact compare before.txt after.txt --title "Before and after"
snapifact markdown report.md --description-file notes.md
snapifact delete https://snapifact.dev/v/<snapshot-id>

Options may appear before, after, or between path operands. Use -- before a path that starts with -:

snapifact text -- -report.txt

Run snapifact <command> --help for the command's built-in usage text.

Development

This repository uses the same checks as CI:

go test ./...
go vet ./...
go build ./cmd/snapifact

Contributing

Read the open issues, then open an issue or pull request with a focused change and the checks you ran.

Public links

About

CLI for turning local artifacts into temporary browser links for human review.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages