Enterprise Flutter Code Generator complying with GetX, Dio, and MDC standards.
Project description
ylapp CLI
ylapp 是一个为 AI Agent 提供辅助的命令行工具。通过执行 ylapp app 进入交互式 REPL,会话内的命令以 / 开头(如 /help)。
特性(首版)
- 交互式 REPL:持续会话,统一斜杠命令入口
/help:查看当前支持的命令与释义- 采用命令模式、注册路由与可扩展架构,便于后续新增命令
安装与使用
首版建议在项目根目录进行本地开发安装。
- 在项目根目录执行开发安装:
pip install -e .
- 运行 CLI(当前通过子命令进入 REPL):
ylapp app- 启动后会进入 REPL,会显示提示符(例如:
yl>)
- 启动后会进入 REPL,会显示提示符(例如:
交互命令
/help:显示支持的命令清单与释义/exit(可选):退出 REPL(后续任务可能提供)
开发步骤示例:新增 /init_app_ai_project 命令
目标:在交互式 REPL 中新增一个命令 /init_app_ai_project [project_name],用于示例化初始化流程(占位实现)。
步骤 1:创建命令实现文件
- 路径:
ylapp/commands/init_app_ai_project.py - 内容示例:
from typing import List from ylapp.core.command import Command, CommandContext class InitAppAiProjectCommand(Command): def __init__(self) -> None: super().__init__("init_app_ai_project", "初始化 AI 项目(示例)") def execute(self, ctx: CommandContext) -> str: args: List[str] = ctx.args or [] name = args[0] if args else "demo" # 占位逻辑:真实实现可在此创建目录、写入模板等 return ( f"初始化完成(占位):项目名={name}\n" "下一步:编辑配置并执行 /help 查看更多命令" ) def register(registry) -> None: registry.register(InitAppAiProjectCommand())
步骤 2:在入口注册该命令
- 文件:
ylapp/cli.py - 在初始化注册器的位置(与帮助命令注册同一处)增加导入与注册:
from ylapp.commands import init_app_ai_project as init_cmd # 注册内置命令 help_cmd.register(registry) init_cmd.register(registry)
步骤 3:运行与验证
- 启动 REPL:
ylapp app - 在 REPL 输入:
/help /init_app_ai_project demo
- 预期:
/help列表中出现/init_app_ai_project - 初始化 AI 项目(示例)- 执行
/init_app_ai_project demo输出“初始化完成(占位):项目名=demo ……”
常见问题排查
/help中未出现新命令:检查是否已在ylapp/cli.py中import并调用了init_cmd.register(registry)。- “未知命令”:确认命令类
name是否为不含斜杠的短名(应为"init_app_ai_project"),以及路由输入是否以/开头。
目录结构(规划)
ylapp/
__init__.py
cli.py
core/
command.py
registry.py
router.py
repl.py
io.py
config.py
logger.py
commands/
help.py
init_app_ai_project.py # 新增命令示例(按需创建)
exit.py # 可选
扩展新命令(通用指引)
- 在
ylapp/commands/新增一个命令实现文件(继承 Command 抽象类) - 在模块中提供
register(registry)并调用registry.register(...) - 在入口
ylapp/cli.py导入并执行该register(...) - 在 REPL 使用
/your_command arg1 arg2调用(当前仅位置参数)
版本与许可证
- 当前版本:
0.1.0 - 许可证:MIT
开发与测试建议
- 使用 Python 3.10+
- 建议使用
pytest编写测试用例 - 使用标准库
logging输出日志,支持环境变量调整日志级别(如YLAPP_LOG_LEVEL)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ylapp_flutter_devkit-0.0.3.tar.gz.
File metadata
- Download URL: ylapp_flutter_devkit-0.0.3.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cf6c62882c82581a4835a9f169f5e9491bac6d321739044e3febb5bef8a4805
|
|
| MD5 |
28caa2ff1b39355d5fecdd2ca0c8483a
|
|
| BLAKE2b-256 |
d7d5bddd14044c2c7bed9aa58e0b21ede1bd1611d59c2870307268e0fff4707d
|
File details
Details for the file ylapp_flutter_devkit-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ylapp_flutter_devkit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93f2e12b3aa464bb7466fdf619e7843e2a813144c8014ac05a76d67a5304e4ca
|
|
| MD5 |
1b2d8df4a581422347f66016f5a0c0e5
|
|
| BLAKE2b-256 |
627ce70d924003fb0cd6d5d44aaae1fe6c5c870036cb5b6b5e50b501a64588dc
|