dkdc-sh

Shell library.
Install
cargo add dkdc-sh
uv add dkdc-sh
Usage
Rust
use dkdc_sh::{which, require, run, tmux, git};
if which("tmux").is_some() { }
require("git")?;
let output = run("echo", &["hello"])?;
tmux::new_session("my-service", "python server.py")?;
tmux::send_keys("my-service", "reload")?;
let logs = tmux::capture_pane("my-service", Some(50))?;
tmux::kill_session("my-service")?;
git::clone_shallow("https://github.com/org/repo.git", &dest, "main")?;
git::checkout_new_branch(&repo_dir, "feature/branch")?;
git::config_set(&repo_dir, "user.email", "bot@example.com")?;
Python
import dkdc_sh
path = dkdc_sh.which("tmux")
dkdc_sh.require("git")
output = dkdc_sh.run("echo", ["hello"])
dkdc_sh.tmux_new_session("my-service", "python server.py")
logs = dkdc_sh.tmux_capture_pane("my-service", lines=50)
dkdc_sh.tmux_kill_session("my-service")
dkdc_sh.git_clone_shallow("https://github.com/org/repo.git", "./dest", "main")
dkdc_sh.git_checkout_new_branch("./repo", "feature/branch")