-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.toml
More file actions
153 lines (143 loc) · 4.11 KB
/
rules.toml
File metadata and controls
153 lines (143 loc) · 4.11 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
# VibeRot Configuration File (Linux/MacOS/WSL + bash/zsh)
#
# 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 install*"
# [rules.action]
# type = "exec"
# path = "/path/to/action/executable/or/script"
# args = ["--arg1", "--arg2"]
# single_instance = true
#
# Rule with multiple commands mapping to the same action:
# [[rules]]
# command = ["*cargo build*", "*cargo check*", "*cargo test*"]
# [rules.action]
# type = "exec"
# path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay"
# args = ["--exit-on-stdin-close"]
# single_instance = true
#
# Rule with single command mapping to multiple actions:
# [[rules]]
# command = "*docker build*"
# action = [
# { type = "exec", path = "python3", args = ["actions/example/info.py"] },
# { type = "exec", path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay", 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 = "node", args = ["/path/to/script.js"] },
# { type = "exec", path = "google-chrome", args = ["https://www.reddit.com/r/unixporn"] }
# ]
#
# 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 = "codex", args = ["exec", "--sandbox", "danger-full-access", "\"chatgpt pls fix my syntax error make no mistakes\""] }
# ]
#
# 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 build*",
"*cargo run*",
"*cargo test*",
"*cargo bench*",
"*cargo install*",
# Python
"*pip install*",
"*python 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 install*",
"*npm i*",
"*npm ci*",
"*npm run test*",
"*npm test*",
"*yarn install*",
"*yarn add*",
"*yarn test*",
"*pnpm install*",
"*pnpm run test*",
"*pnpm test*",
# c/c++
"*cmake*",
"*make*",
# 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
# ------------------------------
"*apt install*",
"*apt-get install*",
"*dnf install*",
"*pacman -S*",
"*zypper install*",
"*snap install*",
"*brew install*",
]
[rules.action]
type = "exec"
path = "${VIBEROT_ACTIONS}/overlay/target/release/viberot-overlay"
args = ["--exit-on-stdin-close"]
single_instance = true