Skip to content

zilliztech/milvus_cli

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

371 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

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
โ”‚   โ”œโ”€โ”€ BaseClient.py    # Base class for all client modules
โ”‚   โ”œโ”€โ”€ ConnectionClient.py # Milvus connection management
โ”‚   โ”œโ”€โ”€ CollectionClient.py # Collection operations
โ”‚   โ”œโ”€โ”€ DatabaseClient.py   # Database management
โ”‚   โ”œโ”€โ”€ IndexClient.py      # Index management
โ”‚   โ”œโ”€โ”€ PartitionClient.py  # Partition management
โ”‚   โ”œโ”€โ”€ DataClient.py       # Data import/export/search
โ”‚   โ”œโ”€โ”€ RoleClient.py       # Role management
โ”‚   โ”œโ”€โ”€ UserClient.py       # User management
โ”‚   โ”œโ”€โ”€ AliasClient.py      # Alias management
โ”‚   โ”œโ”€โ”€ ResourceGroup.py    # Resource group management
โ”‚   โ”œโ”€โ”€ PrivilegeGroup.py   # Privilege group management
โ”‚   โ”œโ”€โ”€ CliClient.py        # Main CLI client (aggregates all modules)
โ”‚   โ”œโ”€โ”€ OutputFormatter.py  # Output formatting (table/json/csv)
โ”‚   โ”œโ”€โ”€ 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
โ”‚   โ”œโ”€โ”€ init_client_cli.py # CLI initialization and global state
โ”‚   โ”œโ”€โ”€ helper_client_cli.py # REPL loop, command groups, output settings
โ”‚   โ”œโ”€โ”€ helper_cli.py    # Help, version, history commands
โ”‚   โ”œโ”€โ”€ connection_client_cli.py # Connection commands
โ”‚   โ”œโ”€โ”€ collection_client_cli.py # Collection commands
โ”‚   โ”œโ”€โ”€ database_client_cli.py  # Database commands
โ”‚   โ”œโ”€โ”€ index_client_cli.py     # Index commands
โ”‚   โ”œโ”€โ”€ partition_client_cli.py # Partition commands
โ”‚   โ”œโ”€โ”€ data_client_cli.py      # Data commands
โ”‚   โ”œโ”€โ”€ role_client_cli.py      # Role commands
โ”‚   โ”œโ”€โ”€ user_client_cli.py      # User commands
โ”‚   โ”œโ”€โ”€ alias_client_cli.py     # Alias commands
โ”‚   โ”œโ”€โ”€ resource_group_cli.py   # Resource group commands
โ”‚   โ””โ”€โ”€ privilege_group_cli.py  # Privilege group 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






About

Milvus Command Line

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%
โšก