-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
167 lines (156 loc) · 9.59 KB
/
Copy path.env.example
File metadata and controls
167 lines (156 loc) · 9.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Mirafold imports only the settings listed in this file from a checkout's
# .env (the allowlist is PROJECT_ENV_KEYS in server/project-env.ts; a test
# keeps this file and that list in sync). Executable overrides, PATH/shell
# controls, runtime loader hooks, the daemon's own log location, and the
# browser auth token must be exported in the parent terminal; a checkout
# cannot grant those authorities to itself. A value already set in the parent environment always wins.
# Which terminal agent Mirafold re-skins by default: claude-code, codex,
# gemini-cli, or opencode. The agent picker still offers every installed agent; an
# agent with no credentials below runs the API-free mock stand-in instead.
MIRAFOLD_AGENT=claude-code
# claude-code credentials — set ONE of these to make it live (else → demo mock):
# - ANTHROPIC_API_KEY (metered API key) — the supported path for Claude here.
# - ANTHROPIC_AUTH_TOKEN and/or ANTHROPIC_BASE_URL (proxy / gateway / local
# endpoint setups, e.g. Ollama — the Agent SDK reads both). A local endpoint
# is BYO — anything goes, local and over the relay. (A RUNNING Ollama is
# also discovered automatically and offered in the agent picker with its models —
# no env needed for that route; see docs/local-models.md.)
# NOTE: a Claude subscription login (`claude` in a terminal) is NOT a supported
# path — Anthropic's terms don't allow using a Pro/Max subscription in a
# third-party app, so Mirafold won't drive it (the picker will say so and
# point you here). This is Anthropic's rule, not ours. Use an API key.
ANTHROPIC_API_KEY=
ANTHROPIC_AUTH_TOKEN=
ANTHROPIC_BASE_URL=
# DEFAULT_MODEL is optional. Leave it unset and Claude Code uses its OWN
# configured default model — the same one your terminal uses (faithful skin).
# Set it only to pin a specific model, e.g. DEFAULT_MODEL=claude-sonnet-5.
# MAX_THINKING_TOKENS is optional too: a per-turn thinking budget passed to the
# Agent SDK; unset → the SDK's own default.
DEFAULT_MODEL=
MAX_THINKING_TOKENS=
# codex credentials: an OPENAI_API_KEY, OR a `codex login` (ChatGPT
# subscription — the SDK reads ~/.codex/auth.json). The subscription path is a
# NOTE: only an API key works over the paid relay; a subscription session is
# served locally but always refused remotely (the closed-model reselling line).
# LOCAL Codex: a RUNNING Ollama/LM Studio/vLLM is discovered automatically and
# offered in the agent picker — pick a model there, no config needed. A DEFAULT
# provider in ~/.codex/config.toml (local, or a hosted open-model API like
# OpenRouter — one key, most open models) is detected too and offered as its
# own endpoint row — no key needed here (see docs/local-models.md).
# CODEX_MODEL is optional; unset → Codex's own default model. Sandbox/approval
# are NOT set here — Codex inherits your own ~/.codex/config.toml (faithful
# skin). MIRAFOLD_CODEX_LOCAL_TURN_TIMEOUT_MS bounds one Codex turn on a
# DISCOVERED local server (default 480000 = eight minutes; 0 disables it).
OPENAI_API_KEY=
CODEX_MODEL=
MIRAFOLD_CODEX_LOCAL_TURN_TIMEOUT_MS=
# gemini-cli credentials: a Google AI Studio API key
# (https://aistudio.google.com/apikey — free tier, no billing), as either
# Gemini CLI: you may try your existing Gemini CLI sign-in locally.
# Access depends on your Google account and plan. If sign-in is unavailable,
# connect with a Gemini API key instead.
# Mirafold runs the official CLI, which manages its own authentication.
# Google's restriction on reusing CLI OAuth for direct backend access is
# not a blanket prohibition on interfaces driving the official CLI.
# Gemini CLI access for individual, Google AI Pro, and Google AI Ultra
# accounts ended June 18, 2026; an existing login does not guarantee access.
# Mirafold does not automatically switch to paid API usage.
# Subscription sign-in is local-only and unavailable over the paid relay.
# Details: docs/provider-subscriptions.md.
GEMINI_API_KEY=
GOOGLE_API_KEY=
GEMINI_MODEL=
# opencode: no credential lives here — OpenCode reads its own auth store
# (`opencode auth login`) and config, and its built-in Zen models work with
# nothing configured. OPENCODE_MODEL optionally pins the model as
# <provider>/<model> (e.g. opencode/big-pickle); a bare model id can't name a
# provider and pins nothing. Unset → OpenCode's own default.
OPENCODE_MODEL=
PORT=3000
# NOT MIRAFOLD_TOKEN: the browser's auth token is an operator setting and is
# never read from this file — an empty value would disable auth, and this
# file is routinely copied to .env verbatim. Export it in the parent terminal
# instead (unset → a fresh random token each launch; empty → auth off, which
# the daemon warns about loudly and which only the Vite dev proxy needs).
# Local model server discovery (optional; see docs/local-models.md). The daemon
# probes localhost's well-known runtime ports (Ollama 11434, LM Studio 1234,
# vLLM 8000, llama.cpp 8080) and offers what it finds in the agent picker.
# MIRAFOLD_LOCAL_DISCOVERY=off disables the well-known-port probing.
# NOT MIRAFOLD_LOCAL_ENDPOINTS (extra URLs to probe): a checkout could
# otherwise add an off-machine address that the agent picker then presents as
# a discovered LOCAL server — export it in the parent terminal instead.
MIRAFOLD_LOCAL_DISCOVERY=
# Remote access (phone / second machine through the relay). All optional —
# and NONE of these six are read from this file: they decide where the
# daemon dials, what credential it presents, and who can pair, so they are
# the operator's alone (a checkout's .env once redirected the license-key
# exchange and the relay to a hostile host and pinned the pairing code —
# 2026-08-26 audit). Export them in the parent terminal; they are documented
# here so the names are in one place.
# What dials out: with MIRAFOLD_RELAY_URL unset, the daemon dials the hosted
# relay (wss://relay.mirafold.sh) ONLY when an entitlement is configured
# (MIRAFOLD_LICENSE_KEY or MIRAFOLD_ENTITLEMENT_TOKEN below); with neither
# set, remote access is off and nothing dials out. MIRAFOLD_RELAY_URL=off
# disables remote access even with an entitlement. An explicit URL
# (wss://… for a remote relay; ws://localhost:8080 for a local dev/self-host
# relay) is dialed as given, entitled or not.
# The pairing code is minted fresh each launch (or pinned with
# MIRAFOLD_RELAY_CODE, min 16 chars of A-Z a-z 0-9 _ - — anything weaker is
# refused and a fresh code is minted instead).
# MIRAFOLD_APP_URL: the static origin the "connect a device" QR points at —
# where a phone's browser loads the viewport app FROM (the relay itself serves
# no JS by design). Unset = the hosted app origin when the hosted relay is in
# use, else the relay URL's HTTP twin (which only works when that host serves
# the app too — dev stub / self-host). The HOSTED app origin dials only the
# hosted relay (its Content-Security-Policy pins wss://relay.mirafold.sh —
# that is what makes a crafted QR harmless there), so pointing it at a
# self-hosted relay does not work; self-host the app origin too.
# Entitlement for the hosted relay (Mirafold Pro): MIRAFOLD_LICENSE_KEY is the
# key from your purchase — the daemon exchanges it for a short-lived token at
# MIRAFOLD_ENTITLEMENT_URL (default https://mirafold.com/api/entitlement) and
# refreshes it itself; the key never leaves this machine except to that
# endpoint. MIRAFOLD_ENTITLEMENT_TOKEN is a hand-issued token that bypasses
# the exchange (self-host / testing). Over a plaintext ws:// relay on a
# non-local host either credential travels in the clear — use wss://.
# Resource limits (all optional; the defaults are the tested values). A
# malformed value falls back to its default — it never widens a limit.
# MAX_WS_PAYLOAD: largest inbound browser frame in bytes (1000000).
# SESSION_BUFFER_MAX_BYTES: replay-ring byte cap per session (32000000).
# SESSION_IDLE_TIMEOUT_MS: unload a warm engine after this long with no
# viewport attached (14400000 = 4 h); the session stays resumable.
# DELTA_COALESCE_MS: text-delta merge window before fan-out (33).
# MAX_SESSIONS: active + dormant sessions per daemon (100).
# PERMISSION_TIMEOUT_MS: how long a permission prompt waits before denying
# (60000).
# TOOL_OUTPUT_CAP_BYTES: tool output kept per record; the rest is reported as
# elided, never silently cut (64000).
# BANG_CONTEXT_CAP: bytes of a `!` command's output handed to the agent as
# context (16000).
# MAX_REMOTE_VIEWPORTS: relay viewports per daemon (16).
# RELAY_VIEWPORT_IDLE_MS: reap a silent relay viewport after this long (90000).
MAX_WS_PAYLOAD=
SESSION_BUFFER_MAX_BYTES=
SESSION_IDLE_TIMEOUT_MS=
DELTA_COALESCE_MS=
MAX_SESSIONS=
PERMISSION_TIMEOUT_MS=
TOOL_OUTPUT_CAP_BYTES=
BANG_CONTEXT_CAP=
MAX_REMOTE_VIEWPORTS=
RELAY_VIEWPORT_IDLE_MS=
# Logs & debugging. The daemon's warnings/errors (and session lifecycle lines)
# land in a size-capped file — ~/.local/state/mirafold/mirafold.log (rolls to
# .1 at 5 MB; ≤10 MB ever) — so "attach your log file" is the whole bug-report
# instruction. It NEVER contains session content, prompts, keys, the ?token=
# URL, or a pairing code.
# MIRAFOLD_DEBUG=1 (or launching with --verbose): stream debug-level detail to
# the terminal — engine stderr, per-message event traces. Console-only; debug
# lines never reach the log file.
MIRAFOLD_DEBUG=
# NOT read from this file (parent environment only):
# MIRAFOLD_LOG_FILE — where the daemon writes its own log (set EMPTY to
# disable the file). It's an operator setting, not project data: honoring
# it from a checkout would hand a hostile repo a file-append primitive.
# MIRAFOLD_CODEX_BIN / MIRAFOLD_GEMINI_BIN / OPENCODE_BIN and every other
# executable override — a checkout must never pick what runs.