Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Package cli for execution in dependent projects #164

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bee-hive/bee_hive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

__all__ = [
"agent",
"workflow",
"interface",
"Agent",
"Workflow",
"Interface",
]
13 changes: 9 additions & 4 deletions bee-hive/cli/beeAI.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@
-v --version Show version.

"""
import os, sys, traceback
import sys

from docopt import docopt
from cli.common import Console
from cli.cli import CLI

from cli import *

if __name__ == '__main__':
def run_cli():
"""
run CLI command
"""
args = docopt(__doc__, version='beeAI CLI v0.0.1')
command = CLI(args).command()
try:
Expand All @@ -50,3 +53,5 @@
Console.error(str(e))
sys.exit(1)

if __name__ == '__main__':
run_cli()
5 changes: 1 addition & 4 deletions bee-hive/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import io, sys

from commands import *
from common import *
from cli.commands import Validate

class CLI:
def __init__(self, args):
Expand Down
4 changes: 2 additions & 2 deletions bee-hive/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import io, sys, yaml, json, jsonschema
import yaml, json, jsonschema

from jsonschema.exceptions import ValidationError
from common import Console
from cli.common import Console

# Base class for all commands
class Command:
Expand Down
1 change: 0 additions & 1 deletion bee-hive/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import sys
from random import randint

VERBOSE=False

Expand Down
8 changes: 7 additions & 1 deletion bee-hive/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description = "A multi-agent platform with the vision to facilitate deploy and r
authors = ["IBM"]
license = "Apache 2.0"
readme = "README.md"
packages = [
{ include = "bee_hive", from = "." },
{ include = "cli", from = "." }
]

[tool.poetry.dependencies]
python = ">= 3.11, < 3.13"
Expand All @@ -14,7 +18,6 @@ python-dotenv = "^1.0.1"
jsonschema = "^4.23.0"
docopt-ng = "^0.9.0"


[tool.poetry.group.dev.dependencies]

[tool.poetry.group.test.dependencies]
Expand All @@ -27,3 +30,6 @@ build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
addopts = "-v -s"

[tool.poetry.scripts]
"beeAI" = "cli.beeAI:run_cli"