Skip to main content

seekdb-cli

Command-line client for seekdb / OceanBase, built for AI agents. Default JSON output, stateless invocations, and a consistent error format make it easy for agents to run SQL, inspect schema, manage vector collections, and use in-database AI models reliably.

Why seekdb-cli

  • Agent-friendly: Any agent that can run shell commands can use seekdb-cli via the seekdb command (the seekdb-cli command is the same entry point, useful for which seekdb-cli–style checks); output is JSON by default, and the seekdb ai-guide command provides a self-description of seekdb-cli usage for agents.
  • Safety: Row limits, write guards, and masking reduce risk when agents or scripts operate on live data.
  • Unified interface: One CLI for remote and embedded, SQL and vector collections, plus in-database AI, without interactive prompts or session state.

Features

  • JSON by default: All commands emit structured JSON; use --format table|csv|jsonl for human-readable output.
  • Row limits: LIMIT required when result exceeds 100 rows.
  • Write safeguards: Writes require --write; DELETE/UPDATE without WHERE are disallowed.
  • Sensitive-field masking: Columns such as phone, email, password, id_card are auto-masked in query results.
  • Operation history: All commands are logged to ~/.seekdb/sql-history.jsonl; for SQL execution, the SQL text is logged with sensitive literals redacted.
  • Database AI: Manage models and endpoints via DBMS_AI_SERVICE; use AI_COMPLETE for completion.

Requirements

  • Python 3.11+
  • seekdb / OceanBase (or any MySQL-protocol–compatible server)

Installation

pip install seekdb-cli

After installation, the seekdb command is available. The same program is also installed as seekdb-cli (e.g. for tooling that probes the binary name matching the PyPI package).

Connection

Works out of the box — with no configuration, seekdb-cli uses a default embedded database at ~/.seekdb/seekdb.db.

To connect to a remote server or use a different database path, create a global config file:

mkdir -p ~/.seekdb
# Remote
echo 'SEEKDB_DSN="seekdb://user:pass@host:port/database"' > ~/.seekdb/config.env

# Or embedded with a custom path
echo 'SEEKDB_DSN="embedded:/path/to/data"' > ~/.seekdb/config.env

Also supports --dsn CLI flag, SEEKDB_DSN environment variable, and project .env files, in decreasing priority.

TLS (remote DSN only): set it in the URL query string — for example seekdb://user:pass@host:2881/db?tls=skip-verify (encrypted, no cert verification — typical for self-signed) or ?tls=required (encrypted with default CA verification). PEM paths: ssl_ca, ssl_cert, ssl_key. That is enough to define the connection; no separate TLS env vars are required.

Common commands

Command Description
seekdb status Connection status and version
seekdb schema tables List all tables
seekdb schema describe <table> Table structure (columns, types, indexes)
seekdb schema dump Output DDL for all tables (to stdout)
seekdb table profile <table> Table data profile (row count, nulls, distinct, min/max, candidate JOIN keys and time columns)
seekdb sql "<stmt>" Execute SQL (read-only by default; use --write for writes; --with-schema adds table schema; --no-truncate keeps large fields intact)
seekdb relations infer [--table <t>] Infer JOIN relationships between tables
seekdb collection list | create | delete | info Vector collection management
seekdb query <coll> --text "<query>" [--mode semantic|fulltext|hybrid] Search a collection (default: hybrid)
seekdb get <coll> [--ids ...] [--limit n] Get documents by ID or condition
seekdb add <coll> (--file | --stdin | --data) Add data to a collection
seekdb export <coll> --output <path> Export collection data
seekdb ai model list | create | delete AI model management (DBMS_AI_SERVICE)
seekdb ai model endpoint create | delete Create or delete AI model endpoints
seekdb ai complete "<prompt>" --model <name> In-database AI completion (AI_COMPLETE)
seekdb ai-guide Print structured guide for AI agents (JSON)

Option order

--dsn and --format are global options and must appear before the subcommand:

seekdb --format table sql "SELECT * FROM t LIMIT 5"
seekdb --dsn "seekdb://root:@127.0.0.1:2881/test" schema tables

Metadata

Release files for seekdb-cli 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seekdb-cli 0.1.7
File Size Uploaded
seekdb_cli-0.1.7.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for seekdb-cli 0.1.7
File Interpreter ABI Platform
seekdb_cli-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 74.8 kB

Release files / seekdb_cli-0.1.7.tar.gz

Download URL seekdb_cli-0.1.7.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c938cad52d197fdf69f74a697637b3a4f3e048c248df588a42929cff8896f4a
BLAKE2b-256 checksum
How to use checksums
40fe7ad94b21f7db3c6cd9517ee9d896465e2ead81d9ed662d35fdd763fcc1a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / seekdb_cli-0.1.7-py3-none-any.whl

Download URL seekdb_cli-0.1.7-py3-none-any.whl
Size 37.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
973a55d63cdc9ea7aa5dff7921450b93772293ff5280f0074fae0450c919d867
BLAKE2b-256 checksum
How to use checksums
776685475f02960a15d9badad835c0260ba7d2e6ffbc7d0673bd0a8d77f0aab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page