Metadata-Version: 2.2
Name: decterm
Version: 0.1.0
Summary: Cross-platform terminal controllable via Python (and web)
Home-page: https://github.com/decrule/decterm
Author: decterm
Author-email: decrule@outlook.com
License: MIT
Keywords: terminal,shell,cross-platform,automation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
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
Classifier: Topic :: System :: Shells
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: author-email
Dynamic: home-page
Dynamic: requires-python

# decterm

Cross-platform terminal you can drive from Python. Run shell commands and get output, with or without a GUI.

- **No GUI** (default): headless, ideal for scripts and servers.
- **GUI mode**: live terminal window (tkinter) where you can type commands and see output.

## Quick start

```bash
pip install decterm
```

```python
from decterm import DecTerm

# Headless
dt = DecTerm()
print(dt.send("dir"))       # or "ls" on Unix
print(dt.sends("cd /tmp", "pwd"))
dt.close()

# With GUI
dt = DecTerm(gui=True)
dt.send("echo Hello")
# Type commands in the window, then:
dt.close()
```

## API (concise)

| Method | Description |
|--------|-------------|
| `DecTerm(gui=False, cwd=None, env=None)` | Start a shell. `gui=True` opens a terminal window. |
| `send(cmd, timeout=30)` | Run one command, return output. Times out for interactive programs (e.g. `python`). |
| `sends(*cmds, timeout=30)` | Run several commands in order; returns last command’s output. |
| `close()` | Stop the shell. |

Use `timeout=None` in `send()` to wait indefinitely.

## Requirements

- Python 3.7+
- Windows, macOS, or Linux  
- No extra packages (uses only the standard library, including tkinter for GUI).

## License

MIT
