-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-example.js
More file actions
98 lines (93 loc) · 2.2 KB
/
cli-example.js
File metadata and controls
98 lines (93 loc) · 2.2 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
// CLI Usage Example
// This file demonstrates how to use the contextr CLI for various tasks
/**
* Building Context
* ----------------
* Basic usage to build context from a directory:
*
* $ contextr build -d ./src -o context.txt
*
* With regex pattern matching:
*
* $ contextr build -d ./src -r -i ".*\.js$" -e ".*\.test\.js$" -o context.json -f json
*
* With multiple directories and file extension filtering:
*
* $ contextr build -d ./src -d ./lib --ext js,ts -o context.txt
*
* With in-file content search:
*
* $ contextr build -d ./src --search "import React" -o context.txt
*
* With whitelist and blacklist:
*
* $ contextr build -d ./src --whitelist "**/*.js" --blacklist "**/node_modules/**" -o context.txt
*/
/**
* Searching in Files
* -----------------
* Basic search:
*
* $ contextr search -p "function" -d ./src
*
* With regex:
*
* $ contextr search -p "function\s+\w+" -r -d ./src
*
* With case sensitivity and whole word matching:
*
* $ contextr search -p "render" -c -w -d ./src
*
* With context lines:
*
* $ contextr search -p "useState" --context 3 -d ./src
*
* With different output formats:
*
* $ contextr search -p "import" -f json -o search-results.json -d ./src
* $ contextr search -p "export" -f files-only -d ./src
* $ contextr search -p "class" -f count -d ./src
*
* With file extension filtering:
*
* $ contextr search -p "function" --ext js,ts -d ./src
*
* With maximum results limit:
*
* $ contextr search -p "const" --max-results 50 -d ./src
*/
/**
* Studio Mode
* -----------
* Launch the UI studio:
*
* $ contextr studio
*
* With custom port and host:
*
* $ contextr studio -p 8080 --host 0.0.0.0
*
* Without automatically opening browser:
*
* $ contextr studio --no-open
*/
/**
* Configuration Management
* -----------------------
* Save current configuration:
*
* $ contextr config --save my-config
*
* Load a saved configuration:
*
* $ contextr config --load my-config
*
* List all saved configurations:
*
* $ contextr config --list
*
* Delete a saved configuration:
*
* $ contextr config --delete my-config
*/
// This file is for documentation purposes only and is not meant to be executed