Skip to main content

AI-Agent-friendly database CLI for seekdb / OceanBase

Project description

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; 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 and DROP/TRUNCATE 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.

Connection

Set the DSN via environment variable or global option (global options must appear before the subcommand):

# Remote
export SEEKDB_DSN="seekdb://user:pass@host:port/database"

# Embedded (local directory, no separate server)
export SEEKDB_DSN="embedded:./seekdb.db"
export SEEKDB_DSN="embedded:./data?database=mydb"

# Or pass per invocation
seekdb --dsn "seekdb://root:@127.0.0.1:2881/test" status

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
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

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

seekdb_cli-0.1.0.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

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

seekdb_cli-0.1.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file seekdb_cli-0.1.0.tar.gz.

File metadata

  • Download URL: seekdb_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for seekdb_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b49c22d9edd5730b9ae4a976fd7bc37463ba7cbcb6027e1d4b75037f7982b58
MD5 76ade6784b28508c39cdc699de7490ee
BLAKE2b-256 4bd3921ce02117fb5c3e368b51eeac71eeab3dc695bfe53b6c55400020d33100

See more details on using hashes here.

File details

Details for the file seekdb_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: seekdb_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for seekdb_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b41c362259619bfb26143cb6a99f4bfbe8abf9de6d8190a1abfca35a6b2bdaae
MD5 79a1fd8f03c6e30f3cbfdeceeebad7ec
BLAKE2b-256 b9753a016a309c3a9752550708a1626c87e31600dc83acd55d237bd0e411dbdb

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