Currently, a Nix package is provided as part of this Nix flake. To use it in an ephemeral shell, run `nix shell git+https://codeberg.org/helvetica/forgesync.git`.
If you can't or don't want to use Nix for this, the best option right now is cloning the repository and using `uv run forgesync`.
Here's how you would synchronize your Codeberg repositories to GitHub:
```bash
# Token for gathering source repository metadata and setting up mirrors.
export FROM_TOKEN=my_forgejo_token
# Token for creating and synchronizing repositories at the destination of your choosing.
export TO_TOKEN=my_github_token
# Token used within Forgejo for Git mirroring.
export MIRROR_TOKEN=my_github_mirror_token
# Run the sync:
forgesync \
--from-instance https://codeberg.org/api/v1 \
--to github \
--to-instance https://api.github.com \
--remirror \
--mirror-interval 8h0m0s \
--immediate \
--log INFO
```
## ❄️ Usage as a NixOS module
Not yet.
## ⚠️ Be careful with your data!
> [!WARNING]
> Before running Forgesync, ensure you have backups. The tool will overwrite any repositories at the destination that share the same names as those on the source Forgejo instance. Proceed with caution.
For GitHub fine-grained personal access tokens, this means that you will need to check "all repositories" under repository access and enable read and write permissions on repository contents.