Skip to content

feat(cli): add extra bind mounts for suave docker run - #178

Merged
Rezenders merged 1 commit into
mainfrom
claude/suave-cli-mount-paths-8a9809
Sep 30, 2026
Merged

Rezenders merged 1 commit into
mainfrom
claude/suave-cli-mount-paths-8a9809

Conversation

@Rezenders

Copy link
Copy Markdown
Member

What

Adds user-configurable extra bind mounts to the suave CLI:

suave docker mount add ../my_package        # → <container_workspace>/src/my_package
suave docker mount add ~/data --to /data
suave docker mount remove /data             # by host path or container path
suave docker mount list                     # default + extra mounts (missing sources flagged)
suave docker run --mount HOST[:CONTAINER]   # one-off, added to the saved ones
suave docker run --no-extra-mounts          # skip saved ones for this run

Why

Mounting a package from outside the checkout (e.g. a managing system in the enclosing workspace) previously needed suave docker run -- -v a:b, which wasn't persisted and made the mount-drift check warn on every later run.

How

  • config.py: new kind='list' for KeySpec, new extra_mounts key (stored as a multi-line INI value; newline or comma separated for config set), Settings.get_list(), list rendering in config show. normalize() checks syntax only: HOST:CONTAINER, both absolute.
  • container.py: build_mounts() is split into default_mounts() + extra_mounts(). check_extra_mounts() requires an existing host path (Docker would otherwise create a root-owned folder), and rejects destinations that equal, nest inside, or contain another active mount's destination. It runs only in docker run and mount add.
  • Host paths are stored with Path.resolve() so they compare equal to docker inspect's mount sources, which keeps the existing drift warning accurate.
  • mount add/remove print a --recreate hint when the container already exists. mount remove tolerates a malformed config so a bad entry can be removed.

Reviewer notes

  • Filesystem checks are deliberately kept out of config normalization, so deleting a mounted folder doesn't break suave build, config show, etc. A test covers this.
  • There's no read-only (:ro) support and no env var. Both were left out to keep scope small.
  • Docs: suave_cli/README.md, docs/source/cli.md, CLAUDE.md, AGENTS.md, CLI help epilogs.

Testing

  • suave self-test: 149 passed, flake8/pep257 clean. New tests cover list normalization, the INI round trip, build/validation of mounts, and the full mount add/list/remove flow through main.main.
  • Checked by hand in a scratch checkout with --dry-run docker run. I haven't tried a real docker run with an extra mount.

🤖 Generated with Claude Code

Add an extra_mounts list setting and `suave docker mount add|remove|list`
so packages outside the checkout (e.g. a managing system under the
workspace src/) can be mounted into the SUAVE container by default.
`suave docker run --mount` adds a one-off mount and `--no-extra-mounts`
skips the saved ones.

Config normalization only checks entry syntax; host existence and
destination overlap are checked in `docker run` and `mount add`, so a
deleted mount source does not break unrelated commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rezenders
Rezenders merged commit 842c311 into main Sep 30, 2026
2 checks passed
@Rezenders
Rezenders deleted the claude/suave-cli-mount-paths-8a9809 branch September 30, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant