https://github.com/jlleitschuh/moderne-client
https://github.com/jlleitschuh/moderne-client
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jlleitschuh/moderne-client
- Owner: JLLeitschuh
- License: apache-2.0
- Created: 2023-11-20T19:49:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-24T20:41:21.000Z (over 2 years ago)
- Last Synced: 2025-04-02T11:24:00.749Z (about 1 year ago)
- Language: Python
- Size: 235 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Moderne Client
[](https://github.com/JLLeitschuh/moderne-client/actions/workflows/ci.yml)
[](https://codecov.io/gh/JLLeitschuh/moderne-client)
This is a client for the [Moderne](https://moderne.io) API.
It is how Jonathan Leitschuh generates automated pull requests to fix vulnerabilities, at-scale, across the entire open source ecosystem.
## Why?
Running a Moderne recipe once via their UI is easy, but what if you want to run a recipe on a scheduled basis across
all of your repositories? Moderne doesn't, currently, support campaigns. This fills that gap.
## Usage
This client can either be used as a standalone script, or as a library.
### Secrets
All environment variables are either read directly from the environment or a `.env` file in the execution directory.
The client requires a few secrets to be set in the environment:
#### Moderne API Token
Can either be read from:
- `~/.moderne/token.txt` file
- `MODERNE_API_TOKEN` environment variable
This is required for all moderne API calls.
#### GitHub API Token
Can either be read from:
- `~/.config/hub` file
- `GITHUB_TOKEN_FOR_MODERNE` environment variable
This is required only when attempting to create pull requests.
#### GPG Key
In order to support GPG signing commits, there are two options:
1. Set the following environment variables:
- `GPG_KEY_PUBLIC_KEY`
- `GPG_KEY_PRIVATE_KEY`
- `GPG_KEY_PASSPHRASE`
2. Set the following environment variables and the rest of the data will be loaded from your local gpg install:
- `GPG_KEY_ID`
- `GPG_KEY_PASSPHRASE`
This is required only when attempting to create pull requests.
### CLI Usage
To install the CLI dependencies use the following command:
```bash
pip install .[cli]
```
For live development, you can use the following command to install the CLI in editable mode:
```bash
pip install -e .[cli]
```
To see more information about developing the CLI, see the [CONTRIBUTING](CONTRIBUTING.md) guide.
To use it as a script, you can run it like this:
```bash
moderne-client --help
```
### Library Usage
TODO