Skip to content

feat: add wrapper script to auto-mount local_folder sources #54

Description

@mrsimpson

Problem

When running the Docker container, every local_folder source in config.yaml must be manually added as a -v flag in the docker run command. The config and the Docker command are two sources of truth that must stay in sync.

Example today:

docker run -i \
  -v ~/project/.knowledge:/knowledge/.knowledge \
  -v ~/project/docs:/knowledge/docs:ro \
  -v ~/project/wiki:/knowledge/wiki:ro \
  agentic-knowledge-mcp

With config.yaml:

docsets:
  - id: docs
    sources:
      - type: local_folder
        paths:
          - ./docs
  - id: wiki
    sources:
      - type: local_folder
        paths:
          - ./wiki

Proposed solution

A wrapper script (e.g., run.sh) that:

  1. Parses config.yaml for local_folder source paths (using js-yaml, already a dependency)
  2. Resolves relative paths against the config directory
  3. Generates the docker run command with -v flags for each path
  4. Mounts .knowledge as writable, all source dirs as read-only
./run.sh                          # runs with all docsets
./run.sh my-docs                  # runs only a specific docset

The script could also:

  • Validate all paths exist before invoking Docker (instant feedback)
  • Accept extra -v flags for anything the config does not cover
  • Accept environment variables for proxy config on corporate networks

Acceptance criteria

  • Script reads config.yaml and extracts all local_folder paths
  • Relative paths are resolved against the config directory
  • Script generates correct docker run with volume mounts
  • All source paths validated before Docker invocation
  • Usage documented in docs/docker.md's open points

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions