naas-abi-cli 1.8.0__py3-none-any.whl
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.
- naas_abi_cli/__init__.py +0 -0
- naas_abi_cli/cli/__init__.py +65 -0
- naas_abi_cli/cli/agent.py +30 -0
- naas_abi_cli/cli/chat.py +29 -0
- naas_abi_cli/cli/config.py +49 -0
- naas_abi_cli/cli/deploy.py +212 -0
- naas_abi_cli/cli/init.py +13 -0
- naas_abi_cli/cli/module.py +28 -0
- naas_abi_cli/cli/new/__init__.py +4 -0
- naas_abi_cli/cli/new/module.py +55 -0
- naas_abi_cli/cli/new/new.py +6 -0
- naas_abi_cli/cli/new/project.py +63 -0
- naas_abi_cli/cli/new/templates/module/__init__.py +31 -0
- naas_abi_cli/cli/new/templates/module/agents/README.md +0 -0
- naas_abi_cli/cli/new/templates/module/agents/{{module_name_pascal}}Agent.py +52 -0
- naas_abi_cli/cli/new/templates/module/orchestrations/README.md +0 -0
- naas_abi_cli/cli/new/templates/module/pipelines/README.md +0 -0
- naas_abi_cli/cli/new/templates/module/workflows/README.md +0 -0
- naas_abi_cli/cli/new/templates/project/.github/workflows/release.yaml +31 -0
- naas_abi_cli/cli/new/templates/project/.gitignore +3 -0
- naas_abi_cli/cli/new/templates/project/Dockerfile +11 -0
- naas_abi_cli/cli/new/templates/project/README.md +0 -0
- naas_abi_cli/cli/new/templates/project/config.prod.yaml +70 -0
- naas_abi_cli/cli/new/templates/project/config.yaml +62 -0
- naas_abi_cli/cli/new/templates/project/pyproject.toml +21 -0
- naas_abi_cli/cli/run.py +18 -0
- naas_abi_cli/cli/secret.py +79 -0
- naas_abi_cli/cli/utils/Copier.py +84 -0
- naas_abi_cli-1.8.0.dist-info/METADATA +243 -0
- naas_abi_cli-1.8.0.dist-info/RECORD +32 -0
- naas_abi_cli-1.8.0.dist-info/WHEEL +4 -0
- naas_abi_cli-1.8.0.dist-info/entry_points.txt +2 -0
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
deploy:
|
|
2
|
+
workspace_id: "{{ naas_workspace_id }}"
|
|
3
|
+
space_name: "{{ project_name_snake }}-abi-api"
|
|
4
|
+
{% raw %}
|
|
5
|
+
naas_api_key: "{{ secret.NAAS_API_KEY }}"
|
|
6
|
+
env:
|
|
7
|
+
ENV: "prod"
|
|
8
|
+
NAAS_API_KEY: "{{ secret.NAAS_API_KEY }}"
|
|
9
|
+
OPENAI_API_KEY: "{{ secret.OPENAI_API_KEY }}"
|
|
10
|
+
ABI_API_KEY: "{{ secret.ABI_API_KEY }}"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
auto_publish:
|
|
14
|
+
enabled: true # Enable automatic publishing of agents to workspace
|
|
15
|
+
exclude_agents: [] # Agents to exclude from auto-publishing (empty list means publish all enabled agents)
|
|
16
|
+
default_agent: "Abi" # Which agent to set as default in workspace
|
|
17
|
+
|
|
18
|
+
api:
|
|
19
|
+
title: "ABI API"
|
|
20
|
+
description: "API for ABI, your Artifical Business Intelligence"
|
|
21
|
+
logo_path: "assets/logo.png"
|
|
22
|
+
favicon_path: "assets/favicon.ico"
|
|
23
|
+
cors_origins:
|
|
24
|
+
- "http://localhost:9879"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
global_config:
|
|
28
|
+
ai_mode: "cloud"
|
|
29
|
+
|
|
30
|
+
modules:
|
|
31
|
+
- module: naas_abi
|
|
32
|
+
enabled: true
|
|
33
|
+
- module: naas_abi_marketplace.ai.chatgpt
|
|
34
|
+
enabled: true
|
|
35
|
+
config:
|
|
36
|
+
openai_api_key: "{{ secret.OPENAI_API_KEY }}"
|
|
37
|
+
{% endraw %}
|
|
38
|
+
- module: {{ project_name_snake }}
|
|
39
|
+
enabled: true
|
|
40
|
+
|
|
41
|
+
# Comment default_agent to talk to naas_abi AbiAgent by default
|
|
42
|
+
default_agent: "{{ project_name_snake }} {{project_name_pascal}}Agent"
|
|
43
|
+
|
|
44
|
+
{% raw %}
|
|
45
|
+
services:
|
|
46
|
+
secret:
|
|
47
|
+
secret_adapters:
|
|
48
|
+
- adapter: "naas"
|
|
49
|
+
config:
|
|
50
|
+
naas_api_key: "{{ secret.NAAS_API_KEY }}"
|
|
51
|
+
naas_api_url: "https://api.naas.ai"
|
|
52
|
+
object_storage:
|
|
53
|
+
object_storage_adapter:
|
|
54
|
+
adapter: "naas"
|
|
55
|
+
config:
|
|
56
|
+
naas_api_key: "{{ secret.NAAS_API_KEY }}"
|
|
57
|
+
workspace_id: "{{ secret.NAAS_WORKSPACE_ID }}"
|
|
58
|
+
storage_name: "{{ secret.NAAS_STORAGE_NAME }}"
|
|
59
|
+
base_prefix: "datastore"
|
|
60
|
+
triple_store:
|
|
61
|
+
triple_store_adapter:
|
|
62
|
+
adapter: "fs"
|
|
63
|
+
config:
|
|
64
|
+
store_path: "storage/triplestore"
|
|
65
|
+
vector_store:
|
|
66
|
+
vector_store_adapter:
|
|
67
|
+
adapter: "qdrant"
|
|
68
|
+
config: {}
|
|
69
|
+
|
|
70
|
+
{% endraw %}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
deploy:
|
|
2
|
+
workspace_id: "{{ naas_workspace_id }}"
|
|
3
|
+
space_name: "{{ project_name_snake }}-abi-api"
|
|
4
|
+
{% raw %}
|
|
5
|
+
naas_api_key: "{{ secret.NAAS_API_KEY }}"
|
|
6
|
+
env:
|
|
7
|
+
NAAS_API_KEY: "{{ secret.NAAS_API_KEY }}"
|
|
8
|
+
OPENAI_API_KEY: "{{ secret.OPENAI_API_KEY }}"
|
|
9
|
+
ABI_API_KEY: "{{ secret.ABI_API_KEY }}"
|
|
10
|
+
|
|
11
|
+
auto_publish:
|
|
12
|
+
enabled: true # Enable automatic publishing of agents to workspace
|
|
13
|
+
exclude_agents: [] # Agents to exclude from auto-publishing (empty list means publish all enabled agents)
|
|
14
|
+
default_agent: "Abi" # Which agent to set as default in workspace
|
|
15
|
+
|
|
16
|
+
api:
|
|
17
|
+
title: "ABI API"
|
|
18
|
+
description: "API for ABI, your Artifical Business Intelligence"
|
|
19
|
+
logo_path: "assets/logo.png"
|
|
20
|
+
favicon_path: "assets/favicon.ico"
|
|
21
|
+
cors_origins:
|
|
22
|
+
- "http://localhost:9879"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
global_config:
|
|
26
|
+
ai_mode: "cloud"
|
|
27
|
+
|
|
28
|
+
modules:
|
|
29
|
+
- module: naas_abi
|
|
30
|
+
enabled: true
|
|
31
|
+
- module: naas_abi_marketplace.ai.chatgpt
|
|
32
|
+
enabled: true
|
|
33
|
+
config:
|
|
34
|
+
openai_api_key: "{{ secret.OPENAI_API_KEY }}"
|
|
35
|
+
{% endraw %}
|
|
36
|
+
- module: {{ project_name_snake }}
|
|
37
|
+
enabled: true
|
|
38
|
+
|
|
39
|
+
# Comment default_agent to talk to naas_abi AbiAgent by default
|
|
40
|
+
default_agent: "{{ project_name_snake }} {{project_name_pascal}}Agent"
|
|
41
|
+
|
|
42
|
+
{% raw %}
|
|
43
|
+
services:
|
|
44
|
+
secret:
|
|
45
|
+
secret_adapters:
|
|
46
|
+
- adapter: "dotenv"
|
|
47
|
+
config: {}
|
|
48
|
+
object_storage:
|
|
49
|
+
object_storage_adapter:
|
|
50
|
+
adapter: "fs"
|
|
51
|
+
config:
|
|
52
|
+
base_path: "storage/datastore"
|
|
53
|
+
triple_store:
|
|
54
|
+
triple_store_adapter:
|
|
55
|
+
adapter: "fs"
|
|
56
|
+
config:
|
|
57
|
+
store_path: "storage/triplestore"
|
|
58
|
+
vector_store:
|
|
59
|
+
vector_store_adapter:
|
|
60
|
+
adapter: "qdrant"
|
|
61
|
+
config: {}
|
|
62
|
+
{% endraw %}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "{{ project_name }}"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = [
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
[build-system]
|
|
11
|
+
requires = ["setuptools"]
|
|
12
|
+
build-backend = "setuptools.build_meta"
|
|
13
|
+
|
|
14
|
+
[tool.setuptools.packages.find]
|
|
15
|
+
where = ["src"]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [tool.uv.sources]
|
|
19
|
+
# naas-abi = { path = ".abi/libs/naas-abi", editable = true }
|
|
20
|
+
# naas-abi-core = { path = ".abi/libs/naas-abi-core", editable = true }
|
|
21
|
+
# naas-abi-marketplace = { path = ".abi/libs/naas-abi-marketplace", editable = true }
|
naas_abi_cli/cli/run.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import click
|
|
2
|
+
from naas_abi_core.engine.Engine import Engine
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@click.group("run")
|
|
6
|
+
def run():
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@run.command("script")
|
|
11
|
+
@click.argument("path", type=str, required=True)
|
|
12
|
+
def run_script(path: str):
|
|
13
|
+
engine = Engine()
|
|
14
|
+
engine.load()
|
|
15
|
+
|
|
16
|
+
import runpy
|
|
17
|
+
|
|
18
|
+
runpy.run_path(path, run_name="__main__")
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@click.group("secrets")
|
|
7
|
+
def secrets():
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@secrets.group("naas")
|
|
12
|
+
def naas():
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@naas.command("push-env-as-base64")
|
|
17
|
+
@click.option(
|
|
18
|
+
"--naas-api-key", type=str, required=True, default=os.getenv("NAAS_API_KEY")
|
|
19
|
+
)
|
|
20
|
+
@click.option("--naas-api-url", type=str, required=True, default="https://api.naas.ai")
|
|
21
|
+
@click.option("--naas-secret-name", type=str, required=True, default="abi_secrets")
|
|
22
|
+
@click.option("--env-file", type=str, required=True, default=".env.prod")
|
|
23
|
+
def push_env_to_naas(naas_api_key, naas_api_url, naas_secret_name, env_file):
|
|
24
|
+
import base64
|
|
25
|
+
|
|
26
|
+
from naas_abi_core.services.secret.adaptors.secondary.NaasSecret import NaasSecret
|
|
27
|
+
|
|
28
|
+
naas_secret = NaasSecret(naas_api_key, naas_api_url)
|
|
29
|
+
|
|
30
|
+
envfile_content = ""
|
|
31
|
+
|
|
32
|
+
with open(env_file, "r") as envfile:
|
|
33
|
+
envfile_content = envfile.read()
|
|
34
|
+
|
|
35
|
+
print(envfile_content)
|
|
36
|
+
|
|
37
|
+
base64_content = base64.b64encode(envfile_content.encode("utf-8")).decode("utf-8")
|
|
38
|
+
naas_secret.set(naas_secret_name, base64_content)
|
|
39
|
+
|
|
40
|
+
print(f"Pushed {env_file} to Naas as base64 secret {naas_secret_name}")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@naas.command("list")
|
|
44
|
+
@click.option(
|
|
45
|
+
"--naas-api-key", type=str, required=True, default=os.getenv("NAAS_API_KEY")
|
|
46
|
+
)
|
|
47
|
+
@click.option("--naas-api-url", type=str, required=True, default="https://api.naas.ai")
|
|
48
|
+
def list_secrets(naas_api_key, naas_api_url):
|
|
49
|
+
from naas_abi_core.services.secret.adaptors.secondary.NaasSecret import NaasSecret
|
|
50
|
+
|
|
51
|
+
naas_secret = NaasSecret(naas_api_key, naas_api_url)
|
|
52
|
+
|
|
53
|
+
naas_secret.list()
|
|
54
|
+
|
|
55
|
+
for key, value in naas_secret.list().items():
|
|
56
|
+
print(f"{key}: {value}")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@naas.command("get-base64-env")
|
|
60
|
+
@click.option(
|
|
61
|
+
"--naas-api-key", type=str, required=True, default=os.getenv("NAAS_API_KEY")
|
|
62
|
+
)
|
|
63
|
+
@click.option("--naas-api-url", type=str, required=True, default="https://api.naas.ai")
|
|
64
|
+
@click.option("--naas-secret-name", type=str, required=True, default="abi_secrets")
|
|
65
|
+
def get_secret(naas_api_key, naas_api_url, naas_secret_name):
|
|
66
|
+
from naas_abi_core.services.secret.adaptors.secondary.Base64Secret import (
|
|
67
|
+
Base64Secret,
|
|
68
|
+
)
|
|
69
|
+
from naas_abi_core.services.secret.adaptors.secondary.NaasSecret import NaasSecret
|
|
70
|
+
|
|
71
|
+
naas_secret = NaasSecret(naas_api_key, naas_api_url)
|
|
72
|
+
base64_secret = Base64Secret(naas_secret, naas_secret_name)
|
|
73
|
+
|
|
74
|
+
for key, value in base64_secret.list().items():
|
|
75
|
+
# If value is multiline
|
|
76
|
+
if "\n" in value:
|
|
77
|
+
print(f'{key}="{value}"')
|
|
78
|
+
else:
|
|
79
|
+
print(f"{key}={value}")
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
|
|
4
|
+
import jinja2
|
|
5
|
+
import rich
|
|
6
|
+
from jinja2 import Environment, meta
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ValueProvider(dict):
|
|
10
|
+
def collect_values(self, template_string: str) -> dict:
|
|
11
|
+
env = Environment() # add your filters/tests if you use them
|
|
12
|
+
ast = env.parse(template_string)
|
|
13
|
+
needed = meta.find_undeclared_variables(ast)
|
|
14
|
+
|
|
15
|
+
for name in sorted(needed):
|
|
16
|
+
if name in self:
|
|
17
|
+
continue
|
|
18
|
+
self[name] = rich.prompt.Prompt.ask(f"Enter value for '{name}'")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Copier:
|
|
22
|
+
templates_path: str
|
|
23
|
+
destination_path: str
|
|
24
|
+
values: dict
|
|
25
|
+
|
|
26
|
+
def __init__(self, templates_path: str, destination_path: str):
|
|
27
|
+
# Normalize paths to avoid double-joining relative segments during recursion.
|
|
28
|
+
self.templates_path = os.path.abspath(templates_path)
|
|
29
|
+
self.destination_path = os.path.abspath(destination_path)
|
|
30
|
+
|
|
31
|
+
def _template_file_to_file(
|
|
32
|
+
self, template_path: str, values: ValueProvider, destination_path: str
|
|
33
|
+
) -> None:
|
|
34
|
+
destination_path = self._template_string(destination_path, values)
|
|
35
|
+
with open(destination_path, "w", encoding="utf-8") as file:
|
|
36
|
+
file.write(self._template_file(template_path, values))
|
|
37
|
+
|
|
38
|
+
def _template_file(self, template_path: str, values: ValueProvider) -> str:
|
|
39
|
+
with open(template_path, "r", encoding="utf-8") as file:
|
|
40
|
+
return self._template_string(file.read(), values)
|
|
41
|
+
|
|
42
|
+
def _template_string(self, template_string: str, values: ValueProvider) -> str:
|
|
43
|
+
values.collect_values(template_string)
|
|
44
|
+
return jinja2.Template(template_string).render(values)
|
|
45
|
+
|
|
46
|
+
def copy(self, values: dict, templates_path: str | None = None):
|
|
47
|
+
vp = ValueProvider(values)
|
|
48
|
+
|
|
49
|
+
if templates_path is None:
|
|
50
|
+
templates_path = self.templates_path
|
|
51
|
+
elif not os.path.isabs(templates_path):
|
|
52
|
+
templates_path = os.path.join(self.templates_path, templates_path)
|
|
53
|
+
|
|
54
|
+
relative_templates_path = os.path.relpath(
|
|
55
|
+
templates_path, start=self.templates_path
|
|
56
|
+
)
|
|
57
|
+
target_path = (
|
|
58
|
+
self.destination_path
|
|
59
|
+
if relative_templates_path == "."
|
|
60
|
+
else os.path.join(self.destination_path, relative_templates_path)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
for file in os.listdir(templates_path):
|
|
64
|
+
if os.path.isfile(os.path.join(templates_path, file)):
|
|
65
|
+
if False and "config" in file and file.endswith(".yaml"):
|
|
66
|
+
shutil.copy(
|
|
67
|
+
os.path.join(templates_path, file),
|
|
68
|
+
self._template_string(os.path.join(target_path, file), vp),
|
|
69
|
+
)
|
|
70
|
+
else:
|
|
71
|
+
self._template_file_to_file(
|
|
72
|
+
os.path.join(templates_path, file),
|
|
73
|
+
vp,
|
|
74
|
+
os.path.join(target_path, file),
|
|
75
|
+
)
|
|
76
|
+
elif os.path.isdir(os.path.join(templates_path, file)):
|
|
77
|
+
os.makedirs(
|
|
78
|
+
self._template_string(os.path.join(target_path, file), vp),
|
|
79
|
+
exist_ok=True,
|
|
80
|
+
)
|
|
81
|
+
self.copy(values, os.path.join(templates_path, file))
|
|
82
|
+
else:
|
|
83
|
+
print(f"Skipping {file}")
|
|
84
|
+
print(f"Skipping {file}")
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: naas-abi-cli
|
|
3
|
+
Version: 1.8.0
|
|
4
|
+
Summary: Abi cli allowing you to build your AI system.
|
|
5
|
+
Project-URL: Homepage, https://github.com/jupyter-naas/abi
|
|
6
|
+
Project-URL: Repository, https://github.com/jupyter-naas/abi/tree/main/libs/naas-abi-cli
|
|
7
|
+
Author-email: Maxime Jublou <maxime@naas.ai>, Florent Ravenel <florent@naas.ai>, Jeremy Ravenel <jeremy@naas.ai>
|
|
8
|
+
License: MIT License
|
|
9
|
+
Requires-Python: <4,>=3.10
|
|
10
|
+
Requires-Dist: naas-abi-core[qdrant]>=1.4.0
|
|
11
|
+
Requires-Dist: naas-abi-marketplace[ai-chatgpt]>=1.3.3
|
|
12
|
+
Requires-Dist: naas-abi>=1.0.11
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# naas-abi-cli
|
|
16
|
+
|
|
17
|
+
Command Line Interface (CLI) tool for building and managing ABI (Agentic Brain Infrastructure) projects.
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
`naas-abi-cli` provides a comprehensive set of commands to create, configure, deploy, and interact with ABI projects. It serves as the primary entry point for developers working with the ABI framework, enabling quick project setup, agent interaction, and cloud deployment.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Install the CLI tool using pip:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install naas-abi-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Available Commands
|
|
32
|
+
|
|
33
|
+
### Project Management
|
|
34
|
+
|
|
35
|
+
#### `abi new project <project-name> [project-path]`
|
|
36
|
+
Creates a new ABI project with all necessary starter files and dependencies.
|
|
37
|
+
|
|
38
|
+
**What it does:**
|
|
39
|
+
- Creates a new project directory (must be empty or non-existent)
|
|
40
|
+
- Generates project structure with configuration files, Docker setup, and Python package structure
|
|
41
|
+
- Automatically installs required dependencies (`naas-abi-core`, `naas-abi-marketplace`, `naas-abi`, and `naas-abi-cli`)
|
|
42
|
+
- Customizes project files with your project name
|
|
43
|
+
|
|
44
|
+
**Example:**
|
|
45
|
+
```bash
|
|
46
|
+
abi new project my-abi-project
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### `abi init <path>`
|
|
50
|
+
Initializes a new ABI project in the specified directory.
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
```bash
|
|
54
|
+
abi init .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Agent Interaction
|
|
58
|
+
|
|
59
|
+
#### `abi chat [module-name] [agent-name]`
|
|
60
|
+
Starts an interactive chat session with an AI agent.
|
|
61
|
+
|
|
62
|
+
**Parameters:**
|
|
63
|
+
- `module-name`: The module containing the agent (default: `naas_abi`)
|
|
64
|
+
- `agent-name`: The specific agent class to use (default: `AbiAgent`)
|
|
65
|
+
|
|
66
|
+
**What it does:**
|
|
67
|
+
- Loads the ABI engine and specified module
|
|
68
|
+
- Launches an interactive terminal chat interface
|
|
69
|
+
- Saves conversations to `storage/datastore/interfaces/terminal_agent/`
|
|
70
|
+
|
|
71
|
+
**Example:**
|
|
72
|
+
```bash
|
|
73
|
+
abi chat naas_abi AbiAgent
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### `abi agent list`
|
|
77
|
+
Lists all available agents across all loaded modules.
|
|
78
|
+
|
|
79
|
+
**What it does:**
|
|
80
|
+
- Loads the ABI engine with all configured modules
|
|
81
|
+
- Displays a formatted table showing module names and agent class names
|
|
82
|
+
|
|
83
|
+
**Example:**
|
|
84
|
+
```bash
|
|
85
|
+
abi agent list
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Configuration Management
|
|
89
|
+
|
|
90
|
+
#### `abi config validate [--configuration-file <path>]`
|
|
91
|
+
Validates the ABI configuration file for correctness.
|
|
92
|
+
|
|
93
|
+
**Options:**
|
|
94
|
+
- `--configuration-file`: Path to configuration file (default: uses `config.yaml` from current directory)
|
|
95
|
+
|
|
96
|
+
**Example:**
|
|
97
|
+
```bash
|
|
98
|
+
abi config validate
|
|
99
|
+
abi config validate --configuration-file config.prod.yaml
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### `abi config render [--configuration-file <path>]`
|
|
103
|
+
Renders the loaded configuration as YAML output, useful for debugging and verification.
|
|
104
|
+
|
|
105
|
+
**Options:**
|
|
106
|
+
- `--configuration-file`: Path to configuration file (default: uses `config.yaml` from current directory)
|
|
107
|
+
|
|
108
|
+
**Example:**
|
|
109
|
+
```bash
|
|
110
|
+
abi config render
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### `abi module list`
|
|
114
|
+
Lists all available modules and their enabled/disabled status.
|
|
115
|
+
|
|
116
|
+
**What it does:**
|
|
117
|
+
- Loads the engine configuration
|
|
118
|
+
- Displays a formatted table showing module names and their enabled status
|
|
119
|
+
|
|
120
|
+
**Example:**
|
|
121
|
+
```bash
|
|
122
|
+
abi module list
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Deployment
|
|
126
|
+
|
|
127
|
+
#### `abi deploy naas [-e/--env <environment>]`
|
|
128
|
+
Deploys your ABI project to Naas cloud infrastructure.
|
|
129
|
+
|
|
130
|
+
**Options:**
|
|
131
|
+
- `-e, --env`: Environment to use (default: `prod`). Determines which configuration file to load (e.g., `config.prod.yaml`, `config.yaml`)
|
|
132
|
+
|
|
133
|
+
**What it does:**
|
|
134
|
+
- Builds a Docker image of your ABI project
|
|
135
|
+
- Pushes the image to your Naas container registry
|
|
136
|
+
- Creates or updates a space on Naas infrastructure
|
|
137
|
+
- Exposes your ABI REST API at `https://{space-name}.default.space.naas.ai`
|
|
138
|
+
|
|
139
|
+
**Requirements:**
|
|
140
|
+
- Naas API key configured in your configuration file
|
|
141
|
+
- Docker installed and running
|
|
142
|
+
- Deploy section in your `config.yaml` file
|
|
143
|
+
|
|
144
|
+
**Example:**
|
|
145
|
+
```bash
|
|
146
|
+
abi deploy naas
|
|
147
|
+
abi deploy naas --env prod
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Secret Management
|
|
151
|
+
|
|
152
|
+
#### `abi secrets naas list`
|
|
153
|
+
Lists all secrets stored in your Naas workspace.
|
|
154
|
+
|
|
155
|
+
**Options:**
|
|
156
|
+
- `--naas-api-key`: Naas API key (default: `NAAS_API_KEY` environment variable)
|
|
157
|
+
- `--naas-api-url`: Naas API URL (default: `https://api.naas.ai`)
|
|
158
|
+
|
|
159
|
+
**Example:**
|
|
160
|
+
```bash
|
|
161
|
+
abi secrets naas list
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### `abi secrets naas push-env-as-base64`
|
|
165
|
+
Pushes a local `.env` file to Naas as a base64-encoded secret.
|
|
166
|
+
|
|
167
|
+
**Options:**
|
|
168
|
+
- `--naas-api-key`: Naas API key (default: `NAAS_API_KEY` environment variable)
|
|
169
|
+
- `--naas-api-url`: Naas API URL (default: `https://api.naas.ai`)
|
|
170
|
+
- `--naas-secret-name`: Name for the secret in Naas (default: `abi_secrets`)
|
|
171
|
+
- `--env-file`: Path to the environment file (default: `.env.prod`)
|
|
172
|
+
|
|
173
|
+
**Example:**
|
|
174
|
+
```bash
|
|
175
|
+
abi secrets naas push-env-as-base64 --env-file .env.prod
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### `abi secrets naas get-base64-env`
|
|
179
|
+
Retrieves a base64-encoded secret from Naas and displays it as environment variables.
|
|
180
|
+
|
|
181
|
+
**Options:**
|
|
182
|
+
- `--naas-api-key`: Naas API key (default: `NAAS_API_KEY` environment variable)
|
|
183
|
+
- `--naas-api-url`: Naas API URL (default: `https://api.naas.ai`)
|
|
184
|
+
- `--naas-secret-name`: Name of the secret to retrieve (default: `abi_secrets`)
|
|
185
|
+
|
|
186
|
+
**Example:**
|
|
187
|
+
```bash
|
|
188
|
+
abi secrets naas get-base64-env
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Script Execution
|
|
192
|
+
|
|
193
|
+
#### `abi run script <path>`
|
|
194
|
+
Runs a Python script in the context of a loaded ABI engine.
|
|
195
|
+
|
|
196
|
+
**What it does:**
|
|
197
|
+
- Loads the ABI engine with all configured modules
|
|
198
|
+
- Executes the specified Python script with access to the engine and all loaded modules
|
|
199
|
+
|
|
200
|
+
**Example:**
|
|
201
|
+
```bash
|
|
202
|
+
abi run script scripts/my_script.py
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Architecture
|
|
206
|
+
|
|
207
|
+
The CLI is built using:
|
|
208
|
+
- **Click**: For command-line interface framework
|
|
209
|
+
- **naas-abi-core**: Core ABI engine and configuration management
|
|
210
|
+
- **naas-abi-marketplace**: Marketplace modules and agents
|
|
211
|
+
- **naas-abi**: Main ABI package
|
|
212
|
+
|
|
213
|
+
The CLI automatically detects if it's being run from within an ABI project (by checking for `pyproject.toml` with `naas-abi-cli` dependency) and uses `uv run` to ensure proper environment isolation.
|
|
214
|
+
|
|
215
|
+
## Project Structure
|
|
216
|
+
|
|
217
|
+
When you create a new project with `abi new project`, the CLI:
|
|
218
|
+
1. Uses template files from `cli/new/templates/project/`
|
|
219
|
+
2. Customizes templates with your project name
|
|
220
|
+
3. Sets up proper Python package structure
|
|
221
|
+
4. Installs all required dependencies via `uv`
|
|
222
|
+
|
|
223
|
+
## Integration with ABI Framework
|
|
224
|
+
|
|
225
|
+
The CLI integrates seamlessly with the ABI ecosystem:
|
|
226
|
+
- **Engine Loading**: Automatically loads modules and agents from your configuration
|
|
227
|
+
- **Configuration Management**: Validates and renders YAML configuration files
|
|
228
|
+
- **Cloud Deployment**: Handles Docker builds and Naas API interactions
|
|
229
|
+
- **Secret Management**: Integrates with Naas secret storage for secure credential management
|
|
230
|
+
|
|
231
|
+
## Dependencies
|
|
232
|
+
|
|
233
|
+
- Python 3.10+
|
|
234
|
+
- `naas-abi>=1.0.6`
|
|
235
|
+
- `naas-abi-core[qdrant]>=1.1.2`
|
|
236
|
+
- `naas-abi-marketplace[ai-chatgpt]>=1.1.0`
|
|
237
|
+
- `uv` package manager (for dependency management)
|
|
238
|
+
|
|
239
|
+
## See Also
|
|
240
|
+
|
|
241
|
+
- [ABI Main README](../../../README.md) - Complete ABI framework documentation
|
|
242
|
+
- [naas-abi-core](../naas-abi-core/) - Core engine documentation
|
|
243
|
+
- [naas-abi-marketplace](../naas-abi-marketplace/) - Marketplace modules documentation
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
naas_abi_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
naas_abi_cli/cli/__init__.py,sha256=U5B_FHw3WZrDBehe1GBSHMNUVbrrZMZDsRvYOKzIg54,1456
|
|
3
|
+
naas_abi_cli/cli/agent.py,sha256=fMdbC7HsrOfZSf5zVRHWSmyrejI5mUdRlAT5v5YHXzk,658
|
|
4
|
+
naas_abi_cli/cli/chat.py,sha256=fobZsW4hCoTe5VJbWDmFR5gUhd91Y1K1D5fJ_H5fshg,948
|
|
5
|
+
naas_abi_cli/cli/config.py,sha256=CcdDX6HKCP32NjRhbVsCOwLUC9LmaqTm2sv8W5rOt00,1484
|
|
6
|
+
naas_abi_cli/cli/deploy.py,sha256=F4ZO-_ZVfBj93m7WQw5C7qAo3s7D3APl3-ePTpdFTYI,6670
|
|
7
|
+
naas_abi_cli/cli/init.py,sha256=Pcy2-hy-FvpXf3UOKMP6agWyFrCl9z-KP5ktEWltPy0,220
|
|
8
|
+
naas_abi_cli/cli/module.py,sha256=TBl-SpeGUcy1Rrp40Irbt34yQS00xJcNje-OijNE4Hk,717
|
|
9
|
+
naas_abi_cli/cli/run.py,sha256=OLrAs0mtnI0jvyW5Bb_Jd3Sp-bWDMdulCcsPixEq-6s,308
|
|
10
|
+
naas_abi_cli/cli/secret.py,sha256=u_yUZgVEcns-CM-qsIIZUHX8j8T6aioJYluqSQhnXFE,2491
|
|
11
|
+
naas_abi_cli/cli/new/__init__.py,sha256=i-lOPJh8DL729CFhZyuXZibsaswsqPj5e7u_N68xXeM,156
|
|
12
|
+
naas_abi_cli/cli/new/module.py,sha256=STF9bfZLmPiYDxfLKMGzYr2AhbIawPeVF9XJtpSzBf4,1692
|
|
13
|
+
naas_abi_cli/cli/new/new.py,sha256=sfNmeoNZLGhjKRKSHuwEl1vtuxWR_SII0qOo9BVoEwY,55
|
|
14
|
+
naas_abi_cli/cli/new/project.py,sha256=GlM423wJ14KXkEF4Ofntv-vv5YWElSNyHYzaIAUwkug,2138
|
|
15
|
+
naas_abi_cli/cli/new/templates/module/__init__.py,sha256=RrPtAs9r4Kf6ZUNkrA2P9BAmQftVZYnid5hZrT7A6wE,912
|
|
16
|
+
naas_abi_cli/cli/new/templates/module/agents/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
naas_abi_cli/cli/new/templates/module/agents/{{module_name_pascal}}Agent.py,sha256=2R0rzjD5YOuIRVzSA_2bSioOniiJOqWcnUWNoZ3DJS8,1323
|
|
18
|
+
naas_abi_cli/cli/new/templates/module/orchestrations/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
naas_abi_cli/cli/new/templates/module/pipelines/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
naas_abi_cli/cli/new/templates/module/workflows/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
+
naas_abi_cli/cli/new/templates/project/.gitignore,sha256=UGpJjKfZf8Gv1AD8aCgx0EDGsY_7j4viVinCdxDZMhQ,18
|
|
22
|
+
naas_abi_cli/cli/new/templates/project/Dockerfile,sha256=1qKIDdqwc_JYJE9ROHFqsq3RPyYpkfqjZHKACCMR4JE,147
|
|
23
|
+
naas_abi_cli/cli/new/templates/project/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
+
naas_abi_cli/cli/new/templates/project/pyproject.toml,sha256=9MHoNOtG2DkS4LE1GZwBFF6Frw4gsl-hb5Mojba0AUM,540
|
|
25
|
+
naas_abi_cli/cli/new/templates/project/.github/workflows/release.yaml,sha256=7uV4SE20zvAfJKr1caKLbHIC3eyBmS-LOwjkKe6plhI,596
|
|
26
|
+
naas_abi_cli/cli/utils/Copier.py,sha256=cYo-5INC0jSrxcBgf2tvhahMr-92j2-BLpSmb6nQ1pc,3269
|
|
27
|
+
naas_abi_cli/cli/new/templates/project/config.prod.yaml,sha256=Y57Qzz_yt8tfHbtDqGCSQxOkwnLgF4eoGOWOq66xSA8,1877
|
|
28
|
+
naas_abi_cli/cli/new/templates/project/config.yaml,sha256=iQAAO6N3xO7iszG33vbSAljO11Pcf4KOvW3N-avJrsQ,1610
|
|
29
|
+
naas_abi_cli-1.8.0.dist-info/METADATA,sha256=ZyDn-70bRW9KjuK1wZJruo6r3f84YK5BiMSHXDtqs_k,7371
|
|
30
|
+
naas_abi_cli-1.8.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
31
|
+
naas_abi_cli-1.8.0.dist-info/entry_points.txt,sha256=ufNXhYVU3uo5dcZ8e1kdEJv1oh2Vons7LHJPg35cP4w,46
|
|
32
|
+
naas_abi_cli-1.8.0.dist-info/RECORD,,
|