Documentation
From empty directory to useful signal.
Genki deploys one ordinary Worker and D1 database into an account you control.
Install
The installer downloads the correct standalone binary and verifies its SHA-256 checksum. Tagged binaries also carry GitHub build-provenance attestations.
curl -fsSL https://genki.sh/install.sh | shFor an additional provenance check, run gh attestation verify ~/.local/bin/genki --repo tamashi095/genki.
Create and deploy
Initialize a complete Worker project and provision its D1 database:
genki init monitoring
cd monitoring
bun install
genki doctor
genki setupStore a cryptographically random operator token of at least 32 bytes as a Worker secret, then test, migrate, deploy, and smoke-test:
export GENKI_TOKEN="$(openssl rand -hex 32)"
printf '%s' "$GENKI_TOKEN" | bunx wrangler secret put API_TOKEN
genki deployConnect the CLI
Use the workers.dev URL printed by deployment. Context tokens are stored privately and always redacted.
printf '%s' "$GENKI_TOKEN" | genki context add personal \
--url https://genki-monitor.<account>.workers.dev \
--token-stdin
genki capabilitiesAdd a monitor
add creates a service and production environment, then runs the first check. It fails nonzero if the endpoint is not healthy.
genki add https://api.example.com/health \
--service public-api \
--name "Public API"
genki statusReuse mechanics across environments
A monitor owns shared assertions and thresholds. Each environment owns its URL, state, and history.
genki add https://staging-api.example.com/health \
--service public-api \
--env staging \
--env-name Staging \
--role non_productionCheck health, not just reachability
Transport failure is down. A reachable response that fails an assertion is unhealthy. Templates provide reviewed requests and JSON assertions for common systems.
genki template list
genki add https://service.example.com/health \
--template generic-json-status \
--service serviceThe JSON status template parses the response and requires "/status" to equal "up"; it does not use text matching.
Enable email alerts
Onboard a sender domain to Cloudflare Email Service and verify the destination. Then add the binding and variables to wrangler.jsonc:
"send_email": [{
"name": "ALERT_EMAIL",
"destination_address": "operator@example.com",
"allowed_sender_addresses": ["alerts@example.com"]
}],
"vars": {
"INSTANCE_NAME": "Example Status",
"ALERT_EMAIL_FROM": "alerts@example.com",
"ALERT_EMAIL_TO": "operator@example.com"
}Redeploy after configuration. Genki sends one email when thresholds open an incident and one when recovery thresholds close it. Failed delivery remains in D1 and retries automatically.
Back up and upgrade
genki backup\ngenki upgrade\nbun install\ngenki deployBackups are SQL exports containing monitor configuration. Store them securely. Upgrade refuses to overwrite modified generated files and preserves wrangler.jsonc.
Use Genki with agents
Select an explicit context and use --json. Destructive commands require --yes and current ETags. Never put bearer tokens in command arguments.
genki status --context personal --json\ngenki check public-api/production --json