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
|
# EasyConfig (cf)
A lightweight CLI tool to quickly open and edit configuration files from the terminal.
**Warning: This project is vibe-coded. Use at your own risk.**
## Features
- **Quick Access**: Open any configured file or directory with a simple command
- **Smart Search**: Automatically search for config files if not found in targets
- **Arbitrary Commands**: Use any command on config files (`cat`, `wc -l`, `rm -rf`, etc.)
- **Flexible Editors**: Choose different editors for files vs directories
- **Multiple Search Paths**: Search across multiple colon-separated config directories
- **Root Awareness**: Automatically searches `/etc/` when running as root
- **Interactive Selection**: Optional fzf integration for interactive selection
- **Fast File Search**: Supports fd for faster file searching
- **Config Restoration**: Restore individual settings with `--config restore`
- **Configurable Cache**: Cache discovered targets for faster lookup
## Installation
### From AUR (Arch Linux)
```bash
yay -S easy-config
# or
paru -S easy-config
```
### Manual Installation
1. Clone the repository:
```bash
git clone https://github.com/keegang6705/EasyConfig
cd EasyConfig
```
2. Install:
```bash
sudo install -Dm755 cf.sh /usr/local/bin/cf
sudo install -Dm755 cf-setup.sh /usr/local/bin/cf-setup
sudo install -Dm644 config.conf /etc/easy-config/config.conf
sudo install -Dm444 config.conf /usr/share/easy-config/config.conf.default
```
3. Run first-time setup:
```bash
cf-setup
```
This copies the system config to your user directory at `~/.config/easy-config/config.conf`.
## Quick Start
### Basic Usage
```bash
# Edit neovim configuration
cf nvim
# Edit with specific editor
cf fish code
# Edit bash config with nano
cf bash nano
# Print kitty config
cf kitty cat
# Count lines in kitty config
cf kitty 'wc -l'
# Delete kitty config (use with caution!)
cf kitty 'rm -rf'
# List all configured targets
cf --list
# View help
cf --help
# View version
cf --version
```
### Configuration
Edit your config file at `~/.config/easy-config/config.conf`:
```ini
[settings]
default_editor_file=nano # Editor for files
default_editor_folder=code # Editor for folders
auto_select_first_found_item=false
config_path=~/.config # Colon-separated search paths
root_config_path=/etc # Search path when running as root
use_fzf=true # Enable fzf selection
smart_search=true # Search if target not found
max_results=20
[targets]
fish=~/.config/fish/config.fish
nvim=~/.config/nvim/*
zsh=~/.zshrc
# Add more...
[aliases]
neovim=nvim
# Map command names to targets
[cache]
enabled=true # Enable/disable target caching
cache_path=~/.config/easy-config/cache.conf # Cache file location
```
#### Multiple Search Paths
Use colon-separated paths to search across multiple directories:
```ini
config_path=~/.config:~/.local/share:~/dotfiles
```
#### Root Mode
When running as root (`sudo cf`), the tool uses `root_config_path` for smart search:
```ini
root_config_path=/etc
```
### Setup & Migration
```bash
# First-time setup (copies system config to user directory)
cf-setup
# Migrate from old .ini format to .conf
cf-setup --migrate
# Force re-copy from system config
cf-setup --force
```
### Restore Configuration
```bash
# Restore entire config to defaults
cf --config restore
# Restore specific section
cf --config restore settings
cf --config restore targets
cf --config restore aliases
cf --config restore cache
```
## Configuration Files
- **User Config**: `~/.config/easy-config/config.conf` (editable)
- **System Config**: `/etc/easy-config/config.conf` (first run copy source)
- **System Defaults**: `/usr/share/easy-config/config.conf.default` (read-only)
On first run of `cf-setup`, your user config is created from the system config.
## Options
```
Options:
--help Show help message
--version Show version
--list List all configured targets and aliases
--config restore Restore all defaults
--config restore SECTION
Restore settings/targets/aliases/cache section
```
## Examples
### Aliases
Set up command shortcuts in the `[aliases]` section:
```ini
[aliases]
hyprland=hypr
dotfiles=~/.config
```
Then use them:
```bash
cf hyprland # Opens [hypr] target
cf dotfiles # Opens [~/.config] directory
```
### Using Commands
The second argument can be any command, not just editors:
```bash
cf nvim # Uses default_editor_file from config
cf nvim code # Override with 'code' editor
cf kitty cat # Print kitty config to stdout
cf kitty 'wc -l' # Count lines in kitty config
cf kitty 'head -5' # Show first 5 lines
```
### Smart Search
If a target isn't found, cf can search for it:
```bash
cf some-config # If not in targets, searches using fd/find
```
## Dependencies
**Required**:
- POSIX shell (sh, bash, zsh, ksh, dash)
**Optional**:
- `fzf` - Interactive selection (enable with `use_fzf=true`)
- `fd` - Faster file searching (automatic fallback to find if not available)
## Troubleshooting
### Config not loading
Check config file exists:
```bash
cat ~/.config/easy-config/config.conf
```
If missing, run setup:
```bash
cf-setup
```
### Migrating from .ini
If you upgraded from an older version that used `.ini` files:
```bash
cf-setup --migrate
```
### Targets not found
Verify target paths exist:
```bash
ls ~/.config/fish/config.fish
```
### Editor not opening
Verify editor is installed and in PATH:
```bash
which nano
which code
```
### Restore defaults
```bash
cf --config restore
```
## License
MIT
## Support
For issues and feature requests, visit: https://github.com/keegang6705/EasyConfig
Author: keegang6705, Claude Haiku 4.5, Claude Opus 4.6
|