blob: 9bcd678c79b86b2d174bb35749045d2f0cf569ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Development Commands
Essential commands for development:
```bash
# Build the binary (using go-task if installed)
task # or: go build -o gitsyncer ./cmd/gitsyncer
# Build for all platforms
task build-all
# Run the application
task run # or: ./gitsyncer
# Run tests
task test
# Format code
task fmt
# Clean build artifacts
task clean
```
## Usage Examples
```bash
# Show version
gitsyncer version
# Delete a repository from all configured organizations (with confirmation)
gitsyncer manage delete-repo <repository-name>
# Manually check for version tags without releases
gitsyncer release check
# Disable automatic release checking during sync operations
gitsyncer sync all --no-releases
# Automatically create releases without confirmation prompts (AI notes enabled by default)
gitsyncer release create --auto
# Create releases without AI notes
gitsyncer release create --auto --no-ai-notes
# Use aichat instead of claude for AI release notes
gitsyncer release create --auto --ai-tool aichat
# Generate showcase using aichat for project descriptions
gitsyncer showcase --ai-tool aichat
```
Note: Release checking is enabled by default after sync operations. It will check for version tags (formats: vX.Y.Z, vX.Y, vX, X.Y.Z, X.Y, X) that don't have corresponding releases on GitHub/Codeberg and prompt for confirmation before creating them.
Note: The Taskfile.yaml is configured for [go-task](https://taskfile.dev/). Install with:
```bash
# macOS
brew install go-task
# Linux
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
# Or use Go directly if task is not installed
go build -o gitsyncer ./cmd/gitsyncer
```
## Project Structure
```
gitsyncer/
├── cmd/
│ └── gitsyncer/
│ └── main.go # Main entry point with CLI flags
├── internal/
│ └── version/
│ └── version.go # Version information
├── go.mod # Go module definition
└── Taskfile.yaml # Task automation (go-task)
```
This follows the standard Go project layout with:
- `cmd/` for application entry points
- `internal/` for private application code
- Root directory for public libraries (if any)
## Architecture
The application currently provides:
- Version information system (internal/version)
- CLI flag parsing for --version
- Automatic release checking and creation (internal/release)
- Repository syncing across GitHub, Codeberg, and other platforms
- Project showcase generation
## Next Steps
The project needs:
1. Support for other platforms (GitLab, Gitea, etc.)
2. Webhook support for automatic syncing
3. Conflict resolution strategies
4. Better handling of large repositories
## Release Process
- When releasing a version, increment the version in version.go, commit all changes to git and push. and tag the version and push to git.
- Gitsyncer will automatically detect the new version tag and prompt to create releases on GitHub and Codeberg using the tokens from your gitsyncer configuration file.
|