github_analyzer 0.1.8
github_analyzer: ^0.1.8 copied to clipboard
Analyze GitHub repositories and generate AI context for LLMs with cross-platform support
GitHub Analyzer #
Powerful GitHub Repository Analysis Tool for AI/LLM
A pure Dart package that analyzes GitHub repositories and automatically generates markdown documentation optimized for AI and LLM contexts. Accelerate code reviews, documentation, and project onboarding with AI assistance.
โจ Key Features #
- ๐ Fast & Efficient - Optimized with isolate-based parallel processing
- ๐ฆ Dual Mode - Supports both local directories and remote GitHub repositories
- ๐ฏ LLM Optimized - Generates compact context for AI models
- ๐ Incremental Updates - Smart caching for fast re-analysis
- ๐ Cross-Platform - Works on web, desktop, and mobile
- ๐ Private Repositories - Access private repos with GitHub tokens
- โก Cache Control - Explicitly enable/disable caching
- ๐ Explicit Token Management - Direct token passing for better security
๐ฏ Use Cases #
- AI Code Review - Provide full project context to ChatGPT/Claude
- Automated Documentation - Auto-analyze project structure and tech stack
- Onboarding - Quickly share project overview with new team members
- CI/CD Integration - Detect code changes and generate automatic reports
- Project Comparison - Compare structure and complexity of multiple repositories
๐ฆ Installation #
Add to your pubspec.yaml:
dependencies:
github_analyzer: ^0.1.8
Install:
dart pub get
or
dart pub add github_analyzer
๐ Quick Start #
1. Get GitHub Token (Optional but Recommended) #
Why you need a token:
- โ Access private repositories
- โ Increased API rate limit (60 โ 5,000 req/hr)
- โ Prevent 403 errors
How to get a token:
- Go to GitHub Settings โ Tokens
- Generate fine-grained token (recommended)
- Set Contents: Read-only permission
- Copy the token
2. Basic Usage (Public Repository) #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// Analyze a public repository
final result = await analyzeQuick(
'https://github.com/flutter/flutter',
);
print('Files: ${result.statistics.totalFiles}');
print('Lines: ${result.statistics.totalLines}');
print('Language: ${result.metadata.language}');
}
3. Private Repository Analysis #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// Analyze private repository with token
final result = await analyzeQuick(
'https://github.com/your/private-repo',
githubToken: 'ghp_your_token_here', // Pass token explicitly
);
print('Files: ${result.statistics.totalFiles}');
}
4. Generate Markdown for LLM #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// LLM-optimized analysis and markdown generation
final outputPath = await analyzeForLLM(
'https://github.com/your/repo',
githubToken: 'ghp_your_token_here', // For private repos
outputDir: './analysis',
maxFiles: 200,
);
print('Generated: $outputPath');
}
5. Advanced Usage #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// Create analyzer with custom config
final config = await GithubAnalyzerConfig.create(
githubToken: 'ghp_your_token_here', // Pass token explicitly
excludePatterns: ['test/', 'docs/'],
maxFileSize: 1024 * 1024, // 1MB
enableCache: true,
);
final analyzer = await GithubAnalyzer.create(config: config);
// Analyze remote repository (disable cache)
final result = await analyzer.analyzeRemote(
repositoryUrl: 'https://github.com/your/repo',
useCache: false, // Always fetch latest data
);
// Generate compact markdown
final contextService = ContextService();
final outputPath = await contextService.generate(
result,
outputDir: './output',
config: MarkdownConfig.compact,
);
print('Generated: $outputPath');
// Clean up resources
await analyzer.dispose();
}
โ๏ธ Configuration Options #
Quick Analysis (Fast) #
final config = await GithubAnalyzerConfig.quick(
githubToken: 'your_token', // Optional for public repos
);
- โก Fast speed
- ๐ Max 100 files
- ๐ซ Cache disabled
- ๐ซ Isolate disabled
LLM Optimized (Balanced) #
final config = await GithubAnalyzerConfig.forLLM(
githubToken: 'your_token', // Optional for public repos
maxFiles: 200,
);
- โ๏ธ Balanced performance
- ๐ Custom file count
- โ Cache enabled
- โ Isolate enabled
- ๐งช Test files excluded
Full Analysis (Comprehensive) #
final config = await GithubAnalyzerConfig.create(
githubToken: 'your_token', // Optional for public repos
enableCache: true,
enableIsolatePool: true,
maxConcurrentRequests: 10,
);
- ๐ Detailed analysis
- โพ๏ธ Unlimited files
- โก Maximum concurrency
- ๐พ Optimized caching
๐ Private Repository Access #
Fine-grained Token (Recommended) #
- Create token
- Repository access: Select "Only select repositories"
- Permissions: Contents: Read-only
- Copy token
Classic Token #
- Create token
- Scopes: Check
repo - Copy token
Use in Code #
// Option 1: Pass token to convenience functions
final result = await analyzeQuick(
'https://github.com/user/private-repo',
githubToken: 'ghp_your_token_here',
);
// Option 2: Pass token via config
final config = await GithubAnalyzerConfig.create(
githubToken: 'ghp_your_token_here',
);
final analyzer = await GithubAnalyzer.create(config: config);
Secure Token Management #
Best practices:
// 1. Load from environment variables
import 'dart:io';
void main() async {
final token = Platform.environment['GITHUB_TOKEN'];
final result = await analyzeQuick(
'https://github.com/user/repo',
githubToken: token,
);
}
// 2. Load from secure storage (mobile/desktop)
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
Future<void> analyze() async {
final storage = FlutterSecureStorage();
final token = await storage.read(key: 'github_token');
final result = await analyzeQuick(
'https://github.com/user/repo',
githubToken: token,
);
}
๐ค Output Formats #
Compact (LLM Friendly) #
final config = MarkdownConfig.compact;
- Minimal formatting
- No statistics
- Token count optimized
Standard (Balanced) #
final config = MarkdownConfig.standard;
- Includes statistics
- Code blocks
- Directory tree
Detailed (Comprehensive) #
final config = MarkdownConfig.detailed;
- Full statistics
- Language distribution
- Dependency analysis
๐ Platform Support #
| Platform | Local Analysis | Remote Analysis | Cache | Isolates |
|---|---|---|---|---|
| Desktop | โ | โ | โ | โ |
| Mobile | โ | โ | โ | โ |
| Web | โ | โ | โ ๏ธ* | โ |
*Web uses browser storage instead of file system
๐ ๏ธ Convenience Functions #
// Quick analysis (public repo)
final result = await analyzeQuick('https://github.com/user/repo');
// Quick analysis (private repo)
final result = await analyzeQuick(
'https://github.com/user/private-repo',
githubToken: 'your_token',
);
// LLM-optimized analysis + markdown generation
final outputPath = await analyzeForLLM(
'https://github.com/user/repo',
githubToken: 'your_token', // Optional for public repos
outputDir: './output',
maxFiles: 100,
);
// Custom config analysis
final result = await analyze(
'https://github.com/user/repo',
config: await GithubAnalyzerConfig.create(
githubToken: 'your_token',
),
verbose: true,
useCache: false, // Disable cache
);
๐ Troubleshooting #
403 Forbidden Error #
Cause: Missing or insufficient GitHub token permissions
Solution:
- Ensure you're passing the token correctly:
final result = await analyzeQuick( 'https://github.com/user/repo', githubToken: 'ghp_your_token_here', ); - Fine-grained token: Verify repository access settings
- Classic token: Ensure
reposcope is enabled - Test token:
curl -H "Authorization: token YOUR_TOKEN" https://api.github.com/user
404 Not Found Error #
Cause: Repository doesn't exist, is private without token, or wrong branch name
Solution:
- Verify repository URL is correct
- Add GitHub token for private repos
- Check default branch name (main vs master)
Rate Limit Exceeded #
Cause: GitHub API rate limit (60 req/hr without token)
Solution:
- Pass GitHub token to increase limit to 5,000 req/hr:
final result = await analyzeQuick( 'https://github.com/user/repo', githubToken: 'your_token', );
Cache Not Respecting useCache: false #
Fixed in v0.1.5: Cache now correctly respects the useCache parameter.
// This will NOT create cache
final result = await analyzer.analyze(
'https://github.com/user/repo',
useCache: false,
);
๐ Examples #
Check out more examples in the example/ directory:
demo.dart- Comprehensive demo with performance metrics- Basic usage examples
- Custom configuration examples
๐ค Contributing #
Contributions are always welcome! Feel free to submit Pull Requests.
Development Setup #
# Clone repository
git clone https://github.com/cruxhan/github_analyzer.git
# Install dependencies
dart pub get
# Run tests
dart test
๐ License #
MIT License - See LICENSE file for details.
๐ Links #
๐ก Usage Tips #
- Large Repositories: Limit file count with
maxFilesparameter - Cache Management: Use
useCache: falseto always fetch latest data - Token Security: Never hardcode tokens - use environment variables or secure storage
- Performance Optimization: Enable parallel processing with
enableIsolatePool: true - LLM Token Savings: Use
MarkdownConfig.compact - Private Repos: Always pass
githubTokenparameter explicitly
๐ What's New in v0.1.7 #
- โ
Fixed: Cache now respects
useCache: falseparameter - โ Changed: Removed automatic .env loading for better security
- โ Improved: Explicit token passing via parameters
- โ Fixed: Private repository analysis with HTTP redirect support
Made with โค๏ธ for the Dart & Flutter community
GitHub Analyzer #
AI/LLM์ ์ํ ๊ฐ๋ ฅํ GitHub ์ ์ฅ์ ๋ถ์ ๋๊ตฌ
GitHub ์ ์ฅ์๋ฅผ ๋ถ์ํ๊ณ AI ๋ฐ LLM ์ปจํ ์คํธ์ ์ต์ ํ๋ ๋งํฌ๋ค์ด ๋ฌธ์๋ฅผ ์๋ ์์ฑํ๋ ์์ Dart ํจํค์ง์ ๋๋ค. ์ฝ๋ ๋ฆฌ๋ทฐ, ๋ฌธ์ํ, ํ๋ก์ ํธ ์จ๋ณด๋ฉ์ AI ์ง์์ผ๋ก ๊ฐ์ํํ์ธ์.
โจ ์ฃผ์ ๊ธฐ๋ฅ #
- ๐ ๋น ๋ฅด๊ณ ํจ์จ์ - Isolate ๊ธฐ๋ฐ ๋ณ๋ ฌ ์ฒ๋ฆฌ๋ก ์ต์ ํ
- ๐ฆ ์ด์ค ๋ชจ๋ - ๋ก์ปฌ ๋๋ ํ ๋ฆฌ ๋ฐ ์๊ฒฉ GitHub ์ ์ฅ์ ์ง์
- ๐ฏ LLM ์ต์ ํ - AI ๋ชจ๋ธ์ ์ํ ๊ฐ๊ฒฐํ ์ปจํ ์คํธ ์์ฑ
- ๐ ์ฆ๋ถ ์ ๋ฐ์ดํธ - ๋น ๋ฅธ ์ฌ๋ถ์์ ์ํ ์ค๋งํธ ์บ์ฑ
- ๐ ํฌ๋ก์ค ํ๋ซํผ - ์น, ๋ฐ์คํฌํฑ, ๋ชจ๋ฐ์ผ์์ ์๋
- ๐ ๋น๊ณต๊ฐ ์ ์ฅ์ - GitHub ํ ํฐ์ผ๋ก ๋น๊ณต๊ฐ ์ ์ฅ์ ์ ๊ทผ
- โก ์บ์ ์ ์ด - ์บ์ฑ์ ๋ช ์์ ์ผ๋ก ํ์ฑํ/๋นํ์ฑํ
- ๐ ๋ช ์์ ํ ํฐ ๊ด๋ฆฌ - ๋ณด์ ๊ฐํ๋ฅผ ์ํ ์ง์ ํ ํฐ ์ ๋ฌ
๐ฏ ์ฌ์ฉ ์ฌ๋ก #
- AI ์ฝ๋ ๋ฆฌ๋ทฐ - ChatGPT/Claude์ ์ ์ฒด ํ๋ก์ ํธ ์ปจํ ์คํธ ์ ๊ณต
- ์๋ํ๋ ๋ฌธ์ - ํ๋ก์ ํธ ๊ตฌ์กฐ ๋ฐ ๊ธฐ์ ์คํ ์๋ ๋ถ์
- ์จ๋ณด๋ฉ - ์ ์ ํ์๊ณผ ๋น ๋ฅด๊ฒ ํ๋ก์ ํธ ๊ฐ์ ๊ณต์
- CI/CD ํตํฉ - ์ฝ๋ ๋ณ๊ฒฝ ๊ฐ์ง ๋ฐ ์๋ ๋ฆฌํฌํธ ์์ฑ
- ํ๋ก์ ํธ ๋น๊ต - ๋ค์ํ ์ ์ฅ์์ ๊ตฌ์กฐ ๋ฐ ๋ณต์ก์ฑ ๋น๊ต
๐ฆ ์ค์น #
pubspec.yaml์ ์ถ๊ฐ:
dependencies:
github_analyzer: ^0.1.5
์ค์น:
dart pub get
๐ ๋น ๋ฅธ ์์ #
1. GitHub ํ ํฐ ๋ฐ๊ธ (์ ํ์ฌํญ์ด์ง๋ง ๊ถ์ฅ) #
ํ ํฐ์ด ํ์ํ ์ด์ :
- โ ๋น๊ณต๊ฐ ์ ์ฅ์ ์ ๊ทผ
- โ API ์๋ ์ ํ ์ฆ๊ฐ (60 โ 5,000 req/hr)
- โ 403 ์ค๋ฅ ๋ฐฉ์ง
ํ ํฐ ๋ฐ๊ธ ๋ฐฉ๋ฒ:
- GitHub Settings โ Tokens ๋ฐฉ๋ฌธ
- Fine-grained ํ ํฐ ์์ฑ (๊ถ์ฅ)
- Contents: Read-only ๊ถํ ์ค์
- ํ ํฐ ๋ณต์ฌ
2. ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ (๊ณต๊ฐ ์ ์ฅ์) #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// ๊ณต๊ฐ ์ ์ฅ์ ๋ถ์
final result = await analyzeQuick(
'https://github.com/flutter/flutter',
);
print('ํ์ผ: ${result.statistics.totalFiles}');
print('๋ผ์ธ: ${result.statistics.totalLines}');
print('์ธ์ด: ${result.metadata.language}');
}
3. ๋น๊ณต๊ฐ ์ ์ฅ์ ๋ถ์ #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// ํ ํฐ์ผ๋ก ๋น๊ณต๊ฐ ์ ์ฅ์ ๋ถ์
final result = await analyzeQuick(
'https://github.com/your/private-repo',
githubToken: 'ghp_your_token_here', // ํ ํฐ ๋ช
์์ ์ ๋ฌ
);
print('ํ์ผ: ${result.statistics.totalFiles}');
}
4. LLM์ฉ ๋งํฌ๋ค์ด ์์ฑ #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// LLM ์ต์ ํ ๋ถ์ ๋ฐ ๋งํฌ๋ค์ด ์์ฑ
final outputPath = await analyzeForLLM(
'https://github.com/your/repo',
githubToken: 'ghp_your_token_here', // ๋น๊ณต๊ฐ ์ ์ฅ์์ ๊ฒฝ์ฐ
outputDir: './analysis',
maxFiles: 200,
);
print('์์ฑ๋จ: $outputPath');
}
5. ๊ณ ๊ธ ์ฌ์ฉ๋ฒ #
import 'package:github_analyzer/github_analyzer.dart';
void main() async {
// ์ฌ์ฉ์ ์ ์ ์ค์ ์ผ๋ก ๋ถ์๊ธฐ ์์ฑ
final config = await GithubAnalyzerConfig.create(
githubToken: 'ghp_your_token_here', // ํ ํฐ ๋ช
์์ ์ ๋ฌ
excludePatterns: ['test/', 'docs/'],
maxFileSize: 1024 * 1024, // 1MB
enableCache: true,
);
final analyzer = await GithubAnalyzer.create(config: config);
// ์๊ฒฉ ์ ์ฅ์ ๋ถ์ (์บ์ ๋นํ์ฑํ)
final result = await analyzer.analyzeRemote(
repositoryUrl: 'https://github.com/your/repo',
useCache: false, // ํญ์ ์ต์ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ
);
// ๊ฐ๊ฒฐํ ๋งํฌ๋ค์ด ์์ฑ
final contextService = ContextService();
final outputPath = await contextService.generate(
result,
outputDir: './output',
config: MarkdownConfig.compact,
);
print('์์ฑ๋จ: $outputPath');
// ๋ฆฌ์์ค ์ ๋ฆฌ
await analyzer.dispose();
}
โ๏ธ ์ค์ ์ต์ #
๋น ๋ฅธ ๋ถ์ (๊ณ ์) #
final config = await GithubAnalyzerConfig.quick(
githubToken: 'your_token', // ๊ณต๊ฐ ์ ์ฅ์๋ ์ ํ์ฌํญ
);
- โก ๋น ๋ฅธ ์๋
- ๐ ์ต๋ 100๊ฐ ํ์ผ
- ๐ซ ์บ์ ๋นํ์ฑํ
- ๐ซ Isolate ๋นํ์ฑํ
LLM ์ต์ ํ (๊ท ํ) #
final config = await GithubAnalyzerConfig.forLLM(
githubToken: 'your_token', // ๊ณต๊ฐ ์ ์ฅ์๋ ์ ํ์ฌํญ
maxFiles: 200,
);
- โ๏ธ ๊ท ํ์กํ ์ฑ๋ฅ
- ๐ ์ฌ์ฉ์ ์ ์ ํ์ผ ์
- โ ์บ์ ํ์ฑํ
- โ Isolate ํ์ฑํ
- ๐งช ํ ์คํธ ํ์ผ ์ ์ธ
์ ์ฒด ๋ถ์ (์ข ํฉ) #
final config = await GithubAnalyzerConfig.create(
githubToken: 'your_token', // ๊ณต๊ฐ ์ ์ฅ์๋ ์ ํ์ฌํญ
enableCache: true,
enableIsolatePool: true,
maxConcurrentRequests: 10,
);
- ๐ ์์ธ ๋ถ์
- โพ๏ธ ๋ฌด์ ํ ํ์ผ
- โก ์ต๋ ๋์์ฑ
- ๐พ ์ต์ ํ๋ ์บ์ฑ
๐ ๋น๊ณต๊ฐ ์ ์ฅ์ ์ ๊ทผ #
Fine-grained ํ ํฐ (๊ถ์ฅ) #
- ํ ํฐ ์์ฑ
- Repository access: "Only select repositories" ์ ํ
- Permissions: Contents: Read-only ์ค์
- ํ ํฐ ๋ณต์ฌ
ํด๋์ ํ ํฐ #
- ํ ํฐ ์์ฑ
- Scopes:
repo์ฒดํฌ - ํ ํฐ ๋ณต์ฌ
์ฝ๋์์ ์ฌ์ฉ #
// ์ต์
1: ํธ์ ํจ์์ ํ ํฐ ์ ๋ฌ
final result = await analyzeQuick(
'https://github.com/user/private-repo',
githubToken: 'ghp_your_token_here',
);
// ์ต์
2: ์ค์ ์ ํตํด ํ ํฐ ์ ๋ฌ
final config = await GithubAnalyzerConfig.create(
githubToken: 'ghp_your_token_here',
);
final analyzer = await GithubAnalyzer.create(config: config);
ํ ํฐ ์์ ๊ด๋ฆฌ #
๋ชจ๋ฒ ์ฌ๋ก:
// 1. ํ๊ฒฝ ๋ณ์์์ ๋ก๋
import 'dart:io';
void main() async {
final token = Platform.environment['GITHUB_TOKEN'];
final result = await analyzeQuick(
'https://github.com/user/repo',
githubToken: token,
);
}
// 2. ๋ณด์ ์ ์ฅ์์์ ๋ก๋ (๋ชจ๋ฐ์ผ/๋ฐ์คํฌํฑ)
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
Future<void> analyze() async {
final storage = FlutterSecureStorage();
final token = await storage.read(key: 'github_token');
final result = await analyzeQuick(
'https://github.com/user/repo',
githubToken: token,
);
}
๐ค ์ถ๋ ฅ ํ์ #
๊ฐ๊ฒฐํ ํ์ (LLM ์นํ์ ) #
final config = MarkdownConfig.compact;
- ์ต์ ํฌ๋งทํ
- ํต๊ณ ์์
- ํ ํฐ ์ ์ต์ ํ
ํ์ค ํ์ (๊ท ํ) #
final config = MarkdownConfig.standard;
- ํต๊ณ ํฌํจ
- ์ฝ๋ ๋ธ๋ก
- ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ
์์ธ ํ์ (์ข ํฉ) #
final config = MarkdownConfig.detailed;
- ์ ์ฒด ํต๊ณ
- ์ธ์ด ๋ถํฌ
- ์์กด์ฑ ๋ถ์
๐ ํ๋ซํผ ์ง์ #
| ํ๋ซํผ | ๋ก์ปฌ ๋ถ์ | ์๊ฒฉ ๋ถ์ | ์บ์ | Isolates |
|---|---|---|---|---|
| ๋ฐ์คํฌํฑ | โ | โ | โ | โ |
| ๋ชจ๋ฐ์ผ | โ | โ | โ | โ |
| ์น | โ | โ | โ ๏ธ* | โ |
*์น์ ๋ธ๋ผ์ฐ์ ์ ์ฅ์ ์ฌ์ฉ
๐ ๏ธ ํธ์ ํจ์ #
// ๋น ๋ฅธ ๋ถ์ (๊ณต๊ฐ ์ ์ฅ์)
final result = await analyzeQuick('https://github.com/user/repo');
// ๋น ๋ฅธ ๋ถ์ (๋น๊ณต๊ฐ ์ ์ฅ์)
final result = await analyzeQuick(
'https://github.com/user/private-repo',
githubToken: 'your_token',
);
// LLM ์ต์ ํ ๋ถ์ + ๋งํฌ๋ค์ด ์์ฑ
final outputPath = await analyzeForLLM(
'https://github.com/user/repo',
githubToken: 'your_token', // ๊ณต๊ฐ ์ ์ฅ์๋ ์ ํ์ฌํญ
outputDir: './output',
maxFiles: 100,
);
// ์ฌ์ฉ์ ์ ์ ์ค์ ๋ถ์
final result = await analyze(
'https://github.com/user/repo',
config: await GithubAnalyzerConfig.create(
githubToken: 'your_token',
),
verbose: true,
useCache: false, // ์บ์ ๋นํ์ฑํ
);
๐ ๋ฌธ์ ํด๊ฒฐ #
403 Forbidden ์ค๋ฅ #
์์ธ: ๋๋ฝ๋์๊ฑฐ๋ ๋ถ์ถฉ๋ถํ GitHub ํ ํฐ ๊ถํ
ํด๊ฒฐ์ฑ :
- ํ ํฐ์ ์ฌ๋ฐ๋ฅด๊ฒ ์ ๋ฌํ๋์ง ํ์ธ:
final result = await analyzeQuick( 'https://github.com/user/repo', githubToken: 'ghp_your_token_here', ); - Fine-grained ํ ํฐ: ์ ์ฅ์ ์ ๊ทผ ์ค์ ํ์ธ
- ํด๋์ ํ ํฐ:
repo๋ฒ์ ํ์ฑํ ํ์ธ - ํ ํฐ ํ
์คํธ:
curl -H "Authorization: token YOUR_TOKEN" https://api.github.com/user
404 Not Found ์ค๋ฅ #
์์ธ: ์ ์ฅ์๊ฐ ์์, ํ ํฐ ์์ด ๋น๊ณต๊ฐ ์ ์ฅ์ ์ ๊ทผ, ์๋ชป๋ ๋ธ๋์น๋ช
ํด๊ฒฐ์ฑ :
- ์ ์ฅ์ URL ์ ํ์ฑ ํ์ธ
- ๋น๊ณต๊ฐ ์ ์ฅ์์ GitHub ํ ํฐ ์ถ๊ฐ
- ๊ธฐ๋ณธ ๋ธ๋์น๋ช ํ์ธ (main vs master)
Rate Limit ์ด๊ณผ #
์์ธ: GitHub API ์๋ ์ ํ (ํ ํฐ ์์: 60 req/hr)
ํด๊ฒฐ์ฑ :
- GitHub ํ ํฐ์ ์ ๋ฌํ์ฌ ํ๋ ์ฆ๊ฐ (5,000 req/hr):
final result = await analyzeQuick( 'https://github.com/user/repo', githubToken: 'your_token', );
useCache: false๋ฅผ ๋ฌด์ํ๋ ์บ์ #
v0.1.5์์ ์์ ๋จ: ์บ์๊ฐ useCache ํ๋ผ๋ฏธํฐ๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ธ์ํฉ๋๋ค.
// ์ด์ ์บ์๋ฅผ ์์ฑํ์ง ์์ต๋๋ค
final result = await analyzer.analyze(
'https://github.com/user/repo',
useCache: false,
);
๐ ์์ #
example/ ๋๋ ํ ๋ฆฌ์์ ๋ ๋ง์ ์์ ๋ฅผ ํ์ธํ์ธ์:
demo.dart- ์ฑ๋ฅ ๋ฉํธ๋ฆญ์ค๋ฅผ ํฌํจํ ์ข ํฉ ๋ฐ๋ชจ- ๊ธฐ๋ณธ ์ฌ์ฉ ์์
- ์ฌ์ฉ์ ์ ์ ์ค์ ์์
๐ค ๊ธฐ์ฌํ๊ธฐ #
๊ธฐ์ฌ๋ ํญ์ ํ์ํฉ๋๋ค! Pull Request๋ฅผ ์์ ๋กญ๊ฒ ์ ์ถํ์ธ์.
๊ฐ๋ฐ ํ๊ฒฝ ์ค์ #
# ์ ์ฅ์ ๋ณต์
git clone https://github.com/cruxhan/github_analyzer.git
# ์์กด์ฑ ์ค์น
dart pub get
# ํ
์คํธ ์คํ
dart test
๐ ๋ผ์ด์ ์ค #
MIT License - ์์ธํ ๋ด์ฉ์ LICENSE ํ์ผ ์ฐธ์กฐ
๐ ๋งํฌ #
- pub.flutter-io.cn ํจํค์ง
- GitHub ์ ์ฅ์
- ์ด์ ์ถ์
- ๋ณ๊ฒฝ ๋ก๊ทธ
๐ก ์ฌ์ฉ ํ #
- ๋๊ท๋ชจ ์ ์ฅ์:
maxFilesํ๋ผ๋ฏธํฐ๋ก ํ์ผ ์ ์ ํ - ์บ์ ๊ด๋ฆฌ: ์ต์ ๋ฐ์ดํฐ๋ฅผ ์ํด
useCache: false์ฌ์ฉ - ํ ํฐ ๋ณด์: ํ๊ฒฝ ๋ณ์ ๋๋ ๋ณด์ ์ ์ฅ์ ์ฌ์ฉ
- ์ฑ๋ฅ ์ต์ ํ:
enableIsolatePool: true๋ก ๋ณ๋ ฌ ์ฒ๋ฆฌ ํ์ฑํ - LLM ํ ํฐ ์ ์ฝ:
MarkdownConfig.compact์ฌ์ฉ - ๋น๊ณต๊ฐ ์ ์ฅ์: ํญ์
githubTokenํ๋ผ๋ฏธํฐ ๋ช ์์ ์ ๋ฌ
๐ v0.1.5์ ์ ๊ธฐ๋ฅ #
- โ
์์ ๋จ:
useCache: falseํ๋ผ๋ฏธํฐ ์บ์ ์กด์ค - โ ๋ณ๊ฒฝ๋จ: ๋ณด์ ๊ฐํ๋ฅผ ์ํด ์๋ .env ๋ก๋ ์ ๊ฑฐ
- โ ๊ฐ์ ๋จ: ํ๋ผ๋ฏธํฐ๋ฅผ ํตํ ๋ช ์์ ํ ํฐ ์ ๋ฌ
- โ ์์ ๋จ: HTTP ๋ฆฌ๋ค์ด๋ ํธ ์ง์ ์ถ๊ฐ
Dart & Flutter ์ปค๋ฎค๋ํฐ๋ฅผ ์ํด โค๏ธ ์ผ๋ก ๋ง๋ค์ด์ก์ต๋๋ค