Skip to main content

Shell utilities for tmux, git, and command management

Project description

dkdc-sh

crates.io PyPI CI License: MIT

Shell library.

Install

cargo add dkdc-sh
uv add dkdc-sh

Usage

Rust

use dkdc_sh::{which, require, run, tmux, git};

// Command checking
if which("tmux").is_some() { /* ... */ }
require("git")?;

// Run arbitrary commands
let output = run("echo", &["hello"])?;

// Tmux session management
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 operations
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

# Command checking
path = dkdc_sh.which("tmux")
dkdc_sh.require("git")

# Run commands
output = dkdc_sh.run("echo", ["hello"])

# Tmux
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")

# Git
dkdc_sh.git_clone_shallow("https://github.com/org/repo.git", "./dest", "main")
dkdc_sh.git_checkout_new_branch("./repo", "feature/branch")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dkdc_sh-0.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_x86_64.whl (295.3 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.39+ x86-64

dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_aarch64.whl (286.6 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.39+ ARM64

dkdc_sh-0.2.0-cp311-abi3-macosx_11_0_arm64.whl (251.5 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

dkdc_sh-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl (259.6 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file dkdc_sh-0.2.0.tar.gz.

File metadata

  • Download URL: dkdc_sh-0.2.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dkdc_sh-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d0b4ae011640fd9bfafc71d75b071507a41965e28403b06bd2f335558a75527
MD5 76328b0be038d5dec99456a77b87f832
BLAKE2b-256 1491ca6a07ba399dfb3026a7a84a8964d7d7f1719b846e592973063cb3f27a69

See more details on using hashes here.

Provenance

The following attestation bundles were made for dkdc_sh-0.2.0.tar.gz:

Publisher: release-python.yml on dkdc-io/sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 aff8b7c3d982c428016958c4509ae8848d686a03ceb595d0d6df08463f3796cf
MD5 1263bcd848a9e303515142d8ad896dfa
BLAKE2b-256 143edd48ebbe5845aafd3d86263ceba865b0b467d7b9f73f6054b1d010087403

See more details on using hashes here.

Provenance

The following attestation bundles were made for dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_x86_64.whl:

Publisher: release-python.yml on dkdc-io/sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 c9ec1866bcc79d209b6d290d5c2cdefd1546dd5dc468d348f05f7c5d1b57a9df
MD5 9d65219dfe1fd7fc607134220b6ca2da
BLAKE2b-256 d25bf58073de895805c373f6e6d49043bd51050cf2bcfc17ce741c95e1e6c32f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dkdc_sh-0.2.0-cp311-abi3-manylinux_2_39_aarch64.whl:

Publisher: release-python.yml on dkdc-io/sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dkdc_sh-0.2.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dkdc_sh-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f14170740da44f3fe8edd6ec004c8f9029b0908f38a722f30f110fb6ed543972
MD5 1ef5da7515bbb5fd73806c362de6f97f
BLAKE2b-256 15157935582cb153807ad06fd39dadd5c1f0f0179610fd4f2d8affc27ed75993

See more details on using hashes here.

Provenance

The following attestation bundles were made for dkdc_sh-0.2.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release-python.yml on dkdc-io/sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dkdc_sh-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dkdc_sh-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c20e1128cf3479864df7b7554fd88d1caf1431088b57c618dacf3430b55b59c0
MD5 014799237c7da7430dcbea8834d68d82
BLAKE2b-256 2ef0da8874174d1b608d52420237956c0a0c00dcac121eb684c6b71178775ae4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dkdc_sh-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: release-python.yml on dkdc-io/sh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page