Repo Man · Integration API

Repo Man
Plugin API.

A tiny JavaScript API for teaching Repo Man how to detect and back up dependencies from any package ecosystem. One file, no build step.



Quickstart

A plugin in under 30 lines.

Three constants and one function. That's the entire contract. The example below teaches Repo Man to back up Go module dependencies.

JavaScript go-modules.js
// 1. Stable ID — becomes the backup subfolder name.
const kindLabel = "go-modules";

// 2. Human-readable name shown in Settings → Integrations.
const displayName = "Go Modules";

// 3. Filenames to search for in every cloned repository.
const manifestFileNames = ["go.mod"];

// 4. Parse function — return Git URLs to back up.
function detect(fileContent, filePath) {
    var results = [], seen = {};
    var knownHosts = ["github.com", "gitlab.com", "bitbucket.org"];
    var re = /^\s*(?:require\s+)?([^\s]+)\s+v[\d]/gm;
    var m;
    while ((m = re.exec(fileContent)) !== null) {
        var mod = m[1].trim();
        var host = mod.split("/")[0];
        if (knownHosts.indexOf(host) === -1) continue;
        var url = "https://" + mod;
        if (!seen[url]) {
            seen[url] = true;
            results.push({ url: url, name: mod.split("/").pop() });
        }
    }
    return results;
}
Full plugin reference → Download sample plugins