bober-cli 0.2.0__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.
@@ -0,0 +1,39 @@
1
+ node_modules/
2
+ .next/
3
+ tsconfig.tsbuildinfo
4
+ build/
5
+ dist/
6
+ coverage/
7
+ coverage/
8
+ playwright-report/
9
+ test-results/
10
+ .DS_Store
11
+ *.log
12
+ .env*
13
+ !.env.example
14
+ out/
15
+ cli/bober-ops
16
+ cli/bobcli/bobcli
17
+ # local article export artifacts (regenerate via publish CLI)
18
+ articles/**/.export/
19
+ # local bobcli / publish secrets (also ~/.config/*/credentials.env)
20
+ **/credentials.env
21
+
22
+ # local yandex360 mailbox passwords / shared mailbox meta
23
+ .yandex360-*-credentials
24
+ .yandex360-*-shared
25
+
26
+ # Яндекс Услуги (кабинет) — сессия Playwright и sniff API
27
+ .yandex-uslugi-auth.json
28
+ data/uslugi-sniff/
29
+
30
+ # Kwork/browser HAR captures (may contain session cookies)
31
+ *.har
32
+ data/*.har
33
+
34
+ # Kwork→Bitrix local dedup cache (order ids)
35
+ data/.kwork-bitrix-sync-state.json
36
+
37
+ # Telegram Business bot local SQLite (use DATABASE_URL on Railway for durable prod)
38
+ data/telegram-bot.sqlite
39
+ data/telegram-bot.sqlite-*
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.5
2
+ Name: bober-cli
3
+ Version: 0.2.0
4
+ Summary: Bober Systems Yandex ops CLI (Webmaster, Metrika, Direct, Business) — Go TUI, pip launcher
5
+ Project-URL: Homepage, https://www.bober-systems.ru
6
+ Project-URL: Repository, https://github.com/fuwiak/bober-ai
7
+ Project-URL: Documentation, https://github.com/fuwiak/bober-ai/tree/main/cli/bobcli
8
+ Project-URL: Issues, https://github.com/fuwiak/bober-ai/issues
9
+ Author-email: Bober Systems <contact@bober-systems.ru>
10
+ License-Expression: MIT
11
+ Keywords: bobcli,bober,cli,metrika,webmaster,yandex
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: System :: Systems Administration
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+
24
+ # bober-cli (pip)
25
+
26
+ Thin Python launcher for the **bobcli** Go CLI (Bubble Tea TUI).
27
+
28
+ > Разработано **Bober Systems**, бизнес-партнёром Yandex Cloud. Проект развивается независимо и не является официальным продуктом Яндекса.
29
+ >
30
+ > *Developed by Bober Systems, a Yandex Cloud business partner. This project is independently developed and is not an official Yandex product.*
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pip install bober-cli
36
+ # or
37
+ pipx install bober-cli
38
+ ```
39
+
40
+ Команда после установки: **`bobcli`**.
41
+
42
+ Требование: **Go 1.22+** на PATH (бинарь ставится через `go install` при первом запуске).
43
+
44
+ ```bash
45
+ bobcli version
46
+ bobcli webmaster status
47
+ bobcli credentials # masked by default
48
+ ```
49
+
50
+ Переопределить бинарь: `export BOBCLI_BIN=/path/to/bobcli`.
51
+
52
+ Исходники CLI: [`cli/bobcli`](https://github.com/fuwiak/bober-ai/tree/main/cli/bobcli) в репозитории [bober-ai](https://github.com/fuwiak/bober-ai).
@@ -0,0 +1,29 @@
1
+ # bober-cli (pip)
2
+
3
+ Thin Python launcher for the **bobcli** Go CLI (Bubble Tea TUI).
4
+
5
+ > Разработано **Bober Systems**, бизнес-партнёром Yandex Cloud. Проект развивается независимо и не является официальным продуктом Яндекса.
6
+ >
7
+ > *Developed by Bober Systems, a Yandex Cloud business partner. This project is independently developed and is not an official Yandex product.*
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install bober-cli
13
+ # or
14
+ pipx install bober-cli
15
+ ```
16
+
17
+ Команда после установки: **`bobcli`**.
18
+
19
+ Требование: **Go 1.22+** на PATH (бинарь ставится через `go install` при первом запуске).
20
+
21
+ ```bash
22
+ bobcli version
23
+ bobcli webmaster status
24
+ bobcli credentials # masked by default
25
+ ```
26
+
27
+ Переопределить бинарь: `export BOBCLI_BIN=/path/to/bobcli`.
28
+
29
+ Исходники CLI: [`cli/bobcli`](https://github.com/fuwiak/bober-ai/tree/main/cli/bobcli) в репозитории [bober-ai](https://github.com/fuwiak/bober-ai).
@@ -0,0 +1,39 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.25"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "bober-cli"
7
+ version = "0.2.0"
8
+ description = "Bober Systems Yandex ops CLI (Webmaster, Metrika, Direct, Business) — Go TUI, pip launcher"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "Bober Systems", email = "contact@bober-systems.ru" },
14
+ ]
15
+ keywords = ["yandex", "webmaster", "metrika", "bobcli", "bober", "cli"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: MacOS",
22
+ "Operating System :: POSIX :: Linux",
23
+ "Programming Language :: Python :: 3",
24
+ "Topic :: Software Development :: Build Tools",
25
+ "Topic :: System :: Systems Administration",
26
+ ]
27
+ dependencies = []
28
+
29
+ [project.urls]
30
+ Homepage = "https://www.bober-systems.ru"
31
+ Repository = "https://github.com/fuwiak/bober-ai"
32
+ Documentation = "https://github.com/fuwiak/bober-ai/tree/main/cli/bobcli"
33
+ Issues = "https://github.com/fuwiak/bober-ai/issues"
34
+
35
+ [project.scripts]
36
+ bobcli = "bobcli.__main__:main"
37
+
38
+ [tool.hatch.build.targets.wheel]
39
+ packages = ["src/bobcli"]
@@ -0,0 +1,3 @@
1
+ """bobcli — pip launcher for the Go Yandex ops CLI."""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,108 @@
1
+ """Resolve / install the Go bobcli binary and exec it."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import shutil
7
+ import subprocess
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ MODULE = "github.com/fuwiak/bober-ai/cli/bobcli@latest"
12
+
13
+
14
+ def data_bin_dir() -> Path:
15
+ base = os.environ.get("XDG_CACHE_HOME") or os.path.join(Path.home(), ".cache")
16
+ d = Path(base) / "bobcli" / "bin"
17
+ d.mkdir(parents=True, exist_ok=True)
18
+ return d
19
+
20
+
21
+ def cached_binary() -> Path:
22
+ name = "bobcli.exe" if os.name == "nt" else "bobcli"
23
+ return data_bin_dir() / name
24
+
25
+
26
+ def which_go_bobcli() -> Path | None:
27
+ """Find a real Go binary, skipping this pip launcher."""
28
+ launcher = Path(sys.argv[0]).resolve()
29
+ gopath = os.environ.get("GOPATH") or str(Path.home() / "go")
30
+ candidates = [
31
+ os.environ.get("BOBCLI_BIN"),
32
+ str(Path.home() / "bin" / "bobcli"),
33
+ str(Path(gopath) / "bin" / "bobcli"),
34
+ shutil.which("bobcli"),
35
+ ]
36
+ for candidate in candidates:
37
+ if not candidate:
38
+ continue
39
+ p = Path(candidate).expanduser()
40
+ try:
41
+ p = p.resolve()
42
+ except OSError:
43
+ continue
44
+ if not p.is_file() or not os.access(p, os.X_OK):
45
+ continue
46
+ if p == launcher:
47
+ continue
48
+ if p.parent == data_bin_dir():
49
+ return p
50
+ # Prefer Go/Bubble Tea binaries (~MB), skip tiny shell wrappers
51
+ if p.stat().st_size > 500_000:
52
+ return p
53
+ return None
54
+
55
+
56
+ def ensure_binary() -> Path:
57
+ env = os.environ.get("BOBCLI_BIN", "").strip()
58
+ if env:
59
+ p = Path(env).expanduser()
60
+ if p.is_file() and os.access(p, os.X_OK):
61
+ return p
62
+ raise SystemExit(f"BOBCLI_BIN={env} not found or not executable")
63
+
64
+ found = which_go_bobcli()
65
+ if found:
66
+ return found
67
+
68
+ dest = cached_binary()
69
+ if dest.is_file() and os.access(dest, os.X_OK) and dest.stat().st_size > 500_000:
70
+ return dest
71
+
72
+ go = shutil.which("go")
73
+ if not go:
74
+ raise SystemExit(
75
+ "bobcli: Go binary not found and `go` is not on PATH.\n"
76
+ "Install Go 1.22+ (https://go.dev/dl/) then re-run: bobcli version\n"
77
+ "Or build from repo: cd cli/bobcli && go build -o bobcli . "
78
+ "&& export BOBCLI_BIN=$PWD/bobcli"
79
+ )
80
+
81
+ print("bobcli: installing Go CLI via `go install` (first run)…", file=sys.stderr)
82
+ gobin = data_bin_dir()
83
+ run_env = {**os.environ, "GOBIN": str(gobin)}
84
+ try:
85
+ subprocess.check_call([go, "install", MODULE], env=run_env)
86
+ except subprocess.CalledProcessError as exc:
87
+ raise SystemExit(
88
+ "bobcli: `go install` failed. "
89
+ "Check network / module github.com/fuwiak/bober-ai/cli/bobcli"
90
+ ) from exc
91
+
92
+ installed = gobin / ("bobcli.exe" if os.name == "nt" else "bobcli")
93
+ if not installed.is_file():
94
+ raise SystemExit("bobcli: go install finished but binary missing")
95
+ if installed != dest:
96
+ shutil.copy2(installed, dest)
97
+ dest.chmod(dest.stat().st_mode | 0o111)
98
+ return dest
99
+
100
+
101
+ def main(argv: list[str] | None = None) -> None:
102
+ args = list(sys.argv[1:] if argv is None else argv)
103
+ binary = ensure_binary()
104
+ os.execv(str(binary), [str(binary), *args])
105
+
106
+
107
+ if __name__ == "__main__":
108
+ main()