aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 0697b5ceb9d3225126ac7e208b9b101e7e0ff31f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 🍰 Mugi

> Personal **Mu**lti-**Gi**t (or Tsu**mugi** Kotobuki, if you will) Remote Manager

Mugi keeps your repositories in sync across multiple Git remotes (GitHub, Codeberg, SourceHut, etc.)
with a single command.

Mugi is written in [Go](https://go.dev) and uses [Bubble Tea](https://github.com/charmbracelet/bubbletea)
for its terminal interface.

## Usage

```bash
mugi pull                      # Pull all repos from all remotes
mugi pull windmark             # Pull Windmark from all remotes
mugi push windmark gh cb       # Push Windmark to GitHub and Codeberg
mugi fetch gemrest/september   # Fetch specific repository
```

<br>
<p align="center"><img src="./assets/example_output.png" alt="Example Output Screenshot" width="50%"></p>

### Installation

```bash
go install github.com/Fuwn/mugi/cmd/mugi@main
```

or

```bash
git clone https://github.com/Fuwn/mugi.git
cd mugi
go build -o mugi ./cmd/mugi
mv mugi ~/.local/bin/  # or anywhere in your PATH
```

### Configuration

Mugi uses a YAML config file at `~/.config/mugi/config.yaml`:

```yaml
remotes:
  github:
    aliases: [gh]
    url: [email protected]:${user}/${repo}.git
  codeberg:
    aliases: [cb]
    url: [email protected]:${user}/${repo}.git
  sourcehut:
    aliases: [sh]
    url: [email protected]:~fuwn/${repo}

defaults:
  remotes: [github, codeberg, sourcehut]
  path_prefix: ~/Developer

repos:
  gemrest/windmark:
  gemrest/september:
```

### `--help`

```
Mugi - Personal Multi-Git Remote Manager

Usage:
  mugi [flags] <command> [repo] [remotes...]

Commands:
  pull          Pull from remote(s)
  push          Push to remote(s)
  fetch         Fetch from remote(s)
  add <path>    Add repository to config
  rm <name>     Remove repository from config
  list          List tracked repositories
  help          Show this help
  version       Show version

Flags:
  -c, --config <path>  Override config file path
  -V, --verbose        Show detailed output
  -f, --force          Force push (use with caution)
  -l, --linear         Run operations sequentially

Examples:
  mugi pull                      Pull all repositories from all remotes
  mugi push windmark gh cb       Push to GitHub and Codeberg
  mugi add .                     Add current directory to config
  mugi add ~/Developer/mugi      Add repository at path
  mugi rm mugi                   Remove repository from config
  mugi list                      List all tracked repositories
```

## Licence

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.