-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.win.toml
More file actions
164 lines (152 loc) · 4.95 KB
/
rules.win.toml
File metadata and controls
164 lines (152 loc) · 4.95 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# VibeRot Configuration File (Windows + any shell)
#
# This file defines rules for intercepting and handling commands.
# Each rule consists of command pattern(s) and action(s) to execute.
#
# Rules support the following:
# - Single command or array of commands
# - Single action or array of actions
#
# Example configuration structures:
#
# Basic rule with single command and single action:
# [[rules]]
# command = "*npm-cli.js* install *"
# [rules.action]
# type = "exec"
# path = "C:\\path\\to\\action.exe"
# args = ["--arg1", "--arg2"]
# single_instance = true
#
# Rule with multiple commands mapping to the same action:
# [[rules]]
# command = ["*cargo.exe build*", "*cargo.exe check*", "*cargo.exe test*"]
# [rules.action]
# type = "exec"
# path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay.exe"
# args = ["--exit-on-stdin-close"]
# single_instance = true
#
# Rule with single command mapping to multiple actions:
# [[rules]]
# command = "*docker* build*"
# action = [
# { type = "exec", path = "python", args = ["actions/example/info.py"] },
# { type = "exec", path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay.exe", args = ["--exit-on-stdin-close"], single_instance = true }
# ]
#
# Rule with multiple commands mapping to multiple actions:
# [[rules]]
# command = ["*npm* install*", "*yarn* install*", "*pnpm* install*"]
# action = [
# { type = "exec", path = "python", args = ["scripts/package-install-notify.py"] },
# { type = "exec", path = "notepad.exe", args = ["package-install-log.txt"] }
# ]
#
# Alternative syntax using aliases:
# [[rules]]
# commands = ["*git* push*", "*git* pull*"] # "commands" is an alias for "command"
# actions = [ # "actions" is an alias for "action"
# { type = "exec", path = "python", args = ["scripts/git-notify.py"] }
# ]
#
# Note about specifying commands
# On Windows, VibeRot doesn't actually see the shell command directly.
# Instead, it listens to process creation and termination events and grabs their command lines.
# This means that shell commands will be fully extended to the actual executable being run.
# For example, 'npm install' might appear as '"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" install',
# which is very verbose.
# So you might want to use wildcards to match the relevant parts of the command line.
# For instance, to match the example above, you could use '*npm-cli.js* install*'.
#
# Path Resolution:
# - Executable names (e.g., "python", "notepad.exe") are found via PATH
# - Absolute paths (e.g., "C:\path\to\action.exe") are used as-is
# - Relative paths are resolved relative to the viberot project root
# - Environment variables are supported:
# - ${VIBEROT_HOME}: viberot project root
# - ${VIBEROT_ACTIONS}: viberot/actions directory
# - Other standard environment variables work too
[[rules]]
command = [
#------------------------------
# Development
#------------------------------
# rust
"*cargo.exe* build*",
"*cargo.exe* run*",
"*cargo.exe* test*",
"*cargo.exe* bench*",
"*cargo.exe* install*",
# Python
"*pip.exe* install*",
"*uv* pip install*",
# ------------------------------
# Note: starting from here all command patterns are unverified. If you use them and they don't work, please open an issue or PR to fix them.
#------------------------------
"*python.exe* setup.py*",
"*poetry* add*",
"*poetry* install*",
"*pyinstaller* *.py*",
"*pipx* install*",
# Optimally we would also be able to detect if a pytorch/tensorflow/jax model is being trained
# but that probably involves calling an external action which will inspect the code
# js/ts
"*npm-cli.js* install*",
"*npm-cli.js* i*",
"*npm-cli.js* ci*",
"*npm-cli.js* run test*",
"*npm-cli.js* test*",
"*yarn* install*",
"*yarn* add*",
"*yarn* test*",
"*pnpm* install*",
"*pnpm* run test*",
"*pnpm* test*",
# c/c++
"*cmake*",
"*nmake*",
# maybe not directly detect compilers because only gods compile big projects with 100 flags by hand
# "*gcc *",
# "*g++ *",
# "*clang ",
# "*clang++ *",
# java
"*mvn* install*",
"*mvn* clean install*",
"*mvn* compile*",
"*mvn* dependency:resolve*",
"*mvn* dependency:tree*",
"*gradle* build*",
# go
"*go* build*",
"*go* mod download*",
# native stuff
"*react-native* run*",
"*react-native* build*",
"*expo* run*",
"*expo* prebuild*",
"*eas* build*",
"*gradlew* build*",
"*flutter* pub get*",
"*flutter* build*",
#------------------------------
# Cloud
#------------------------------
"*docker* build*",
"*docker-compose* up*",
"*kubectl* apply*",
"*terraform* apply*",
"*terraform* plan*",
# ------------------------------
# Package Managers
# ------------------------------
"*choco* install*",
"*winget* install*",
"*scoop* install*",
]
[rules.action]
type = "exec"
path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay.exe"
args = ["--exit-on-stdin-close"]
single_instance = true