forked from vitali87/code-graph-rag
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcli_help.py
More file actions
103 lines (91 loc) · 4.48 KB
/
Copy pathcli_help.py
File metadata and controls
103 lines (91 loc) · 4.48 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from enum import StrEnum
class CLICommandName(StrEnum):
START = "start"
INDEX = "index"
EXPORT = "export"
OPTIMIZE = "optimize"
MCP_SERVER = "mcp-server"
GRAPH_LOADER = "graph-loader"
LANGUAGE = "language"
DOCTOR = "doctor"
APP_DESCRIPTION = (
"An accurate Retrieval-Augmented Generation (RAG) system that analyzes "
"multi-language codebases using Tree-sitter, builds comprehensive knowledge "
"graphs, and enables natural language querying of codebase structure and relationships."
)
CMD_START = "Start interactive chat session with your codebase"
CMD_INDEX = "Index codebase to protobuf files for offline use"
CMD_EXPORT = "Export knowledge graph from Memgraph to JSON file"
CMD_OPTIMIZE = "AI-guided codebase optimization session"
CMD_MCP_SERVER = "Start the MCP server for Claude Code integration"
CMD_GRAPH_LOADER = "Load and display summary of exported graph JSON"
CMD_LANGUAGE = "Manage language grammars (add, remove, list)"
CMD_DOCTOR = "Verify that all dependencies and configurations are properly set up"
CMD_LANGUAGE_GROUP = "CLI for managing language grammars"
CMD_LANGUAGE_ADD = "Add a new language grammar to the project."
CMD_LANGUAGE_LIST = "List all currently configured languages."
CMD_LANGUAGE_REMOVE = "Remove a language from the project."
CMD_LANGUAGE_CLEANUP = "Clean up orphaned git modules that weren't properly removed."
HELP_BATCH_SIZE = "Number of buffered nodes/relationships before flushing to Memgraph"
HELP_MEMGRAPH_HOST = "Memgraph host"
HELP_MEMGRAPH_PORT = "Memgraph port"
HELP_ORCHESTRATOR = (
"Specify orchestrator as provider:model "
"(e.g., ollama:llama3.2, openai:gpt-4, google:gemini-2.5-pro)"
)
HELP_CYPHER_MODEL = (
"Specify cypher model as provider:model "
"(e.g., ollama:codellama, google:gemini-2.5-flash)"
)
HELP_NO_CONFIRM = "Disable confirmation prompts for edit operations (YOLO mode)"
HELP_REPO_PATH_RETRIEVAL = "Path to the target repository for code retrieval"
HELP_REPO_PATH_INDEX = "Path to the target repository to index."
HELP_REPO_PATH_OPTIMIZE = "Path to the repository to optimize"
HELP_REPO_PATH_WATCH = "Path to the repository to watch."
HELP_UPDATE_GRAPH = "Update the knowledge graph by parsing the repository"
HELP_CLEAN_DB = "Clean the database before updating (use when adding first repo)"
HELP_OUTPUT_GRAPH = "Export graph to JSON file after updating (requires --update-graph)"
HELP_OUTPUT_PATH = "Output file path for the exported graph"
HELP_OUTPUT_PROTO_DIR = (
"Required. Path to the output directory for the protobuf index file(s)."
)
HELP_SPLIT_INDEX = "Write index to separate nodes.bin and relationships.bin files."
HELP_FORMAT_JSON = "Export in JSON format"
HELP_LANGUAGE_ARG = (
"Programming language to optimize for (e.g., python, java, javascript, cpp)"
)
HELP_REFERENCE_DOC = "Path to reference document/book for optimization guidance"
HELP_GRAPH_FILE = "Path to the exported graph JSON file"
HELP_EXPORTED_GRAPH_FILE = "Path to the exported_graph.json file."
HELP_GRAMMAR_URL = (
"URL to the tree-sitter grammar repository. If not provided, "
"will use https://github.com/tree-sitter/tree-sitter-<language_name>"
)
HELP_KEEP_SUBMODULE = "Keep the git submodule (default: remove it)"
HELP_EXCLUDE_PATTERNS = (
"Additional paths to exclude from indexing. Accepts either a literal "
"directory segment (e.g. 'build') or a gitignore-style glob matched "
"against the repo-relative path: '*' = any chars except '/', '**' = "
"any number of path segments, '?' = single char, '[abc]' = char class. "
"A pattern without '/' matches against any path component, "
"'**/__mocks__' matches '__mocks__' at any depth, '**/*.test.ts' "
"matches test files anywhere. Can be specified multiple times."
)
HELP_INTERACTIVE_SETUP = (
"Show interactive prompt to select which detected directories to keep. "
"Without this flag, all directories matching ignore patterns are automatically excluded."
)
HELP_START_LOG_FILE = (
"Write full DEBUG log to this file (parent directory created if missing)."
)
HELP_START_FILES = "Scan only these file paths (relative to repo root). Skips Pass 1, pre-loads registry from graph."
CLI_COMMANDS: dict[CLICommandName, str] = {
CLICommandName.START: CMD_START,
CLICommandName.INDEX: CMD_INDEX,
CLICommandName.EXPORT: CMD_EXPORT,
CLICommandName.OPTIMIZE: CMD_OPTIMIZE,
CLICommandName.MCP_SERVER: CMD_MCP_SERVER,
CLICommandName.GRAPH_LOADER: CMD_GRAPH_LOADER,
CLICommandName.LANGUAGE: CMD_LANGUAGE,
CLICommandName.DOCTOR: CMD_DOCTOR,
}