Termux development environment setup tool (PostgreSQL, Redis, etc.)
Project description
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.
📖 About
Why does this exist? Setting up services like PostgreSQL or Redis on a mobile environment can be tricky. tds abstracts away the complexity, providing a seamless experience for developers who want to code on the go. Whether you're building a backend API or learning cloud engineering, tds prepares your environment so you can focus on writing code.
🚀 Quick Start
Prerequisites
- Termux with Proot-Distro (Ubuntu recommended) installed.
- Python 3.8+
pip(Python Package Installer)
Installation
Install tds directly from the source with a single command:
pip install .
Usage Example
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 (Is it running?)
tds manage postgres status
# 4. Connect to your database
# (Connection string provided in output)
✨ Key Features
- PostgreSQL Management: God Level control over your database. Install, configure, start, stop, and restart with ease.
- Redis Support: Full lifecycle management for Redis, including password protection and persistence settings.
- OpenTelemetry Management: Full lifecycle management (start, stop, status) for the OTEL collector.
- Google Cloud CLI: Seamless installation of
gcloudto manage your GCP resources from your phone. - Smart Validation: Built-in checks for ports, configuration paths, and environment variables.
- Robust Error Handling: informative error messages to help you debug setup issues quickly.
⚙️ Configuration & Advanced Usage
Customize your setup using Environment Variables. tds respects these variables during setup and execution.
Environment Variables
| Variable | Description | Default Value |
|---|---|---|
PG_PORT |
PostgreSQL listening port | 5432 |
PG_DATA |
PostgreSQL data directory | /var/lib/postgresql/data |
PG_LOG |
PostgreSQL log file path | /var/log/postgresql/postgresql.log |
PG_USER |
Default PostgreSQL user | postgres |
PG_DB |
Default database to create | app |
REDIS_PORT |
Redis listening port | 6379 |
REDIS_CONF |
Redis configuration file | /etc/redis/redis.conf |
REDIS_DATA_DIR |
Redis data directory | /var/lib/redis |
REDIS_PASSWORD |
Redis password (if any) | "" (Empty) |
APPENDONLY |
Redis Append Only Mode | yes |
OTEL_VERSION |
OpenTelemetry Collector version | 0.137.0 |
Note: Paths like
/var/librefer to the path inside your Proot environment.
CLI Command Reference
| Command | Action | Description |
|---|---|---|
tds setup postgres |
Setup | Install & Init PostgreSQL |
tds setup redis |
Setup | Install & Configure Redis |
tds setup otel |
Setup | Download & Install OTEL Collector |
tds setup gcloud |
Setup | Install Google Cloud CLI |
tds manage postgres |
start, stop, restart, status |
Control PostgreSQL Service |
tds manage redis |
start, stop, restart, status |
Control Redis Service |
tds manage otel |
start, stop, restart, status |
Control OpenTelemetry Collector |
🏗️ Architecture
tds is built with modularity in mind, separating service logic from the CLI interface.
Directory Structure
src/termux_dev_setup/
├── cli.py # Entry Point (Argparse logic)
├── config.py # Configuration Classes & Validation
├── gcloud.py # Google Cloud Installer
├── otel.py # OpenTelemetry Installer
├── postgres.py # PostgreSQL Installer & Manager
├── redis.py # Redis Installer & Manager
└── utils/
├── banner.py # CLI Visuals
├── lock.py # Process Locking
├── shell.py # Shell Command Wrappers
└── status.py # Logging & Output Utilities
Core Logic Flow
- Entry:
cli.pyparses the command (setupormanage). - Configuration:
config.pyloads defaults and overrides them with Environment Variables. - Execution: The specific service module (e.g.,
postgres.py) performs the action.- Setup: Checks prerequisites (apt, users), installs packages, and initializes data directories.
- Manage: Uses process control (like
pg_ctlor direct binary execution) to handle the service state.
- Feedback:
utils.statusprovides rich, colored output to the user.
🗺️ Roadmap
We are constantly evolving! Here is a glimpse of what's next:
- Upcoming:
- 🔌 Plugin Architecture: Add your own services easily.
- 🧪 Automated Testing: More robust integration tests.
- 📊 Observability Stack: Prometheus & Grafana setup.
- Completed:
- ✅ Core Services (PG, Redis, OTEL, GCloud)
- ✅ Service Lifecycle Management (Start/Stop/Restart)
See ROADMAP.md for the detailed vision.
🤝 Contributing & License
We welcome contributions! Whether it's a bug fix or a new feature, please check out our GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termux_dev_setup-2.0.0.tar.gz.
File metadata
- Download URL: termux_dev_setup-2.0.0.tar.gz
- Upload date:
- Size: 40.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6da26655fbc3127750b56e7445daa8336ef04a5ea307fac8fca4c8c11c6ffc52
|
|
| MD5 |
d3c8a8f4bcb222809126503e6a55a245
|
|
| BLAKE2b-256 |
a2733688e56d9843ca45ceb07ddef10e3d9c90e5c5eb29adfcac52568bfb28b4
|
Provenance
The following attestation bundles were made for termux_dev_setup-2.0.0.tar.gz:
Publisher:
publish.yml on dhruv13x/termux-dev-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
termux_dev_setup-2.0.0.tar.gz -
Subject digest:
6da26655fbc3127750b56e7445daa8336ef04a5ea307fac8fca4c8c11c6ffc52 - Sigstore transparency entry: 747630247
- Sigstore integration time:
-
Permalink:
dhruv13x/termux-dev-setup@d6a1caacd5d82d098020cf16bc777f14df196ae6 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/dhruv13x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6a1caacd5d82d098020cf16bc777f14df196ae6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file termux_dev_setup-2.0.0-py3-none-any.whl.
File metadata
- Download URL: termux_dev_setup-2.0.0-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a4bc01fa28f09f22eb1764ccf37f72b7a3b2ae4c5d42fe9ac5ef65e9e604b25
|
|
| MD5 |
4ccbe8deadb88ba2838556e4b0700868
|
|
| BLAKE2b-256 |
8e64bb4b0fbcdbaac2b8a1c0cfb2db60c0ef0190f35b1eacdc3848d5765e794b
|
Provenance
The following attestation bundles were made for termux_dev_setup-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on dhruv13x/termux-dev-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
termux_dev_setup-2.0.0-py3-none-any.whl -
Subject digest:
0a4bc01fa28f09f22eb1764ccf37f72b7a3b2ae4c5d42fe9ac5ef65e9e604b25 - Sigstore transparency entry: 747630248
- Sigstore integration time:
-
Permalink:
dhruv13x/termux-dev-setup@d6a1caacd5d82d098020cf16bc777f14df196ae6 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/dhruv13x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d6a1caacd5d82d098020cf16bc777f14df196ae6 -
Trigger Event:
push
-
Statement type: