Compare commits

...
3 Commits
Author SHA1 Message Date
Ku6epXBOCTuK 1a2bb73b62 chore: rename app 2026-08-29 14:18:47 +05:00
Ku6epXBOCTuK ec98d30b31 fix: add short names for commands 2026-08-28 08:00:00 +05:00
Ku6epXBOCTuK e099995f42 chore: change exe name to short xd 2026-08-28 00:29:43 +05:00
6 changed files with 23 additions and 18 deletions
Generated
+1 -1
View File
@@ -2472,7 +2472,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "xboctploy" name = "xboct-deploy"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
+6 -2
View File
@@ -1,10 +1,10 @@
[package] [package]
name = "xboctploy" name = "xboct-deploy"
version = "0.1.0" version = "0.1.0"
description = "Lightweight CLI to deploy hobby projects from a local PC to a VPS over SSH" description = "Lightweight CLI to deploy hobby projects from a local PC to a VPS over SSH"
license = "MIT" license = "MIT"
readme = "README.md" readme = "README.md"
repository = "https://xboct-git.duckdns.org/Ku6epXBOCTuK/xboctploy" repository = "https://xboct-git.duckdns.org/Ku6epXBOCTuK/xboct-deploy"
keywords = ["deploy", "ssh", "sftp", "vps", "cli"] keywords = ["deploy", "ssh", "sftp", "vps", "cli"]
categories = ["command-line-utilities", "development-tools"] categories = ["command-line-utilities", "development-tools"]
rust-version = "1.88" rust-version = "1.88"
@@ -28,3 +28,7 @@ ssh2-config = "0.7.2"
tokio = { version = "1.53.1", features = ["rt", "time", "io-util"] } tokio = { version = "1.53.1", features = ["rt", "time", "io-util"] }
toml = "1.1.4" toml = "1.1.4"
walkdir = "2.5.0" walkdir = "2.5.0"
[[bin]]
name = "xd"
path = "src/main.rs"
+8 -8
View File
@@ -1,4 +1,4 @@
# xboctploy # xboct-deploy
Легковесная CLI-утилита на Rust для централизованного деплоя хобби-проектов Легковесная CLI-утилита на Rust для централизованного деплоя хобби-проектов
(Node.js, Rust) с локального ПК на слабую VPS по SSH. (Node.js, Rust) с локального ПК на слабую VPS по SSH.
@@ -19,12 +19,12 @@ cargo install --path .
## Быстрый старт ## Быстрый старт
```sh ```sh
xboctploy --list # показать проекты из конфига xboct-deploy --list # показать проекты из конфига
xboctploy --list-servers # показать серверы из конфига xboct-deploy --list-servers # показать серверы из конфига
xboctploy --pick # интерактивно выбрать проект (нечёткий поиск) xboct-deploy --pick # интерактивно выбрать проект (нечёткий поиск)
xboctploy --dry-run demo # напечатать план деплоя без выполнения xboct-deploy --dry-run demo # напечатать план деплоя без выполнения
xboctploy demo # задеплоить проект demo xboct-deploy demo # задеплоить проект demo
xboctploy --this # задеплоить проект текущей папки (глобальный конфиг) xboct-deploy --this # задеплоить проект текущей папки (глобальный конфиг)
``` ```
Вывод: Вывод:
@@ -43,7 +43,7 @@ Deploy successful! (total 2.3s)
1. `--config PATH`, если указан явно; 1. `--config PATH`, если указан явно;
2. `./deploy.toml` в текущей папке — удобно держать рядом с проектом и в тестах; 2. `./deploy.toml` в текущей папке — удобно держать рядом с проектом и в тестах;
3. глобальный `~/.config/xboctploy/deploy.toml` — запуск «из любой папки». 3. глобальный `~/.config/xboct-deploy/deploy.toml` — запуск «из любой папки».
`--this` деплоит проект, чей `workdir` совпадает с текущей папкой; конфиг `--this` деплоит проект, чей `workdir` совпадает с текущей папкой; конфиг
ищется по обычной цепочке, так что временный локальный `./deploy.toml` ищется по обычной цепочке, так что временный локальный `./deploy.toml`
+5 -4
View File
@@ -4,11 +4,12 @@ use clap::{ArgGroup, Parser};
/// Deploy hobby projects from a local PC to a VPS over SSH. /// Deploy hobby projects from a local PC to a VPS over SSH.
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[command(name = "xboctploy", version, about)] #[command(name = "xboct-deploy", version, about)]
#[command(arg_required_else_help = true)] #[command(arg_required_else_help = true)]
#[command(group = ArgGroup::new("target").required(true).args(["project", "list", "list_servers", "pick", "this"]))] #[command(group = ArgGroup::new("target").required(true).args(["project", "list", "list_servers", "pick", "this"]))]
pub struct Cli { pub struct Cli {
/// Project name from deploy.toml /// Project name from deploy.toml
#[arg(short, long)]
pub project: Option<String>, pub project: Option<String>,
/// Explicit path to the config file /// Explicit path to the config file
#[arg(long, value_name = "PATH")] #[arg(long, value_name = "PATH")]
@@ -17,15 +18,15 @@ pub struct Cli {
#[arg(long)] #[arg(long)]
pub dry_run: bool, pub dry_run: bool,
/// List configured projects and exit /// List configured projects and exit
#[arg(long)] #[arg(short, long)]
pub list: bool, pub list: bool,
/// List configured servers and exit /// List configured servers and exit
#[arg(long)] #[arg(long)]
pub list_servers: bool, pub list_servers: bool,
/// Interactively pick a project to deploy (fuzzy search) /// Interactively pick a project to deploy (fuzzy search)
#[arg(long)] #[arg(short, long)]
pub pick: bool, pub pick: bool,
/// Deploy the project whose workdir matches the current folder (global config) /// Deploy the project whose workdir matches the current folder (global config)
#[arg(long)] #[arg(short, long)]
pub this: bool, pub this: bool,
} }
+2 -2
View File
@@ -6,7 +6,7 @@ use anyhow::{Context, Result, bail};
use serde::Deserialize; use serde::Deserialize;
pub const CONFIG_FILE_NAME: &str = "deploy.toml"; pub const CONFIG_FILE_NAME: &str = "deploy.toml";
pub const GLOBAL_DIR: &str = "xboctploy"; pub const GLOBAL_DIR: &str = "xboct-deploy";
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
@@ -423,7 +423,7 @@ commands = []
fn tmpdir(tag: &str) -> PathBuf { fn tmpdir(tag: &str) -> PathBuf {
let dir = let dir =
std::env::temp_dir().join(format!("xboctploy-tests-{}-{tag}", std::process::id())); std::env::temp_dir().join(format!("xboct-deploy-tests-{}-{tag}", std::process::id()));
let _ = fs::remove_dir_all(&dir); let _ = fs::remove_dir_all(&dir);
fs::create_dir_all(&dir).unwrap(); fs::create_dir_all(&dir).unwrap();
dir dir
+1 -1
View File
@@ -97,7 +97,7 @@ mod tests {
fn tmpdir(tag: &str) -> PathBuf { fn tmpdir(tag: &str) -> PathBuf {
let dir = let dir =
std::env::temp_dir().join(format!("xboctploy-local-{}-{tag}", std::process::id())); std::env::temp_dir().join(format!("xboct-deploy-local-{}-{tag}", std::process::id()));
let _ = fs::remove_dir_all(&dir); let _ = fs::remove_dir_all(&dir);
fs::create_dir_all(&dir).unwrap(); fs::create_dir_all(&dir).unwrap();
dir dir