Skip to main content

ZeroDB Local CLI - Manage local ZeroDB environment and sync with cloud

Project description

ZeroDB Local CLI

Command-line interface for managing ZeroDB Local environment and syncing with ZeroDB Cloud.

Installation

pip install zerodb-cli

Quick Start

1. Start Local Environment

zerodb local up

2. Login to Cloud

zerodb cloud login --email your@email.com

3. Link Project

zerodb cloud link <project-id>

4. Sync Data

# Generate sync plan
zerodb sync plan

# Apply sync (with confirmation)
zerodb sync apply

# Push to cloud (shorthand)
zerodb sync push

# Pull from cloud (shorthand)
zerodb sync pull

Commands

Sync Commands

  • zerodb sync plan - Generate and display sync plan

    • --schema - Show schema diff only
    • --data - Show data diff only
    • --vectors - Show vector diff only
    • --json - Output as JSON
  • zerodb sync apply - Execute sync plan

    • --yes - Skip confirmation
    • --dry-run - Preview without executing
    • --strategy - Conflict resolution strategy (local-wins, cloud-wins, newest-wins, manual)
  • zerodb sync push - Push local changes to cloud

    • --yes - Skip confirmation
    • --force - Force push, overwriting cloud data
  • zerodb sync pull - Pull cloud changes to local

    • --yes - Skip confirmation

Local Environment Commands

  • zerodb local init - Initialize local environment (create data directories)
  • zerodb local up - Start all services (docker-compose up -d)
    • --logs - Show logs instead of detaching
  • zerodb local down - Stop all services
    • --volumes - Also remove volumes
  • zerodb local status - Show service status and health
  • zerodb local logs [service] - View service logs
    • --no-follow - Don't follow logs
  • zerodb local restart [--service NAME] - Restart services
  • zerodb local reset - Reset environment (removes all data)
    • --yes - Skip confirmation prompt

Cloud Commands

  • zerodb cloud login - Login to ZeroDB Cloud
  • zerodb cloud logout - Logout from ZeroDB Cloud
  • zerodb cloud whoami - Show current user
  • zerodb cloud link <project-id> - Link to cloud project
  • zerodb cloud unlink - Unlink current project

Environment Commands

  • zerodb env list - List all environments
  • zerodb env switch <env> - Switch environment
  • zerodb env current - Show current environment

Inspect Commands

  • zerodb inspect schema - Show local schema tree
  • zerodb inspect vectors - Vector namespace summary
  • zerodb inspect events - Event lag and offsets
  • zerodb inspect sync-state - Last sync time and status

Features

Conflict Resolution

When conflicts are detected during sync, you can choose how to resolve them:

  • local-wins - Always use local version
  • cloud-wins - Always use cloud version
  • newest-wins - Use the version with the latest timestamp
  • manual - Interactively choose for each conflict

Example:

zerodb sync apply --strategy=local-wins

Interactive Conflict UI

When using manual conflict resolution, you'll see an interactive prompt:

⚠️  Conflict Detected

Table: users
Row ID: 550e8400-e29b-41d4-a716-446655440000

Local:  {"name": "Alice Smith", "email": "alice@local.com"}
Cloud:  {"name": "Alice Johnson", "email": "alice@cloud.com"}

Choose resolution:
  1) Use local version
  2) Use cloud version
  3) Merge manually
  4) Skip this conflict
>

Progress Indicators

Long-running operations show progress bars:

Syncing push... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

Rollback on Error

If sync fails, all changes are automatically rolled back to prevent partial sync states.

Configuration

Configuration is stored in ~/.zerodb/:

  • config.json - CLI configuration
  • credentials.json - Cloud credentials (JWT tokens)

Documentation

For comprehensive documentation, visit: https://docs.ainative.studio/zerodb-local

Support

License

MIT License - Copyright (c) 2025 AINative Studio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zerodb_cli-1.0.0.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zerodb_cli-1.0.0-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file zerodb_cli-1.0.0.tar.gz.

File metadata

  • Download URL: zerodb_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6891e91fd511f2c3c6b9d45554a25e93230543c97bee99c159084771a09b25f1
MD5 0f9f0987dcc5715bea549c08af6a2872
BLAKE2b-256 be8defbac9d1d4162b4bfb018fdd9ac849654d6ecfbc908b3f6d9daa094b9eae

See more details on using hashes here.

File details

Details for the file zerodb_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: zerodb_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73f195526d3625fce1892b33274be815df161792bc0ec5dc22bfa1df4615da82
MD5 f9c6eb20218bb1905652bf8ea913c235
BLAKE2b-256 6de622b3855c49578b349a4e3a3f632b28080617368e42c4435c11e9c96c559f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page