aidevops 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
|
|
3
|
+
|
|
4
|
+
# Git Platforms Helper Script
|
|
5
|
+
# Enhanced Git platform management with AI assistants (GitHub, GitLab, Gitea, Local Git)
|
|
6
|
+
|
|
7
|
+
# Colors for output
|
|
8
|
+
|
|
9
|
+
GREEN='\033[0;32m'
|
|
10
|
+
BLUE='\033[0;34m'
|
|
11
|
+
YELLOW='\033[1;33m'
|
|
12
|
+
RED='\033[0;31m'
|
|
13
|
+
NC='\033[0m' # No Color
|
|
14
|
+
|
|
15
|
+
# HTTP Constants
|
|
16
|
+
readonly AUTH_HEADER_PREFIX="Authorization: Bearer"
|
|
17
|
+
# Common message constants
|
|
18
|
+
readonly HELP_SHOW_MESSAGE="Show this help"
|
|
19
|
+
readonly USAGE_COMMAND_OPTIONS="Usage: $0 <command> [options]"
|
|
20
|
+
|
|
21
|
+
# Common constants
|
|
22
|
+
readonly CONTENT_TYPE_JSON=$CONTENT_TYPE_JSON
|
|
23
|
+
|
|
24
|
+
print_info() {
|
|
25
|
+
local msg="$1"
|
|
26
|
+
echo -e "${BLUE}[INFO]${NC} $msg"
|
|
27
|
+
return 0
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
print_success() {
|
|
31
|
+
local msg="$1"
|
|
32
|
+
echo -e "${GREEN}[SUCCESS]${NC} $msg"
|
|
33
|
+
return 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# Colors for output
|
|
37
|
+
|
|
38
|
+
GREEN='\033[0;32m'
|
|
39
|
+
BLUE='\033[0;34m'
|
|
40
|
+
YELLOW='\033[1;33m'
|
|
41
|
+
RED='\033[0;31m'
|
|
42
|
+
NC='\033[0m' # No Color
|
|
43
|
+
|
|
44
|
+
# HTTP Constants
|
|
45
|
+
readonly AUTH_HEADER_PREFIX="Authorization: Bearer"
|
|
46
|
+
# Common message constants
|
|
47
|
+
readonly HELP_SHOW_MESSAGE="Show this help"
|
|
48
|
+
readonly USAGE_COMMAND_OPTIONS="Usage: $0 <command> [options]"
|
|
49
|
+
|
|
50
|
+
# Common constants
|
|
51
|
+
readonly CONTENT_TYPE_JSON=$CONTENT_TYPE_JSON
|
|
52
|
+
|
|
53
|
+
print_info() {
|
|
54
|
+
local msg="$1"
|
|
55
|
+
echo -e "${BLUE}[INFO]${NC} $msg"
|
|
56
|
+
return 0
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
print_success() {
|
|
60
|
+
local msg="$1"
|
|
61
|
+
echo -e "${GREEN}[SUCCESS]${NC} $msg"
|
|
62
|
+
return 0
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
print_warning() {
|
|
66
|
+
local msg="$1"
|
|
67
|
+
echo -e "${YELLOW}[WARNING]${NC} $msg"
|
|
68
|
+
return 0
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
print_error() {
|
|
72
|
+
local msg="$1"
|
|
73
|
+
echo -e "${RED}[ERROR]${NC} $msg" >&2
|
|
74
|
+
return 0
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
CONFIG_FILE="../configs/git-platforms-config.json"
|
|
78
|
+
|
|
79
|
+
# Constants for repeated strings
|
|
80
|
+
readonly PLATFORM_GITHUB="github"
|
|
81
|
+
readonly PLATFORM_GITLAB="gitlab"
|
|
82
|
+
readonly PLATFORM_GITEA="gitea"
|
|
83
|
+
|
|
84
|
+
# Check dependencies
|
|
85
|
+
check_dependencies() {
|
|
86
|
+
if ! command -v curl &> /dev/null; then
|
|
87
|
+
print_error "curl is required but not installed"
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
if ! command -v jq &> /dev/null; then
|
|
92
|
+
print_error "jq is required but not installed"
|
|
93
|
+
print_info "Install on macOS: brew install jq"
|
|
94
|
+
print_info "Install on Ubuntu: sudo apt-get install jq"
|
|
95
|
+
exit 1
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
if ! command -v git &> /dev/null; then
|
|
99
|
+
print_error "git is required but not installed"
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
return 0
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# Load configuration
|
|
106
|
+
load_config() {
|
|
107
|
+
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
108
|
+
print_error "Configuration file not found: $CONFIG_FILE"
|
|
109
|
+
print_info "Copy and customize: cp ../configs/git-platforms-config.json.txt $CONFIG_FILE"
|
|
110
|
+
exit 1
|
|
111
|
+
fi
|
|
112
|
+
return 0
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
# Get platform configuration
|
|
116
|
+
get_platform_config() {
|
|
117
|
+
local platform="$command"
|
|
118
|
+
local account_name="$account_name"
|
|
119
|
+
|
|
120
|
+
if [[ -z "$platform" || -z "$account_name" ]]; then
|
|
121
|
+
print_error "Platform and account name are required"
|
|
122
|
+
list_platforms
|
|
123
|
+
exit 1
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
local platform_config
|
|
127
|
+
platform_config=$(jq -r ".platforms.\"$platform\".accounts.\"$account_name\"" "$CONFIG_FILE")
|
|
128
|
+
if [[ "$platform_config" == "null" ]]; then
|
|
129
|
+
print_error "Platform '$platform' account '$account_name' not found in configuration"
|
|
130
|
+
list_platforms
|
|
131
|
+
exit 1
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
echo "$platform_config"
|
|
135
|
+
return 0
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# Make API request
|
|
139
|
+
api_request() {
|
|
140
|
+
local platform="$command"
|
|
141
|
+
local account_name="$account_name"
|
|
142
|
+
local endpoint="$target"
|
|
143
|
+
local method="${4:-GET}"
|
|
144
|
+
local data="$5"
|
|
145
|
+
|
|
146
|
+
local config
|
|
147
|
+
config=$(get_platform_config "$platform" "$account_name")
|
|
148
|
+
local api_token
|
|
149
|
+
api_token=$(echo "$config" | jq -r '.api_token')
|
|
150
|
+
local base_url
|
|
151
|
+
base_url=$(echo "$config" | jq -r '.base_url')
|
|
152
|
+
|
|
153
|
+
if [[ "$api_token" == "null" || "$base_url" == "null" ]]; then
|
|
154
|
+
print_error "Invalid API credentials for $platform account '$account_name'"
|
|
155
|
+
exit 1
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
local url="$base_url/$endpoint"
|
|
159
|
+
local auth_header
|
|
160
|
+
|
|
161
|
+
case "$platform" in
|
|
162
|
+
"$PLATFORM_GITHUB")
|
|
163
|
+
auth_header="Authorization: token $api_token"
|
|
164
|
+
;;
|
|
165
|
+
"$PLATFORM_GITLAB")
|
|
166
|
+
auth_header="PRIVATE-TOKEN: $api_token"
|
|
167
|
+
;;
|
|
168
|
+
"gitea")
|
|
169
|
+
auth_header="Authorization: token $api_token"
|
|
170
|
+
;;
|
|
171
|
+
*)
|
|
172
|
+
auth_header="$AUTH_HEADER_PREFIX $api_token"
|
|
173
|
+
;;
|
|
174
|
+
esac
|
|
175
|
+
|
|
176
|
+
if [[ "$method" == "GET" ]]; then
|
|
177
|
+
curl -s -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
178
|
+
elif [[ "$method" == "POST" ]]; then
|
|
179
|
+
curl -s -X POST -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
180
|
+
elif [[ "$method" == "PUT" ]]; then
|
|
181
|
+
curl -s -X PUT -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
182
|
+
elif [[ "$method" == "DELETE" ]]; then
|
|
183
|
+
curl -s -X DELETE -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
184
|
+
fi
|
|
185
|
+
return 0
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
# List all configured platforms
|
|
189
|
+
list_platforms() {
|
|
190
|
+
load_config
|
|
191
|
+
print_info "Available Git platforms:"
|
|
192
|
+
jq -r '.platforms | keys[]' "$CONFIG_FILE" | while read -r platform; do
|
|
193
|
+
echo " Platform: $platform"
|
|
194
|
+
jq -r ".platforms.\"$platform\".accounts | keys[]" "$CONFIG_FILE" | while read -r account; do
|
|
195
|
+
local description
|
|
196
|
+
description=$(jq -r ".platforms.\"$platform\".accounts.\"$account\".description" "$CONFIG_FILE")
|
|
197
|
+
local base_url
|
|
198
|
+
base_url=$(jq -r ".platforms.\"$platform\".accounts.\"$account\".base_url" "$CONFIG_FILE")
|
|
199
|
+
echo " - $account ($base_url) - $description"
|
|
200
|
+
done
|
|
201
|
+
echo ""
|
|
202
|
+
return 0
|
|
203
|
+
done
|
|
204
|
+
return 0
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
# GitHub functions
|
|
208
|
+
github_list_repositories() {
|
|
209
|
+
local account_name="$command"
|
|
210
|
+
local visibility="${2:-all}"
|
|
211
|
+
|
|
212
|
+
print_info "Listing GitHub repositories for account: $account_name"
|
|
213
|
+
local response
|
|
214
|
+
if response=$(api_request "$PLATFORM_GITHUB" "$account_name" "user/repos?visibility=$visibility&sort=updated&per_page=100"); then
|
|
215
|
+
echo "$response" | jq -r '.[] | "\(.name) - \(.description // "No description") (Stars: \(.stargazers_count), Forks: \(.forks_count))"'
|
|
216
|
+
else
|
|
217
|
+
print_error "Failed to retrieve repositories"
|
|
218
|
+
echo "$response"
|
|
219
|
+
fi
|
|
220
|
+
return 0
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
github_create_repository() {
|
|
224
|
+
local account_name="$command"
|
|
225
|
+
local repo_name="$account_name"
|
|
226
|
+
local description="$target"
|
|
227
|
+
local private="${4:-false}"
|
|
228
|
+
|
|
229
|
+
if [[ -z "$repo_name" ]]; then
|
|
230
|
+
print_error "Repository name is required"
|
|
231
|
+
exit 1
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
local data=$(jq -n \
|
|
235
|
+
--arg name "$repo_name" \
|
|
236
|
+
--arg description "$description" \
|
|
237
|
+
--argjson private "$private" \
|
|
238
|
+
'{name: $name, description: $description, private: $private}')
|
|
239
|
+
|
|
240
|
+
print_info "Creating GitHub repository: $repo_name"
|
|
241
|
+
local response
|
|
242
|
+
response=$(api_request "$PLATFORM_GITHUB" "$account_name" "user/repos" "POST" "$data")
|
|
243
|
+
|
|
244
|
+
if [[ $? -eq 0 ]]; then
|
|
245
|
+
print_success "Repository created successfully"
|
|
246
|
+
echo "$response" | jq -r '"Clone URL: \(.clone_url)"'
|
|
247
|
+
else
|
|
248
|
+
print_error "Failed to create repository"
|
|
249
|
+
return 0
|
|
250
|
+
echo "$response"
|
|
251
|
+
fi
|
|
252
|
+
return 0
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
# GitLab functions
|
|
256
|
+
gitlab_list_projects() {
|
|
257
|
+
local account_name="$command"
|
|
258
|
+
local visibility="${2:-private}"
|
|
259
|
+
|
|
260
|
+
print_info "Listing GitLab projects for account: $account_name"
|
|
261
|
+
local response
|
|
262
|
+
response=$(api_request "$PLATFORM_GITLAB" "$account_name" "projects?visibility=$visibility&order_by=last_activity_at&per_page=100")
|
|
263
|
+
|
|
264
|
+
if [[ $? -eq 0 ]]; then
|
|
265
|
+
return 0
|
|
266
|
+
echo "$response" | jq -r '.[] | "\(.name) - \(.description // "No description") (Stars: \(.star_count), Forks: \(.forks_count))"'
|
|
267
|
+
else
|
|
268
|
+
print_error "Failed to retrieve projects"
|
|
269
|
+
echo "$response"
|
|
270
|
+
fi
|
|
271
|
+
return 0
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
gitlab_create_project() {
|
|
275
|
+
local account_name="$command"
|
|
276
|
+
local project_name="$account_name"
|
|
277
|
+
local description="$target"
|
|
278
|
+
local visibility="${4:-private}"
|
|
279
|
+
|
|
280
|
+
if [[ -z "$project_name" ]]; then
|
|
281
|
+
print_error "Project name is required"
|
|
282
|
+
exit 1
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
local data=$(jq -n \
|
|
286
|
+
--arg name "$project_name" \
|
|
287
|
+
--arg description "$description" \
|
|
288
|
+
--arg visibility "$visibility" \
|
|
289
|
+
'{name: $name, description: $description, visibility: $visibility}')
|
|
290
|
+
|
|
291
|
+
print_info "Creating GitLab project: $project_name"
|
|
292
|
+
local response
|
|
293
|
+
response=$(api_request "$PLATFORM_GITLAB" "$account_name" "projects" "POST" "$data")
|
|
294
|
+
|
|
295
|
+
if [[ $? -eq 0 ]]; then
|
|
296
|
+
print_success "Project created successfully"
|
|
297
|
+
return 0
|
|
298
|
+
echo "$response" | jq -r '"Clone URL: \(.http_url_to_repo)"'
|
|
299
|
+
else
|
|
300
|
+
print_error "Failed to create project"
|
|
301
|
+
echo "$response"
|
|
302
|
+
fi
|
|
303
|
+
return 0
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
# Gitea functions
|
|
307
|
+
gitea_list_repositories() {
|
|
308
|
+
local account_name="$command"
|
|
309
|
+
|
|
310
|
+
print_info "Listing Gitea repositories for account: $account_name"
|
|
311
|
+
local response
|
|
312
|
+
response=$(api_request "gitea" "$account_name" "user/repos?limit=100")
|
|
313
|
+
return 0
|
|
314
|
+
|
|
315
|
+
if [[ $? -eq 0 ]]; then
|
|
316
|
+
echo "$response" | jq -r '.[] | "\(.name) - \(.description // "No description") (Stars: \(.stars_count), Forks: \(.forks_count))"'
|
|
317
|
+
else
|
|
318
|
+
print_error "Failed to retrieve repositories"
|
|
319
|
+
echo "$response"
|
|
320
|
+
fi
|
|
321
|
+
return 0
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
gitea_create_repository() {
|
|
325
|
+
local account_name="$command"
|
|
326
|
+
local repo_name="$account_name"
|
|
327
|
+
local description="$target"
|
|
328
|
+
local private="${4:-false}"
|
|
329
|
+
|
|
330
|
+
if [[ -z "$repo_name" ]]; then
|
|
331
|
+
print_error "Repository name is required"
|
|
332
|
+
exit 1
|
|
333
|
+
fi
|
|
334
|
+
|
|
335
|
+
local data=$(jq -n \
|
|
336
|
+
--arg name "$repo_name" \
|
|
337
|
+
--arg description "$description" \
|
|
338
|
+
--argjson private "$private" \
|
|
339
|
+
'{name: $name, description: $description, private: $private}')
|
|
340
|
+
|
|
341
|
+
print_info "Creating Gitea repository: $repo_name"
|
|
342
|
+
local response
|
|
343
|
+
response=$(api_request "gitea" "$account_name" "user/repos" "POST" "$data")
|
|
344
|
+
|
|
345
|
+
if [[ $? -eq 0 ]]; then
|
|
346
|
+
print_success "Repository created successfully"
|
|
347
|
+
echo "$response" | jq -r '"Clone URL: \(.clone_url)"'
|
|
348
|
+
else
|
|
349
|
+
print_error "Failed to create repository"
|
|
350
|
+
echo "$response"
|
|
351
|
+
fi
|
|
352
|
+
return 0
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
# Local Git functions
|
|
356
|
+
local_git_init() {
|
|
357
|
+
local repo_path="$command"
|
|
358
|
+
local repo_name="$account_name"
|
|
359
|
+
|
|
360
|
+
if [[ -z "$repo_path" || -z "$repo_name" ]]; then
|
|
361
|
+
print_error "Repository path and name are required"
|
|
362
|
+
exit 1
|
|
363
|
+
fi
|
|
364
|
+
|
|
365
|
+
local full_path="$repo_path/$repo_name"
|
|
366
|
+
|
|
367
|
+
print_info "Initializing local Git repository: $full_path"
|
|
368
|
+
|
|
369
|
+
if [[ -d "$full_path" ]]; then
|
|
370
|
+
print_warning "Directory already exists: $full_path"
|
|
371
|
+
return 1
|
|
372
|
+
fi
|
|
373
|
+
|
|
374
|
+
mkdir -p "$full_path"
|
|
375
|
+
cd "$full_path" || exit
|
|
376
|
+
git init
|
|
377
|
+
|
|
378
|
+
# Create initial README
|
|
379
|
+
echo "# $repo_name" > README.md
|
|
380
|
+
echo "" >> README.md
|
|
381
|
+
echo "Created on $(date)" >> README.md
|
|
382
|
+
|
|
383
|
+
git add README.md
|
|
384
|
+
git commit -m "Initial commit"
|
|
385
|
+
|
|
386
|
+
print_success "Local repository initialized: $full_path"
|
|
387
|
+
return 0
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
local_git_list() {
|
|
391
|
+
local base_path="${1:-$HOME/git}"
|
|
392
|
+
|
|
393
|
+
print_info "Listing local Git repositories in: $base_path"
|
|
394
|
+
|
|
395
|
+
if [[ ! -d "$base_path" ]]; then
|
|
396
|
+
print_warning "Directory does not exist: $base_path"
|
|
397
|
+
return 1
|
|
398
|
+
fi
|
|
399
|
+
|
|
400
|
+
return 0
|
|
401
|
+
find "$base_path" -name ".git" -type d | while read git_dir; do
|
|
402
|
+
local repo_dir
|
|
403
|
+
repo_dir=$(dirname "$git_dir")
|
|
404
|
+
local repo_name
|
|
405
|
+
repo_name=$(basename "$repo_dir")
|
|
406
|
+
local last_commit
|
|
407
|
+
last_commit=$(cd "$repo_dir" && git log -1 --format="%cr" 2>/dev/null || echo "No commits")
|
|
408
|
+
local branch
|
|
409
|
+
branch=$(cd "$repo_dir" && git branch --show-current 2>/dev/null || echo "No branch")
|
|
410
|
+
echo "$repo_name - Branch: $branch, Last commit: $last_commit"
|
|
411
|
+
done
|
|
412
|
+
return 0
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
# Repository management across platforms
|
|
416
|
+
clone_repository() {
|
|
417
|
+
local platform="$command"
|
|
418
|
+
local account_name="$account_name"
|
|
419
|
+
local repo_identifier="$target"
|
|
420
|
+
local local_path="${4:-$HOME/git}"
|
|
421
|
+
|
|
422
|
+
if [[ -z "$platform" || -z "$account_name" || -z "$repo_identifier" ]]; then
|
|
423
|
+
print_error "Platform, account name, and repository identifier are required"
|
|
424
|
+
exit 1
|
|
425
|
+
fi
|
|
426
|
+
|
|
427
|
+
local config
|
|
428
|
+
config=$(get_platform_config "$platform" "$account_name")
|
|
429
|
+
local username
|
|
430
|
+
username=$(echo "$config" | jq -r '.username')
|
|
431
|
+
local base_url
|
|
432
|
+
base_url=$(echo "$config" | jq -r '.base_url')
|
|
433
|
+
|
|
434
|
+
local clone_url
|
|
435
|
+
case "$platform" in
|
|
436
|
+
"$PLATFORM_GITHUB")
|
|
437
|
+
clone_url="https://github.com/$username/$repo_identifier.git"
|
|
438
|
+
;;
|
|
439
|
+
"$PLATFORM_GITLAB")
|
|
440
|
+
clone_url="$base_url/$username/$repo_identifier.git"
|
|
441
|
+
;;
|
|
442
|
+
"$PLATFORM_GITEA")
|
|
443
|
+
clone_url="$base_url/$username/$repo_identifier.git"
|
|
444
|
+
;;
|
|
445
|
+
*)
|
|
446
|
+
print_error "Unknown platform: $platform"
|
|
447
|
+
exit 1
|
|
448
|
+
;;
|
|
449
|
+
esac
|
|
450
|
+
|
|
451
|
+
print_info "Cloning repository: $clone_url"
|
|
452
|
+
return 0
|
|
453
|
+
cd "$local_path" || exit
|
|
454
|
+
git clone "$clone_url"
|
|
455
|
+
|
|
456
|
+
if [[ $? -eq 0 ]]; then
|
|
457
|
+
print_success "Repository cloned successfully to: $local_path/$repo_identifier"
|
|
458
|
+
else
|
|
459
|
+
print_error "Failed to clone repository"
|
|
460
|
+
fi
|
|
461
|
+
return 0
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
# Start MCP servers for Git platforms
|
|
465
|
+
start_mcp_servers() {
|
|
466
|
+
local platform="$command"
|
|
467
|
+
local port="${2:-3006}"
|
|
468
|
+
|
|
469
|
+
print_info "Starting MCP server for $platform on port $port"
|
|
470
|
+
|
|
471
|
+
case "$platform" in
|
|
472
|
+
"$PLATFORM_GITHUB")
|
|
473
|
+
if command -v github-mcp-server &> /dev/null; then
|
|
474
|
+
github-mcp-server --port "$port"
|
|
475
|
+
else
|
|
476
|
+
print_warning "GitHub MCP server not found. Install with:"
|
|
477
|
+
echo " npm install -g @github/mcp-server"
|
|
478
|
+
fi
|
|
479
|
+
;;
|
|
480
|
+
"$PLATFORM_GITLAB")
|
|
481
|
+
if command -v gitlab-mcp-server &> /dev/null; then
|
|
482
|
+
gitlab-mcp-server --port "$port"
|
|
483
|
+
else
|
|
484
|
+
print_warning "GitLab MCP server not found. Check GitLab documentation for MCP integration"
|
|
485
|
+
fi
|
|
486
|
+
;;
|
|
487
|
+
"$PLATFORM_GITEA")
|
|
488
|
+
if command -v gitea-mcp-server &> /dev/null; then
|
|
489
|
+
gitea-mcp-server --port "$port"
|
|
490
|
+
else
|
|
491
|
+
print_warning "Gitea MCP server not found. Check Gitea documentation for MCP integration"
|
|
492
|
+
fi
|
|
493
|
+
;;
|
|
494
|
+
*)
|
|
495
|
+
print_error "Unknown platform: $platform"
|
|
496
|
+
print_info "Available platforms: $PLATFORM_GITHUB, $PLATFORM_GITLAB, $PLATFORM_GITEA"
|
|
497
|
+
;;
|
|
498
|
+
esac
|
|
499
|
+
return 0
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
# Comprehensive repository audit
|
|
503
|
+
audit_repositories() {
|
|
504
|
+
local platform="$command"
|
|
505
|
+
local account_name="$account_name"
|
|
506
|
+
|
|
507
|
+
print_info "Auditing repositories for $platform account: $account_name"
|
|
508
|
+
echo ""
|
|
509
|
+
|
|
510
|
+
case "$platform" in
|
|
511
|
+
"$PLATFORM_GITHUB")
|
|
512
|
+
print_info "=== GITHUB REPOSITORIES ==="
|
|
513
|
+
github_list_repositories "$account_name"
|
|
514
|
+
;;
|
|
515
|
+
"$PLATFORM_GITLAB")
|
|
516
|
+
print_info "=== GITLAB PROJECTS ==="
|
|
517
|
+
gitlab_list_projects "$account_name"
|
|
518
|
+
;;
|
|
519
|
+
"gitea")
|
|
520
|
+
print_info "=== GITEA REPOSITORIES ==="
|
|
521
|
+
gitea_list_repositories "$account_name"
|
|
522
|
+
;;
|
|
523
|
+
*)
|
|
524
|
+
print_error "Unknown platform: $platform"
|
|
525
|
+
;;
|
|
526
|
+
esac
|
|
527
|
+
|
|
528
|
+
echo ""
|
|
529
|
+
print_info "=== SECURITY RECOMMENDATIONS ==="
|
|
530
|
+
echo "- Enable two-factor authentication"
|
|
531
|
+
echo "- Use SSH keys for authentication"
|
|
532
|
+
echo "- Review repository permissions regularly"
|
|
533
|
+
echo "- Enable branch protection rules"
|
|
534
|
+
echo "- Use signed commits where possible"
|
|
535
|
+
return 0
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
# Show help
|
|
539
|
+
show_help() {
|
|
540
|
+
echo "Git Platforms Helper Script"
|
|
541
|
+
echo "Usage: $0 [command] [platform] [account] [options]"
|
|
542
|
+
echo ""
|
|
543
|
+
echo "Commands:"
|
|
544
|
+
echo " platforms - List all configured platforms"
|
|
545
|
+
echo " github-repos [account] [visibility] - List GitHub repositories"
|
|
546
|
+
echo " github-create [account] [name] [desc] [private] - Create GitHub repository"
|
|
547
|
+
echo " gitlab-projects [account] [visibility] - List GitLab projects"
|
|
548
|
+
echo " gitlab-create [account] [name] [desc] [visibility] - Create GitLab project"
|
|
549
|
+
echo " gitea-repos [account] - List Gitea repositories"
|
|
550
|
+
echo " gitea-create [account] [name] [desc] [private] - Create Gitea repository"
|
|
551
|
+
echo " local-init [path] [name] - Initialize local Git repository"
|
|
552
|
+
echo " local-list [base_path] - List local Git repositories"
|
|
553
|
+
echo " clone [platform] [account] [repo] [path] - Clone repository"
|
|
554
|
+
echo " start-mcp [platform] [port] - Start MCP server for platform"
|
|
555
|
+
echo " audit [platform] [account] - Audit repositories"
|
|
556
|
+
echo " help - $HELP_SHOW_MESSAGE"
|
|
557
|
+
echo ""
|
|
558
|
+
echo "Examples:"
|
|
559
|
+
echo " $0 platforms"
|
|
560
|
+
echo " $0 github-repos personal public"
|
|
561
|
+
echo " $0 github-create personal my-new-repo 'My project description' false"
|
|
562
|
+
echo " $0 clone github personal my-repo ~/projects"
|
|
563
|
+
echo " $0 local-init ~/projects my-local-repo"
|
|
564
|
+
echo " $0 audit github personal"
|
|
565
|
+
return 0
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
# Main script logic
|
|
569
|
+
main() {
|
|
570
|
+
# Assign positional parameters to local variables
|
|
571
|
+
local command="${1:-help}"
|
|
572
|
+
local account_name="$account_name"
|
|
573
|
+
local target="$target"
|
|
574
|
+
local options="$options"
|
|
575
|
+
# Assign positional parameters to local variables
|
|
576
|
+
local command="${1:-help}"
|
|
577
|
+
local account_name="$account_name"
|
|
578
|
+
local target="$target"
|
|
579
|
+
local options="$options"
|
|
580
|
+
# Assign positional parameters to local variables
|
|
581
|
+
local command="${1:-help}"
|
|
582
|
+
local account_name="$account_name"
|
|
583
|
+
local target="$target"
|
|
584
|
+
local options="$options"
|
|
585
|
+
# Assign positional parameters to local variables
|
|
586
|
+
# Assign positional parameters to local variables
|
|
587
|
+
local platform="$account_name"
|
|
588
|
+
local account_name="$target"
|
|
589
|
+
local repo_name="$options"
|
|
590
|
+
local description="$param5"
|
|
591
|
+
|
|
592
|
+
check_dependencies
|
|
593
|
+
|
|
594
|
+
case "$command" in
|
|
595
|
+
"platforms")
|
|
596
|
+
list_platforms
|
|
597
|
+
;;
|
|
598
|
+
"github-repos")
|
|
599
|
+
github_list_repositories "$platform" "$account_name"
|
|
600
|
+
;;
|
|
601
|
+
"github-create")
|
|
602
|
+
github_create_repository "$platform" "$account_name" "$repo_name" "$description"
|
|
603
|
+
;;
|
|
604
|
+
"gitlab-projects")
|
|
605
|
+
gitlab_list_projects "$platform" "$account_name"
|
|
606
|
+
;;
|
|
607
|
+
"gitlab-create")
|
|
608
|
+
gitlab_create_project "$platform" "$account_name" "$repo_name" "$description"
|
|
609
|
+
;;
|
|
610
|
+
"gitea-repos")
|
|
611
|
+
gitea_list_repositories "$platform"
|
|
612
|
+
;;
|
|
613
|
+
"gitea-create")
|
|
614
|
+
gitea_create_repository "$platform" "$account_name" "$repo_name" "$description"
|
|
615
|
+
;;
|
|
616
|
+
"local-init")
|
|
617
|
+
local_git_init "$platform" "$account_name"
|
|
618
|
+
;;
|
|
619
|
+
"local-list")
|
|
620
|
+
local_git_list "$platform"
|
|
621
|
+
;;
|
|
622
|
+
"clone")
|
|
623
|
+
clone_repository "$platform" "$account_name" "$repo_name" "$description"
|
|
624
|
+
;;
|
|
625
|
+
"start-mcp")
|
|
626
|
+
start_mcp_servers "$platform" "$account_name"
|
|
627
|
+
;;
|
|
628
|
+
"audit")
|
|
629
|
+
audit_repositories "$platform" "$account_name"
|
|
630
|
+
;;
|
|
631
|
+
"help"|*)
|
|
632
|
+
show_help
|
|
633
|
+
;;
|
|
634
|
+
esac
|
|
635
|
+
return 0
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
main "$@"
|
|
639
|
+
|
|
640
|
+
return 0
|