Skip to main content

A minimal terminal interaction API

Project description

⚡ Open Terminal

A lightweight API for running shell commands remotely — with real-time streaming and secure access.

Getting Started

Docker (recommended)

docker run -p 8000:8000 -e OPEN_TERMINAL_API_KEY=your-secret-key ghcr.io/open-webui/open-terminal

If no API key is provided, one is auto-generated and printed on startup.

Build from Source

docker build -t open-terminal .
docker run -p 8000:8000 open-terminal

Bare Metal (if you like to live dangerously)

pip install open-terminal
open-terminal run --host 0.0.0.0 --port 8000 --api-key your-secret-key
Option Default Env Var Description
--host 0.0.0.0 Bind address
--port 8000 Bind port
--api-key auto-generated OPEN_TERMINAL_API_KEY Bearer API key

Usage

Run a Command

curl -X POST http://localhost:8000/execute \
  -H "Authorization: Bearer <api-key>" \
  -H "Content-Type: application/json" \
  -d '{"command": "echo hello"}'

Stream Output

curl -X POST "http://localhost:8000/execute?stream=true" \
  -H "Authorization: Bearer <api-key>" \
  -H "Content-Type: application/json" \
  -d '{"command": "for i in 1 2 3; do echo $i; sleep 1; done"}'

Output streams as JSONL:

{"type": "stdout", "data": "1\n"}
{"type": "stdout", "data": "2\n"}
{"type": "stdout", "data": "3\n"}
{"type": "exit", "data": 0}

Upload a File

From URL:

curl -X POST "http://localhost:8000/files/upload?url=https://example.com/data.csv&path=/tmp/data.csv" \
  -H "Authorization: Bearer <api-key>"

Direct upload:

curl -X POST "http://localhost:8000/files/upload?path=/tmp/data.csv" \
  -H "Authorization: Bearer <api-key>" \
  -F "file=@local_file.csv"

Via temporary link (no auth needed to upload):

# 1. Generate an upload link
curl -X POST "http://localhost:8000/files/upload/link?path=/tmp/data.csv" \
  -H "Authorization: Bearer <api-key>"
# → {"url": "http://localhost:8000/files/upload/a1b2c3d4..."}

# 2. Upload to the link (no auth required)
curl -X POST "http://localhost:8000/files/upload/a1b2c3d4..." \
  -F "file=@local_file.csv"

Download a File

curl "http://localhost:8000/files/download/link?path=/tmp/output.csv" \
  -H "Authorization: Bearer <api-key>"

Returns a temporary download link (valid for 5 minutes, no auth needed):

{"url": "http://localhost:8000/files/download/a1b2c3d4..."}

API Docs

Interactive API documentation is available at http://localhost:8000/docs.

License

MIT — see LICENSE for details.

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

open_terminal-0.1.7.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

open_terminal-0.1.7-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file open_terminal-0.1.7.tar.gz.

File metadata

  • Download URL: open_terminal-0.1.7.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for open_terminal-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1632b420dce4de136b82b46f1e498b0eb0167fe142d4fb34eb73c72141b8feb9
MD5 4317aa4d8c51b06c4844a51cb9fc0cc9
BLAKE2b-256 c5c0b490594225fe0bd4a1d4e587ef4a4916bb6a0cb88c47f565d9bdff4bde95

See more details on using hashes here.

File details

Details for the file open_terminal-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for open_terminal-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d76048093359051cccdb7877f92018c4562141bd48e5cde578496948642ffaaa
MD5 58035ef6153fa18bc1435f7254d392d9
BLAKE2b-256 37a3ad26d1ba98761c94065321ec006557e40e8a0f6b9fd6b173e65bd0fe57f8

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