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.5.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.5-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: open_terminal-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 2f97d92ccd0a861cb47940468ae4c1cd7d1b471c60ba5b18be563addc51eebfe
MD5 7be43ce2d23bc91e79a04e81de8dbfc0
BLAKE2b-256 e7c24cf94da2d887c972d9ac05239a8f2d8b6ec70fdb117bebe59885920f8443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for open_terminal-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 40ec4c4bd70c06252d0c36f8a82f3cc8ead5df183424a985324da623a294824f
MD5 d61039ca2436093a16ea10efbc1653fc
BLAKE2b-256 639d5dfe889cadadb7ff666365d64a4dd12fdf6197735fc99ed1359d37e8636d

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