Skip to content

Commit 4ceb054

Browse files
committed
Update README
1 parent efb5c48 commit 4ceb054

File tree

1 file changed

+57
-35
lines changed

1 file changed

+57
-35
lines changed

README.md

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,83 @@
11
# UCD: Undocumented Change Detector
22

3+
UCD helps security teams detect hidden code changes between software versions using Google's Gemini AI.
4+
35
[![Go Report Card](https://goreportcard.com/badge/github.com/tstromberg/ucd)](https://goreportcard.com/report/github.com/tstromberg/ucd)
46
[![Go Reference](https://pkg.go.dev/badge/github.com/tstromberg/ucd.svg)](https://pkg.go.dev/github.com/tstromberg/ucd)
57

6-
UCD is an experimental AI-powered tool that identifies hidden code changes between software versions. It helps security teams detect undocumented modifications that might introduce security risks.
7-
8-
> **Note:** This is an experimental project. Analysis results may vary in accuracy and should be manually verified.
9-
10-
## Features
11-
12-
* Detects hidden code changes missed in documentation
13-
* Assesses risk for potential malware and silent security patches
14-
* Supports Git repositories and diff files
15-
* Uses Google's Gemini AI for analysis
16-
* Provides JSON output for integration with other tools
8+
> **Note:** Experimental project. Results should be manually verified.
179
18-
## Quick Start
10+
## Install
1911

2012
```bash
2113
go install github.com/tstromberg/ucd@latest
22-
export GEMINI_API_KEY=YOUR_API_KEY # From Google AI Studio
23-
ucd --a v1.0.0 --b v1.1.0 git https://github.com/repo/example.git
2414
```
2515

2616
## Usage
2717

2818
```bash
29-
# Analyze Git repository
30-
ucd --a v0.25.3 --b v0.25.4 git https://github.com/org/repo.git
19+
# Set API key
20+
export GEMINI_API_KEY=YOUR_API_KEY
3121

32-
# Analyze diff file
33-
ucd diff changes.patch
22+
# Analyze a Git repository
23+
ucd git https://github.com/org/repo.git
3424

35-
# Use with additional options
36-
ucd --json --model gemini-2.0-flash git --a v1.0 --b v1.1 https://github.com/org/repo.git
37-
```
25+
# Compare specific versions
26+
ucd -a v0.25.3 -b v0.25.4 git https://github.com/org/repo.git
3827

39-
## Key Options
28+
# Analyze a local diff file
29+
ucd file changes.patch
4030

31+
# Output in JSON format
32+
ucd -json git https://github.com/org/repo.git
4133
```
42-
--a string Old version (default "v0")
43-
--b string New version (default "v1")
44-
--diff string Unified diff file
45-
--commit-messages Commit messages file
46-
--changelog Changelog file
47-
--api-key string Gemini API key
48-
--model string AI model (default "gemini-2.0-flash")
49-
--json Output as JSON
50-
--debug Enable debug output
34+
35+
## Go API Example
36+
37+
```go
38+
package main
39+
40+
import (
41+
"context"
42+
"fmt"
43+
"log"
44+
45+
"github.com/google/generative-ai-go/genai"
46+
"github.com/tstromberg/ucd/pkg/ucd"
47+
"google.golang.org/api/option"
48+
)
49+
50+
func main() {
51+
// Collect data
52+
data, err := ucd.Collect(ucd.Config{
53+
RepoURL: "https://github.com/example/repo",
54+
VersionA: "v1.0.0",
55+
VersionB: "v1.1.0",
56+
})
57+
if err != nil {
58+
log.Fatal(err)
59+
}
60+
61+
// Analyze changes
62+
ctx := context.Background()
63+
client, err := genai.NewClient(ctx, option.WithAPIKey("YOUR_API_KEY"))
64+
if err != nil {
65+
log.Fatal(err)
66+
}
67+
defer client.Close()
68+
69+
result, err := ucd.AnalyzeChanges(ctx, client, data, "gemini-2.0-flash")
70+
if err != nil {
71+
log.Fatal(err)
72+
}
73+
74+
// Process results
75+
fmt.Printf("Found %d undocumented changes\n", len(result.UndocumentedChanges))
76+
}
5177
```
5278

5379
## Requirements
5480

5581
* Go 1.18+
5682
* Gemini API Key
5783
* Git (for repository analysis)
58-
59-
## Contributing
60-
61-
Contributions welcome! As this is an experimental tool, we value feedback and improvements.

0 commit comments

Comments
 (0)