Local Playgrounds Link
[MODE:BROWNFIELD] Tier: brownfield. Idempotent.
Creates symlinks from /opt/fibe/playgrounds/<name>/... (or MARQUEE_ROOT) into link_dir so the Agent container can edit Playground files directly. Wraps fibe local playgrounds link <id-or-name> [--link-dir DIR].
When to use
- After
fibe_greenfield_create(called automatically — manually re-run only when the auto-link failed). - Switching between Playgrounds within one Agent session.
- Recovering after
/app/playgroundsymlinks went stale (Playground recreated, paths changed).
Inputs
| Field | Type | Required | Notes |
|---|---|---|---|
id_or_name | string | no | Local Playground ID, name, compose project, Playspec, or unique Playspec prefix |
link_dir | string | no | Target directory; default /app/playground |
Output
CLI-run envelope. stdout typically lists the created symlinks. The link command also writes canonical state to <link_dir>/.current_playground.json.
Behavior
- Resolves the target Playground locally (discover candidates with
fibe_local_playgrounds_info(view:"names")). - Removes prior symlinks under
link_dirthat pointed to a different Playground. - Creates fresh symlinks for each mount slot — typically the Prop checkout, optional secondary repos, and shared volumes.
- Writes
.current_playground.jsonwith Playground identity, URLs including scheme, mounts, and repo entries. Use it throughfibe_local_playgrounds_info(view:"current"|"repos"|"urls"|"mounts").
Gotchas
- If the Playground was recreated, paths under
/opt/fibe/playgrounds/<name>may have changed; re-link to refresh. link_dirmust be writable by the Agent process —/app/playgroundis the standard mount and works in default Agent images.- Files written through
link_dirland in the real Marquee filesystem and become visible to the Playground's containers immediately (live-reload territory). Load thefibe-live-reloadskill. - Linking a Playground that doesn't exist locally errors; pre-flight with
fibe_local_playgrounds_info(view:"names"). - Multiple repos may be linked. Before git operations, call
fibe_local_playgrounds_info(view:"repos", link_dir:"/app/playground"), choose the intendedrepo_root, then run normal shell git such asgit -C <repo_root> status. Do not use guessed first-repo behavior. - Local development URLs may be HTTP or HTTPS depending on the Marquee/dev configuration. Use
view:"urls"or.current_playground.json; do not rewrite schemes.
Related
fibe_local_playgrounds_info(view:"names")— find target names.fibe_local_playgrounds_info(view:"current")— inspect canonical current Playground state.fibe_local_playgrounds_info(view:"repos")— list linked repos and exact repo roots forgit -C.fibe_local_playgrounds_info(view:"mounts")— confirm source paths.fibe-live-reloadskill — live editing semantics.fibe_greenfield_create— auto-links on success.