Skip to content

Commit c0bcaf8

Browse files
committed
docs: document explicit web-tools env file
1 parent b4e89f4 commit c0bcaf8

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

skills/web-tools/SKILL.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,20 @@ web-tools setup --check --json
7979

8080
The token is stored in `~/.config/web-tools/.env` with `0600` permissions when
8181
`--set-env` is used. `config.json` stores only `auth_env`, never the token
82-
value. Existing shell environment variables take precedence over the env file.
82+
value. The CLI automatically loads `~/.config/web-tools/.env`. It does not
83+
automatically load a project-local `./.env`.
84+
85+
If a user keeps secrets in another env file, run commands with `WEB_TOOLS_ENV`
86+
pointing at that file:
87+
88+
```bash
89+
WEB_TOOLS_ENV=/path/to/web-tools.env web-tools setup --check --json
90+
WEB_TOOLS_ENV=/path/to/web-tools.env web-tools web-search "Go readability library" --provider bigmodel --json
91+
```
92+
93+
Existing shell environment variables take precedence over env file values.
94+
`WEB_TOOLS_ENV` can override values from `~/.config/web-tools/.env`, but not
95+
values already exported in the shell before `web-tools` starts.
8396

8497
Enable provider auto chains only when the user has accepted any remote provider
8598
privacy and cost implications:
@@ -404,9 +417,16 @@ Environment variables override config file:
404417
- `WEB_READER_TIMEOUT` — Default HTTP timeout
405418
- `WEB_READER_NO_BROWSER` — Disable browser fallback
406419
- `MARKITDOWN_PATH` — Path to markitdown binary
420+
- `WEB_TOOLS_ENV` — Optional env file path to load in addition to `~/.config/web-tools/.env`
407421

408422
These overrides are applied by both `web-tools web-search` and `web-tools web-reader` at runtime.
409423

424+
Env file loading rules:
425+
- Default env file: `~/.config/web-tools/.env`
426+
- Explicit env file: set `WEB_TOOLS_ENV=/path/to/file.env`
427+
- Project-local `./.env` is not loaded automatically
428+
- Shell env values win over both env files
429+
410430
### Optional MCP provider config
411431

412432
The built-in path does not require API keys. Optional remote providers must be
@@ -430,6 +450,10 @@ The CLI loads that file automatically. Existing shell environment variables win
430450
over env file values, so temporary `export ZHIPU_APIKEY=...` still works for
431451
one-off runs.
432452

453+
For non-default env file locations, set `WEB_TOOLS_ENV` on the command. This is
454+
useful for handoffs where the user provides a repo-specific or agent-specific
455+
secret file without moving it into `~/.config/web-tools/.env`.
456+
433457
Then verify:
434458

435459
```bash

0 commit comments

Comments
 (0)