diff --git a/command/__main__.py b/command/__main__.py deleted file mode 100644 index 4120698b..00000000 --- a/command/__main__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""command 命令行入口""" -from command.cli import main -main() diff --git a/ga b/ga index 0093d71f..6184a293 100755 --- a/ga +++ b/ga @@ -1,3 +1,3 @@ #!/usr/bin/env bash cd "$(dirname "$0")" -exec python -m command "$@" +exec python -m ga_cli "$@" diff --git a/ga.cmd b/ga.cmd index 8f0b2a53..99db5581 100644 --- a/ga.cmd +++ b/ga.cmd @@ -1,3 +1,3 @@ @echo off cd /d "%~dp0" -python -m command %* +python -m ga_cli %* diff --git a/command/__init__.py b/ga_cli/__init__.py similarity index 92% rename from command/__init__.py rename to ga_cli/__init__.py index 98cc9852..7a59cf16 100644 --- a/command/__init__.py +++ b/ga_cli/__init__.py @@ -1,8 +1,8 @@ """ -command - GenericAgent CLI 命令包 +ga_cli - GenericAgent CLI 命令包 作为包导入时,自动从根 ga.py 加载核心类(GenericAgentHandler 等) -以 python -m command 运行时,进入 CLI 命令模式 +以 python -m ga_cli 运行时,进入 CLI 命令模式 """ import importlib.util, sys, os diff --git a/ga_cli/__main__.py b/ga_cli/__main__.py new file mode 100644 index 00000000..4154ee0d --- /dev/null +++ b/ga_cli/__main__.py @@ -0,0 +1,3 @@ +"""ga_cli 命令行入口""" +from ga_cli.cli import main +main() diff --git a/command/cli.py b/ga_cli/cli.py similarity index 98% rename from command/cli.py rename to ga_cli/cli.py index 7c488299..8a73a805 100644 --- a/command/cli.py +++ b/ga_cli/cli.py @@ -1,7 +1,7 @@ """ -command/cli.py - GenericAgent 命令行分发系统 +ga_cli/cli.py - GenericAgent 命令行分发系统 -通过 python -m command <命令> 或 ga <命令> 调用 +通过 python -m ga_cli <命令> 或 ga <命令> 调用 """ import os, sys, subprocess, argparse, textwrap diff --git a/command/command-install.cmd b/ga_cli/ga-cli-install.cmd similarity index 96% rename from command/command-install.cmd rename to ga_cli/ga-cli-install.cmd index 2a27b059..47e27160 100644 --- a/command/command-install.cmd +++ b/ga_cli/ga-cli-install.cmd @@ -1,6 +1,6 @@ @echo off chcp 65001 >nul -:: command-install.cmd - 将 GenericAgent 命令注册到系统 PATH +:: ga-cli-install.cmd - 将 GenericAgent 命令注册到系统 PATH :: 运行一次后,即可在任意位置敲 ga :: 建议以管理员身份运行 diff --git a/command/command.cmd b/ga_cli/ga_cli.cmd similarity index 55% rename from command/command.cmd rename to ga_cli/ga_cli.cmd index 95e330c7..ed53cab1 100644 --- a/command/command.cmd +++ b/ga_cli/ga_cli.cmd @@ -1,3 +1,3 @@ @echo off cd /d "%~dp0.." -python -m command %* +python -m ga_cli %* diff --git a/pyproject.toml b/pyproject.toml index 7a33a2eb..e0d17e7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ build-backend = "setuptools.build_meta" [tool.setuptools] py-modules = [] -packages = ["command"] +packages = ["ga_cli"] [project.scripts] -ga = "command.cli:main" \ No newline at end of file +ga = "ga_cli.cli:main" \ No newline at end of file