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
//! Save command CLI definitions
use clap::Subcommand;
use std::path::PathBuf;
#[derive(Subcommand)]
pub enum SaveCommand {
/// Decrypt a .sav file to YAML (uses stdin/stdout if paths not specified)
Decrypt {
/// Path to encrypted .sav file (uses stdin if not specified)
#[arg(short, long)]
input: Option<PathBuf>,
/// Path to output YAML file (uses stdout if not specified)
#[arg(short, long)]
output: Option<PathBuf>,
/// Steam ID for decryption (uses configured default if not provided)
#[arg(short, long)]
steam_id: Option<String>,
},
/// Encrypt a YAML file to .sav (uses stdin/stdout if paths not specified)
Encrypt {
/// Path to input YAML file (uses stdin if not specified)
#[arg(short, long)]
input: Option<PathBuf>,
/// Path to output .sav file (uses stdout if not specified)
#[arg(short, long)]
output: Option<PathBuf>,
/// Steam ID for encryption (uses configured default if not provided)
#[arg(short, long)]
steam_id: Option<String>,
},
/// Edit a save file in your $EDITOR
Edit {
/// Path to .sav file
input: PathBuf,
/// Steam ID for decryption/encryption (uses configured default if not provided)
#[arg(short, long)]
steam_id: Option<String>,
/// Create backup before editing
#[arg(short, long, default_value_t = true)]
backup: bool,
},
/// Get specific values from a save file
Get {
/// Path to .sav file
input: PathBuf,
/// YAML path query (e.g. "state.currencies.cash" or "state.experience[0].level")
query: Option<String>,
/// Steam ID for decryption (uses configured default if not provided)
#[arg(short, long)]
steam_id: Option<String>,
/// Show character level and XP
#[arg(long)]
level: bool,
/// Show currency (cash, eridium)
#[arg(long)]
money: bool,
/// Show character info (name, class, difficulty)
#[arg(long)]
info: bool,
/// Show all available data
#[arg(long)]
all: bool,
},
/// Set specific values in a save file
Set {
/// Path to .sav file
input: PathBuf,
/// YAML path to modify (e.g. "state.currencies.cash" or "state.experience[0].level")
path: String,
/// Value to set (auto-detects numbers vs strings, unless --raw is used)
value: String,
/// Steam ID for encryption/decryption (uses configured default if not provided)
#[arg(short, long)]
steam_id: Option<String>,
/// Treat value as raw YAML (for complex/unknown structures)
#[arg(short, long)]
raw: bool,
/// Create backup before modifying
#[arg(short, long, default_value_t = true)]
backup: bool,
},
}