Metadata-Version: 2.4
Name: zilliz-cli
Version: 0.1.0
Summary: CLI for Zilliz Cloud resource management and Milvus operations
Project-URL: Homepage, https://zilliz.com
Project-URL: Documentation, https://docs.zilliz.com
Author-email: Zilliz <support@zilliz.com>
License-Expression: Apache-2.0
Keywords: cli,milvus,vector-database,zilliz
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: questionary>=2.0.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# Zilliz CLI

Command-line tool for Zilliz Cloud cluster management and Milvus vector database operations.

## Requirements

- Python 3.10+

## Installation

```bash
pip install -e .
```

For development:

```bash
pip install -e ".[dev]"
```

## Quick Start

```bash
# 1. Configure API Key
zilliz configure
# or
export ZILLIZ_API_KEY=your-api-key

# 2. List clusters
zilliz cluster list

# 3. Set cluster context (auto-resolves endpoint)
zilliz context set --cluster-id in01-xxxx

# 4. Work with collections and vectors
zilliz collection list
zilliz vector search --collection my_col --data '[[0.1, 0.2, 0.3]]' --limit 5
```

## Commands

### Configuration

```bash
# Interactive setup
zilliz configure

# Set individual values
zilliz configure set api_key YOUR_KEY
zilliz configure set output json

# View values
zilliz configure get api_key
zilliz configure list
```

### Context

```bash
# Set cluster context (endpoint auto-resolved)
zilliz context set --cluster-id in01-xxxx

# Set with specific database
zilliz context set --cluster-id in01-xxxx --database mydb

# Change database only
zilliz context set --database another_db

# Manual endpoint override
zilliz context set --cluster-id in01-xxxx --endpoint https://custom.endpoint.com

# View current context
zilliz context current
```

### Cluster Management

```bash
# List all clusters
zilliz cluster list
zilliz cluster list --output json

# Describe a cluster
zilliz cluster describe --cluster-id in01-xxxx

# Create a serverless cluster
zilliz cluster create --name my-cluster --project-id p1 --region gcp-us-west1

# Delete a cluster
zilliz cluster delete --cluster-id in01-xxxx
```

### Collection Operations

Requires a context to be set first (`zilliz context set --cluster-id ...`).

```bash
# List collections
zilliz collection list

# Describe a collection
zilliz collection describe --name my_collection

# Quick Setup: create with dimension and metric type
zilliz collection create --name my_collection --dimension 768 --metric-type COSINE

# Custom Setup: create with full JSON schema
zilliz collection create --body '{"collectionName": "my_col", "schema": {...}}'
zilliz collection create --body file://schema.json
```

### Vector Operations

Requires a context to be set first (`zilliz context set --cluster-id ...`).

```bash
# Vector search
zilliz vector search --collection my_col --data '[[0.1, 0.2, 0.3]]' --limit 10
zilliz vector search --collection my_col --data '[[0.1, 0.2, 0.3]]' --filter "age > 20" --output-fields '["name", "age"]'

# Query by filter
zilliz vector query --collection my_col --filter "id in [1, 2, 3]" --limit 10
zilliz vector query --collection my_col --filter "age > 20" --output-fields '["name", "age"]'

# Insert data
zilliz vector insert --collection my_col --data '[{"id": 1, "vector": [0.1, 0.2], "name": "doc1"}]'
```

### Version

```bash
zilliz version
zilliz version --output json
```

## Global Options

| Option | Description |
|--------|-------------|
| `--output`, `-o` | Output format: `json`, `table`, `text` |
| `--api-key` | API key (overrides config file and env var) |
| `--help` | Show help |

## Configuration

### Credential Resolution

API Key is resolved in order (first found wins):
1. `--api-key` CLI flag
2. `ZILLIZ_API_KEY` environment variable
3. `~/.zilliz/credentials` file

### Config Files

```
~/.zilliz/
  credentials     # API key
  config          # CLI settings + cluster context
```

## Output Formats

```bash
# Table (default, human-friendly)
zilliz cluster list

# JSON (machine/agent-friendly)
zilliz cluster list --output json

# Plain text
zilliz cluster list --output text
```

## Testing

```bash
# Run unit tests
pytest tests/unit/

# Run all tests (E2E tests skipped without API key)
pytest

# Run E2E tests (requires real API key)
ZILLIZ_API_KEY=your-key pytest -m e2e

# Run E2E tests with data plane (requires cluster)
ZILLIZ_API_KEY=your-key ZILLIZ_CLUSTER_ID=in01-xxxx pytest -m e2e
```

## License

Apache-2.0
