aboutsummaryrefslogtreecommitdiffstats
path: root/crates/client/src/command
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-09 22:05:46 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-09 22:05:46 +0200
commit92a8fd40209c5595475fb0288741d0347fe244c4 (patch)
treebc6a275c32bfe9f71dc98bd39146c82938631c82 /crates/client/src/command
parentchore: Add more things (diff)
downloadatuin-92a8fd40209c5595475fb0288741d0347fe244c4.zip
chore: Move more stuff out of atuin-client
Diffstat (limited to 'crates/client/src/command')
-rw-r--r--crates/client/src/command/client/server.rs56
1 files changed, 0 insertions, 56 deletions
diff --git a/crates/client/src/command/client/server.rs b/crates/client/src/command/client/server.rs
deleted file mode 100644
index 88b12a7a..00000000
--- a/crates/client/src/command/client/server.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-use std::net::SocketAddr;
-
-use crate::atuin_server::{Settings, database::DbType, launch, launch_metrics_server};
-
-use clap::Subcommand;
-use eyre::{Context, Result, eyre};
-
-#[derive(Subcommand, Clone, Debug)]
-#[command(infer_subcommands = true)]
-pub(crate) enum Cmd {
- /// Start the server
- Start {
- /// The host address to bind
- #[clap(long)]
- host: Option<String>,
-
- /// The port to bind
- #[clap(long, short)]
- port: Option<u16>,
- },
-
- /// Print server example configuration
- DefaultConfig,
-}
-
-impl Cmd {
- pub(crate) async fn run(self) -> Result<()> {
- match self {
- Self::Start { host, port } => {
- let settings = Settings::new().wrap_err("could not load server settings")?;
- let host = host.as_ref().unwrap_or(&settings.host).clone();
- let port = port.unwrap_or(settings.port);
- let addr = SocketAddr::new(host.parse()?, port);
-
- if settings.metrics.enable {
- tokio::spawn(launch_metrics_server(
- settings.metrics.host.clone(),
- settings.metrics.port,
- ));
- }
-
- match settings.db_settings.db_type() {
- DbType::Postgres => launch(settings, addr).await,
- DbType::Unknown => {
- Err(eyre!("db_uri must start with postgres:// or sqlite://"))
- }
- }
- }
- Self::DefaultConfig => {
- // TODO(@bpeetz): Add this back <2026-06-11>
- println!("TODO");
- Ok(())
- }
- }
- }
-}