From 76a667f259de2762bcb0c6664a17ebce9c2f9961 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Wed, 7 Jan 2026 14:57:40 +0000 Subject: [PATCH] Remove DBAL and package command implementations - Deleted dbal_commands.h and package_commands.h files, removing DBAL command handlers and package command definitions. - Removed package_commands.cpp, which contained the implementation of package commands including list, run, and generate functionalities. - Eliminated lua_runner.cpp and lua_runner.h, which provided the Lua script execution environment and related functionalities. - Removed main.cpp and http_client files, which were responsible for the CLI entry point and HTTP client interactions. --- frontends/cli/CMakeLists.txt | 35 -- frontends/cli/README.md | 114 ----- frontends/cli/conanfile.txt | 16 - .../cli/src/commands/command_dispatch.cpp | 146 ------ frontends/cli/src/commands/command_dispatch.h | 11 - frontends/cli/src/commands/dbal_commands.cpp | 445 ------------------ frontends/cli/src/commands/dbal_commands.h | 39 -- .../cli/src/commands/package_commands.cpp | 345 -------------- frontends/cli/src/commands/package_commands.h | 18 - frontends/cli/src/lua/lua_runner.cpp | 268 ----------- frontends/cli/src/lua/lua_runner.h | 135 ------ frontends/cli/src/main.cpp | 27 -- frontends/cli/src/utils/http_client.cpp | 63 --- frontends/cli/src/utils/http_client.h | 26 - 14 files changed, 1688 deletions(-) delete mode 100644 frontends/cli/CMakeLists.txt delete mode 100644 frontends/cli/README.md delete mode 100644 frontends/cli/conanfile.txt delete mode 100644 frontends/cli/src/commands/command_dispatch.cpp delete mode 100644 frontends/cli/src/commands/command_dispatch.h delete mode 100644 frontends/cli/src/commands/dbal_commands.cpp delete mode 100644 frontends/cli/src/commands/dbal_commands.h delete mode 100644 frontends/cli/src/commands/package_commands.cpp delete mode 100644 frontends/cli/src/commands/package_commands.h delete mode 100644 frontends/cli/src/lua/lua_runner.cpp delete mode 100644 frontends/cli/src/lua/lua_runner.h delete mode 100644 frontends/cli/src/main.cpp delete mode 100644 frontends/cli/src/utils/http_client.cpp delete mode 100644 frontends/cli/src/utils/http_client.h diff --git a/frontends/cli/CMakeLists.txt b/frontends/cli/CMakeLists.txt deleted file mode 100644 index fd87725c4..000000000 --- a/frontends/cli/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.27) -project(metabuilder_cli VERSION 0.1.0 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - -include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake OPTIONAL) - -add_executable(metabuilder-cli - src/main.cpp - src/commands/command_dispatch.cpp - src/commands/dbal_commands.cpp - src/commands/package_commands.cpp - src/lua/lua_runner.cpp - src/utils/http_client.cpp -) - -find_package(cpr CONFIG REQUIRED) -find_package(lua REQUIRED) -find_package(sol2 REQUIRED) -find_package(nlohmann_json REQUIRED) - -target_link_libraries(metabuilder-cli PRIVATE - cpr::cpr - lua::lua - sol2::sol2 - nlohmann_json::nlohmann_json -) -target_compile_features(metabuilder-cli PRIVATE cxx_std_20) -target_include_directories(metabuilder-cli PRIVATE src) - -install(TARGETS metabuilder-cli - RUNTIME DESTINATION bin -) diff --git a/frontends/cli/README.md b/frontends/cli/README.md deleted file mode 100644 index 06564fbd8..000000000 --- a/frontends/cli/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# MetaBuilder CLI - -This CLI targets MetaBuilder services via HTTP and includes a Lua runtime for executing package scripts. Uses Conan + CMake for dependency management and builds. - -## Requirements - -- [Conan 2](https://docs.conan.io/) (used for dependency resolution) -- CMake 3.27+ (the Conan toolchain generator targets this minimum) -- Ninja (build backend) -- A running MetaBuilder frontend (defaults to `http://localhost:3000`) - -## Building - -```bash -cd frontends/cli -conan install . --output-folder build --build missing -cmake -S . -B build -G Ninja -cmake --build build -``` - -Conan provisions these dependencies: -- [`cpr`](https://github.com/libcpr/cpr) - HTTP requests -- [`lua`](https://www.lua.org/) - Lua 5.4 interpreter -- [`sol2`](https://github.com/ThePhD/sol2) - C++/Lua binding -- [`nlohmann_json`](https://github.com/nlohmann/json) - JSON handling - -## Running - -The executable looks for `METABUILDER_BASE_URL` (default `http://localhost:3000`): - -```bash -# API commands -./build/bin/metabuilder-cli auth session -./build/bin/metabuilder-cli user list - -# Package commands (run from project root) -./build/bin/metabuilder-cli package list -./build/bin/metabuilder-cli package generate my_forum --category social --with-schema --entities Thread,Post -./build/bin/metabuilder-cli package run codegen_studio package_template get_categories -``` - -## Commands - -### API Commands - -```bash -metabuilder-cli auth session # Show current session -metabuilder-cli auth login # Authenticate -metabuilder-cli user list # List users -metabuilder-cli user get # Get user by ID -metabuilder-cli tenant list # List tenants -metabuilder-cli tenant get # Get tenant by ID -metabuilder-cli dbal # DBAL operations -``` - -### Package Commands - -```bash -metabuilder-cli package list # List packages with scripts -metabuilder-cli package run