@within-7/jetr
v0.10.3
Published
CLI for Jetr static site hosting
Readme
@within-7/jetr
Static site hosting CLI. Deploy files to Cloudflare R2 with one command. Incremental uploads, custom domains, password protection, file rendering.
Install
npm i -g @within-7/jetrOr use directly:
npx @within-7/jetr ./dist my-siteQuick Start
# 1. Login (or auto-detected from AITER_TOKEN env)
jetr login
# 2. Deploy
jetr ./dist my-blog
# ✔ Deployed!
# Site: my-blog
# URL: https://my-blog.your-jetr-domain.com
# 3. Re-deploy (remembers site name via .jetrrc)
jetr
# Using saved site: my-blog
# ✔ Deployed! 1 uploaded, 11 unchangedDeploy
The default command. Just run jetr in any project directory.
jetr # deploy current dir (name from .jetrrc or random)
jetr ./dist # deploy a directory
jetr ./dist my-blog # deploy with a specific site name
jetr ./dist docs.example.com # deploy to a custom domain (auto-registers)
jetr index.html # deploy a single file
jetr *.html *.css my-site # deploy multiple files- Site auto-created if it doesn't exist
- Name saved to
.jetrrcfor zero-config re-deploys - SHA-256 incremental diff — only changed files upload
- 10x concurrent upload
- Root domains (e.g.
example.com) are rejected — use a subdomain likewww.example.com
Custom Domains
Pass a domain name instead of a site name:
jetr ./dist docs.example.com
# ✔ Deployed!
# Domain: docs.example.com
# DNS: docs.example.com CNAME fallback-origin.jetr.your-domain.comSet the CNAME record at your DNS provider, and the site is live. SSL auto-provisioned.
Auth
jetr login # interactive (username + hidden password)
jetr login user pass # non-interactive
jetr login --token <jwt> # direct JWT (for CI)
jetr whoami # show current user
jetr logout # clear credentialsEnvironment variables (auto-detected, no login needed):
AITER_TOKEN— AiTer platform JWTJETR_TOKEN— explicit JWT for CI/scripts
Manage Sites
jetr list # list all your sites
jetr info <name> # show files, domains, tokens, config
jetr info docs.example.com # lookup by domain name
jetr delete <name> # permanently delete site + files + domains
jetr create <name> -p secret # create with password
jetr create <name> -e 86400 # create with 24h expiryAccess Control
jetr password <name> secret # set visitor password
jetr password <name> # remove password (make public)
jetr token create <name> # generate share link (bypasses password)
jetr token create <name> -n "QA" # share link with label
jetr token revoke <name> <id> # revoke a share linkIgnore Files
.jetrignore (gitignore syntax) controls what gets deployed. Default rules auto-exclude node_modules, .env, .git, build artifacts, etc.
jetr init # generate .jetrignore with defaults.jetrkeep overrides .jetrignore — force-include specific files.
Metadata files (.jetrignore, .jetrkeep, .jetrrc) are never uploaded.
File Rendering
Jetr automatically renders documents in the browser:
| File type | Rendering |
|-----------|-----------|
| .md | Markdown → styled HTML page |
| .csv | Parsed into HTML table |
| .json | Formatted + syntax colored |
| .txt, .yaml | Code view with line numbers |
| No index.html | Auto directory listing (grouped by type) |
Append ?raw to any URL to get the original file.
How It Works
- CLI scans directory, computes SHA-256 hashes
- Sends manifest to API — diffs against stored hashes
- Only changed files transfer (10 concurrent streams to R2)
- Finalize: old files cleaned, metadata updated, site is live
Config
Stored at ~/.jetr/config.json:
{
"apiUrl": "https://api.your-domain.com/jetr",
"user": "lib",
"token": "eyJhbG..."
}