Files
wehub-resource-sync 70cb81e982
CI / Test (macos-latest, stable) (push) Waiting to run
CI / Test (ubuntu-latest, stable) (push) Waiting to run
CI / Test (windows-latest, stable) (push) Waiting to run
CI / Lint (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 12:45:24 +08:00

1.9 KiB

Testing Memvid CLI Docker Image

Quick Test

1. Build the Image

cd docker/cli
docker build -t memvid/cli:test .

2. Test Basic Commands

# Test help command
docker run --rm memvid/cli:test --help

# Test version (if available)
docker run --rm memvid/cli:test --version

3. Test with Volume Mount

# Create a test directory
mkdir -p /tmp/memvid-test
cd /tmp/memvid-test

# Create a test document
echo "This is a test document about AI and machine learning." > test.txt

# Create a memory file
docker run --rm \
  -v $(pwd):/data \
  memvid/cli:test create test-memory.mv2

# Add the document
docker run --rm \
  -v $(pwd):/data \
  memvid/cli:test put test-memory.mv2 --input test.txt

# Search the memory
docker run --rm \
  -v $(pwd):/data \
  memvid/cli:test find test-memory.mv2 --query "AI"

# View stats
docker run --rm \
  -v $(pwd):/data \
  memvid/cli:test stats test-memory.mv2

4. Test with API Keys (if needed)

docker run --rm \
  -v $(pwd):/data \
  -e OPENAI_API_KEY="sk-..." \
  memvid/cli:test ask test-memory.mv2 "What is this about?" -m openai

Automated Testing

Run the test script:

cd docker/cli
./test.sh

Multi-Architecture Testing

To test multi-arch builds locally (requires buildx):

# Create builder
docker buildx create --name memvid-builder --use

# Build for specific platform
docker buildx build \
  --platform linux/amd64 \
  --tag memvid/cli:test-amd64 \
  --load \
  .

# Test the amd64 image
docker run --rm memvid/cli:test-amd64 --help

Troubleshooting

Image not found

Make sure you've built the image:

docker build -t memvid/cli:test docker/cli

Permission errors

Ensure Docker has permission to access the mounted directory:

chmod 755 /path/to/your/directory

CLI not found

Verify the npm package exists:

docker run --rm memvid/cli:test which memvid