Skip to content

taufanAli65/microservices-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

MARS – Microservices Automated Repo Sync

MARS is a lightweight CLI helper for teams working with many git-based microservices. It keeps a local inventory of projects, lets you open or inspect any service quickly, and runs common git chores (fetch/pull, branch switching) across repos from one place.

Features

  • Register a microservices project (auto-detects all git repos in a root folder)
  • Language support: English and Indonesian (-lang en|id)
  • Inventory view of all registered projects
  • List repo status (branch + clean/modified) across a project or a specific repo
  • Open a project or a specific repo in your file explorer
  • Batch git fetch/pull for all repos in the active project
  • Batch branch switching across repos (or a single repo)

Prerequisites

  • macOS, Linux, or Windows
  • git available in your shell
  • Bash (macOS/Linux ship with it; on Windows use Git Bash or WSL)

Installation & Initialization

Follow the steps for your platform. Replace <path-to-project> with the directory where you cloned this repo.

macOS / Linux

  1. Clone the repository:
    git clone https://github.com/taufanAli65/microservices-manager.git microservices_manager
    cd microservices_manager
  2. Make the script executable:
    chmod +x manager.sh
  3. (Optional) Add to PATH for convenience:
    # example: symlink to /usr/local/bin
    ln -s "$(pwd)/manager.sh" /usr/local/bin/mars
  4. Run the tool:
    ./manager.sh -h
    # or, if symlinked
    mars -h

Windows

  • Use Git Bash or WSL for best compatibility.
  • Clone the repo, then run the script via:
    bash manager.sh -h
  • To make it easier to call, add an alias/function in your shell profile (e.g., .bashrc / .bash_profile / .bash_aliases).

How MARS Stores Data

Configuration is stored at ~/.mars_config with entries like:

LANG=en
PROJECT|MyProject|/absolute/path/to/root|repoA repoB repoC

Usage

All commands are executed from Bash. Examples assume the script is available as mars (symlink/alias) but ./manager.sh works the same.

Register a microservices project

From the project root containing multiple git repos:

mars init

The tool scans subfolders containing .git, saves them to ~/.mars_config, and prompts for a project name (defaults to the current folder name).

List inventory

mars -i

Shows all registered projects and their root paths.

List repo status (git status summary)

mars -l            # auto-detect project from current path
mars -l -i Apollo  # check a specific project from anywhere
mars -l -i Apollo -r apollo-kit  # only a specific repo

Outputs current branch and whether the repo is clean or modified.

Open project or repo folder

mars -o Apollo            # open project root in Finder/Explorer
mars -o Apollo -r api-gateway  # open a specific repo

Update all repos (fetch + pull origin main)

mars -a

Run inside a registered project (auto-detected) to fetch & pull all repos. Use -r <repo> with -a if you extend the script similarly to other commands.

Switch branches across repos

mars -s -b dev        # switch all repos to branch 'dev'
mars -s -b main -r ui # switch only the 'ui' repo

Delete a project from config

mars -d Apollo

Removes the project entry from ~/.mars_config (does not delete files).

Change language

mars -lang en
mars -lang id

Help

mars -h

Shows the command summary and examples.

Tips & Conventions

  • Keep repo names unique within a project to avoid ambiguity.
  • Run mars -l regularly to ensure working directories are clean before batch operations.
  • The -a command pulls from origin main; adjust as needed if your default branch differs.

Contributing

  1. Fork the repository and create a feature branch: git checkout -b feature/my-change
  2. Make changes and add tests/docs where helpful.
  3. Ensure the script remains POSIX-friendly for macOS/Linux and works in Git Bash/WSL on Windows.
  4. Commit with clear messages and open a pull request describing the change and testing done.

License

This project is licensed under the MIT License. See LICENSE for details.

About

MARS is a lightweight CLI helper for teams working with many git-based microservices. It keeps a local inventory of projects, lets you open or inspect any service quickly, and runs common git chores (fetch/pull, branch switching) across repos from one place.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages