Skip to main content

cc-shellback-kit

License: MIT Version CI CD Python Version Download Ask DeepWiki docs

Shellback is a robust, architecturally-agnostic Python library designed to bridge terminal environments (Bash, CMD, PowerShell) with Python scripts. It provides a clean, decoupled abstraction layer to execute system commands while maintaining persistent session state and cross-platform compatibility.

Built with Hexagonal Architecture (Ports and Adapters) principles, Shellback ensures that your domain logic remains independent of the specific shell or operating system being used.


📍 Contents


Installation

You can install cc-shellback-kit using pip:

pip install cc.shellback-kit

Usage

from cc_shellback_kit import Bash, ConsoleLogObserver, Command

# 1. We configure the observer to see the activity in the console
observer = ConsoleLogObserver()

# 2. We start the Shell using the context manager (with)
with Bash(observer=observer) as shell:
    
    # --- EXECUTION OF EXTERNAL COMMANDS ---
    # We create a simple command: 'ls -la'
    cmd_list = Command("ls").add_args("-la")
    result = shell.run(cmd_list)
    
    if result.is_success():
        print(f"Files found:\n{result.standard_output}")

    # --- STATE MANAGEMENT (VIRTUAL BUILT-INS) ---
    # We change directory (this affects the SessionContext, not just the process)
    shell.run(Command("cd").add_args("/tmp"))
    
    # We verify the change by running 'pwd'
    shell.run(Command("pwd"))

    # --- ENVIRONMENT VARIABLES ---
    # We export a variable that will persist during this 'with' block
    shell.run(Command("export").add_args("APP_STAGE=development", "DEBUG=true"))

Metadata

Release files for cc.shellback-kit 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cc.shellback-kit 0.5.0
File Size Uploaded
cc_shellback_kit-0.5.0.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cc.shellback-kit 0.5.0
File Interpreter ABI Platform
cc_shellback_kit-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.4 kB

Release files / cc_shellback_kit-0.5.0.tar.gz

Download URL cc_shellback_kit-0.5.0.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
733bc14e5d54b17d800ad9236f7f3f72c1cec7e2038c615678a23646a84779cb
BLAKE2b-256 checksum
How to use checksums
cf42ca15eb75616f4a00d036f9aaff1152072ece9b8c87d855d06e7fd653eb06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cc_shellback_kit-0.5.0-py3-none-any.whl

Download URL cc_shellback_kit-0.5.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9322ac8d04b05a07373bce7c1347283fb955073008f918c3171a56b58edf0a03
BLAKE2b-256 checksum
How to use checksums
e96e306db27018af3f78b7cf0283c4c330985d567bf65ddcc4ae8f361b01b683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page