Filling Network Config Placeholders
Before first use, collect and store the user's real values (see Workflow step 1). Once stored, whenever output would normally contain a placeholder, substitute the real value automatically without asking again.
Example substitution:
# Before (generic)
ssh <USERNAME>@<TAILNET_HOSTNAME>
# After (filled from stored info)
ssh sam@dev-box.tailnet-abc123.ts.net
Progress:
- Step 1: Build/update the user's info profile
- Step 2: Scan output for placeholder patterns
- Step 3: Match placeholders to stored values
- Step 4: Fill in and flag anything unmatched
- Step 5: Confirm silently (don't re-ask unless value is missing/ambiguous)
Step 1: Build the profile Ask once (or infer from prior conversation) for commonly reused values, such as:
- Tailnet name / MagicDNS domain (e.g.
tailnet-abc123.ts.net) - Device hostnames (laptop, server, NAS, etc.)
- SSH usernames per device
- SSH key paths / port numbers if non-default
- Local IPs or Tailscale IPs per device
- LLM/tool endpoints (Gemini API key location, Grok endpoint, offline LLM host/port)
Store this as a running reference (e.g., a running "Known Values" list in context). Never re-request a value already stored — reuse it every time.
Step 2: Scan for placeholders
Look for bracketed/angle-bracket/uppercase tokens: <HOSTNAME>, YOUR_IP_HERE, {username}, PLACEHOLDER_KEY, etc., in code, commands, configs, or docs being generated.
Step 3: Match to stored values
Map each placeholder to the closest known value by context (e.g., <HOST> in an SSH command → device hostname; <PORT> → stored SSH port if set, else default 22).
Step 4: Fill and flag Replace matched placeholders directly. For any placeholder with no stored match, insert the best guess and mark it clearly:
<UNKNOWN: tailscale_authkey> # please provide, will remember after
Step 5: Persist Any new value the user provides gets added to the profile for future reuse — don't ask for it again.
Example 1: Input: "Give me the SSH command to connect to my NAS over tailnet." Output:
ssh sam@nas.tailnet-abc123.ts.net -p 22
(uses stored username, hostname, tailnet domain, default port — no placeholders shown)
Example 2: Input: "Write a Python script that connects to my offline LLM server." Output:
PythonLLM_HOST = "192.168.1.42" # stored: offline-llm-box LLM_PORT = 11434 # stored default for local LLM server
Example 3:
Input: A new device is mentioned that isn't in the profile yet.
Output: Fills known values, flags the new one: <UNKNOWN: new_device_hostname>, then adds it to the profile once the user supplies it — never asked again afterward.
- Reuse silently — don't narrate "I remembered this for you" every single time; just do it.
- Keep one running "Known Values" list, update it in place rather than duplicating.
- Prefer Tailscale MagicDNS names over raw IPs when both are known (more stable).
- Default to standard ports/paths only when user hasn't specified otherwise.
- When a value could apply to multiple devices (e.g., same username everywhere), apply it broadly unless told otherwise.
- Don't ask the user to re-confirm values already established in the conversation/profile.
- Don't silently invent critical secrets (auth keys, passwords, tokens) — always flag these as unknown rather than guessing.
- Don't overwrite a stored value based on a one-off contradictory mention without confirming it's a permanent update.
- Don't leave generic placeholders in final output when a matching stored value exists.