Skip to main content

OceanBase CLI (obcli) — encrypted local DSN, read-only sql without policy.json; DML/DDL when policy.json is present (block_rules); MySQL protocol via pymysql

Project description

oceanbase-cli (obcli)

OceanBase / MySQL protocol CLI (pymysql):

  • Encrypted DSN under ~/.config/obcli/ (or $XDG_CONFIG_HOME/obcli/).
  • obcli sql — read-only without policy.json; with a valid policy.json, DML/DDL follow block_rules (no CLI flag or env to skip policy).
  • Chinese ops guide: docs/operations-guide-zh.md · Policy sample: examples/policy.example.json

Design note (historical): docs/cloud-platform-token-cli-skills-design.md

Agent skill: skills/oceanbase-cli/SKILL.md · Architecture (中文): docs/architecture-components-zh.md

Install

pip install -e ./oceanbase-cli

Dependencies: click, cryptography, pymysql. Optional oceanbase_cli.connection_pool for other tools; obcli uses one connection per command via executor.

Store DSN (stdin)

printf '%s' 'oceanbase://user:pass@host:2881/db' | obcli config set-dsn
obcli config status

Avoid obcli --dsn '...' where argv is visible in ps.

Commands

Command Purpose
obcli config set-dsn / clear-dsn / status Encrypted DSN + paths
obcli rules show / metadata / explain policy.json + policy_governs_writes
obcli sql, status, schema tables Data plane

Publishing to PyPI (maintainers)

Releases are automated from ecology-plugins: workflow publish-oceanbase-cli-pypi.yml (same Twine + token pattern as publish-pyobsql-pypi.yml).

  • Manual run: Actions → Publish OceanBase CLI to PyPIRun workflow (optional version override, Test PyPI toggle).
  • Tag push: push a tag matching release_oceanbase_cli_* after bumping version in pyproject.toml.

Configure repository secrets PYPI_API_TOKEN / TEST_PYPI_API_TOKEN as in the monorepo root README.

Tests

cd oceanbase-cli && pip install -e ".[dev]" && pytest tests/ -v

Debug

OBCLI_AUDIT_LOG / OBCLI_AUDIT_DISABLED — audit JSONL.

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

oceanbase_cli-0.1.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

oceanbase_cli-0.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for oceanbase_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eff664d4b08b059a886a5797d5ffbf9d73b7fd44298979903a894d336ce9318f
MD5 93631222997cc9ee928196a007376111
BLAKE2b-256 91de6447b80e6a52637dcc2aee25e55d5b453c192897e900a087f8f99b5fa0ea

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for oceanbase_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb346839580c8848a41cf0903f36d239ee5aea98205dac81666f0be334af2bfb
MD5 b46badb84575c0e42fe2017f892e57aa
BLAKE2b-256 0abfc5eb8bdb7f117d68e3f6f369a6fbfeb10e9d5b9c2a392de73e52ca1b212f

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