termux-dev-setup (tds)
Your "Batteries Included" Development Environment for Termux.
tds is a powerful CLI tool designed to effortlessly set up and manage a production-grade development environment inside Termux (Proot/Ubuntu). Forget manual configuration files and permission headaches—get your database, cache, and cloud tools running in seconds.
⚡ Quick Start
Prerequisites
- Termux with Proot-Distro (Ubuntu recommended).
- Python 3.8+ installed.
- Basic knowledge of terminal operations.
Installation
Install tds directly from the source with a single command:
pip install .
Or via PyPI (Recommended for users):
pip install termux-dev-setup
Run
Launch the interactive wizard to get started immediately:
tds --interactive
Demo
Get a PostgreSQL database up and running in under a minute:
# 1. Install and Configure PostgreSQL
tds setup postgres
# 2. Start the Server
tds manage postgres start
# 3. Check Status
tds manage postgres status
✨ Features
💎 Core Services
- PostgreSQL: Production-ready setup with
pg_ctl. Manage users, databases, and logs effortlessly. - Redis: Secure, persistent cache with full lifecycle management. Includes password protection and persistence settings.
- OpenTelemetry: Observability out-of-the-box. Install and manage the OTEL Collector for metrics and traces.
- Google Cloud CLI: Seamless installation of
gcloudto manage your GCP resources from your pocket.
🚀 Performance & UX
- Interactive Mode: A user-friendly wizard (
tds -i) guides you through setup without memorizing flags. - Smart Validation: Built-in checks for ports, configuration paths, and environment variables prevent errors before they happen.
- Version Control: Specify exactly which version of a service you need (e.g.,
tds setup postgres --version 15).
🛡️ Security
- Secure Defaults: Redis is configured with protected mode and password support.
- Non-Root Execution: Services run as the current user, avoiding dangerous root permissions in the container.
🛠️ Configuration
Customize your setup using Environment Variables. tds respects these variables during setup and execution, allowing for flexible deployments.
Environment Variables
| Variable | Description | Default Value | Required |
|---|---|---|---|
PG_PORT |
PostgreSQL listening port | 5432 |
No |
PG_DATA |
PostgreSQL data directory | /var/lib/postgresql/data |
No |
PG_LOG |
PostgreSQL log file path | /var/log/postgresql/postgresql.log |
No |
PG_USER |
Default PostgreSQL user | postgres |
No |
REDIS_PORT |
Redis listening port | 6379 |
No |
REDIS_CONF |
Redis configuration file | /etc/redis/redis.conf |
No |
REDIS_DATA_DIR |
Redis data directory | /var/lib/redis |
No |
REDIS_PASSWORD |
Redis password | "" (Empty) |
No |
APPENDONLY |
Redis Append Only Mode | yes |
No |
OTEL_METRICS_PORT |
OTEL Metrics Port | 8888 |
No |
OTEL_GRPC_PORT |
OTEL gRPC Port | 4317 |
No |
OTEL_HTTP_PORT |
OTEL HTTP Port | 4318 |
No |
OTEL_CONFIG |
OTEL Config Path | ~/otel-config.yaml |
No |
CLI Arguments
| Flag/Command | Description | Example |
|---|---|---|
--interactive, -i |
Launch the interactive setup wizard. | tds -i |
setup [service] |
Install and configure a service. | tds setup postgres |
manage [service] [action] |
Control service state (start/stop/restart/status). | tds manage redis start |
--version |
Specify a version during setup. | tds setup postgres --version 15 |
🏗️ Architecture
tds follows a modular architecture, strictly separating the Command Line Interface (CLI) from the core business logic and configuration.
Directory Tree
src/termux_dev_setup/
├── cli.py # Entry Point: Parses arguments & routes commands
├── config.py # Configuration: Dataclasses & Env Var Validation
├── errors.py # Error Handling: Custom TDSError hierarchy
├── gcloud.py # Module: Google Cloud Installer
├── interactive.py # UI: Interactive Wizard Logic
├── otel.py # Module: OpenTelemetry Installer & Manager
├── postgres.py # Module: PostgreSQL Installer & Manager
├── redis.py # Module: Redis Installer & Manager
├── service_status.py # Logic: Service health checking
├── views.py # UI: Rich library views
└── utils/
├── banner.py # UI: CLI ASCII Art & Banner
└── status.py # UI: Logging, Success/Error styling
Data Flow
- User Input:
cli.pyreceives the command or triggersinteractive.py. - Configuration:
config.pyloads defaults and overrides with Environment Variables. - Validation: Ports and paths are validated before any action is taken.
- Execution: The respective module (e.g.,
redis.py) executes the requested action (Setup or Manage). - Feedback:
utils.statusrenders the result to the console using formatted output.
🐞 Troubleshooting
Common Issues
| Error Message | Possible Cause | Solution |
|---|---|---|
Port must be between 1 and 65535 |
Invalid port number in Env Vars. | Check PG_PORT or REDIS_PORT. |
Permission denied |
Trying to write to a protected directory. | Ensure you are running in Proot or use user-writable paths. |
Service failed to start |
Port conflict or bad config. | Check if another service is using the port. Check logs. |
command not found after install |
Path issue. | Ensure Python scripts are in your $PATH. Restart shell. |
Debugging
If a service fails to start, check the specific log files defined in your configuration:
- Postgres:
/var/log/postgresql/postgresql.log(default) - Redis:
/var/log/redis/redis-server.log(default) - OTEL:
~/otel.log(default)
🤝 Contributing
We welcome contributions! Please see our CONTRIBUTING.md for details.
Dev Setup
- Clone the repository.
- Install dependencies:
pip install . - Run tests:
pytest - Lint code:
ruff check .
🗺️ Roadmap
We are constantly improving tds. Here is a snapshot of our upcoming goals:
- Phase 1 (Completed): Core Services (PG, Redis, OTEL, GCloud), Basic Management.
- Phase 2 (Current): Interactive Setup, Version Management.
- Phase 3 (Upcoming): Plugin Architecture, Database Integrations (MySQL/Mongo), Observability Stack.
- Phase 4 (Vision): AI-Powered Tuning, Remote Tunnels.
See ROADMAP.md for the full detailed vision.
Metadata
Release files for termux-dev-setup 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| termux_dev_setup-2.0.1.tar.gz | 41.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| termux_dev_setup-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.1 kB
Release files / termux_dev_setup-2.0.1.tar.gz
| Download URL | termux_dev_setup-2.0.1.tar.gz |
|---|---|
| Size | 41.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c798ed612ffb1c21849e1d285c4152e27bc427f01ceec592bd4f52cdf0620571
|
|
BLAKE2b-256 checksum How to use checksums |
0b2a2984c5c166e64b5b1ba25cd35ec9ce03fc26289240fe38d2551bc69ed16b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 15, 2025.
Transparency logRelease files / termux_dev_setup-2.0.1-py3-none-any.whl
| Download URL | termux_dev_setup-2.0.1-py3-none-any.whl |
|---|---|
| Size | 30.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c7c4785699aba75df3e07cdf7be6027bfd25e862b90946f59ca42f889b6e2ee
|
|
BLAKE2b-256 checksum How to use checksums |
a33e206f829b4da472c937cbc9806cf275e34dfc7acfb6e92ea568549bb040aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 15, 2025.
Transparency log