# `mix demo_director.install`
[🔗](https://github.com/ralmidani/demo_director/blob/v0.1.1/lib/mix/tasks/demo_director.install.ex#L2)

Installs `demo_director` into a Phoenix application.

Run via:

    mix igniter.install demo_director

The task does three things:

  1. Adds `import DemoDirector.Router` and a
     `demo_director "/demo-director"` macro call inside an
     `if Application.compile_env(:my_app, :dev_routes) do ... end`
     block in your router (creating the block if absent). The
     scope is *not* piped through `:browser` because the playback
     POST endpoint must bypass `protect_from_forgery`.
  2. Appends a marked instructions section to `AGENTS.md` (always)
     and to `CLAUDE.md` (only if it already exists, or if a
     `.claude/` directory is present).
  3. Prints a post-install message reminding you of the remaining
     manual steps: adding the playback socket to your endpoint,
     setting the `:pubsub` config, and rendering the overlay
     component in your layout. We don't auto-edit those because
     endpoint and layout structure vary too much across apps.

Sections written to `AGENTS.md` / `CLAUDE.md` are wrapped in
`<!-- BEGIN demo_director -->` / `<!-- END demo_director -->`
markers, so re-running the task replaces the section in place
rather than appending a duplicate.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
