Skip to main content

CLI client for SBM 12.0 JSON API

Project description

sbm-cli

A generic command-line client for the SBM (Serena Business Manager) 12.0 JSON API.

Designed for day-to-day L3 support work and for use as a tool by AI assistants (Claude Code).

Install

# Recommended — isolated environment
uv tool install sbm-cli

# Also works
pip install sbm-cli

Quick start

sbm configure setup  # interactive setup wizard
sbm schema           # verify config and see available transitions
sbm list             # list open tickets
sbm get 02440942     # get ticket details

Configuration

Config is stored at ~/.sbm-cli/config.toml. Run sbm configure setup to create it interactively.

The password is stored in Windows Credential Manager (never in the config file). If you have an existing config with a plaintext password field, it is migrated automatically on the next run.

Use sbm configure transition <name> to add or update a named transition interactively. Manual editing is still needed for teams (transition IDs are instance-specific):

[connection]
host       = "https://sbm.example.com"
username   = "myuser"
verify_ssl = false          # set true for trusted certs

[defaults]
table_id  = 1000
report_id = 2208
list_fields = ["TITLE","STATE","FUNCTIONALITY","URGENCY"]  # optional; blank uses built-in default

[transitions]
assign    = { id = 155, fields = ["OWNER", "3RD_LEVEL_SPECIALIST"] }
close     = { id = 19,  fields = ["RESOLUTION", "ROOT_CAUSE"], pre_transition_id = 148, pre_transition_optional = true }
return-l2 = { id = 88,  fields = ["RETURN_REASON", "RETURN_NOTE"] }
transfer  = { id = 140, fields = ["L3_SPECIALIST_GROUP"] }

[transitions.transfer.field_types]
L3_SPECIALIST_GROUP = "list"

[teams]
my-team = { id = 155, name = "L3 My Team" }

Transition IDs are instance-specific. Find them by inspecting browser developer tools while performing actions in the SBM web UI, or ask your SBM admin.

Commands

Command Description
sbm configure setup Interactive setup wizard
sbm configure transition <name> Add/update a named transition interactively
sbm schema Machine-readable capabilities JSON
sbm list [--report N] [--filter N] List tickets
sbm get <ticket-id> Get ticket by display ID
sbm fields <ticket-id> [--fields F1,F2] List field definitions (dbnames, types, labels)
sbm transition <name> <ticket-id> --field K=V Run named transition
sbm transition run <ticket-id> --id N --field K=V Run raw transition by ID
sbm field-values <field> --table <table-id> Discover valid relational field values
sbm teams List configured teams

Global flags

--pretty / -H   Human-readable output (rich tables)
--config PATH   Override config file location
--quiet         Suppress stderr status messages
--indent        Output formatted JSON with indentation

Output format

All commands output a JSON envelope:

{"ok": true, "command": "get", "data": {...}}
{"ok": false, "command": "transition", "error": {"type": "api_error", "message": "..."}}

Exit codes: 0 success · 1 API error · 2 config/auth error · 3 validation error

Development

git clone https://github.com/xdoko01/sbm-cli
cd sbm-cli
uv sync
uv run sbm configure
uv run pytest
uv run pytest -m integration  # requires live SBM connection

License

MIT

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

sbm_cli-0.2.0.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

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

sbm_cli-0.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file sbm_cli-0.2.0.tar.gz.

File metadata

  • Download URL: sbm_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbm_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab106f867cca0d67c99f3ddb014b6c6a354ed01fee0ecdf2727afa6b3279d11b
MD5 a8fdd28e77c22874c6a73934a47176a0
BLAKE2b-256 88f96105d5da58497d482323d8196b2f20db867f9bdf2fe4cefaa02beab1e8b0

See more details on using hashes here.

File details

Details for the file sbm_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sbm_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sbm_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4cdf4336cc9d26ed9a23a134362036f6f64673e8587ab2fa59b8e2cb542868
MD5 35ff1a679b1047124686f3fb09445290
BLAKE2b-256 509d9165497fd2837b128b7bd67b6b392d0c9a8128025d46aee1cb44ebb635a6

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