Skip to content

Commit 359a6c9

Browse files
argenisleonclaude
andcommitted
docs: update README with --token flag, persistent config, and ~/.funny/.env details
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a8a7fab commit 359a6c9

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ The admin can create additional user accounts from the central server's API.
103103

104104
#### Step 2: Each team member connects
105105

106-
Each team member runs funny locally with the `--team` flag:
106+
Each team member runs funny locally with the `--team` and `--token` flags:
107107

108108
```bash
109-
funny --team http://<central-server-ip>:3002
109+
funny --team http://<central-server-ip>:3002 --token <invite-token>
110+
```
111+
112+
The invite token is generated from the central server's **Settings > Runners** page. Copy the install command and run it — it works on Windows, macOS, and Linux.
113+
114+
On first run, the `--team` and `--token` values are **automatically saved** to `~/.funny/.env`, so subsequent runs only need:
115+
116+
```bash
117+
funny
110118
```
111119

112120
This starts the full funny app locally (UI, git, agents) **and** connects to the central server to:
@@ -147,6 +155,7 @@ Team member A Team member B
147155
| `-h, --host <host>` | Server host | `127.0.0.1` |
148156
| `--auth-mode <mode>` | Authentication mode: `local` or `multi` | `local` |
149157
| `--team <url>` | Connect to a central team server | - |
158+
| `--token <token>` | Runner invite token for team registration | - |
150159
| `--help` | Show help message | - |
151160

152161
**funny-server** (team coordination server)
@@ -157,6 +166,22 @@ Team member A Team member B
157166
| `-h, --host <host>` | Server host | `0.0.0.0` |
158167
| `--help` | Show help message | - |
159168

169+
### Persistent Configuration
170+
171+
When you pass `--team` or `--token` via the CLI, the values are automatically saved to `~/.funny/.env`. On subsequent runs, funny loads this file so you don't need to repeat the flags.
172+
173+
```bash
174+
# First time — pass the full connection info
175+
funny --team http://192.168.1.10:3002 --token utkn_xxx
176+
177+
# Every subsequent run — just this
178+
funny
179+
```
180+
181+
**Precedence order:** CLI flags > shell environment variables > saved `~/.funny/.env`
182+
183+
To change the server, simply pass `--team` again with a new URL — the saved config is updated automatically. The `.env` file is created with restricted permissions (`0600`) since it contains tokens.
184+
160185
### Environment Variables
161186

162187
| Variable | Description | Default | Used by |
@@ -165,6 +190,7 @@ Team member A Team member B
165190
| `HOST` | Server hostname | `127.0.0.1` | both |
166191
| `AUTH_MODE` | Authentication mode (`local`/`multi`) | `local` | funny |
167192
| `TEAM_SERVER_URL` | Central server URL (same as `--team`) | - | funny |
193+
| `RUNNER_INVITE_TOKEN` | Runner invite token (same as `--token`)| - | funny |
168194
| `CORS_ORIGIN` | Custom CORS origins (comma-separated) | Auto-configured | both |
169195
| `FUNNY_CENTRAL_DATA_DIR` | Central server data directory | `~/.funny-central` | funny-server |
170196
| `LOG_LEVEL` | Log level (debug/info/warn/error) | `info` | funny-server |
@@ -276,6 +302,7 @@ bun test
276302

277303
```
278304
~/.funny/
305+
├── .env # Saved CLI config (--team, --token) — auto-generated
279306
├── data.db # SQLite database (projects, threads, messages)
280307
├── auth-token # Bearer token for local auth
281308
├── auth-secret # Session secret (multi-user mode)

0 commit comments

Comments
 (0)