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.
Resources
Everything you need
to get started.
Plugin Guide
The complete reference: plugin contract, metadata fields, the detect() function,
sandbox model, validation rules, runtime limits, and annotated examples for six ecosystems.
Read the guide →
Sample Plugins
Four ready-made plugins — for npm, CocoaPods, Cargo (Rust), and Ruby Gems — that you can import directly into Repo Man or use as a starting point for your own.
Browse plugins →
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;
}