Skip to content
Proyek

Tentang

One client, every forge.

Alat pengembangan

Cara angka ini diukur

213 bintang13 Fork +1 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+1
dalam 7 hari
+3
dalam 15 hari
+10
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

forges

npm version npm downloads Github Actions Codecov

One client, every forge.

forges is a TypeScript library for working with issues, pull requests, notifications, checks and webhooks on fourteen forges: GitHub, GitLab, Bitbucket, Forgejo, Gitea, Gitee, Azure DevOps, Cursor Origin, Tangled, Pushin.eu, Sourcehut, GitBucket, GitCafe and Upstream. A forge is a service that hosts Git repositories and the collaboration around them. It also reads repositories and their contents from Git hosts without the collaboration, such as Cloudflare Artifacts. Each provider normalises the forge's responses into one data model and declares which operations it supports.

Read the documentation at forges.link.

install

pnpm add forges

forges requires Node.js 22.18 or later.

usage

import { createForges, forgejo, github } from 'forges'

const forges = createForges([
  github({
    auth: { type: 'token', token: process.env.GITHUB_TOKEN! }
  }),
  forgejo({
    baseUrl: 'https://codeberg.org',
    auth: { type: 'token', token: process.env.CODEBERG_TOKEN! }
  }),
])

for await (const notification of forges.notifications.list()) {
  console.log(notification.ref.forge, notification.title)
}

The example above lists the notifications of two forges in a single loop. To go further, the quick start walks you through reading a thread, writing a comment and checking what a forge supports.

documentation

  • Getting started covers installation, import paths and a first call.
  • The guides explain authentication, working with several forges, environment variables, webhooks, capabilities, errors, pagination, browser bundles and testing.
  • The concepts describe the data model, capabilities, providers and events.
  • Each provider page explains how to authenticate and how that forge behaves.
  • The reference lists the API, the capability matrix, errors and JSON schemas.
  • The examples are small, tested projects that use forges.

related projects

  • @agntn/forges: a TypeScript API for GitHub, GitLab, Gitea, Forgejo and GitBucket, with an MCP server and Pi and OMP extensions for agents.
  • git-pkgs/forge: a Go library and CLI for GitHub, GitLab, Gitea, Forgejo, Bitbucket Cloud, Gerrit and Tangled.

contributing

Contributions are welcome. The contribution guide explains how to set up the repository and run the checks.

licence

Made with ❤️

Published under the MIT licence.

Jelajahi proyek terkait

Memuat…