Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(cli): 添加 CLI crate 骨架

Illuminated20205720f05dd085
diff --git a/Cargo.toml b/Cargo.toml
index 390ef8ef7f..1b5c694ece 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
-members = ["src-tauri", "crates/dbx-core", "src-web"]
+members = ["src-tauri", "crates/dbx-core", "crates/dbx-cli", "src-web"]
[profile.release]
panic = "abort"
diff --git a/crates/dbx-cli/Cargo.toml b/crates/dbx-cli/Cargo.toml
new file mode 100644
index 0000000000..c816811ec5
--- /dev/null
+++ b/crates/dbx-cli/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "dbx-cli"
+version = "0.5.2"
+edition = "2021"
+
+[[bin]]
+name = "dbx"
+path = "src/main.rs"
+
+[dependencies]
+dbx-core = { path = "../dbx-core" }
+chrono = { version = "0.4", features = ["serde"] }
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+tokio = { version = "1", features = ["full"] }
+reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
+uuid = { version = "1", features = ["v4", "serde"] }
diff --git a/crates/dbx-cli/src/main.rs b/crates/dbx-cli/src/main.rs
new file mode 100644
index 0000000000..f34308a758
--- /dev/null
+++ b/crates/dbx-cli/src/main.rs
@@ -0,0 +1,13 @@
+mod commands;
+mod runtime_client;
+
+#[tokio::main]
+async fn main() {
+ if let Err(err) = commands::run(std::env::args().skip(1).collect()).await {
+ println!(
+ "{}",
+ serde_json::to_string_pretty(&err).unwrap_or_else(|_| "{\"ok\":false}".to_string())
+ );
+ std::process::exit(1);
+ }
+}