{"id":26800571,"url":"https://github.com/ktsu-dev/crossrepoactions","last_synced_at":"2026-07-08T01:00:33.743Z","repository":{"id":265687955,"uuid":"896487080","full_name":"ktsu-dev/CrossRepoActions","owner":"ktsu-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-04T23:22:22.000Z","size":750,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-07-05T01:10:37.514Z","etag":null,"topics":["batch-operations","build-automation","cli-tool","cross-repo-actions","csharp","dependency-resolution","dotnet","dotnet-solutions","git-operations","monorepo","multi-repository","package-updates","parallel-processing","repository-management"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktsu-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT.md","agents":null,"dco":null,"cla":null}},"created_at":"2024-11-30T13:49:41.000Z","updated_at":"2026-07-04T23:22:25.000Z","dependencies_parsed_at":"2026-02-16T08:04:42.845Z","dependency_job_id":"bb0ffaa5-ddeb-45ba-ba18-ef974845656a","html_url":"https://github.com/ktsu-dev/CrossRepoActions","commit_stats":null,"previous_names":["ktsu-dev/crossrepoactions"],"tags_count":127,"template":false,"template_full_name":null,"purl":"pkg:github/ktsu-dev/CrossRepoActions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FCrossRepoActions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FCrossRepoActions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FCrossRepoActions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FCrossRepoActions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktsu-dev","download_url":"https://codeload.github.com/ktsu-dev/CrossRepoActions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktsu-dev%2FCrossRepoActions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35247742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-operations","build-automation","cli-tool","cross-repo-actions","csharp","dependency-resolution","dotnet","dotnet-solutions","git-operations","monorepo","multi-repository","package-updates","parallel-processing","repository-management"],"created_at":"2025-03-29T20:17:51.907Z","updated_at":"2026-07-08T01:00:33.710Z","avatar_url":"https://github.com/ktsu-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrossRepoActions\n\nA powerful C# console application for performing batch operations across multiple git repositories and .NET solutions. CrossRepoActions helps you manage an entire organization's codebase efficiently with an interactive menu-driven interface.\n\n## Features\n\n- **Repository Discovery**: Automatically discover all git repositories in a directory tree\n- **Solution Management**: Find and analyze .NET solutions with dependency resolution\n- **Batch Building \u0026 Testing**: Build and test multiple solutions in dependency order\n- **Package Management**: Update NuGet packages across multiple projects simultaneously\n- **Git Operations**: Pull changes from multiple repositories in one command\n- **Smart Caching**: Cache discovery results for faster subsequent operations\n- **Interactive Menu**: User-friendly console menu for easy operation selection\n- **Parallel Processing**: Efficient parallel execution of operations where possible\n- **Repository Status**: List repositories with branch, working-tree status, and ahead/behind tracking\n- **AI Commit Messages**: Generate suggested Conventional Commits messages for repositories with uncommitted changes using a remote LLM (OpenAI via Microsoft Semantic Kernel), then review and commit/push them\n\n## Requirements\n\n- .NET 10.0 SDK or later\n- PowerShell Core (cross-platform)\n- Git\n- An OpenAI API key (only required for the AI commit message feature)\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/ktsu-dev/CrossRepoActions.git\ncd CrossRepoActions\n```\n\n2. Restore dependencies:\n```bash\ndotnet restore\n```\n\n3. Build the application:\n```bash\ndotnet build\n```\n\n## Usage\n\n### Interactive Menu (Default)\n\nRun the application without arguments to launch the interactive menu:\n\n```bash\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj\n```\n\nUse arrow keys to navigate and Enter to select an operation.\n\n### Command Line Interface\n\nRun specific operations directly from the command line:\n\n```bash\n# Discover all repositories in a directory\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- DiscoverRepositories -p c:/dev/ktsu-dev\n\n# Discover all solutions\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- DiscoverSolutions -p c:/dev/ktsu-dev\n\n# Build and test all solutions\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- BuildAndTest -p c:/dev/ktsu-dev\n\n# Pull latest changes from all repositories\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- GitPull -p c:/dev/ktsu-dev\n\n# Update packages across solutions\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- UpdatePackages -p c:/dev/ktsu-dev\n\n# List repositories with branch and ahead/behind status\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- ListRepositories -p c:/dev/ktsu-dev\n\n# Configure the OpenAI LLM settings (model, API key, etc.)\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- ConfigureLlm\n\n# Suggest AI commit messages for repos with uncommitted changes\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- SuggestCommits -p c:/dev/ktsu-dev\n```\n\n## Available Commands\n\n| Command | Description |\n|---------|-------------|\n| `Menu` | Launch interactive menu (default) |\n| `DiscoverRepositories` | Scan directory tree for git repositories and cache results |\n| `DiscoverSolutions` | Find all .NET solutions, analyze dependencies, and sort by build order |\n| `ListRepositories` | List repositories with branch, working-tree status, and upstream/default ahead-behind |\n| `BuildAndTest` | Build all discovered solutions and run tests with visual feedback |\n| `GitPull` | Pull latest changes from all discovered repositories |\n| `GitFetch` | Fetch from all remotes across all discovered repositories |\n| `InstallGitLfs` | Install Git LFS hooks locally in each discovered repository |\n| `UpdatePackages` | Update outdated NuGet packages across multiple projects |\n| `ConfigureLlm` | Configure OpenAI LLM settings (model, organization, max diff size, API key) |\n| `SuggestCommits` | Generate AI commit messages for repos with uncommitted changes, then review/commit/push |\n\n## Configuration\n\n### Default Path\n\nThe default repository discovery path is `c:/dev/ktsu-dev`. Override this using the `-p` or `--path` option:\n\n```bash\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- BuildAndTest -p /path/to/your/repos\n```\n\n### Persistent State\n\nCrossRepoActions caches discovered repositories and solutions for faster subsequent operations. Cache is stored in platform-specific app data directory and automatically refreshed when running discovery commands.\n\n### Parallel Processing\n\nOperations are executed in parallel where possible for maximum performance. The degree of parallelism is configurable in `Program.cs`.\n\n### LLM Settings\n\nThe AI commit message feature talks to OpenAI through [Microsoft Semantic Kernel](https://github.com/microsoft/semantic-kernel). Settings (model, organization ID, maximum diff size, and API key) are stored in the same platform-specific app data location as the discovery cache. Configure them interactively with the `ConfigureLlm` command — the API key is entered masked and displayed masked thereafter. The default model is `gpt-5.4-mini`.\n\n\u003e The API key is stored in plaintext in app data (consistent with how the app caches other state). Repository diffs are sent to OpenAI only when you run `SuggestCommits`.\n\n## AI Commit Messages\n\nThe `SuggestCommits` command generates suggested commit messages for every repository with uncommitted local changes:\n\n```bash\n# One-time setup\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- ConfigureLlm\n\n# Generate and review suggestions\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- SuggestCommits -p c:/dev/ktsu-dev\n```\n\nThe workflow is:\n\n1. **Discover \u0026 filter** — find repositories whose working tree is not clean. Repositories that contain **untracked files are skipped** (and listed), because `git diff HEAD` doesn't include new files, so the model couldn't see their content even though `git add -A` would commit them. Commit, stash, or ignore new files first.\n2. **Fetch** — fetch all remotes (in parallel, with a progress counter) so ahead/behind is accurate.\n3. **Pull if behind** — for any repo behind its upstream, offer to pull (`--autostash`) before generating.\n4. **Generate** — in parallel, send each repo's `git diff` to the model and produce a Conventional Commits message. The diff is fit to a character budget (`MaxDiffChars`) by including only **whole-file** diffs — a file whose diff would be clipped (and any after it) is dropped entirely rather than sent partially. No version tag is added — the CI `[major]`/`[minor]`/`[patch]` bump is inferred by PSBuild when absent.\n5. **Review** — for each repo, see the target branch, ahead/behind, diff stat, and (if the diff was budgeted) how many characters were sent vs. the full diff and which files were not fully included, then choose:\n   - `[C]ommit` — stage all and commit on the current branch\n   - `[P]ush` — stage, commit, then push\n   - `[E]dit` — replace the message\n   - `[R]egenerate` — ask the model again\n   - `[D]iff` — print the diff to the console\n   - `[S]kip` — leave the repo untouched\n\n   If the suggestion was generated from a budgeted (truncated) diff, choosing commit/push first offers to resend the **full** diff and regenerate so the message accounts for every change.\n\n6. **Background execution** — `[C]ommit`/`[P]ush` run in the **background** so you can move straight to the next repo. Each background action re-fetches the repo and, if it is behind, auto-pulls with `--autostash` (a pull conflict or rejected push is recorded as a failure). When you finish reviewing, `SuggestCommits` waits for the background actions, prints a per-repo success/failure summary, and offers to walk through any failures interactively.\n\n## How It Works\n\n1. **Discovery**: Recursively scans directories for `.git` folders and `.sln` files\n2. **Analysis**: Examines each solution to identify projects, packages, and dependencies\n3. **Dependency Sorting**: Topologically sorts solutions so dependencies are built before dependents\n4. **Execution**: Runs operations in optimal order with parallel processing where appropriate\n5. **Feedback**: Provides real-time progress with spinners, progress bars, and status indicators\n\n## Examples\n\n### Build All Solutions in Order\n\n```bash\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- BuildAndTest -p c:/dev/myorg\n```\n\nOutput includes:\n- Build status indicators (🛠️ in progress, ✅ success, ❌ error)\n- Per-project build results\n- Test discovery and execution results\n- Summary of all errors\n\n### Update Packages Organization-Wide\n\n```bash\ndotnet run --project CrossRepoActions/CrossRepoActions.csproj -- UpdatePackages -p c:/dev/myorg\n```\n\nThis will:\n1. Discover all solutions\n2. Identify outdated packages\n3. Update packages while respecting prerelease settings\n4. Handle each project's dependencies correctly\n\n## Development\n\nSee [CLAUDE.md](CLAUDE.md) for detailed architecture documentation and development guidance.\n\n### Adding a New Command\n\n1. Create a new class in `CrossRepoActions/Verbs/`\n2. Inherit from `BaseVerb\u003cYourVerb\u003e`\n3. Add the `[Verb(\"YourCommandName\")]` attribute\n4. Implement the `Run(YourVerb options)` method\n5. The command automatically appears in the interactive menu\n\nExample:\n```csharp\n[Verb(\"MyCommand\")]\ninternal class MyCommand : BaseVerb\u003cMyCommand\u003e\n{\n    internal override void Run(MyCommand options)\n    {\n        // Your implementation\n    }\n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Links\n\n- [GitHub Repository](https://github.com/ktsu-dev/CrossRepoActions)\n- [ktsu-dev Organization](https://github.com/ktsu-dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktsu-dev%2Fcrossrepoactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktsu-dev%2Fcrossrepoactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktsu-dev%2Fcrossrepoactions/lists"}