This project is a command-line tool that streamlines the setup of new software projects with automated configuration, directory scaffolding, and version control. It serves as a practical demonstration of fundamental skills in configuration management, automation, and DevOps best practices.
The tool has three primary functions:
- Automated Configuration: It installs required software packages from
config.yamlacross a wide range of operating systems (apt,dnf,brew,winget). - Project Scaffolding: It creates a custom directory structure (
src/,tests/, etc.) and initial files based on your configuration. - Secure Version Control: It initializes a Git repository, enforces security rules (ignoring secrets), and performs the first commit programmatically.
- Cross-Platform Support: Automatically detects the system's package manager and installs the correct packages.
- Smart CLI: New Feature! Use command-line flags (e.g.,
--name) to customize the project setup on the fly without editing code. - Project Scaffolding: New Feature! Define your project's folder structure and starter files in
config.yaml, and the tool will build the directory tree for you. - Security First: New Feature! Automatically checks and enforces
.gitignorerules to ensure sensitive files like.envand.venv/are never committed. - Automated Environment Variables: Securely generates a
.envfile for project secrets and updates system-wide shell profiles (like.bashrc) for global pathing. - Automated Python Environment: Optionally creates a Python virtual environment and installs necessary project dependencies (
requests,numpy, etc.) viapip. - Post-Setup Hooks: Define custom shell commands (like
pip freeze > requirements.txtornpm install) that run after setup but before the final commit.
Follow these steps to use the automation tool for your projects.
- Python 3: Ensure
python3is installed and accessible in your system's PATH.
-
Clone the Repository:
git clone https://github.com/Shafiyullah/Project_Initilizer_CLI.git
cd Project_Initilizer_CLI -
Edit Configuration (Optional): Open
config.yamlto customize thePACKAGES_TO_INSTALL,PROJECT_STRUCTURE, orENVIRONMENT_VARIABLES. -
Run the Setup Script: You can run the script with default settings or use arguments to customize the execution.
Standard Run (uses defaults):
python main.py
- Python: The core programming language used for the automation logic.
- argparse: A Python library for robust command-line argument parsing.
- subprocess module: Used to execute system commands and Git operations safely.
- logging module: Used for creating a detailed log of all setup operations.
- Git: The project itself is version-controlled, and the script automates Git initialization.