Skip to content

zilliztech/milvus_cli

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Milvus_CLIπŸš€

GitHub release (latest by date including pre-releases) PyPI PyPI - Downloads GitHub release (latest by date including pre-releases) Docker Pulls GitHub repo size PyPI - License

Overview

Milvus Command Line Interface based on Milvus Python SDK.

  • Applicable to most platforms: MS Windows, macOS, Ubuntu

  • Support pip install & offline installation package

  • Support single executable file

  • Milvus Python SDK full function coverage

  • Built-in help function

  • Support auto completion

Project Structure

milvus_cli/
β”œβ”€β”€ Core Modules
β”‚   β”œβ”€β”€ main.py          # Main entry point
β”‚   β”œβ”€β”€ Cli.py           # CLI command interface
β”‚   β”œβ”€β”€ Connection.py    # Milvus connection management
β”‚   β”œβ”€β”€ Collection.py    # Collection operations
β”‚   β”œβ”€β”€ Database.py      # Database management
β”‚   β”œβ”€β”€ Index.py         # Index management
β”‚   β”œβ”€β”€ Partition.py     # Partition management
β”‚   β”œβ”€β”€ Data.py          # Data import/export
β”‚   β”œβ”€β”€ Role.py          # Role management
β”‚   β”œβ”€β”€ User.py          # User management
β”‚   β”œβ”€β”€ Alias.py         # Alias management
β”‚   β”œβ”€β”€ Fs.py            # File system operations
β”‚   β”œβ”€β”€ Types.py         # Data type definitions
β”‚   β”œβ”€β”€ utils.py         # Utility functions
β”‚   └── Validation.py    # Input validation
β”œβ”€β”€ scripts/             # CLI command implementations
β”‚   β”œβ”€β”€ milvus_cli.py    # Main CLI script
β”‚   β”œβ”€β”€ connection_cli.py # Connection-related commands
β”‚   β”œβ”€β”€ collection_cli.py # Collection-related commands
β”‚   β”œβ”€β”€ database_cli.py  # Database-related commands
β”‚   β”œβ”€β”€ index_cli.py     # Index-related commands
β”‚   β”œβ”€β”€ partition_cli.py # Partition-related commands
β”‚   β”œβ”€β”€ data_cli.py      # Data-related commands
β”‚   β”œβ”€β”€ role_cli.py      # Role-related commands
β”‚   β”œβ”€β”€ user_cli.py      # User-related commands
β”‚   β”œβ”€β”€ alias_cli.py     # Alias-related commands
β”‚   └── helper_cli.py    # Helper commands
β”œβ”€β”€ test/                # Unit tests (internal APIs)
β”‚   β”œβ”€β”€ test_config.py
β”‚   β”œβ”€β”€ test_connection_client.py
β”‚   β”œβ”€β”€ test_collection_client.py
β”‚   └── ...
└── tests/               # Integration tests (CLI commands)
    β”œβ”€β”€ conftest.py
    β”œβ”€β”€ test_connection.py
    β”œβ”€β”€ test_collection.py
    └── ...

Core Components

  • Core Modules: Implement the main functionality logic of Milvus CLI, each module handles specific Milvus feature domains
  • scripts/: Contains all CLI command implementations, providing user interaction interfaces
  • milvus_cli/test/: Unit tests for internal Python modules and classes
  • tests/: Integration tests for CLI commands and user interface

Installation methods

πŸ”Install in a Python environment

Prerequisites

Python >= 3.8.5

Install from PyPI (Recommended)

Run pip install pymilvus>=2.5.0 Run pip install milvus-cli==1.0.2

Install from a tarball

  1. Download the latest release of milvus_cli-<version>.tar.gz.
  2. Run pip install milvus_cli-<version>.tar.gz.

Install from source code

  1. Run git clone https://github.com/zilliztech/milvus_cli.git.
  2. Run cd milvus_cli.
  3. Run pip install --editable .

Docker image in docker hub

docker run -it zilliz/milvus_cli:latest

Usage

Run milvus_cli (in a Python environment) or double click milvus_cli-<version>.exe file (in a Windows environment).

Run Milvus_CLI

  • In a Python environment, run milvus_cli.

Document

https://milvus.io/docs/cli_commands.md

Testing

This project has two types of tests:

Integration Tests (CLI Commands)

Test the command-line interface and user experience.

# Run all integration tests
source venv/bin/activate
python run_tests.py --uri http://localhost:19530

# Or use pytest directly
MILVUS_URI=http://localhost:19530 pytest tests/ -v

See TESTING.md for detailed guide.

Unit Tests (Internal APIs)

Test Python modules and classes directly.

# Run all unit tests
python -m unittest discover milvus_cli/test

# Run specific test
python -m unittest milvus_cli.test.test_connection_client

See milvus_cli/test/README.md for configuration details.

Community

πŸ’¬ Community isn’t just about writing code together. Come join the conversation, share your knowledge and get your questions answered on Milvus Slack Channel!

Miluvs Slack Channel



Image
Image Image Image Image Image Image

About

Milvus Command Line

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%