xmemcli 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xmemcli-0.0.1/.gitignore +4 -0
- xmemcli-0.0.1/PKG-INFO +22 -0
- xmemcli-0.0.1/README.md +15 -0
- xmemcli-0.0.1/pyproject.toml +21 -0
- xmemcli-0.0.1/uv.lock +8 -0
- xmemcli-0.0.1/xmemcli/__init__.py +3 -0
- xmemcli-0.0.1/xmemcli/_envelope.py +24 -0
- xmemcli-0.0.1/xmemcli/_help.py +720 -0
- xmemcli-0.0.1/xmemcli/_instance_schema.py +769 -0
- xmemcli-0.0.1/xmemcli/_login.py +593 -0
- xmemcli-0.0.1/xmemcli/_org_cluster.py +70 -0
- xmemcli-0.0.1/xmemcli/_output.py +274 -0
- xmemcli-0.0.1/xmemcli/_pretty.py +373 -0
- xmemcli-0.0.1/xmemcli/_rc.py +192 -0
- xmemcli-0.0.1/xmemcli/_version.py +4 -0
- xmemcli-0.0.1/xmemcli/_xmem_bridge.py +33 -0
- xmemcli-0.0.1/xmemcli/cli.py +1826 -0
xmemcli-0.0.1/.gitignore
ADDED
xmemcli-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xmemcli
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: xmemory CLI tool
|
|
5
|
+
Requires-Python: <4,>=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# xmemcli
|
|
9
|
+
|
|
10
|
+
Standalone UV-managed CLI for the xmemory HTTP API (stdlib only). PyPI package
|
|
11
|
+
name: **xmemcli**; console command: ``xmemcli``.
|
|
12
|
+
|
|
13
|
+
This tree is generated by ``scripts/prepare_xmemcli_release.py`` from the
|
|
14
|
+
monorepo ``cli/`` sources. Version: **0.0.1**.
|
|
15
|
+
|
|
16
|
+
## Quick check
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv sync
|
|
20
|
+
uv run xmemcli version
|
|
21
|
+
uv run xmemcli status
|
|
22
|
+
```
|
xmemcli-0.0.1/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# xmemcli
|
|
2
|
+
|
|
3
|
+
Standalone UV-managed CLI for the xmemory HTTP API (stdlib only). PyPI package
|
|
4
|
+
name: **xmemcli**; console command: ``xmemcli``.
|
|
5
|
+
|
|
6
|
+
This tree is generated by ``scripts/prepare_xmemcli_release.py`` from the
|
|
7
|
+
monorepo ``cli/`` sources. Version: **0.0.1**.
|
|
8
|
+
|
|
9
|
+
## Quick check
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv sync
|
|
13
|
+
uv run xmemcli version
|
|
14
|
+
uv run xmemcli status
|
|
15
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "xmemcli"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "xmemory CLI tool"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12,<4"
|
|
7
|
+
dependencies = []
|
|
8
|
+
|
|
9
|
+
[project.scripts]
|
|
10
|
+
xmemcli = "xmemcli.cli:main"
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["hatchling"]
|
|
14
|
+
build-backend = "hatchling.build"
|
|
15
|
+
|
|
16
|
+
[tool.hatch.build.targets.wheel]
|
|
17
|
+
packages = ["xmemcli"]
|
|
18
|
+
|
|
19
|
+
[tool.pytest.ini_options]
|
|
20
|
+
pythonpath = ["."]
|
|
21
|
+
testpaths = ["tests"]
|
xmemcli-0.0.1/uv.lock
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Batch API envelope helpers shared by stdlib-only CLI modules.
|
|
2
|
+
|
|
3
|
+
The HTTP API returns ``{"items": [...], "errors": [...]}`` on success paths too.
|
|
4
|
+
Callers must reject a non-empty ``errors`` array before reading ``items``.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def batch_envelope_error(envelope: Any) -> str | None:
|
|
11
|
+
"""Return the first API error message when the batch ``errors`` array is non-empty."""
|
|
12
|
+
if not isinstance(envelope, dict):
|
|
13
|
+
return "API returned non-object envelope"
|
|
14
|
+
errors = envelope.get("errors")
|
|
15
|
+
if not isinstance(errors, list) or not errors:
|
|
16
|
+
return None
|
|
17
|
+
first = errors[0]
|
|
18
|
+
if not isinstance(first, dict):
|
|
19
|
+
return "API error"
|
|
20
|
+
message = first.get("message")
|
|
21
|
+
if isinstance(message, str) and message:
|
|
22
|
+
return message
|
|
23
|
+
code = first.get("code")
|
|
24
|
+
return str(code) if code else "API error"
|