Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chamilonster/Piumy/llms.txt

Use this file to discover all available pages before exploring further.

All Piumy configuration is driven by environment variables. The three systemd services (pimywa-core, pimywa-display, pimywa-power) all load the same file via EnvironmentFile=/opt/pimywa/pimywa.env, so one file configures the entire stack. The installer creates this file with sensible defaults on a fresh install, and migrates it on upgrade — appending only the keys that are missing, never overwriting values you have already set.
PIMYWA_MCP_KEY must be set before the MCP endpoint accepts any connections. Run pimywa auth setup to generate it. The installer does this automatically; on a manual install you must run it yourself.

Example env file

The file shipped in the repository as deploy/pimywa.env.example:
# Piumy core environment. Copy to pimywa.env and adjust.
# pimywa.env is NOT committed (it may hold an API key).
PIMYWA_DB=/opt/pimywa/data/pimywa.db
PIMYWA_STATUS=/opt/pimywa/data/status.json
PIMYWA_ROUTER=/opt/pimywa/router.json
PIMYWA_API_ADDR=:8080
PIMYWA_MCP_ADDR=:8081
# Empty = open (dev, LAN only). Set a value to require X-API-Key on /api/*.
PIMYWA_API_KEY=
PIMYWA_NAME=Piumy
The installer expands this significantly with all the defaults listed below. The full deployed file at /opt/pimywa/pimywa.env is never committed to git — it may contain API keys and bearer tokens.

Configuration Groups

Paths

File and directory paths used by the core. All paths default to locations under /opt/pimywa/data/ (durable SD storage) or /run/pimywa/ (tmpfs RAM, for transient files that must not wear the SD card).
VariableDefaultDescription
PIMYWA_DB/opt/pimywa/data/pimywa.dbSQLite switchboard database (messages, queue, whitelist)
PIMYWA_STATUSstatus.json (relative)status.json path — the data contract between core and display adapter
PIMYWA_ROUTERrouter.json (relative)Per-chat routing rules and whitelist
PIMYWA_SESSION_DB/opt/pimywa/data/wa.dbWhatsApp session SQLite file (linked device credentials)

Network

Bind addresses for the three servers the core exposes. All default to binding on all interfaces — restrict with a specific IP if needed.
VariableDefaultDescription
PIMYWA_API_ADDR:8080REST API (curl / scripts / dashboard backend)
PIMYWA_MCP_ADDR:8081MCP server endpoint (AI agents connect here)
PIMYWA_DASH_ADDR:80Web dashboard (served by the same binary; requires CAP_NET_BIND_SERVICE)

Authentication

VariableDefaultDescription
PIMYWA_MCP_KEY""MCP bearer token (Authorization: Bearer <token>). Fail-closed — the MCP endpoint rejects all requests until this is set. Generate with pimywa auth setup.
PIMYWA_API_KEY""REST API key (X-API-Key header or ?key= query param). Empty = open (LAN dev only).
PIMYWA_DASH_USERadminDashboard login username
PIMYWA_DASH_PASS""Dashboard password (plaintext; bcrypt-hashed in memory at startup). If empty and PIMYWA_DASH_PASS_HASH is also empty, a random password is generated and logged once via journalctl -u pimywa-core.
PIMYWA_DASH_PASS_HASH""Pre-computed bcrypt hash of the dashboard password. Overrides PIMYWA_DASH_PASS when set.

Gateway

VariableDefaultDescription
PIMYWA_GATEWAYnoneWhatsApp backend. "whatsmeow" to connect to WhatsApp; "none" for offline/dev mode.
PIMYWA_WA_DEVICEPiumyDevice label shown in WhatsApp → Linked Devices. Set to something inconspicuous (e.g. Chrome (Windows)) for extra camouflage. Only takes effect at pairing time — an already-linked device’s name is unaffected.

Anti-Ban Delays

All delays are randomized within a min/max range to simulate human pacing. A non-positive or unparseable value falls back to the default.
VariableDefaultDescription
PIMYWA_DELAY_DISPATCH_MIN1sMinimum random wait before each outbound WhatsApp send
PIMYWA_DELAY_DISPATCH_MAX5sMaximum random wait before each outbound WhatsApp send
PIMYWA_DELAY_READ_MIN2sMinimum random wait before marking a message as read
PIMYWA_DELAY_READ_MAX8sMaximum random wait before marking a message as read
PIMYWA_DELAY_ACTION_MIN1sMinimum delay before other WhatsApp-facing actions (contact/group syncs)
PIMYWA_DELAY_ACTION_MAX4sMaximum delay before other WhatsApp-facing actions

Rate Limits

The governor’s hard send caps. These are startup defaults and can be overridden at runtime via the dashboard’s KV-override without a restart.
VariableDefaultDescription
PIMYWA_RATE_LIMIT_PER_MIN10Maximum outbound WhatsApp messages per minute
PIMYWA_RATE_LIMIT_PER_DAY500Maximum outbound WhatsApp messages per day

Session Backup

Encrypted backups of the WhatsApp session SQLite file. Backups are disabled by default until PIMYWA_BACKUP_KEY is set.
VariableDefaultDescription
PIMYWA_BACKUP_KEY""Passphrase to derive the backup encryption key (scrypt). Empty = backups disabled.
PIMYWA_BACKUP_DIR/opt/pimywa/data/backupsDirectory where encrypted session backups are written
PIMYWA_BACKUP_KEEP5Number of newest backups to retain; older ones are deleted on rotation
PIMYWA_BACKUP_INTERVAL24hHow often the periodic backup ticker runs
The default PIMYWA_BACKUP_DIR is on the same SD card as the session it backs up — this protects against database corruption, not against SD card failure. For disaster recovery, set PIMYWA_BACKUP_DIR to a path on an external or network-mounted volume.

MCP Anti-Flood

A limiter on MCP-inbound tool calls, distinct from the WhatsApp send rate limits. These protect the switchboard from a buggy or runaway AI agent hammering the MCP server. Applied per MCP client session ID, dashboard-editable via KV-override.
VariableDefaultDescription
PIMYWA_MCPGUARD_RATE_PER_MIN120General tool call rate limit per MCP client, per minute
PIMYWA_MCPGUARD_EMIT_RATE_PER_MIN20Stricter rate limit for send_message / escalate (tools with real-world side effects)
PIMYWA_MCPGUARD_BLOCK_THRESHOLD5Consecutive throttled calls that trip the circuit breaker and fully block the client
PIMYWA_MCPGUARD_BLOCK_COOLDOWN5mHow long a tripped client remains fully blocked before the circuit breaker resets

Auto-Reply Bridge

The bridge plugin selects how the auto-reply worker generates draft replies for chats in auto mode. Disabled by default.
VariableDefaultDescription
PIMYWA_BRIDGEnoneBridge backend. "direct-api" to enable the DeepSeek auto-reply bridge; "none" to disable.
PIMYWA_DEEPSEEK_KEY""DeepSeek API key. Secret — never logged or exposed via MCP.
PIMYWA_DEEPSEEK_MODELdeepseek-chatDeepSeek model name to use for draft generation
See reference/env-vars for the complete variable reference, including display adapter, power adapter, battery telemetry, and dashboard configuration variables.

Build docs developers (and LLMs) love