Go-native Telegram wrapper around phi.
git clone <your-repo-url> jarvis
cd jarvis
./wake-jarvis.shwake-jarvis.sh will:
- ask for required Telegram + ChatGPT auth setup
- ask how Jarvis should address you (
JARVIS_USER_NAME) - ask for required OpenAI API setup (used for memory embeddings + voice transcription)
- ask optional voice-reply setup (ElevenLabs key)
- auto-write
.env - build the server binary
- install reboot autostart + crash restart via a background supervisor
- start Jarvis immediately
- guide Cloudflare Zero Trust tunnel setup and optionally auto-register Telegram webhook
When wake-jarvis.sh asks for the public URL, use this Cloudflare Zero Trust flow:
- Open Zero Trust dashboard.
- Go to
Network->Connectors. - Click
Create Tunnel. - Add a public hostname that forwards to your local Jarvis listener (default
http://127.0.0.1:8080). - Copy the
https://...URL and paste it intowake-jarvis.sh; the script will runsetWebhookfor you.
- Telegram webhook ingress (
/telegram/webhook) phi-backed agent runtime (ChatGPT subscription mode viaPHI_AUTH_MODE=chatgpt)phiruntime with thebashtool- Explicit-send contract via prompting: agent sends user-visible output through
./bin/jarvisctl telegram ...; final assistant text is not auto-delivered - Persistent memory in parquet (
jarvisctl memory save|retrieve|list|remove) with background embedding backfill every minute - Rolling recent-chat cache for fast recap (
jarvisctl recent --chat <id> --pairs 10) - Internal scheduler with persistent reminder jobs (
jarvisctl schedule ...) - Parallel-powered web search + extraction (
jarvisctl parallel search|extract) - Default Bring app integration (
jarvisctl bring list|add|remove|complete) - Structured JSONL logs for inbound, stream/tool events, scheduler activity, and outbound CLI sends
If you already completed the interactive ./wake-jarvis.sh setup, manual env setup is usually not needed because the script writes .env for you.
For manual setup, copy .env.example to .env and set at least:
TELEGRAM_BOT_TOKENTELEGRAM_WEBHOOK_SECRETJARVIS_USER_NAMEPHI_AUTH_MODE=chatgptPHI_CHATGPT_ACCESS_TOKEN(or preexisting~/.phi/chatgpt_tokens.json)OPENAI_API_KEY(required for memory embeddings + voice transcription)
Feature toggles:
JARVIS_PHI_TRANSCRIPTION_ENABLEDcontrols inbound voice transcription handling (defaulttrue)JARVIS_PHI_VOICE_REPLY_ENABLEDcontrolsjarvisctl telegram send-voiceJARVIS_PHI_MEMORY_EMBEDDING_MODELcontrols the embedding model for memory retrieval (defaulttext-embedding-3-small)
If using voice:
ELEVENLABS_API_KEY(+ optionalELEVENLABS_VOICE_ID)
If using the Bring app:
BRING_EMAILBRING_PASSWORD- optional
BRING_LIST_UUIDorBRING_LIST_NAME - optional
BRING_API_KEY(defaults to the current Bring web key used by jarvis)
Optional:
PARALLEL_API_KEY(enablesjarvisctl parallel search|extract)JARVIS_PHI_DEFAULT_CHAT_ID(restrict inbound processing to one Telegram chat)
Parallel docs snapshot:
docs/parallel_docs/search_extract.mdis a checked-in Jarvis-focused guide for the two Parallel endpoints that matter here:searchandextract.
If running in a sandboxed/CI/container environment, set:
export GOCACHE=/tmp/go-build-cache
export GOMODCACHE=/tmp/go-mod-cache
export GOPATH=/tmp/goRun server:
go run ./cmd/serverRun CLI:
go run ./cmd/jarvisctl --helpAgent runtime canonical command form (used by phi tool execution):
cd /path/to/jarvis
./bin/jarvisctl telegram send-text --chat 123456 --text "hello"send-text supports mixed prose plus code formatting in one Telegram message: inline backticks become inline code, and triple-backtick fenced snippets become Telegram code blocks.
For shell safety, prefer single-quoting --text when sending backticks, e.g.:
./bin/jarvisctl telegram send-text --chat 123456 --text $'run `go test ./...` and use:\n```go\nfmt.Println("ok")\n```'Optional typing indicator:
./bin/jarvisctl telegram typing --chat 123456Use exact supported Telegram CLI flags/subcommands. Variants like telegram send or --chat-id are invalid.
Webhook setup helper:
go run ./cmd/jarvisctl telegram set-webhook --url https://YOUR_DOMAIN/telegram/webhookset-webhook uses TELEGRAM_WEBHOOK_SECRET from .env by default, so you do not need to paste the token manually again.
Examples:
# Send message
go run ./cmd/jarvisctl telegram send-text --chat 123456 --text "hello"
# Send typing status
go run ./cmd/jarvisctl telegram typing --chat 123456
# Add scheduled prompt
go run ./cmd/jarvisctl schedule add \
--id morning-check --chat 123456 --prompt "do a quick check-in" --mode cron --cron "0 9 * * *" --tz Europe/Vienna
# List schedules
go run ./cmd/jarvisctl schedule list
# Execute due schedules immediately (sends reminders)
go run ./cmd/jarvisctl schedule run-due
# Inspect due schedules only (no execution)
go run ./cmd/jarvisctl schedule run-due --dry-run
# Bring list and add
go run ./cmd/jarvisctl bring list
go run ./cmd/jarvisctl bring add "Milk" "Eggs" "Butter:unsalted"
# Save memory
go run ./cmd/jarvisctl memory save --keywords "coffee,morning" --memory "user prefers black coffee in the morning"
# Retrieve related memories
go run ./cmd/jarvisctl memory retrieve --query "what coffee does the user like?" --limit 5
# Recap the latest user/jarvis back-and-forth
go run ./cmd/jarvisctl recent --chat 123456 --pairs 10
# Search the web with Parallel
go run ./cmd/jarvisctl parallel search --objective "latest postgres 18 release notes"
# Extract page content with Parallel
go run ./cmd/jarvisctl parallel extract --url https://www.example.com --full-contentdata/logs/events-YYYY-MM-DD.jsonldata/messages/dedup.jsondata/messages/index.jsondata/messages/recent/chat-<id>.jsonldata/memory/memories.parquetdata/sessions/chat-<id>.jsonldata/scheduler/jobs.json
If running in a sandboxed/CI/container environment, set the same env vars from the Commands section first.
go test ./...