conduit-ui/repo
Composer 安装命令:
composer require conduit-ui/repo
包简介
Repository management for agents
README 文档
README
Stop manually auditing repository settings. Start enforcing compliance policies across your entire organization.
Audit, update, and manage repositories in bulk. Enforce branch protection, security policies, and team permissions across hundreds of repos with clean PHP code.
Installation
composer require conduit-ui/repo
Why This Exists
Your organization has 200+ repositories. Some have branch protection disabled. Others allow force pushes to main. Security policies are inconsistent. This package gives you the tools to audit and enforce compliance at scale.
Quick Start
use ConduitUI\Repo\Repository; // Find a single repository $repo = Repository::find('owner/repo'); // Audit all org repositories Repository::forOrganization('your-org') ->get() ->filter(fn($repo) => !$repo->branchProtectionEnabled()) ->each(fn($repo) => $repo->enableBranchProtection('main')); // Create a new repository Repository::create('new-repo', [ 'description' => 'API service for user management', 'private' => true, 'auto_init' => true, ]);
Core Features
Repository Discovery
Find by Name
$repo = Repository::find('owner/repo');
List User Repositories
$repos = Repository::forUser('username')->get();
List Organization Repositories
$repos = Repository::forOrganization('org-name')->get();
List Authenticated User's Repos
$repos = Repository::forAuthenticatedUser()->get();
Repository Creation
Basic Creation
Repository::create('my-new-repo', [ 'description' => 'A new project', 'private' => false, ]);
Organization Repository
Repository::createForOrganization('org-name', 'repo-name', [ 'description' => 'Team project', 'private' => true, 'auto_init' => true, 'gitignore_template' => 'PHP', 'license_template' => 'mit', ]);
Repository Updates
Update Metadata
$repo = Repository::find('owner/repo'); $repo->update([ 'description' => 'Updated description', 'homepage' => 'https://example.com', 'private' => true, 'has_issues' => true, 'has_wiki' => false, ]);
Repository Details
Branches
$branches = $repo->branches(); $main = $repo->defaultBranch();
Releases
$releases = $repo->releases(); $latest = $repo->latestRelease();
Collaborators
$collaborators = $repo->collaborators();
Topics (Tags)
$topics = $repo->topics();
Languages
$languages = $repo->languages(); // ['PHP' => 75234, 'JavaScript' => 12456, ...]
Repository Deletion
Repository::find('owner/repo')->delete();
Governance & Compliance
Audit Branch Protection
// Find repos without branch protection Repository::forOrganization('your-org') ->get() ->filter(fn($repo) => !$repo->branchProtectionEnabled()) ->each(function($repo) { echo "{$repo->name} is not protected!\n"; });
Enforce Security Policies
// Disable force pushes across all repos Repository::forOrganization('your-org') ->get() ->each(fn($repo) => $repo->update([ 'allow_force_pushes' => false, 'delete_branch_on_merge' => true, ]));
Standardize Repository Settings
// Enforce consistent settings across org $standardSettings = [ 'has_issues' => true, 'has_wiki' => false, 'has_projects' => false, 'allow_squash_merge' => true, 'allow_merge_commit' => false, 'allow_rebase_merge' => false, 'delete_branch_on_merge' => true, ]; Repository::forOrganization('your-org') ->get() ->each(fn($repo) => $repo->update($standardSettings));
Archive Stale Repositories
// Archive repos with no commits in 12 months Repository::forOrganization('your-org') ->get() ->filter(fn($repo) => $repo->pushedAt < now()->subYear()) ->each(fn($repo) => $repo->update(['archived' => true]));
Bulk Operations
Clone All Org Repositories
Repository::forOrganization('your-org') ->get() ->each(function($repo) { $cloneUrl = $repo->cloneUrl; exec("git clone {$cloneUrl}"); });
Generate Org Report
$report = Repository::forOrganization('your-org') ->get() ->map(fn($repo) => [ 'name' => $repo->name, 'private' => $repo->private, 'branch_protection' => $repo->branchProtectionEnabled(), 'last_push' => $repo->pushedAt->diffForHumans(), 'open_issues' => $repo->openIssuesCount, 'language' => $repo->language, ]); // Export to CSV, send to Slack, etc.
Bulk Topic Management
// Tag all PHP repos Repository::forOrganization('your-org') ->get() ->filter(fn($repo) => $repo->language === 'PHP') ->each(fn($repo) => $repo->addTopics(['php', 'backend']));
Data Objects
All responses return strongly-typed DTOs:
$repo->id; // int $repo->name; // string $repo->fullName; // string (owner/repo) $repo->description; // ?string $repo->private; // bool $repo->fork; // bool $repo->archived; // bool $repo->disabled; // bool $repo->owner; // Owner object $repo->license; // ?License object $repo->language; // ?string $repo->defaultBranch; // string $repo->openIssuesCount; // int $repo->stargazersCount; // int $repo->watchersCount; // int $repo->forksCount; // int $repo->createdAt; // Carbon instance $repo->updatedAt; // Carbon instance $repo->pushedAt; // Carbon instance $repo->cloneUrl; // string $repo->sshUrl; // string $repo->branchProtectionEnabled(); // bool
Usage Patterns
Static API (Recommended)
use ConduitUI\Repo\Repository; $repo = Repository::find('owner/repo'); $repos = Repository::forOrganization('org')->get();
Instance API
use ConduitUI\Repo\RepositoryManager; $manager = new RepositoryManager(); $repo = $manager->find('owner/repo');
Configuration
Publish the config file:
php artisan vendor:publish --tag="repo-config"
Set your GitHub token in .env:
GITHUB_TOKEN=your-github-token
For organization-level operations, ensure your token has repo and admin:org scopes.
Requirements
- PHP 8.2+
- GitHub personal access token or GitHub App
- For org operations:
admin:orgscope
Testing
composer test
Code Quality
composer format # Fix code style composer analyse # Run static analysis
Related Packages
- conduit-ui/issue - Issue triage automation
- conduit-ui/pr - Pull request automation
- conduit-ui/connector - GitHub API transport layer
Enterprise Support
Managing governance for 500+ repositories? Contact jordan@partridge.rocks for enterprise solutions including:
- Custom compliance reporting
- Automated policy enforcement
- Audit trail integration
- SOC2/ISO27001 compliance tooling
- Multi-organization management
License
MIT License. See LICENSE for details.
conduit-ui/repo 适用场景与选型建议
conduit-ui/repo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「github」 「laravel」 「repositories」 「conduit-ui」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 conduit-ui/repo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 conduit-ui/repo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 conduit-ui/repo 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
A Laravel package for the Repository Design Pattern.
Creating a Laravel Repositories
Simple, safe and flexible implementation of handling SQL entities and repositories as well as multi-table SQL queries while staying lightweight and straightforward.
Symfony integration of squirrelphp/entities - automatic integration of generated repositories for existing entities.
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-11