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.3.tar.gz (4.4 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.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for open_terminal-0.1.3.tar.gz
Algorithm Hash digest
SHA256 91945585dacd89e515b825fd21ea7ec736700dffeec1fe05ecd538a956a215b3
MD5 178e02ca03b7798831c51c33f2d3adca
BLAKE2b-256 cf83f3f3e461644aa8d6c692b1b71151a57aebe08292b6df2652445e1d7325b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for open_terminal-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6216eee344c1e2822ae8da19712f2e8adef77d48093064874cc036cc4ca86637
MD5 c7890c742f868f81e1598d8649bf517b
BLAKE2b-256 bc07b4315d8d668c97d36c9834eb9517fb079503548bd0a835089dd77c75d954

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