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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
[](https://github.com/rust-lang/cargo/issues/4121)
[](https://crates.io/crates/can-utils-rs)
[](https://docs.rs/can-utils-rs/)
[](https://github.com/wallem89/can-utils-rs/actions)
[](https://opensource.org/licenses/MIT)
`can-utils-rs` is a Rust library and CLI utility for working with
**Linux SocketCAN interfaces**. It provides an interactive workflow
for creating CAN interfaces and inspecting CAN traffic with a
colorized CAN dump.
The tool currently supports:
- --
The goal of this project is to provide a **friendlier and more visual
alternative to common Linux CAN tools** such as `candump`, while still
integrating seamlessly with the standard SocketCAN ecosystem.
The interactive wizard helps configure CAN interfaces without needing
to remember the exact Linux commands.
Supported interface types:
- --
The tool previews the commands before executing them so users can see
exactly what will happen.
Example native CAN configuration:
```text
sudo ip link set can0 up type can bitrate 500000
```
The project includes a **colorized CAN dump utility** similar to
Linux `candump`, but optimized for readability.
Example output:
```text
(1773430351.545039) vcan0 7FF#00 11 22 33 44 55 66
```
Enhancements include:
- ---
This makes it significantly easier to visually scan CAN traffic.
On startup the tool checks whether required system utilities exist.
Missing prerequisites are detected automatically and the user is
offered an option to install them.
Example prompt:
```text
Missing prerequisites:
-
? Some required tools are missing. What do you want to do?
❯ Install prerequisites
Continue anyway
Exit
```
Installation currently supports **APT-based systems** (Debian / Ubuntu).
Configures a hardware CAN controller via SocketCAN.
```text
sudo ip link set can0 up type can bitrate 500000
```
Typical hardware:
- ---
Serial CAN adapters using the `slcand` daemon.
Example command sequence:
```text
sudo slcand -c -o -f -s6 -t hw -S 3000000 /dev/ttyUSB0 slcan0
sudo ip link set up slcan0
```
Virtual CAN interfaces are extremely useful for development,
testing, and CI environments.
```text
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
```
Install the CLI locally with Cargo:
```text
cargo install --path .
```
Or install it from crates.io without needing to build from source:
```text
cargo install can-utils-rs
```
Then run:
```text
can-utils-rs
```

Running the binary launches an interactive menu.
```text
$ can-utils-rs
? What do you want to do?
❯ Create or manage a CAN interface
Start pretty CAN dump
Create/manage CAN interface then start dump
```
The setup workflow asks for:
- ---
Before applying changes the tool prints the commands that will run.
If an interface already exists the user is asked how to proceed:
```text
Interface 'can0' already exists.
❯ Replace existing interface
Enter another interface name
Keep existing and skip setup
Cancel
```
When replacing an interface the tool will:
- --
The following system packages are required:
```text
iproute2
can-utils
kmod
```
For virtual CAN interfaces:
```text
sudo modprobe vcan
```
The tool can optionally install these automatically on supported systems.
The project is structured into modular subsystems:
```text
setup::models - shared configuration types
setup::prompt - interactive setup wizard
setup::plan - command planning / preview generation
setup::exec - command execution helpers
setup::prereqs - prerequisite detection and installation
dump::format - colored frame formatting
dump::live - live SocketCAN frame reader
dump::mod - dump orchestration and interface selection
```
This architecture keeps setup logic, CAN traffic handling, and CLI
interaction clearly separated.
MIT