Automate the entire Software Development Lifecycle.
Project description
BLU CLI 🌔
BLU CLI is an, AI Powered, command-line interface designed to streamline the SDLC by automating project workflows. Includes automations for source control, CI/CD, ticket and documentation generation, and other processes.
This tool simplifies tasks like managing source control repositories i.e Github, CI/CD i.e github actions, Project management workflows and more, allowing teams to focus on building and delivering software efficiently.
Table of Contents
️ Features ⚙️
- Automation Tools: Scripts for automating repetitive tasks, such as data processing, file management, github actions, and API integration.
- Data Utilities: Scripts for data extraction, transformation, and analysis, including basic visualizations.
- Task Scheduling: Scripts to schedule and automate recurring tasks (e.g., backups, log parsing).
Getting Started 🔑
Prerequisites
Ensure you have the following installed:
- Python3 for running the scripts in this repo
- Pip3 pythons package manager used to install the pypi package BLU
Installation
Via PyPI
Install the latest version using pip:
pip install blu
Via Source
Clone the repository and install it locally:
git clone https://github.com/dj-io/blu/blu-cli.git
cd blu-cli
pip install -r requirements.txt
Usage 🛠
BLU provides a collection of commands designed to streamline your development workflows. After installation, the blu command is available in your terminal.
Show Available Commands
Run the following to see a list of available commands and their descriptions:
blu --help
example output:
Usage: blu COMMAND [ARGS] [OPTIONS]...
Options:
--help Show this message and exit.
Commands:
gh-create Create and push a new repository to GitHub.
gh-delete Delete remote and local repositories, 1 by 1 or in bulk.
gh-add Push an existing local repository to a new GitHub repo.
Show Command Features
Run the following to see a more descriptive output of commands features and usage:
blu <command> --help
example output:
Usage: blu gh-create [OPTIONS]
Create a new GitHub repository and initialize it locally.
Features:
- Allows you to specify a repository name and description.
- Option to choose whether the repository is public or private.
- Automatically initializes the repository with a README.
- Sets up a remote connection to GitHub using the GitHub CLI.
Considerations:
- Ensure you are authenticated with the GitHub CLI (`gh auth login`) before using this command.
- Requires the GitHub CLI installed locally.
Options:
-h, --help Show this message and exit.
Key Features
-
Interactive Directory Selection
blu automatically detects directories and provides multiple options:
- Use the current working directory.
- Select an existing directory from a list.
- Create a new directory if needed.
Example Prompt:
Would you like to use the current directory as the parent directory? (yes/no)
-
Caching
The CLI stores information and preferences needed for use with various integrations i.e GitHub username for future use, eliminating repetitive inputs. If the username is already cached, the CLI will prompt you to reuse it.
Example Prompt:
Using cached GitHub username: dj-io
Contributing 💡
Getting started:
-
Fork the repository.
gh repo fork https://github.com/dj-io/blu.git --remote=true
-
Create a new branch to your feature or bug fix:
git checkout -b feature/your-feature-name
-
Commit your changes:
git commit -m "Description of your changes"
-
Push to your branch:
git push origin feature/your-feature-name
-
Open a pull request on Github.
Developer Mode 🪄:
Setting up developer mode
Developer mode enables additional CLI commands (e.g., blu build and blu deploy) that are not available in production. Follow these steps to configure and use developer mode:
1. Create Environment Files
- Navigate to the root directory of the project.
- Create .env.dev and .env.prod files based on the provided .env.sample file.
cp .env.sample .env.dev
cp .env.sample .env.prod
- Edit the .env.dev and .env.prod files with your environment-specific variables. For example:
blu_DEV_MODE=1
2. Enable Developer Mode. Run the following command in your terminal to enable developer mode:
export ENV=dev
- This sets the ENV variable to dev for the current terminal session, which ensures the script loads .env.dev and enables developer-specific features.
Using Developer Mode
Developer mode commands are available for contributors to streamline package development, testing, and deployment. These commands allow developers to rebuild and deploy blu.
Available Commands
-
Build
Use the blu build command to rebuild the package during development. This ensures all changes to the codebase are reflected in the package.
blu build- The command includes prompts to:
- Cleans up old build artifacts.
- Rebuilds the package into the dist/ directory
- Installs the package locally for testing
- Automatically installs missing dependencies from
requirements.txt
- The command includes prompts to:
-
Deploy Use the blu deploy command to package and deploy the CLI to PyPI (or TestPyPI)
blu deploy-
The command includes prompts to:
- Select between TestPyPI or Prod PyPI.
- Provide changelog or release notes.
- Confirm the deployment target.
- Automatically detects the .pypirc file and verifies its validity.
-
Example
blu deploy --test # Deploy to TestPyPI blu deploy --prod # Deploy to Prod PyPI
-
-
Clean up Use the blu clean-up command to run linting checks and automatically resolve using
flake8andblackblu clean-up- The command includes prompts to:
- Confirm clean-up action if linting issues are found.
- Traverses code base and runs black on each file with linting issues present
- The command includes prompts to:
Additional Notes
-
The deploy command is only executable with credentials provided upon request -
Switching Modes:
- To switch back to production mode, run:
export ENV=prod
- This switch happens automatically during deployments.
-
Ensuring a Valid
.pypircFile Exists:The deploy command relies on the
.pypircconfiguration file for TestPyPI and ProdPyPI deployments:- Automatic Detection
-
The CLI automatically detects the
.pypircfile in your home directory (~/.pypirc) during deployment. -
If the file is missing or lacks the necessary credentials for TestPyPI or ProdPyPI, the CLI will prompt you to create or update it.
- Structure of .pypirc:
Ensure your .pypirc file contains the correct repository configuration:
[distutils] index-servers = pypi testpypi [pypi] repository = https://upload.pypi.org/legacy/ username = __token__ password = your-prod-token [testpypi] repository = https://test.pypi.org/legacy/ username = __token__ password = your-test-token
- Prompts for Missing Credentials:
- DON'T WORRY, If the
.pypircfile is incomplete (e.g., missing a repository, username, or password), the CLI will guide you through updating it!
-
-
Run
blu --helpin developer mode to view the full list of available commands -
If you modify .env.dev or .env.prod, reload your environment variables:
source ~/.zshrc # For Zsh source ~/.bashrc # For Bash
Guidelines:
- Ensure your code is well-documented and adheres to PEP 8 standards.
- Add tests for any new features or bug fixes.
- Do Not Commit Sensitive Data: Ensure .env.dev and .env.prod are excluded from version control by including them in .gitignore.
- Testing Locally: Use
blu buildto test changes locally before deploying to PyPI or TestPyPI. - Deploy Responsibly: Always verify the environment (dev or prod) before running deployment commands to avoid accidental production deployments.
Versioning:
Given a version number major.minor.patch, all:
- Breaking backwards compatibility bumps the MAJOR
- New additions without breaking backwards compatibility bumps the MINOR
- Bug fixes and misc changes bump the PATCH
For more information on semantic versioning, please visit http://semver.org/.
License: 📜
Copyright Stratum Labs LLC.
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments 🙏
BLU is inspired by the need to streamline development workflows. Special thanks to all future contributors who will help shape this project.
Project details
Release history Release notifications | RSS feed
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 blu_cli-0.1.0.tar.gz.
File metadata
- Download URL: blu_cli-0.1.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
825fd578a0ab09c4ef68682fb7cefcc3616bc61110ca2496a5528d8d71e098b1
|
|
| MD5 |
484df19435e80ac2b3b43d6decdccbb3
|
|
| BLAKE2b-256 |
9a9c86e0e7e12ab2822d613bc1eed1238a9c51758cd24312b577c6b09779ddbe
|
File details
Details for the file blu_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: blu_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aee6027602290ec2841874a8630a11f9252c454f6f68c276e0da6c986e2e767
|
|
| MD5 |
4f8166c06ab3e81e4b0b2ef8ea9386d0
|
|
| BLAKE2b-256 |
d0b60e19651960e8725d9f988624a71d689bb1ade3585b8f5ebe1b684fcae65d
|