Skip to content

Configurable directory for pasted attachments (instead of <pane cwd>/.herdr-web-ui/) #331

Closed

Description

@hank-warren

Problem

Pasted and attached files are always written to <pane cwd>/.herdr-web-ui/ (server/paste.ts, savePaneImage). There is no setting to change this; the OS temp dir is only used when the pane has no known cwd.

The in-project location makes sense for avoiding agent read-permission prompts, but it means every repository I paste into from the web UI picks up an untracked .herdr-web-ui/ directory containing screenshots. Those then show up in git status, need per-repo or global ignore rules, and accumulate until cleaned up by hand. For some workflows (e.g. infrastructure repos, shared checkouts) I would rather attachments never land in the working tree at all.

Seen on v0.3.41 (plugin install), Linux.

Proposal

Make the paste directory configurable, for example:

  • HERDR_WEB_PASTE_DIR (unset = current behaviour, <pane cwd>/.herdr-web-ui/)
  • When set, write attachments to that directory instead, e.g. HERDR_WEB_PASTE_DIR=/tmp/herdr-web-ui

It would fit alongside the other env vars in the Configuration table in docs/guide.md. Optionally a Settings toggle ("save attachments in the project / in a temp directory"), but an env var alone would cover it.

The change in savePaneImage is small:

const directory = process.env.HERDR_WEB_PASTE_DIR
  ?? join(pane.cwd ?? join(tmpdir(), "herdr-web-ui"), ".herdr-web-ui");

The trade-off (agents may prompt before reading a path outside the project) is then the user's explicit choice.

Where

Chat and prompt cards

Workarounds and alternatives

  • Add .herdr-web-ui/ to a global git ignore file. This hides the files from git but they still accumulate in every project.
  • Patch the installed plugin checkout, which blocks self-updates.
  • Symlink .herdr-web-ui to /tmp in each repo, which is per-repo and leaves an untracked symlink behind.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions