logion-cli 0.1.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.
- logion_cli-0.1.0/LICENSE +21 -0
- logion_cli-0.1.0/PKG-INFO +49 -0
- logion_cli-0.1.0/README.md +21 -0
- logion_cli-0.1.0/cli/__init__.py +2 -0
- logion_cli-0.1.0/cli/_config.py +51 -0
- logion_cli-0.1.0/cli/_confirm.py +16 -0
- logion_cli-0.1.0/cli/_context.py +17 -0
- logion_cli-0.1.0/cli/_course_bundle.py +46 -0
- logion_cli-0.1.0/cli/_course_capabilities.py +580 -0
- logion_cli-0.1.0/cli/_credentials.py +104 -0
- logion_cli-0.1.0/cli/_errors.py +82 -0
- logion_cli-0.1.0/cli/_first_run.py +90 -0
- logion_cli-0.1.0/cli/_harness/__init__.py +68 -0
- logion_cli-0.1.0/cli/_harness/base.py +106 -0
- logion_cli-0.1.0/cli/_harness/claude_code.py +168 -0
- logion_cli-0.1.0/cli/_harness/codex.py +79 -0
- logion_cli-0.1.0/cli/_harness/custom.py +55 -0
- logion_cli-0.1.0/cli/_harness/hermes.py +93 -0
- logion_cli-0.1.0/cli/_harness/opencode.py +255 -0
- logion_cli-0.1.0/cli/_local_state.py +1053 -0
- logion_cli-0.1.0/cli/_options.py +36 -0
- logion_cli-0.1.0/cli/_output.py +47 -0
- logion_cli-0.1.0/cli/_parser.py +73 -0
- logion_cli-0.1.0/cli/_recall_calibration.py +90 -0
- logion_cli-0.1.0/cli/_recall_ranker.py +74 -0
- logion_cli-0.1.0/cli/_taxonomy.py +120 -0
- logion_cli-0.1.0/cli/_update_policy.py +152 -0
- logion_cli-0.1.0/cli/_utils.py +16 -0
- logion_cli-0.1.0/cli/_version.py +26 -0
- logion_cli-0.1.0/cli/commands/__init__.py +2 -0
- logion_cli-0.1.0/cli/commands/admin.py +535 -0
- logion_cli-0.1.0/cli/commands/bounties.py +490 -0
- logion_cli-0.1.0/cli/commands/course_reviews/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/course_reviews/_download_handler.py +104 -0
- logion_cli-0.1.0/cli/commands/course_reviews/_render.py +129 -0
- logion_cli-0.1.0/cli/commands/course_reviews/handlers.py +197 -0
- logion_cli-0.1.0/cli/commands/course_reviews/parser.py +93 -0
- logion_cli-0.1.0/cli/commands/courses/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/courses/_capability_render.py +183 -0
- logion_cli-0.1.0/cli/commands/courses/_cmd_help.py +18 -0
- logion_cli-0.1.0/cli/commands/courses/_purchase.py +76 -0
- logion_cli-0.1.0/cli/commands/courses/_review_helpers.py +93 -0
- logion_cli-0.1.0/cli/commands/courses/_taxonomy_data.py +173 -0
- logion_cli-0.1.0/cli/commands/courses/_upload_bundle_validation.py +28 -0
- logion_cli-0.1.0/cli/commands/courses/_uploads_push.py +243 -0
- logion_cli-0.1.0/cli/commands/courses/capabilities.py +250 -0
- logion_cli-0.1.0/cli/commands/courses/capability_frontmatter.py +150 -0
- logion_cli-0.1.0/cli/commands/courses/handlers.py +50 -0
- logion_cli-0.1.0/cli/commands/courses/mutations.py +217 -0
- logion_cli-0.1.0/cli/commands/courses/parser.py +66 -0
- logion_cli-0.1.0/cli/commands/courses/parser_capabilities.py +95 -0
- logion_cli-0.1.0/cli/commands/courses/parser_sections.py +239 -0
- logion_cli-0.1.0/cli/commands/courses/parser_uploads.py +84 -0
- logion_cli-0.1.0/cli/commands/courses/parser_utils.py +65 -0
- logion_cli-0.1.0/cli/commands/courses/publication.py +60 -0
- logion_cli-0.1.0/cli/commands/courses/report_usage.py +131 -0
- logion_cli-0.1.0/cli/commands/courses/reviews.py +237 -0
- logion_cli-0.1.0/cli/commands/courses/taxonomy_handler.py +61 -0
- logion_cli-0.1.0/cli/commands/courses/taxonomy_suggest.py +197 -0
- logion_cli-0.1.0/cli/commands/courses/uploads.py +142 -0
- logion_cli-0.1.0/cli/commands/courses/versions.py +65 -0
- logion_cli-0.1.0/cli/commands/credits/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/credits/_helpers.py +153 -0
- logion_cli-0.1.0/cli/commands/credits/handlers.py +218 -0
- logion_cli-0.1.0/cli/commands/credits/parser.py +115 -0
- logion_cli-0.1.0/cli/commands/docs/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/docs/handlers.py +137 -0
- logion_cli-0.1.0/cli/commands/docs/parser.py +27 -0
- logion_cli-0.1.0/cli/commands/health/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/health/handlers.py +26 -0
- logion_cli-0.1.0/cli/commands/health/parser.py +20 -0
- logion_cli-0.1.0/cli/commands/identity/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/identity/_autopost.py +97 -0
- logion_cli-0.1.0/cli/commands/identity/_closing_copy.py +89 -0
- logion_cli-0.1.0/cli/commands/identity/_companion.py +232 -0
- logion_cli-0.1.0/cli/commands/identity/_companion_source.py +135 -0
- logion_cli-0.1.0/cli/commands/identity/_harness_select.py +85 -0
- logion_cli-0.1.0/cli/commands/identity/_onboarding_helpers.py +168 -0
- logion_cli-0.1.0/cli/commands/identity/handlers.py +173 -0
- logion_cli-0.1.0/cli/commands/identity/onboarding.py +246 -0
- logion_cli-0.1.0/cli/commands/identity/parser.py +72 -0
- logion_cli-0.1.0/cli/commands/listings/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/listings/handlers.py +135 -0
- logion_cli-0.1.0/cli/commands/listings/parser.py +57 -0
- logion_cli-0.1.0/cli/commands/notifications/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/notifications/handlers.py +120 -0
- logion_cli-0.1.0/cli/commands/notifications/parser.py +49 -0
- logion_cli-0.1.0/cli/commands/payments/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/payments/_orders_helpers.py +114 -0
- logion_cli-0.1.0/cli/commands/payments/handlers.py +138 -0
- logion_cli-0.1.0/cli/commands/payments/parser.py +97 -0
- logion_cli-0.1.0/cli/commands/recall/__init__.py +7 -0
- logion_cli-0.1.0/cli/commands/recall/handlers.py +87 -0
- logion_cli-0.1.0/cli/commands/recall/parser.py +70 -0
- logion_cli-0.1.0/cli/commands/referrals/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/referrals/_helpers.py +63 -0
- logion_cli-0.1.0/cli/commands/referrals/handlers.py +100 -0
- logion_cli-0.1.0/cli/commands/referrals/parser.py +65 -0
- logion_cli-0.1.0/cli/commands/reports/__init__.py +6 -0
- logion_cli-0.1.0/cli/commands/reports/handlers.py +57 -0
- logion_cli-0.1.0/cli/commands/reports/parser.py +52 -0
- logion_cli-0.1.0/cli/commands/skills/__init__.py +7 -0
- logion_cli-0.1.0/cli/commands/skills/_agent_symlink.py +161 -0
- logion_cli-0.1.0/cli/commands/skills/_finalize.py +112 -0
- logion_cli-0.1.0/cli/commands/skills/_inspect_handler.py +218 -0
- logion_cli-0.1.0/cli/commands/skills/_install_helpers.py +186 -0
- logion_cli-0.1.0/cli/commands/skills/_query_handlers.py +83 -0
- logion_cli-0.1.0/cli/commands/skills/_search_handler.py +136 -0
- logion_cli-0.1.0/cli/commands/skills/_update_handler.py +110 -0
- logion_cli-0.1.0/cli/commands/skills/_verify_handler.py +109 -0
- logion_cli-0.1.0/cli/commands/skills/handlers.py +202 -0
- logion_cli-0.1.0/cli/commands/skills/parser.py +154 -0
- logion_cli-0.1.0/cli/commands/workspace.py +406 -0
- logion_cli-0.1.0/cli/docs/README.md +5 -0
- logion_cli-0.1.0/cli/docs/__init__.py +1 -0
- logion_cli-0.1.0/cli/docs/bounties-and-referrals.md +18 -0
- logion_cli-0.1.0/cli/docs/concepts.md +47 -0
- logion_cli-0.1.0/cli/docs/creating-courses.md +25 -0
- logion_cli-0.1.0/cli/docs/credits-and-purchases.md +30 -0
- logion_cli-0.1.0/cli/docs/credits-terms.md +23 -0
- logion_cli-0.1.0/cli/docs/getting-started.md +95 -0
- logion_cli-0.1.0/cli/docs/marketplace-loop.md +108 -0
- logion_cli-0.1.0/cli/docs/privacy.md +30 -0
- logion_cli-0.1.0/cli/docs/referral-terms.md +24 -0
- logion_cli-0.1.0/cli/docs/reviews.md +47 -0
- logion_cli-0.1.0/cli/docs/safety.md +28 -0
- logion_cli-0.1.0/cli/docs/terms.md +54 -0
- logion_cli-0.1.0/cli/main.py +84 -0
- logion_cli-0.1.0/cli/templates/__init__.py +2 -0
- logion_cli-0.1.0/cli/templates/course_capabilities.template.yaml +189 -0
- logion_cli-0.1.0/cli/templates/course_license_apache-2.0.template.txt +30 -0
- logion_cli-0.1.0/cli/templates/course_license_logion-standard-course-v1.template.txt +49 -0
- logion_cli-0.1.0/cli/templates/course_license_mit.template.txt +21 -0
- logion_cli-0.1.0/pyproject.toml +162 -0
logion_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nicolas Leal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: logion-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Logion CLI for AI agents and marketplace operators.
|
|
5
|
+
Keywords: logion,marketplace,agent,skill,cli
|
|
6
|
+
Author: Logion contributors
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
+
Requires-Dist: logion-client
|
|
17
|
+
Requires-Dist: pydantic>=2.7,<3.0.0
|
|
18
|
+
Requires-Dist: pyyaml>=6.0,<7.0
|
|
19
|
+
Requires-Dist: rapidfuzz>=3.9,<4.0 ; extra == 'recall'
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Project-URL: Homepage, https://github.com/nicolasmelo1/logion
|
|
22
|
+
Project-URL: Repository, https://github.com/nicolasmelo1/logion
|
|
23
|
+
Project-URL: Issues, https://github.com/nicolasmelo1/logion/issues
|
|
24
|
+
Project-URL: Documentation, https://github.com/nicolasmelo1/logion#readme
|
|
25
|
+
Project-URL: Changelog, https://github.com/nicolasmelo1/logion/releases
|
|
26
|
+
Provides-Extra: recall
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# logion-cli
|
|
30
|
+
|
|
31
|
+
CLI for the Logion marketplace — discover, acquire, install, update,
|
|
32
|
+
and manage AI agent courses and capabilities.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install logion-cli
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
lgn --help
|
|
44
|
+
lgn courses get <COURSE_ID>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# logion-cli
|
|
2
|
+
|
|
3
|
+
CLI for the Logion marketplace — discover, acquire, install, update,
|
|
4
|
+
and manage AI agent courses and capabilities.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install logion-cli
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Quick start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
lgn --help
|
|
16
|
+
lgn courses get <COURSE_ID>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
MIT
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""CLI configuration — env-var resolution and defaults."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
|
|
9
|
+
DEFAULT_BASE_URL = "https://api.logion.sh"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class CliConfig:
|
|
14
|
+
"""Resolved CLI configuration."""
|
|
15
|
+
|
|
16
|
+
api_key: str | None
|
|
17
|
+
base_url: str
|
|
18
|
+
json_output: bool
|
|
19
|
+
timeout: float | None
|
|
20
|
+
max_retries: int | None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def is_truthy(value: str | None) -> bool:
|
|
24
|
+
"""Return True if *value* looks like a truthy env-var string."""
|
|
25
|
+
return value is not None and value.lower() in {"1", "true", "yes", "on"}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def is_admin_enabled() -> bool:
|
|
29
|
+
"""Return True if ``LOGION_ENABLE_ADMIN`` is set to a truthy value."""
|
|
30
|
+
return is_truthy(os.getenv("LOGION_ENABLE_ADMIN"))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def resolve_config_from_args(
|
|
34
|
+
args: object,
|
|
35
|
+
) -> CliConfig:
|
|
36
|
+
"""Build a CliConfig from parsed argparse args + env vars."""
|
|
37
|
+
api_key: str | None = getattr(args, "api_key", None)
|
|
38
|
+
if api_key is None:
|
|
39
|
+
api_key = os.getenv("LOGION_API_KEY")
|
|
40
|
+
|
|
41
|
+
base_url: str | None = getattr(args, "base_url", None)
|
|
42
|
+
if base_url is None:
|
|
43
|
+
base_url = os.getenv("LOGION_BASE_URL", DEFAULT_BASE_URL)
|
|
44
|
+
|
|
45
|
+
return CliConfig(
|
|
46
|
+
api_key=api_key,
|
|
47
|
+
base_url=base_url,
|
|
48
|
+
json_output=getattr(args, "json_output", False),
|
|
49
|
+
timeout=getattr(args, "timeout", None),
|
|
50
|
+
max_retries=getattr(args, "max_retries", None),
|
|
51
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""Confirmation helper — require --yes for destructive actions."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from cli._errors import print_err
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def require_yes(yes: bool, action: str) -> int | None:
|
|
10
|
+
"""Return ``None`` if *yes* is True, otherwise print a refusal and
|
|
11
|
+
return exit code 2.
|
|
12
|
+
"""
|
|
13
|
+
if yes:
|
|
14
|
+
return None
|
|
15
|
+
print_err(f"This is a destructive action. Re-run with --yes to {action}.")
|
|
16
|
+
return 2
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""CLI context — builds a LogionClient from CliConfig."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from cli._config import CliConfig
|
|
7
|
+
from logion import LogionClient
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def make_client(config: CliConfig) -> LogionClient:
|
|
11
|
+
"""Create a LogionClient from resolved CLI configuration."""
|
|
12
|
+
return LogionClient(
|
|
13
|
+
api_key=config.api_key,
|
|
14
|
+
base_url=config.base_url,
|
|
15
|
+
timeout=config.timeout,
|
|
16
|
+
max_retries=config.max_retries,
|
|
17
|
+
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""Validation helpers for publishable course bundles."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
REQUIRED_BUNDLE_FILES = ("SKILL.md", "LICENSE", "course/capabilities.yaml")
|
|
9
|
+
LOGION_STANDARD_COURSE_LICENSE_NAME = "Logion Standard Course License v1.0"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CourseBundleError(ValueError):
|
|
13
|
+
"""Raised when a bundle is missing publish-time metadata."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def read_bundle_license_text(bundle_dir: Path) -> str:
|
|
17
|
+
"""Return the stripped bundle LICENSE text."""
|
|
18
|
+
return (bundle_dir / "LICENSE").read_text(encoding="utf-8").strip()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def is_logion_standard_course_license(license_text: str) -> bool:
|
|
22
|
+
"""Return whether *license_text* is the Logion paid-course license."""
|
|
23
|
+
return LOGION_STANDARD_COURSE_LICENSE_NAME in license_text
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def validate_course_bundle(bundle_dir: Path, *, paid: bool = False) -> None:
|
|
27
|
+
"""Require the bundle files Logion needs before publication/install."""
|
|
28
|
+
missing = [
|
|
29
|
+
name
|
|
30
|
+
for name in REQUIRED_BUNDLE_FILES
|
|
31
|
+
if not (bundle_dir / name).is_file()
|
|
32
|
+
]
|
|
33
|
+
if missing:
|
|
34
|
+
missing_csv = ", ".join(missing)
|
|
35
|
+
raise CourseBundleError(
|
|
36
|
+
"bundle is missing required file(s): "
|
|
37
|
+
f"{missing_csv}. "
|
|
38
|
+
"Every publishable course bundle must ship its own LICENSE file."
|
|
39
|
+
)
|
|
40
|
+
license_text = read_bundle_license_text(bundle_dir)
|
|
41
|
+
if not license_text:
|
|
42
|
+
raise CourseBundleError("LICENSE exists but is empty")
|
|
43
|
+
if paid and not is_logion_standard_course_license(license_text):
|
|
44
|
+
raise CourseBundleError(
|
|
45
|
+
"paid courses must ship the Logion Standard Course License v1.0"
|
|
46
|
+
)
|