-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_junie_rule.py
More file actions
31 lines (25 loc) · 1.13 KB
/
add_junie_rule.py
File metadata and controls
31 lines (25 loc) · 1.13 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
import os
import sys
def main() -> None:
script_dir = os.path.dirname(os.path.abspath(__file__))
doc_path = os.path.join(script_dir, "LLM_DOC.md")
user_project_root = os.getcwd()
output_directory = os.path.join(user_project_root, ".junie")
output_file = os.path.join(output_directory, "guidelines.md")
relative_doc_path = os.path.relpath(doc_path, user_project_root)
try:
rule = f"""
# Nutrient DWS Python Client Usage
- Use the `nutrient-dws` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
- Package Documentation and Examples can be found at: {relative_doc_path}
"""
if not os.path.exists(output_directory):
os.makedirs(output_directory)
with open(output_file, "a", encoding="utf-8") as f:
f.write(rule)
print(
f"📄 Updated Junie Code Rules to point to Nutrient DWS documentation at {relative_doc_path}."
)
except Exception as err:
print(f"Failed to update .junie/guidelines.md file: {err}", file=sys.stderr)
sys.exit(1)