Git
Typed read/write git operations shared over RPC by every devframe on the host, generalizing the utilities that used to live inside the Git devframe. The exec wrapper and output parsers stay internal; consumers get the typed GitServiceApi in-process (ctx.services.get) and the same ops over devframes:service:git:* RPC.
Package: @devframes/service-git · Scope: devframes:service:git
Installing
defineDevframe({
importMetaUrl: import.meta.url,
services: [
{ package: '@devframes/service-git', options: { cwd: process.cwd() } },
],
})A hub installs a shared instance with initHub({ services: [createGitService(options)] }).
Options
GitServiceOptions — cwd merges as a scalar (later installer wins).
| Option | Type | Description |
|---|---|---|
cwd | string | Repository directory to operate on. Defaults to the context's cwd; the repo root is discovered once (rev-parse --show-toplevel) and memoized. |
RPC functions
Registered under devframes:service:git:*. Reads are query; writes are action. Write ops are always exposed — authorization is the host's connection-trust boundary. The service defines no dump/snapshot; a devframe bakes what it needs via snapshotRpc.
| Function | Type | Args | Returns |
|---|---|---|---|
status | query | — | Working-tree status: branch, ahead/behind, staged/unstaged/untracked files. |
log | query | { limit?, skip?, ref?, paths? } | Commit history, newest first (paginated). |
show | query | { hash, patch? } | Full detail of one commit: metadata, files, unified patch. |
readFile | query | { path, ref? } | Contents of a file at a commit-ish (default HEAD). |
diff | query | { path?, staged? } | Unified diff of uncommitted changes. |
branches | query | — | Local branches with tracking state and the current branch. |
tags | query | — | Tags (newest first) with target SHA, date, and subject. |
stage | action | { … } | Stage paths; returns the new status. |
unstage | action | { … } | Unstage paths; returns the new status. |
commit | action | { … } | Create a commit; returns the result. |
The read query functions carry agent metadata, so they surface as tools to a coding agent.
Node API
ctx.services.get('@devframes/service-git') returns the in-process GitServiceApi — the same operations without an RPC hop.
On the RPC client
const rpc = await connectDevframe()
if (rpc.services.has('@devframes/service-git')) {
const git = rpc.services.get('@devframes/service-git')!
const status = await git.rpc.call('status')
}Source
Open
The @devframes/service-open wire service: open files in an editor or reveal them in the OS explorer over RPC, with workspace-root path containment and editor gating.
Shiki
The @devframes/service-shiki wire service: node-side Shiki syntax highlighting shared over RPC, LRU-cached and dual-theme, so client bundles stop shipping their own grammars and themes.