Skip to main content

Reusable terminal session core with optional web terminal extras.

Project description

Bamboo SSH

This project currently provides a reusable PTY-backed shell session core and an optional FastAPI web terminal adapter. It is designed for local or otherwise trusted environments.

It is not an SSH transport layer yet. The current implementation launches a real shell on the host where the service runs.

Requires Python 3.12 or newer.

Full Documentation

See the documentation set in docs/:

Install Profiles

The package supports three install modes:

  • pip install bamboo-ssh for the reusable core package
  • pip install "bamboo-ssh[web]" for the FastAPI web terminal adapter
  • pip install "bamboo-ssh[full]" for the web adapter plus built-in config-file auth helpers

From this checkout, install the matching local package profile with:

python -m pip install .
python -m pip install ".[web]"
python -m pip install ".[full]"

Use requirements.txt for contributor setup. It installs the editable project with the full and dev extras.

Make Targets

For local contributor and release helpers:

  • make install creates .venv and installs requirements.txt
  • make clean removes local build and test artifacts
  • make build creates a source distribution and wheel in dist/
  • make deploy builds and uploads dist/* to PyPI with twine

For make deploy, authenticate with PyPI first, typically with a token in TWINE_PASSWORD.

Quick Start

python3 -m venv .venv
. .venv/bin/activate
python -m pip install ".[full]"
bamboo-ssh auth init
bamboo-ssh serve --host 127.0.0.1 --port 8765

Open http://127.0.0.1:8765/.

If the default config file exists, bamboo-ssh serve loads it automatically. Use --config /path/to/config.toml to point at a different file.

Embedded Usage

Other Python projects can import the package without using the built-in web auth flow.

Use the core session API directly:

from bamboo_ssh.core.session import TerminalSession

session = TerminalSession.start(cols=80, rows=24)
session.write("printf 'hello\\n'\n")
session.close()

Or mount the web adapter inside another backend:

from bamboo_ssh.adapters.fastapi_app import create_app

terminal_app = create_app()
protected_terminal_app = create_app(config_path="/etc/bamboo-ssh/config.toml")

Built-In Auth

The standalone auth mode is intentionally simple:

  • one admin username
  • password hash stored in a TOML config file
  • signed session cookie for the browser
  • no database

Manage it with:

bamboo-ssh auth init
bamboo-ssh auth set-password
bamboo-ssh auth show-config-path

After login, the terminal page loads normally. POST /logout clears the session cookie and returns the browser to the login page.

Shell Startup Tuning

Web terminal shell sessions export WEB_TERMINAL=1.

If your shell startup files do expensive optional work such as loading large completion bundles, language managers, or interactive prompts, you can use that variable to skip them for browser terminal sessions while keeping a full login shell for normal terminal use.

Docker Quick Start

cp docker/.env.example docker/.env
docker compose -f docker/compose.yml --env-file docker/.env up --build

This runs the terminal inside a Python 3.12 container. The browser terminal connects to the shell inside the container, not the host machine shell.

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

bamboo_ssh-0.1.0.tar.gz (97.1 kB view details)

Uploaded Source

Built Distribution

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

bamboo_ssh-0.1.0-py3-none-any.whl (89.0 kB view details)

Uploaded Python 3

File details

Details for the file bamboo_ssh-0.1.0.tar.gz.

File metadata

  • Download URL: bamboo_ssh-0.1.0.tar.gz
  • Upload date:
  • Size: 97.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bamboo_ssh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d2d700a703f4d0a69f08d4ddbdb3aec8e823d8b8c07e24ffe2c5135335fafd5
MD5 cea27594e840db5f81f636eda11b9cc3
BLAKE2b-256 0469a33996d948f2f135678529d51df3145cb86c56d05fb211378f2061770bf3

See more details on using hashes here.

File details

Details for the file bamboo_ssh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bamboo_ssh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 89.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bamboo_ssh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3e97f12be911a8560536095594dbdcc94a56424ea05222c24353cc679bc12df
MD5 33e7ee29b9b7b375f371c4e8bebbebfa
BLAKE2b-256 c71e46ab2e782ddf244d0b1185a899af879700921ef7f511200106fbc6ad6c46

See more details on using hashes here.

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