Skip to content

lf init

Creates user-level lenserfight.json under your OS config directory (e.g. ~/.config/lenserfight/lenserfight.json on Linux) and ensures config.json exists for auth tokens. Nothing is written into the current git repository unless you pass --project.

bash
lf init                           # cloud mode (default) → user config dir
lf init --mode local              # local Supabase stack
lf init --mode cloud --url https://your-project.supabase.co
lf init --project                 # optional: .lenserfight/lenserfight.json in cwd

For a guided experience, use lf setup or lf onboard instead.


Config layers

FileScopeContainsSafe to commit?
~/.config/lenserfight/lenserfight.json (Linux)Usermode, Supabase URL, portsNo — stays on your machine
~/.config/lenserfight/config.jsonUserauth tokens, dev tokensNo
.lenserfight/lenserfight.jsonProject (--project only)mode, URL, ports (team override)Yes, if the team agrees

Secrets are never written to lenserfight.json — use environment variables or config.json after lf auth login.


Examples

Local mode

bash
lf init --mode local

Output:

✔ Created user config: /home/you/.config/lenserfight/lenserfight.json (mode: local)
✔ Created /home/you/.config/lenserfight/config.json (tokens stored here after login)
ℹ Anon key : local Supabase defaults (auto)
ℹ URL      : http://127.0.0.1:54321

Cloud mode (default)

bash
lf init --mode cloud --url https://xyzproject.supabase.co

Output:

✔ Created user config: …/lenserfight.json (mode: cloud)
ℹ Anon key : detected in .env/.env.local
ℹ URL      : https://xyzproject.supabase.co

If the anon key is missing:

⚠ Anon key : not found. Set SUPABASE_ANON_KEY in .env.local or your shell environment.

Re-initializing

If user config already exists, lf init warns before overwriting:

⚠ User config already exists (mode: local)
ℹ Overwriting with mode: cloud

Options

FlagTypeDefaultDescription
--modestringcloudEnvironment mode: local or cloud
--urlstringSupabase URL (auto-detected as http://127.0.0.1:54321 for local mode)
--sourcestringautoKey source hint: auto, env, supabase
--projectbooleanfalseWrite .lenserfight/lenserfight.json in the current directory

lf init

Initialize .lenserfight.json. Keys are never stored here — use env vars or ~/.lenserfight/lenserfight.json.

FlagTypeRequiredDescription
--modestringnoEnvironment mode: local or cloud
--urlstringnoSupabase URL (optional — auto-detected for local mode)
--sourcestringnoKey source hint: auto (default), env, supabase