Panniantong/Agent-Reach · error · SystemExit
Missing value for {args.key}
Error message
Missing value for {args.key} What it means
In manual configure mode, after `agent-reach configure <key>` reads a value (positional, --stdin, or hidden prompt), an empty result (empty string, whitespace-only stdin, or immediate Enter at the prompt) prints 'Missing value for <key>' and exits 1. Config is not modified.
Source
Thrown at agent_reach/cli.py:1451
else:
print(f"No cookies found. Make sure you're logged into the platforms in {browser}.")
raise SystemExit(1)
return
# ── Manual configure ──
if not args.key:
print("Usage: agent-reach configure <key> [--stdin]")
print(" Omit the value to enter it through a hidden prompt.")
print(
" or: agent-reach configure --from-browser chrome "
"--platform xueqiu"
)
return
value = _read_configure_value(args)
if not value:
print(f"Missing value for {args.key}")
raise SystemExit(1)
if args.key == "proxy":
# Generic network proxy for restricted environments. Nothing reads
# this key at runtime — agents read it back and export HTTP(S)_PROXY
# before invoking upstream tools (see docs/install.md). The legacy
# bilibili_proxy key is kept in sync for older configs.
config.set("proxy", value)
config.set("bilibili_proxy", value)
print("✅ 代理已保存(供 Agent 在访问 Reddit/Twitter 等需要代理的网络时设置 HTTP_PROXY/HTTPS_PROXY)")
print(" Note: B站走 bili-cli,国内网络无需代理。")
elif args.key == "twitter-cookies":
# Accept two formats:
# 1. auth_token ct0 (two separate values)
# 2. Full cookie header string: "auth_token=xxx; ct0=yyy; ..."
auth_token, ct0 = _parse_twitter_cookie_input(value)
if auth_token and ct0:View on GitHub (pinned to 93ae1d18c3)
Solutions
- Re-run and actually provide the value; for --stdin ensure the source file/pipe is non-empty
- Check the producer in your pipeline: test -s value.txt && agent-reach configure key --stdin < value.txt
- If you meant to clear a key, note empty values are rejected — remove the key from ~/.agent-reach/config.yaml or use a placeholder per platform docs
Example fix
# before: silently proceeds even when the producer wrote nothing
./fetch-token.sh > token.txt
agent-reach configure github-token --stdin < token.txt
# after: fail fast on an empty value file
./fetch-token.sh > token.txt
test -s token.txt || { echo 'token fetch failed' >&2; exit 1; }
agent-reach configure github-token --stdin < token.txt Defensive patterns
Strategy: validation
Validate before calling
import os
def has_configure_value(source: str) -> bool:
if source == "stdin":
return not sys.stdin.isatty() and sys.stdin.read().strip() != ""
return len(source.strip()) > 0
# shell variant: test -s value.txt || echo 'empty value' >&2 Prevention
- Use `test -s file` before redirecting files into --stdin
- Check the exit code of token-producing scripts before piping their output to configure
- Empty input is always rejected; there is deliberately no 'clear key by empty value' path
When it happens
Trigger: Running `agent-reach configure proxy` and just pressing Enter at the hidden prompt; piping an empty file via --stdin (e.g. `: | agent-reach configure key --stdin`); `agent-reach configure key ""` with an empty quoted argument.
Common situations: Automation where the secret-producing step failed and emitted nothing, so the pipe delivers an empty stream; users pressing Enter to 'skip' a prompt; trailing-newline-only files passed via --stdin after rstrip.
Related errors
- Could not read configure value from stdin
- Configure value exceeds the 1 MiB safety limit
- Configure input cancelled
- No cookies found. Make sure you're logged into the platforms
- [X] Could not find auth_token and ct0 in your input.
AI-assisted analysis of Panniantong/Agent-Reach@93ae1d18c3 (2026-08-14).
Data as JSON: /api/errors/ddce668e8b9c133d.
Report an issue: GitHub.