@aspruyt/xfg
v3.7.6
Published
CLI tool for repository-as-code
Maintainers
Readme
xfg
A CLI tool for repository-as-code. Sync files and manage settings across GitHub, Azure DevOps, and GitLab.
Quick Start
GitHub Action
# .github/workflows/sync-configs.yml
name: Sync Configs
on:
push:
branches: [main]
paths: [sync-config.yaml]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthony-spruyt/xfg@v3
with:
command: sync
config: ./sync-config.yaml
github-token: ${{ secrets.GH_PAT }} # PAT with repo scope for cross-repo accessCLI
# Install
npm install -g @aspruyt/xfg
# Authenticate (GitHub)
gh auth login
# Sync files across repos
xfg sync --config ./config.yaml
# Apply repository settings
xfg settings --config ./config.yamlExample Config
# sync-config.yaml
id: my-org-config
files:
.prettierrc.json:
content:
semi: false
singleQuote: true
tabWidth: 2
settings:
repo:
allowSquashMerge: true
deleteBranchOnMerge: true
vulnerabilityAlerts: true
rulesets:
main-protection:
target: branch
enforcement: active
conditions:
refName:
include: ["refs/heads/main"]
exclude: []
rules:
- type: pull_request
parameters:
requiredApprovingReviewCount: 1
repos:
- git:
- [email protected]:your-org/frontend-app.git
- [email protected]:your-org/backend-api.gitResult: PRs are created with .prettierrc.json files, and repos get standardized merge options, security settings, and branch protection rules.
Documentation
See anthony-spruyt.github.io/xfg for configuration reference, examples, platform setup, and troubleshooting.
