Metadata-Version: 2.4
Name: gradio-terminal
Version: 0.1.0
Summary: A Gradio component that provides a fully functional terminal using xterm.js and PTY
Author: Po-Hsuan Huang
Author-email: Po-Hsuan Huang <aben20807@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/aben20807/gradio-terminal
Project-URL: Repository, https://github.com/aben20807/gradio-terminal
Project-URL: Issues, https://github.com/aben20807/gradio-terminal/issues
Keywords: gradio,terminal,xterm,pty,shell
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gradio>=6.3.0
Requires-Dist: flask>=3.1.2
Requires-Dist: flask-socketio>=5.6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=4.0.0; extra == "dev"
Dynamic: author
Dynamic: license-file
Dynamic: requires-python

# Gradio Terminal

A Gradio component that provides a fully functional terminal in your browser. This package uses xterm.js on the frontend and a PTY on the backend to provide a real shell experience.

![Gradio Terminal](https://github.com/user-attachments/assets/8a4cc81a-07a4-4c56-a008-bd438eae50de)

## Installation

```bash
pip install gradio-terminal
```

## Quick Start

### Simple Usage

```python
import gradio as gr
from gradio_terminal import Terminal
demo = gr.Blocks()
with demo:
    terminal = Terminal()
demo.launch()
```

## API Reference

`launch_terminal(port=5000, host="127.0.0.1", command="bash", share=False, **launch_kwargs)`

Launch a standalone Gradio app with a terminal.

`create_terminal_demo(port=5000, host="127.0.0.1", command="bash", height=400)`

Create a Gradio Blocks demo with an embedded terminal.

`TerminalServer(port=5000, host="127.0.0.1", command="bash")`

Low-level terminal server for custom integrations.

- `start()`: Start the server and return the URL
- `get_url()`: Get the terminal server URL
- `stop()`: Stop the terminal server

## Requirements

- Python 3.8+
- Linux
- Dependencies: gradio, flask, flask-socketio

## Security Notice

This component provides shell access to your server. Use only in trusted environments.

## License

This project is licensed under the Apache-2.0 License.

## Acknowledgments

- [pyxtermjs](https://github.com/cs01/pyxtermjs) - Inspiration for the terminal implementation
- [xterm.js](https://xtermjs.org/) - Terminal emulator for the browser
- [Gradio](https://gradio.app/) - The awesome ML demo framework
