Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CountCmd = &cobra.Command{ Use: "count COLLECTION_NAME [COLLECTION_NAME...]", Aliases: []string{"C"}, Short: "Count documents in one or more collections", Long: `Count the number of documents in one or more collections. This command returns the total number of documents in the specified collection(s). You can specify multiple collections to get counts for each one. Examples: weave docs C MyCollection weave docs C RagMeDocs RagMeImages weave docs C Collection1 Collection2 Collection3`, Args: cobra.MinimumNArgs(1), Run: runDocumentCount, }
CountCmd represents the document count command
View Source
var CreateCmd = &cobra.Command{ Use: "create COLLECTION_NAME FILE_PATH", Aliases: []string{"c"}, Short: "Create a document from a file", Long: `Create a document in a collection from a file. Supported file types: - Text files (.txt, .md, .json, etc.) - Content goes to 'text' field - Image files (.jpg, .jpeg, .png, .gif, etc.) - Base64 data goes to 'image_data' field - PDF files (.pdf) - Text extracted and chunked, images extracted separately The command will automatically: - Detect file type and process accordingly - Generate appropriate metadata - Chunk text content (default 1000 chars, configurable with --chunk-size) - Extract images from PDFs with OCR and EXIF data - Create documents following RagMeDocs/RagMeImages schema For PDF files with images: - Text chunks go to the main collection - Extracted images go to a separate collection (use --image-collection) - Images include OCR text, EXIF data, and captions when available Examples: weave docs create MyCollection document.txt weave docs create MyCollection image.jpg weave docs create MyCollection document.pdf --chunk-size 500 weave docs create WeaveDocs document.pdf --image-collection WeaveImages weave docs create WeaveDocs document.pdf --image-col RagMeImages`, Args: cobra.ExactArgs(2), Run: runDocumentCreate, }
CreateCmd represents the document create command
View Source
var DeleteAllCmd = &cobra.Command{ Use: "delete-all COLLECTION_NAME", Aliases: []string{"del-all", "da"}, Short: "Delete all documents in a collection", Long: `Delete all documents from a specific collection. ⚠️ WARNING: This is a destructive operation that will permanently delete ALL documents in the specified collection. Use with caution! This command requires double confirmation: 1. First confirmation: Standard y/N prompt 2. Second confirmation: Red warning requiring exact "yes" input Use --force to skip confirmations in scripts. Example: weave document delete-all MyCollection`, Args: cobra.ExactArgs(1), Run: runDocumentDeleteAll, }
DeleteAllCmd represents the document delete-all command
View Source
var DeleteCmd = &cobra.Command{ Use: "delete COLLECTION_NAME [DOCUMENT_ID] [DOCUMENT_ID...]", Aliases: []string{"del", "d"}, Short: "Delete documents from a collection", Long: `Delete documents from a collection. You can delete documents in six ways: 1. By single document ID: weave doc delete COLLECTION_NAME DOCUMENT_ID 2. By multiple document IDs: weave doc delete COLLECTION_NAME DOC_ID1 DOC_ID2 DOC_ID3 3. By metadata filter: weave doc delete COLLECTION_NAME --metadata key=value 4. By filename/name: weave doc delete COLLECTION_NAME --name filename.pdf (or use --filename as an alias) 5. By original filename (virtual): weave doc delete COLLECTION_NAME ORIGINAL_FILENAME --virtual 6. By pattern: weave doc delete COLLECTION_NAME --pattern "tmp*.png" Pattern types (auto-detected): - Shell glob: tmp*.png, tmp?.png, tmp[0-9].png - Regex: tmp.*\.png, ^tmp.*\.png$, .*\.(png|jpg)$ When using --virtual flag, all chunks and images associated with the original filename will be deleted in one operation. Examples: weave docs delete MyCollection doc123 weave docs d MyCollection doc123 doc456 doc789 weave docs delete MyCollection --metadata filename=test.pdf weave docs delete MyCollection --name test_image.png weave docs delete MyCollection --filename test_image.png weave docs delete MyCollection test.pdf --virtual weave docs delete MyCollection --pattern "tmp*.png" weave docs delete MyCollection --pattern "tmp.*\.png" ⚠️ WARNING: This is a destructive operation that will permanently delete the specified documents. Use with caution!`, Args: cobra.MinimumNArgs(1), Run: runDocumentDelete, }
DeleteCmd represents the document delete command
View Source
var DocumentCmd = &cobra.Command{ Use: "document", Aliases: []string{"doc", "docs"}, Short: "Document management", Long: `Manage documents in vector database collections. This command provides subcommands to list, show, and delete documents.`, }
DocumentCmd represents the document command
View Source
var ListCmd = &cobra.Command{ Use: "list COLLECTION_NAME", Aliases: []string{"ls", "l"}, Short: "List documents in a collection", Long: `List documents in a specific collection. This command shows: - Document IDs - Content previews (truncated) - Metadata information - Document counts`, Args: cobra.ExactArgs(1), Run: runDocumentList, }
ListCmd represents the document list command
View Source
var ShowCmd = &cobra.Command{ Use: "show COLLECTION_NAME [DOCUMENT_ID]", Aliases: []string{"s"}, Short: "Show documents from a collection", Long: `Show detailed information about documents from a collection. You can show documents in three ways: 1. By document ID: weave doc show COLLECTION_NAME DOCUMENT_ID 2. By metadata filter: weave doc show COLLECTION_NAME --metadata key=value 3. By filename/name: weave doc show COLLECTION_NAME --name filename.pdf (or use --filename as an alias) This command displays: - Full document content - Complete metadata - Document ID and collection information Use --schema to show the document schema including metadata structure. Use --expand-metadata to show expanded metadata information.`, Args: cobra.RangeArgs(1, 2), Run: runDocumentShow, }
ShowCmd represents the document show command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.