-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontextmaker
More file actions
executable file
·57 lines (47 loc) · 1.84 KB
/
contextmaker
File metadata and controls
executable file
·57 lines (47 loc) · 1.84 KB
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
#!/usr/bin/env python3
"""
Real contextmaker wrapper
This script provides a command-line interface to the real contextmaker package.
"""
import sys
import argparse
from pathlib import Path
try:
from contextmaker import make
CONTEXTMAKER_AVAILABLE = True
except ImportError:
CONTEXTMAKER_AVAILABLE = False
print("❌ contextmaker package not available")
print("Install it with: pip install contextmaker")
sys.exit(1)
def main():
"""Main CLI function"""
parser = argparse.ArgumentParser(description='contextmaker - Extract documentation from repositories')
parser.add_argument('repo_name', nargs='?', help='Repository name (e.g., "username/repo")')
parser.add_argument('--output', '-o', help='Output file path')
parser.add_argument('--input-path', help='Input repository path')
parser.add_argument('--rough', action='store_true', help='Use rough mode for faster, more compact output')
parser.add_argument('--version', '-v', action='store_true', help='Show version')
args = parser.parse_args()
if args.version:
try:
import contextmaker
print(f"contextmaker {getattr(contextmaker, '__version__', 'unknown')}")
except:
print("contextmaker (version unknown)")
return
if not CONTEXTMAKER_AVAILABLE:
print("❌ contextmaker package not available")
sys.exit(1)
if not args.repo_name or not args.output:
parser.print_help()
sys.exit(1)
try:
# Call the real contextmaker.make function
make(args.repo_name, output_path=args.output, input_path=args.input_path, rough=args.rough)
print(f"✅ Context generated successfully: {args.output}")
except Exception as e:
print(f"❌ Error generating context: {e}")
sys.exit(1)
if __name__ == "__main__":
main()