gitea/cmd/gitea-cli/main.go
logikonline ad82306b52 feat(sdk): add CLI tool and SDK libraries for developer tooling (Phase 4)
Add comprehensive developer tooling for Gitea integration:

CLI Tool (cmd/gitea-cli/):
- gitea-cli auth login/logout/status - Authentication management
- gitea-cli upload release-asset - Chunked upload with progress
- gitea-cli upload resume - Resume interrupted uploads
- gitea-cli upload list - List pending upload sessions
- Parallel chunk uploads with configurable workers
- SHA256 checksum verification
- Progress bar with speed and ETA display

Go SDK (sdk/go/):
- GiteaClient with token authentication
- User, Repository, Release, Attachment types
- ChunkedUpload with parallel workers
- Progress callbacks for upload tracking
- Functional options pattern (WithChunkSize, WithParallel, etc.)

Python SDK (sdk/python/):
- GiteaClient with requests-based HTTP
- Full type hints and dataclasses
- ThreadPoolExecutor for parallel uploads
- Resume capability for interrupted uploads
- Exception hierarchy (APIError, UploadError, etc.)

TypeScript SDK (sdk/typescript/):
- Full TypeScript types and interfaces
- Async/await API design
- Browser and Node.js compatible
- Web Crypto API for checksums
- ESM and CJS build outputs

All SDKs support:
- Chunked uploads for large files
- Parallel upload workers
- Progress tracking with callbacks
- Checksum verification
- Resume interrupted uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 12:07:07 -05:00

29 lines
568 B
Go

// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// gitea-cli is a command-line tool for interacting with Gitea instances.
// It provides efficient chunked uploads, progress tracking, and resume capability.
package main
import (
"fmt"
"os"
"code.gitea.io/gitea/cmd/gitea-cli/cmd"
)
var (
Version = "dev"
BuildTime = "unknown"
GitCommit = "unknown"
)
func main() {
cmd.SetVersion(Version, BuildTime, GitCommit)
if err := cmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
}