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.
Files changed (134) hide show
  1. logion_cli-0.1.0/LICENSE +21 -0
  2. logion_cli-0.1.0/PKG-INFO +49 -0
  3. logion_cli-0.1.0/README.md +21 -0
  4. logion_cli-0.1.0/cli/__init__.py +2 -0
  5. logion_cli-0.1.0/cli/_config.py +51 -0
  6. logion_cli-0.1.0/cli/_confirm.py +16 -0
  7. logion_cli-0.1.0/cli/_context.py +17 -0
  8. logion_cli-0.1.0/cli/_course_bundle.py +46 -0
  9. logion_cli-0.1.0/cli/_course_capabilities.py +580 -0
  10. logion_cli-0.1.0/cli/_credentials.py +104 -0
  11. logion_cli-0.1.0/cli/_errors.py +82 -0
  12. logion_cli-0.1.0/cli/_first_run.py +90 -0
  13. logion_cli-0.1.0/cli/_harness/__init__.py +68 -0
  14. logion_cli-0.1.0/cli/_harness/base.py +106 -0
  15. logion_cli-0.1.0/cli/_harness/claude_code.py +168 -0
  16. logion_cli-0.1.0/cli/_harness/codex.py +79 -0
  17. logion_cli-0.1.0/cli/_harness/custom.py +55 -0
  18. logion_cli-0.1.0/cli/_harness/hermes.py +93 -0
  19. logion_cli-0.1.0/cli/_harness/opencode.py +255 -0
  20. logion_cli-0.1.0/cli/_local_state.py +1053 -0
  21. logion_cli-0.1.0/cli/_options.py +36 -0
  22. logion_cli-0.1.0/cli/_output.py +47 -0
  23. logion_cli-0.1.0/cli/_parser.py +73 -0
  24. logion_cli-0.1.0/cli/_recall_calibration.py +90 -0
  25. logion_cli-0.1.0/cli/_recall_ranker.py +74 -0
  26. logion_cli-0.1.0/cli/_taxonomy.py +120 -0
  27. logion_cli-0.1.0/cli/_update_policy.py +152 -0
  28. logion_cli-0.1.0/cli/_utils.py +16 -0
  29. logion_cli-0.1.0/cli/_version.py +26 -0
  30. logion_cli-0.1.0/cli/commands/__init__.py +2 -0
  31. logion_cli-0.1.0/cli/commands/admin.py +535 -0
  32. logion_cli-0.1.0/cli/commands/bounties.py +490 -0
  33. logion_cli-0.1.0/cli/commands/course_reviews/__init__.py +6 -0
  34. logion_cli-0.1.0/cli/commands/course_reviews/_download_handler.py +104 -0
  35. logion_cli-0.1.0/cli/commands/course_reviews/_render.py +129 -0
  36. logion_cli-0.1.0/cli/commands/course_reviews/handlers.py +197 -0
  37. logion_cli-0.1.0/cli/commands/course_reviews/parser.py +93 -0
  38. logion_cli-0.1.0/cli/commands/courses/__init__.py +6 -0
  39. logion_cli-0.1.0/cli/commands/courses/_capability_render.py +183 -0
  40. logion_cli-0.1.0/cli/commands/courses/_cmd_help.py +18 -0
  41. logion_cli-0.1.0/cli/commands/courses/_purchase.py +76 -0
  42. logion_cli-0.1.0/cli/commands/courses/_review_helpers.py +93 -0
  43. logion_cli-0.1.0/cli/commands/courses/_taxonomy_data.py +173 -0
  44. logion_cli-0.1.0/cli/commands/courses/_upload_bundle_validation.py +28 -0
  45. logion_cli-0.1.0/cli/commands/courses/_uploads_push.py +243 -0
  46. logion_cli-0.1.0/cli/commands/courses/capabilities.py +250 -0
  47. logion_cli-0.1.0/cli/commands/courses/capability_frontmatter.py +150 -0
  48. logion_cli-0.1.0/cli/commands/courses/handlers.py +50 -0
  49. logion_cli-0.1.0/cli/commands/courses/mutations.py +217 -0
  50. logion_cli-0.1.0/cli/commands/courses/parser.py +66 -0
  51. logion_cli-0.1.0/cli/commands/courses/parser_capabilities.py +95 -0
  52. logion_cli-0.1.0/cli/commands/courses/parser_sections.py +239 -0
  53. logion_cli-0.1.0/cli/commands/courses/parser_uploads.py +84 -0
  54. logion_cli-0.1.0/cli/commands/courses/parser_utils.py +65 -0
  55. logion_cli-0.1.0/cli/commands/courses/publication.py +60 -0
  56. logion_cli-0.1.0/cli/commands/courses/report_usage.py +131 -0
  57. logion_cli-0.1.0/cli/commands/courses/reviews.py +237 -0
  58. logion_cli-0.1.0/cli/commands/courses/taxonomy_handler.py +61 -0
  59. logion_cli-0.1.0/cli/commands/courses/taxonomy_suggest.py +197 -0
  60. logion_cli-0.1.0/cli/commands/courses/uploads.py +142 -0
  61. logion_cli-0.1.0/cli/commands/courses/versions.py +65 -0
  62. logion_cli-0.1.0/cli/commands/credits/__init__.py +6 -0
  63. logion_cli-0.1.0/cli/commands/credits/_helpers.py +153 -0
  64. logion_cli-0.1.0/cli/commands/credits/handlers.py +218 -0
  65. logion_cli-0.1.0/cli/commands/credits/parser.py +115 -0
  66. logion_cli-0.1.0/cli/commands/docs/__init__.py +6 -0
  67. logion_cli-0.1.0/cli/commands/docs/handlers.py +137 -0
  68. logion_cli-0.1.0/cli/commands/docs/parser.py +27 -0
  69. logion_cli-0.1.0/cli/commands/health/__init__.py +6 -0
  70. logion_cli-0.1.0/cli/commands/health/handlers.py +26 -0
  71. logion_cli-0.1.0/cli/commands/health/parser.py +20 -0
  72. logion_cli-0.1.0/cli/commands/identity/__init__.py +6 -0
  73. logion_cli-0.1.0/cli/commands/identity/_autopost.py +97 -0
  74. logion_cli-0.1.0/cli/commands/identity/_closing_copy.py +89 -0
  75. logion_cli-0.1.0/cli/commands/identity/_companion.py +232 -0
  76. logion_cli-0.1.0/cli/commands/identity/_companion_source.py +135 -0
  77. logion_cli-0.1.0/cli/commands/identity/_harness_select.py +85 -0
  78. logion_cli-0.1.0/cli/commands/identity/_onboarding_helpers.py +168 -0
  79. logion_cli-0.1.0/cli/commands/identity/handlers.py +173 -0
  80. logion_cli-0.1.0/cli/commands/identity/onboarding.py +246 -0
  81. logion_cli-0.1.0/cli/commands/identity/parser.py +72 -0
  82. logion_cli-0.1.0/cli/commands/listings/__init__.py +6 -0
  83. logion_cli-0.1.0/cli/commands/listings/handlers.py +135 -0
  84. logion_cli-0.1.0/cli/commands/listings/parser.py +57 -0
  85. logion_cli-0.1.0/cli/commands/notifications/__init__.py +6 -0
  86. logion_cli-0.1.0/cli/commands/notifications/handlers.py +120 -0
  87. logion_cli-0.1.0/cli/commands/notifications/parser.py +49 -0
  88. logion_cli-0.1.0/cli/commands/payments/__init__.py +6 -0
  89. logion_cli-0.1.0/cli/commands/payments/_orders_helpers.py +114 -0
  90. logion_cli-0.1.0/cli/commands/payments/handlers.py +138 -0
  91. logion_cli-0.1.0/cli/commands/payments/parser.py +97 -0
  92. logion_cli-0.1.0/cli/commands/recall/__init__.py +7 -0
  93. logion_cli-0.1.0/cli/commands/recall/handlers.py +87 -0
  94. logion_cli-0.1.0/cli/commands/recall/parser.py +70 -0
  95. logion_cli-0.1.0/cli/commands/referrals/__init__.py +6 -0
  96. logion_cli-0.1.0/cli/commands/referrals/_helpers.py +63 -0
  97. logion_cli-0.1.0/cli/commands/referrals/handlers.py +100 -0
  98. logion_cli-0.1.0/cli/commands/referrals/parser.py +65 -0
  99. logion_cli-0.1.0/cli/commands/reports/__init__.py +6 -0
  100. logion_cli-0.1.0/cli/commands/reports/handlers.py +57 -0
  101. logion_cli-0.1.0/cli/commands/reports/parser.py +52 -0
  102. logion_cli-0.1.0/cli/commands/skills/__init__.py +7 -0
  103. logion_cli-0.1.0/cli/commands/skills/_agent_symlink.py +161 -0
  104. logion_cli-0.1.0/cli/commands/skills/_finalize.py +112 -0
  105. logion_cli-0.1.0/cli/commands/skills/_inspect_handler.py +218 -0
  106. logion_cli-0.1.0/cli/commands/skills/_install_helpers.py +186 -0
  107. logion_cli-0.1.0/cli/commands/skills/_query_handlers.py +83 -0
  108. logion_cli-0.1.0/cli/commands/skills/_search_handler.py +136 -0
  109. logion_cli-0.1.0/cli/commands/skills/_update_handler.py +110 -0
  110. logion_cli-0.1.0/cli/commands/skills/_verify_handler.py +109 -0
  111. logion_cli-0.1.0/cli/commands/skills/handlers.py +202 -0
  112. logion_cli-0.1.0/cli/commands/skills/parser.py +154 -0
  113. logion_cli-0.1.0/cli/commands/workspace.py +406 -0
  114. logion_cli-0.1.0/cli/docs/README.md +5 -0
  115. logion_cli-0.1.0/cli/docs/__init__.py +1 -0
  116. logion_cli-0.1.0/cli/docs/bounties-and-referrals.md +18 -0
  117. logion_cli-0.1.0/cli/docs/concepts.md +47 -0
  118. logion_cli-0.1.0/cli/docs/creating-courses.md +25 -0
  119. logion_cli-0.1.0/cli/docs/credits-and-purchases.md +30 -0
  120. logion_cli-0.1.0/cli/docs/credits-terms.md +23 -0
  121. logion_cli-0.1.0/cli/docs/getting-started.md +95 -0
  122. logion_cli-0.1.0/cli/docs/marketplace-loop.md +108 -0
  123. logion_cli-0.1.0/cli/docs/privacy.md +30 -0
  124. logion_cli-0.1.0/cli/docs/referral-terms.md +24 -0
  125. logion_cli-0.1.0/cli/docs/reviews.md +47 -0
  126. logion_cli-0.1.0/cli/docs/safety.md +28 -0
  127. logion_cli-0.1.0/cli/docs/terms.md +54 -0
  128. logion_cli-0.1.0/cli/main.py +84 -0
  129. logion_cli-0.1.0/cli/templates/__init__.py +2 -0
  130. logion_cli-0.1.0/cli/templates/course_capabilities.template.yaml +189 -0
  131. logion_cli-0.1.0/cli/templates/course_license_apache-2.0.template.txt +30 -0
  132. logion_cli-0.1.0/cli/templates/course_license_logion-standard-course-v1.template.txt +49 -0
  133. logion_cli-0.1.0/cli/templates/course_license_mit.template.txt +21 -0
  134. logion_cli-0.1.0/pyproject.toml +162 -0
@@ -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,2 @@
1
+ # SPDX-License-Identifier: MIT
2
+ """Logion CLI package."""
@@ -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
+ )