Skip to main content

A barebones terminal interaction API

Project description

⬛ Open Terminal

A lightweight API for remote command execution with streaming support.

Quick Start

Run Locally

pip install .
open-terminal run

Docker

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

An API key is auto-generated on startup if not provided. To set your own:

# via CLI flag
open-terminal run --api-key my-secret

# via environment variable
docker run -p 8000:8000 -e OPEN_TERMINAL_API_KEY=my-secret open-terminal

API

GET /health

Health check — no auth required.

POST /execute

Execute a command and return the result.

curl -X POST http://localhost:8000/execute \
  -H "Authorization: Bearer <api-key>" \
  -H "Content-Type: application/json" \
  -d '{"command": "echo hello", "timeout": 30}'
{"exit_code": 0, "stdout": "hello\n", "stderr": ""}

POST /execute?stream=true

Stream output as JSONL (application/x-ndjson):

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"}'
{"type": "stdout", "data": "1\n"}
{"type": "stdout", "data": "2\n"}
{"type": "stdout", "data": "3\n"}
{"type": "exit", "data": 0}

License

MIT

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.4.tar.gz (5.6 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.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for open_terminal-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d3a51ff13ff51b40001dd85c57967477111ada28d2a91a15ca862e0e9c3bba77
MD5 98c6bdba20e2cf368428b9acea5353f9
BLAKE2b-256 5013d82c8a4d619264e4a939fcde83176bc5367169eae77402200507c90c0d35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for open_terminal-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d6731e7f33ebdadfd1093b15c9153d98b042fb808c30179a6c7ecafa1f70dd5f
MD5 90e9151353c1fa09d1c214c101bed527
BLAKE2b-256 fc766db4acc81de2a30d7d3953e0b0ec72d83ed89581a05bf98d07eb5a8db046

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