rauto 0.2.2

A powerful CLI tool for network device automation using minijinja templates and rneter.
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# rauto - Network Device Automation CLI

[![Crates.io](https://img.shields.io/crates/v/rauto.svg)](https://crates.io/crates/rauto)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Website](https://img.shields.io/badge/Website-rauto.top-0ea5e9?style=for-the-badge&logo=googlechrome&logoColor=white)](https://rauto.top)
[中文文档](README_zh.md)

`rauto` is a powerful CLI tool for network device automation, written in Rust. It leverages the [rneter](https://github.com/demohiiiii/rneter) library for intelligent SSH connection management and utilizes [minijinja](https://github.com/mitsuhiko/minijinja) for flexible command templating.

## Features

- **Double Template System**: Command Templates (Jinja2) & Device Profiles (TOML).
- **Intelligent Connection Handling**: Uses `rneter` for SSH state management.
- **Dry Run Support**: Preview commands before execution.
- **Variable Injection**: Load variables from JSON.
- **Extensible**: Custom TOML device profiles.
- **Built-in Web Console**: Start browser UI with `rauto web`.
- **Embedded Web Assets**: Frontend files are embedded into the binary for release usage.
- **Saved Connection Profiles**: Reuse named connection settings across commands.
- **Session Recording & Replay**: Record SSH sessions to JSONL and replay offline.
- **Data Backup & Restore**: Backup full `~/.rauto` runtime data and restore when needed.
- **Multi-device Orchestration (Web + CLI)**: Run staged serial/parallel plans across multiple devices, reusing saved connections and current `tx` / `tx-workflow` capabilities.

## Installation

### From Binary (Recommended)

Download the latest release for your platform from [GitHub Releases](https://github.com/demohiiiii/rauto/releases).

### From Crates.io

```bash
cargo install rauto
```

### From Source

Ensure you have Rust and Cargo installed.

```bash
git clone https://github.com/demohiiiii/rauto.git
cd rauto
cargo build --release
```

The binary will be available at `target/release/rauto`.

## Codex Skill (Optional)

This repo includes a Codex skill for rauto usage under `skills/rauto-usage/`.

Recommended usage:
- If you are operating `rauto` through Codex or Claude Code, using the skill is the cleanest path.
- The skill is action-first: it prefers running read-only `rauto` commands directly, and for config changes it prefers `tx` / `tx-workflow` with rollback or `--dry-run` first.
- It also returns a compact execution summary instead of raw terminal noise.

### Install to your machine

1. Clone the repo:
```bash
git clone https://github.com/demohiiiii/rauto.git
```
2. Copy the skill into your Codex skills folder:
```bash
cp -R rauto/skills/rauto-usage "$CODEX_HOME/skills/"
```

Notes:
- If `CODEX_HOME` is not set, it usually defaults to `~/.codex`.
- You can verify the skill is present at `$CODEX_HOME/skills/rauto-usage`.

### Recommended prompts

You can explicitly invoke the skill with `$rauto-usage`, for example:

```text
Use $rauto-usage to test connection lab1 and run "show version".
Use $rauto-usage to preview templates/examples/fabric-advanced-orchestration.json, then wait for my confirmation before execution.
Use $rauto-usage to show connection history for lab1 and summarize failures only.
Use $rauto-usage to render configure_vlan.j2 with templates/example_vars.json and dry-run it first.
```

If your agent supports automatic skill routing, natural requests like these usually work too:

```text
Run one show command on my saved connection lab1.
Preview this tx workflow and tell me the rollback plan.
Check recent execution history for core-01 and summarize the errors.
```

### Claude Code example

If you use Claude Code skills, copy the folder into your Claude Code skills directory:
```bash
cp -R rauto/skills/rauto-usage ~/.claude/skills/
```

`~/.claude/skills/` is a common personal skills location for Claude Code. If your local setup uses a different skills directory, copy it there instead.

## Usage

### 1. Template Mode (Recommended)

Render commands from a template and execute them on a device.

**Basic Usage:**
```bash
rauto template show_version.j2 \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

**With Variables:**
Given a template `templates/commands/configure_vlan.j2` and variables file `templates/example_vars.json`:

```bash
rauto template configure_vlan.j2 \
    --vars templates/example_vars.json \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

**Dry Run (Preview):**
```bash
rauto template configure_vlan.j2 \
    --vars templates/example_vars.json \
    --dry-run
```

### 2. Direct Execution

Execute raw commands directly without templates.

```bash
rauto exec "show ip int br" \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

**Specifying Execution Mode:**
Execute a command in a specific mode (e.g., `Enable`, `Config`).

```bash
rauto exec "show bgp neighbor" \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22 \
    --mode Enable
```

### 3. Device Profiles

`rauto` supports built-in device profiles (inherited from `rneter`) and custom TOML profiles.

**List Available Profiles:**
```bash
rauto device list
```

**Using a Specific Profile:**
Default is `cisco`. To use Huawei VRP:

```bash
rauto template show_ver.j2 \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22 \
    --device-profile huawei
```

**Custom Device Profile:**
You can define custom profiles in `templates/devices/*.toml`.

Example `templates/devices/custom_cisco.toml`:
```toml
name = "custom_cisco"

[[prompts]]
state = "Enable"
patterns = ['^[^\s#]+#\s*$']

# ... see templates/devices/custom_cisco.toml for full example
```

Use it:
```bash
rauto exec "show ver" \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22 \
    --device-profile custom_cisco
```

**Useful profile management commands:**
```bash
rauto device list
rauto device show cisco
rauto device copy-builtin cisco my_cisco
rauto device delete-custom my_cisco
rauto connection test \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

### 4. Web Console (Axum)

Start the built-in web service and open the visual console in your browser:

```bash
rauto web \
    --bind 127.0.0.1 \
    --port 3000 \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

Then visit `http://127.0.0.1:3000`.

Web assets are embedded into the binary at build time.  
For released binaries, users only need to run the executable (no extra `static/` files required at runtime).

Web console key capabilities:
- Manage saved connections in UI: add, load, update, delete, and inspect details.
- Execute commands with saved connection info (load one connection, then run direct or template mode).
- Manage profiles (builtin/custom) and templates in dedicated tabs.
- Manage data backups in UI: create/list/download/restore `~/.rauto` backup archives.
- Diagnose profile state machines in Prompt Management -> Diagnostics with visualized result fields.
- Switch Chinese/English in UI.
- Record execution sessions and replay recorded outputs in browser (list events or replay by command/mode).

### 5. Template Storage Commands

```bash
rauto templates list
rauto templates show show_version.j2
rauto templates delete show_version.j2
```

### 6. Saved Connection Profiles

You can save and reuse connection settings by name:

```bash
# Add/update a profile directly from CLI args
rauto connection add lab1 \
    --host 192.168.1.1 \
    --username admin \
    --ssh-port 22 \
    --device-profile cisco

# Reuse the saved profile
rauto exec "show version" --connection lab1

# Save current effective connection after a successful run
rauto connection test \
    --connection lab1 \
    --save-connection lab1_backup

# Manage saved profiles
rauto connection list
rauto connection show lab1
rauto connection delete lab1
rauto history list lab1 --limit 20
```

Password behavior:
- `--save-connection` (used in `exec/template/connection test`) saves without password by default; add `--save-password` to include password fields.
- `connection add` saves password only when `--password` / `--enable-password` is explicitly provided.

### 7. Backup & Restore

Backup all current `rauto` runtime data (`connections`, `profiles`, `templates`, `records`, etc.):

```bash
# Create backup to default path: ~/.rauto/backups/rauto-backup-<timestamp>.tar.gz
rauto backup create

# Create backup to custom output path
rauto backup create --output ./rauto-backup.tar.gz

# List default backup archives
rauto backup list

# Restore archive (merge into current ~/.rauto)
rauto backup restore ./rauto-backup.tar.gz

# Restore archive and replace current ~/.rauto data first
rauto backup restore ./rauto-backup.tar.gz --replace
```

### 8. CLI Quick Reference

**Connection troubleshooting**
```bash
rauto connection test \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --ssh-port 22
```

**Saved connection profiles**
```bash
rauto connection add lab1 \
    --host 192.168.1.1 \
    --username admin \
    --ssh-port 22 \
    --device-profile cisco
rauto exec "show version" --connection lab1
rauto connection list
rauto history list lab1 --limit 20
```

**Profile management**
```bash
rauto device list
rauto device show cisco
rauto device copy-builtin cisco my_cisco
rauto device show my_cisco
rauto device delete-custom my_cisco
```

**Template storage management**
```bash
rauto templates list
rauto templates show show_version.j2
rauto templates delete show_version.j2
```

**Session recording & replay**
```bash
# Record direct exec
rauto exec "show version" \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --record-file ~/.rauto/records/show_version.jsonl \
    --record-level full

# Record template execution
rauto template show_version.j2 \
    --host 192.168.1.1 \
    --username admin \
    --password secret \
    --record-file ~/.rauto/records/template_run.jsonl \
    --record-level key-events-only

# Replay / inspect
rauto replay ~/.rauto/records/show_version.jsonl --list
rauto replay ~/.rauto/records/show_version.jsonl --command "show version" --mode Enable
```

**Backup & restore**
```bash
rauto backup create
rauto backup list
rauto backup restore ~/.rauto/backups/rauto-backup-1234567890.tar.gz --replace
```

**Transaction blocks**
```bash
# Tx block with inferred per-step rollback
rauto tx \
    --command "interface vlan 10" \
    --command "ip address 10.0.10.1 255.255.255.0" \
    --host 192.168.1.1 \
    --username admin \
    --password secret

# Tx block with explicit per-step rollback (repeatable flags)
rauto tx \
    --command "interface vlan 10" \
    --command "ip address 10.0.10.1 255.255.255.0" \
    --rollback-command "no interface vlan 10" \
    --rollback-command "no ip address 10.0.10.1 255.255.255.0" \
    --host 192.168.1.1 \
    --username admin \
    --password secret

# Tx block with per-step rollback from file (one per line, empty lines ignored)
rauto tx \
    --command "interface vlan 10" \
    --command "ip address 10.0.10.1 255.255.255.0" \
    --rollback-commands-file ./rollback.txt \
    --host 192.168.1.1 \
    --username admin \
    --password secret

# Tx block with per-step rollback from JSON array
rauto tx \
    --command "interface vlan 10" \
    --command "ip address 10.0.10.1 255.255.255.0" \
    --rollback-commands-json ./rollback.json \
    --host 192.168.1.1 \
    --username admin \
    --password secret

# Tx block with whole-resource rollback
rauto tx \
    --command "vlan 10" \
    --resource-rollback-command "no vlan 10" \
    --host 192.168.1.1 \
    --username admin \
    --password secret
```

**Transaction workflow**
```bash
# Visualize workflow structure in terminal (ANSI colors enabled by default)
# Disable colors with: NO_COLOR=1
rauto tx-workflow ./workflow.json --view

# Execute a workflow from JSON
rauto tx-workflow ./workflow.json \
    --host 192.168.1.1 \
    --username admin \
    --password secret

# Dry-run: print workflow plan and exit
rauto tx-workflow ./workflow.json --dry-run

# Dry-run raw JSON
rauto tx-workflow ./workflow.json --dry-run --json
```

**Transaction workflow JSON example**
```json
{
  "name": "fw-policy-publish",
  "fail_fast": true,
  "blocks": [
    {
      "name": "addr-objects",
      "kind": "config",
      "fail_fast": true,
      "rollback_policy": "per_step",
      "steps": [
        {
          "mode": "Config",
          "command": "address-book global address WEB01 10.0.10.1/32",
          "timeout_secs": 10,
          "rollback_command": "delete address-book global address WEB01"
        }
      ]
    },
    {
      "name": "policy",
      "kind": "config",
      "fail_fast": true,
      "rollback_policy": {
        "whole_resource": {
          "mode": "Config",
          "undo_command": "delete security policies from-zone trust to-zone untrust policy allow-web",
          "timeout_secs": 10
        }
      },
      "steps": [
        {
          "mode": "Config",
          "command": "set security policies from-zone trust to-zone untrust policy allow-web match source-address WEB01",
          "timeout_secs": 10,
          "rollback_command": null
        }
      ]
    }
  ]
}
```

Ready-to-edit sample files:
- [templates/examples/core-vlan-workflow.json]/Users/adam/Project/rauto-all/rauto/templates/examples/core-vlan-workflow.json

Advanced sample files:
- [templates/examples/fabric-change-workflow.json]/Users/adam/Project/rauto-all/rauto/templates/examples/fabric-change-workflow.json

**Multi-device orchestration**
```bash
# Preview orchestration structure in terminal
rauto orchestrate ./orchestration.json --view

# Dry-run: print normalized plan and exit
rauto orchestrate ./orchestration.json --dry-run

# Execute a multi-device plan
rauto orchestrate ./orchestration.json --record-level full

# Print execution result as JSON
rauto orchestrate ./orchestration.json --json
```

**Orchestration plan JSON example**
```json
{
  "name": "campus-vlan-rollout",
  "fail_fast": true,
  "stages": [
    {
      "name": "core",
      "strategy": "serial",
      "targets": ["core-01", "core-02"],
      "action": {
        "kind": "tx_workflow",
        "workflow_file": "./workflows/core-vlan.json"
      }
    },
    {
      "name": "access",
      "strategy": "parallel",
      "max_parallel": 10,
      "targets": [
        {
          "connection": "sw-01",
          "vars": {
            "hostname": "sw-01"
          }
        },
        {
          "connection": "sw-02",
          "vars": {
            "hostname": "sw-02"
          }
        }
      ],
      "action": {
        "kind": "tx_block",
        "name": "access-vlan",
        "template": "configure_vlan.j2",
        "mode": "Config",
        "vars": {
          "vlans": [
            {
              "id": 120,
              "name": "STAFF"
            }
          ]
        }
      }
    }
  ]
}
```

**Inventory + group example**
```json
{
  "name": "campus-vlan-rollout",
  "inventory_file": "./inventory.json",
  "stages": [
    {
      "name": "core",
      "strategy": "serial",
      "target_groups": ["core"],
      "action": {
        "kind": "tx_workflow",
        "workflow_file": "./workflows/core-vlan.json"
      }
    },
    {
      "name": "access",
      "strategy": "parallel",
      "max_parallel": 20,
      "target_groups": ["access"],
      "action": {
        "kind": "tx_block",
        "template": "configure_vlan.j2",
        "mode": "Config",
        "vars": {
          "vlans": [
            {
              "id": 120,
              "name": "STAFF"
            }
          ]
        }
      }
    }
  ]
}
```

```json
{
  "defaults": {
    "username": "ops",
    "port": 22,
    "vars": {
      "tenant": "campus"
    }
  },
  "groups": {
    "core": ["core-01", "core-02"],
    "access": {
      "defaults": {
        "username": "admin",
        "port": 22,
        "device_profile": "huawei",
        "template_dir": "~/.rauto/templates/site-a",
        "vars": {
          "site": "campus-a",
          "region": "east"
        }
      },
      "targets": [
        {"connection": "sw-01", "vars": {"hostname": "sw-01"}},
        {"connection": "sw-02", "vars": {"hostname": "sw-02"}}
      ]
    }
  }
}
```

Ready-to-edit sample files:
- [templates/examples/campus-vlan-orchestration.json]/Users/adam/Project/rauto-all/rauto/templates/examples/campus-vlan-orchestration.json
- [templates/examples/campus-inventory.json]/Users/adam/Project/rauto-all/rauto/templates/examples/campus-inventory.json

Advanced sample files:
- [templates/examples/fabric-advanced-orchestration.json]/Users/adam/Project/rauto-all/rauto/templates/examples/fabric-advanced-orchestration.json
- [templates/examples/fabric-advanced-inventory.json]/Users/adam/Project/rauto-all/rauto/templates/examples/fabric-advanced-inventory.json

Notes:
- `targets` can reference saved connections by name or provide inline connection fields.
- `target_groups` can load target lists from `inventory_file` or inline `inventory.groups`.
- `inventory.defaults` applies to all groups and stage-level inline `targets`; group `defaults` override inventory defaults.
- `tx_block` stages reuse existing template/rollback behavior and support per-target `vars`.
- `tx_workflow` stages reuse existing single-device workflow JSON.
- Multi-device orchestration is available in both Web UI and CLI.

**CLI ⇄ Web UI mapping**
```text
Operations (Web)                 CLI
-------------------------------- ---------------------------------------------
Direct Execute                   rauto exec
Template Render + Execute        rauto template
Transaction Block (Tx Block)     rauto tx
Transaction Workflow (Tx Flow)   rauto tx-workflow
Multi-device Orchestration       rauto orchestrate
Saved connections               rauto connection
Connection history              rauto history

Prompt Profiles (Web)            CLI
-------------------------------- ---------------------------------------------
Built-in profiles                rauto device list / rauto device show <name>
Copy builtin to custom           rauto device copy-builtin <builtin> <custom>
Custom profiles CRUD             rauto device show/delete <custom>

Template Manager (Web)           CLI
-------------------------------- ---------------------------------------------
List templates                   rauto templates list
Show template                    rauto templates show <name>
Delete template                  rauto templates delete <name>

Session Replay (Web)             CLI
-------------------------------- ---------------------------------------------
List records                     rauto replay <jsonl> --list
Replay command                   rauto replay <jsonl> --command "<cmd>" [--mode <Mode>]
```

**Feature availability**
```text
Feature                                   Web UI   CLI
----------------------------------------- ------- ----
Connection profiles CRUD                 Yes     Yes
Execution history browser                Yes     Yes (by file)
Session recording (auto)                 Yes     Yes
Session replay list/inspect              Yes     Yes
Session replay UI table/detail           Yes     No
Prompt profile diagnose view             Yes     No
Workflow builder (visual)                Yes     No
Transaction workflow JSON execution      Yes     Yes
Multi-device orchestration (plan JSON)   Yes     Yes
```

**Migration tips (Web ⇄ CLI)**
```text
Workflow Builder → CLI
  1. In Web, open Tx Workflow step and click "Generate JSON".
  2. Download JSON (More Actions → Download JSON).
  3. Run: rauto tx-workflow ./workflow.json

Tx Block (custom per-step rollback) → CLI
  1. In Web, choose Rollback mode = "custom per-step".
  2. Use "text" to copy rollback lines.
  3. Run: rauto tx --rollback-commands-file ./rollback.txt ... (commands in same order)

CLI recordings → Web Replay
  1. Run with --record-file to create JSONL.
  2. Open Web → Session Replay, paste JSONL and inspect.
```

**Start web console**
```bash
rauto web \
    --bind 127.0.0.1 \
    --port 3000
```

## Directory Structure

By default, `rauto` stores runtime data under `~/.rauto/`.

Default directories:
- `~/.rauto/connections` (saved connection profiles)
- `~/.rauto/profiles` (custom device profiles)
- `~/.rauto/templates/commands`
- `~/.rauto/templates/devices`
- `~/.rauto/records` (session recordings)
- `~/.rauto/backups` (backup archives)

These folders are auto-created on startup.

For backward compatibility, local `./templates/` is still checked as a fallback.

```
~/.rauto
├── connections/            # Saved connection profiles (*.toml)
├── profiles/               # Custom profiles copied/created from builtin
├── templates/
│   ├── commands/           # Store your .j2 command templates here
│   └── devices/            # Store custom .toml device profiles here
├── records/                # Session recording output (*.jsonl)
└── backups/                # Backup archives (*.tar.gz)
```

You can specify a custom template directory using the `--template-dir` argument or `RAUTO_TEMPLATE_DIR` environment variable.

## Configuration

| Argument | Env Var | Description |
|----------|---------|-------------|
| `--host` | - | Device hostname or IP |
| `--username` | - | SSH username |
| `--password` | `RAUTO_PASSWORD` | SSH password |
| `--enable-password` | - | Enable/Secret password |
| `--ssh-port` | - | SSH port (default: 22) |
| `--device-profile` | - | Device type (default: cisco) |
| `--connection` | - | Load saved connection profile by name |
| `--save-connection` | - | Save effective connection profile after successful connect |
| `--save-password` | - | With `--save-connection`, also save password/enable_password |

Recording-related options (command-specific):
- `exec/template --record-file <path>`: Save recording JSONL after execution.
- `exec/template --record-level <off|key-events-only|full>`: Recording granularity.
- `replay <record_file> --list`: List recorded command output events.
- `replay <record_file> --command <cmd> [--mode <mode>]`: Replay one command output.

## Template Syntax

`rauto` uses Minijinja, which is compatible with Jinja2.

**Example `configure_vlan.j2`:**
```jinja
conf t
{% for vlan in vlans %}
vlan {{ vlan.id }}
 name {{ vlan.name }}
{% endfor %}
end
```

**Example variables:**
```json
{
  "vlans": [
    { "id": 10, "name": "Marketing" },
    { "id": 20, "name": "Engineering" }
  ]
}
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

MIT