@@ -25,144 +25,105 @@ UsrGrp-Manager-TUI (Users/Groups Manager TUI)
2525 </p >
2626</div >
2727
28- ## Table of Contents
29- - [ Introduction] ( #introduction )
30- - [ Status] ( #status )
31- - [ Quick Start] ( #quick-start )
32- - [ Environment Setup] ( #environment-setup )
33- - [ Configuration] ( #configuration )
34- - [ Prerequisites] ( #prerequisites )
35- - [ Installation Details] ( #installation-details )
36- - [ Project Structure] ( #project-structure )
37- - [ Usage & Keybindings] ( #usage--keybindings )
38- - [ What’s Implemented] ( #whats-implemented )
39- - [ Notes & Requirements] ( #notes--requirements )
40- - [ Tests] ( #tests )
41- - [ Troubleshooting] ( #troubleshooting )
42- - [ Permissions] ( #permissions )
43- - [ External Tools Missing] ( #external-tools-missing )
44- - [ Parsing Issues] ( #parsing-issues )
45- - [ Contributing & Support] ( #contributing--support )
46- - [ License] ( #license )
47-
48- ## Introduction
49-
50- Keyboard‑driven terminal app to view and manage users and groups. Browse accounts, see memberships, search, and make common changes: rename users, update names or shells, adjust group membership. Safe to explore without admin rights; asks for permission to apply changes.
51-
52- Linux‑focused. Written in Rust.
28+ ## Quick Links
29+
30+ - 📖 ** [ Complete Documentation] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI/wiki ) ** – Installation, usage, shortcuts, troubleshooting
31+ - 🚀 ** [ Quick Start] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI/wiki/Quick%E2%80%90Start ) **
32+ - ⌨️ ** [ Keyboard Shortcuts] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI/wiki/Keyboard%E2%80%90Shortcuts ) **
33+ - 🆘 ** [ Troubleshooting & FAQ] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI/wiki/Troubleshooting%E2%80%90FAQ ) **
34+
35+ ## What is it?
36+
37+ Keyboard-driven terminal app to view and manage users and groups on Linux. Browse accounts, see memberships, search, and make common changes: rename users, update names or shells, adjust group membership. Safe to explore without admin rights; asks for permission to apply changes.
38+
39+ ** Status:** Alpha. Read-only browsing is safe; write operations require privileges and are still limited.
5340
5441### Screenshot
42+
5543![ TUI screenshot] ( example-images/Release_v0.3.0.png )
5644
5745### Demo
58- ![ TUI GIF] ( example-example-images/usrgrp-manager-v0.2.0-sample.gif )
5946
60- ### Status
61- Alpha. Read‑only browsing is safe; write operations require privileges and are still limited.
47+ ![ TUI GIF] ( example-images/usrgrp-manager-v0.2.0-sample.gif )
6248
63- Alpha means:
64- - Interfaces and keybindings may change without notice.
65- - Some actions are intentionally guarded (e.g., user deletion requires confirmation; optional home removal).
66- - Error handling, edge cases, and performance are still being improved.
49+ ## Installation
6750
68- ### Quick Start
51+ ### Quick Install (Arch Linux)
6952
7053Using yay:
54+
7155``` bash
72- yay -S usrgrp-manager-git
56+ yay -S usrgrp-manager-git # Latest from main branch
7357# or
74- yay -S usrgrp-manager-bin
58+ yay -S usrgrp-manager-bin # Prebuilt binary
7559```
7660
7761Using paru:
62+
7863``` bash
7964paru -S usrgrp-manager-git
8065# or
8166paru -S usrgrp-manager-bin
8267```
83- Using cargo:
84- ``` bash
85- # Build and run (release)
86- cargo build --release
87- ```
8868
89- After installation:
69+ ### Build from Source
70+
9071``` bash
91- usrgrp-manager
72+ cargo build --release
73+ ./target/release/usrgrp-manager
9274```
9375
94- ## Configuration
76+ For other installation methods, see [ Install Documentation ] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI/wiki/Install ) .
9577
96- - Logging level:
97- ``` bash
98- USRGRP_MANAGER_LOG=info # or debug, trace
99- ```
78+ ## Running
10079
101- - Sudo group name (for sudo membership checks):
10280``` bash
103- export UGM_SUDO_GROUP=sudo # defaults to 'wheel' if unset
81+ usrgrp-manager # Browse read-only
82+ sudo usrgrp-manager # Required for write operations
10483```
10584
85+ ## Features
10686
107- ## Environment Setup
108-
109- - Linux/BSD terminals supported; primary target is Linux.
110- - Read operations work without privileges.
111- - Write operations (create/delete users/groups, modify memberships, change shell/password) require appropriate privileges (root or sudo).
87+ ### Users
88+ - View users from ` /etc/passwd `
89+ - Create/delete users
90+ - Modify username, full name, shell
91+ - Manage group membership
92+ - Set/change/reset passwords
93+ - View user details: UID, GID, home, shell, password status, sudo membership, SSH keys, processes
11294
113- ## Prerequisites
95+ ![ Actions menu ] ( example-images/Release_v0.3.0_User_actions.png )
11496
115- - Rust toolchain (stable) and Cargo
116- - Linux system with standard user/group management tools:
117- - ` usermod ` , ` useradd ` , ` userdel `
118- - ` groupadd ` , ` groupdel ` , ` gpasswd `
119- - ` chpasswd ` , ` chage `
97+ ![ Modify user] ( example-images/Release_v0.3.0_User_mod.png )
12098
121- ## Installation Details
99+ ![ Modify details ] ( example-images/Release_v0.3.0_User_mod_details.png )
122100
123- - Build: ` cargo build --release `
124- - Run: ` cargo run --release `
125- - Logging: set ` USRGRP_MANAGER_LOG=info|debug|trace ` (default: ` info ` )
126- - Feature flags: ` file-parse ` exists, but enumeration currently parses ` /etc/passwd ` and ` /etc/group ` by default.
101+ ![ Remove user from groups] ( example-images/Release_v0.3.0_Remove_UserFromGroups.png )
127102
128- ### Upgrade Notes (v0.3.0)
103+ ### Groups
104+ - View groups from ` /etc/group `
105+ - Create/delete groups
106+ - Manage members
107+ - View group details: GID, classification, membership count, privilege level
129108
130- - ` Ctrl+Tab ` pane toggling was removed; use ` Shift+Tab ` .
131- - Use ` Shift+K ` to toggle the keybindings side panel.
109+ ![ Modify groups] ( example-images/Release_v0.3.0_Modify_Groups.png )
132110
133- ### Install from AUR
111+ ### General
112+ - Fast search/filter (case-insensitive substring matching)
134113
135- - usrgrp-manager-git: latest development version from the main branch
136- - usrgrp-manager-bin: prebuilt binaries from the latest release
114+ ![ Filter users] ( example-images/Release_v0.3.0_filters.png )
137115
138- Install yay (AUR helper) if needed:
139- ``` bash
140- sudo pacman -S --needed git base-devel
141- git clone https://aur.archlinux.org/yay.git
142- cd yay
143- makepkg -si
144- ```
116+ - Safe paging and navigation
117+ - Keyboard-driven (no mouse required)
118+ - Confirmation prompts for destructive actions
145119
146- Using yay:
147- ``` bash
148- yay -S usrgrp-manager-git
149- # or
150- yay -S usrgrp-manager-bin
151- ```
120+ ## Prerequisites
152121
153- Using paru:
154- ``` bash
155- paru -S usrgrp-manager-git
156- # or
157- paru -S usrgrp-manager-bin
158- ```
159-
160- After installation:
161- ``` bash
162- usrgrp-manager
163- ```
122+ - Rust toolchain (stable) + Cargo
123+ - Linux system with standard user/group tools: ` usermod ` , ` useradd ` , ` userdel ` , ` groupadd ` , ` groupdel ` , ` gpasswd ` , ` chpasswd ` , ` chage `
164124
165125## Project Structure
126+
166127``` text
167128src/
168129 main.rs # Entry point
@@ -179,146 +140,32 @@ src/
179140 search.rs # Search functionality
180141```
181142
182- ## Usage & Keybindings
183-
184- - Quit: ` q `
185- - Switch tab: ` Tab ` (Users ↔ Groups)
186- - Users tab focus: ` Shift+Tab ` toggles Users list ↔ Member‑of list
187- - Move: ` ↑/k ` , ` ↓/j `
188- - Page: ` ←/h ` (previous page), ` →/l ` (next page)
189- - Search: ` / ` to start, type query, ` Enter ` to apply, ` Esc ` to cancel
190- - Filter dialog example:
191-
192- ![ Filter users] ( example-images/Release_v0.3.0_filters.png )
193- - Open actions on selection: ` Enter `
194- - In popups: ` ↑/k ` , ` ↓/j ` , ` PageUp ` , ` PageDown ` , ` Enter ` , ` Esc `
195-
196- - Toggle keybindings panel: ` Shift+K `
197- - Help: ` ? `
198-
199- - New user: ` n ` (toggle "Create home" with ` Space ` )
200- - Pane toggle change: ` Ctrl+Tab ` was removed; use ` Shift+Tab ` instead
201- - Delete confirmation: ` Space ` toggles "Also delete home"
202- - Password: Actions → Modify → Password
203- - Set/change: masked input with confirm; toggle "must change at next login" with ` Space ` ; select Submit and press ` Enter `
204- - Reset: expire password immediately (forces change at next login)
205-
206- ## What’s Implemented
207-
208- - Users tab
209- - Table of users (from ` /etc/passwd ` ), selection, paging
210- - Detail pane (expanded):
211- - Identity: UID, primary GID, and primary group name
212- - Home: path, existence, and octal permissions (e.g., 755)
213- - Shell: validity (in ` /etc/shells ` ) and interactivity (` nologin ` /` false ` detection)
214- - Password status: locked, no_password, expired; last change and expiry (days since epoch)
215- - Sudo membership: whether the user is in the configured sudo group
216- - SSH: count of entries in ` ~/.ssh/authorized_keys ` (best‑effort)
217- - Processes: current number of processes owned by the user (best‑effort)
218- - Member‑of pane: primary and supplementary groups
219- - Create user (` useradd ` ; optional ` -m ` to create home)
220- - Delete user (` userdel ` ; optional ` -r ` to remove home)
221- - Password management:
222- - Set/change (masked via ` chpasswd ` , optional "must change at next login")
223- - Reset (expire now via ` chage -d 0 ` )
224- - Actions → Modify:
225- - Add user to groups (via ` gpasswd -a ` )
226- - Remove user from groups (via ` gpasswd -d ` , excluding primary group)
227- - Change username (` usermod -l ` )
228- - Change full name (GECOS, ` usermod -c ` )
229- - Change login shell (pick from ` /etc/shells ` , ` usermod -s ` )
230-
231- - Examples:
232-
233- ![ Actions menu] ( example-images/Release_v0.3.0_User_actions.png )
234-
235- ![ Modify user] ( example-images/Release_v0.3.0_User_mod.png )
236-
237- ![ Modify details] ( example-images/Release_v0.3.0_User_mod_details.png )
238-
239- ![ Remove user from groups] ( example-images/Release_v0.3.0_Remove_UserFromGroups.png )
240-
241- - Groups tab
242- - Table of groups (from ` /etc/group ` ), selection, paging
243- - Detail pane (expanded):
244- - Classification: GID and whether it's a system or user group
245- - Membership: counts of primary vs secondary members; preview of top‑N names
246- - Orphan detection: flags listed secondary members not present in users
247- - Distributions: shell interactivity, UID class (system <1000 vs user ≥1000), account status
248- - Privilege: indicates if this is the sudo‑capable group
249- - Change proxy: ` /etc/group ` mtime (days since epoch) as a rough change indicator
250- - Actions:
251- - Create group (` groupadd ` )
252- - Delete group (` groupdel ` )
253- - Modify members (add/remove users)
254-
255- - Example:
256-
257- ![ Modify groups] ( example-images/Release_v0.3.0_Modify_Groups.png )
258-
259- - Search
260- - Simple substring filter for Users and Groups tabs
261-
262- ## Notes & Requirements
263-
264- - Linux/BSD only. macOS behavior may differ (Directory Services).
265- - Write actions call system tools and require appropriate privileges (root or sudo): ` usermod ` , ` gpasswd ` , ` groupadd ` , ` groupdel ` , ` useradd ` , ` userdel ` , ` chpasswd ` , ` chage ` .
266- - User deletion is implemented with confirmation and optional home removal.
267-
268- - Some account fields (password status, last change/expiry) rely on best‑effort reads of ` /etc/shadow ` ; these may be unavailable without sufficient privileges.
269- - SSH key counting and process counts are best‑effort and can vary across environments.
270-
271- ## Tests
272-
273- - Run all tests: ` cargo test ` (Tests run while building the project automatically)
274-
275- What’s covered today:
276- - Unit tests for parsers in ` src/sys/mod.rs ` (fake ` /etc/passwd ` and ` /etc/group ` files).
277- - Unit tests for filtering in ` src/search.rs ` (case‑insensitive user/group search, membership matching).
278-
279- Guidelines:
280- - Keep small unit tests inline next to the code with ` #[cfg(test)] ` for private helpers and pure logic.
281- - For broader or cross‑module tests, add a ` src/lib.rs ` exposing modules (e.g., ` pub mod app; pub mod search; pub mod sys; ` ) and place integration tests in ` tests/ ` .
282- - Avoid invoking privileged commands (` useradd ` , ` gpasswd ` , etc.) in tests. Prefer testing pure parts (parsing, filtering) or introduce a trait to mock ` SystemAdapter ` in higher‑level tests.
283-
284- Optional:
285- - UI snapshot/sanity tests can be written using ` ratatui ` ’s test backend (and, if desired, a snapshot tool like ` insta ` ). These should render minimal views and assert on expected labels/highlights, not terminal specifics.
286-
287- ## Troubleshooting
143+ ## Configuration
288144
289- ### Permissions
290145``` bash
291- # Verify you have sufficient privileges when applying changes
292- id
293- sudo -v # refresh sudo credentials
294- ```
146+ # Logging level
147+ USRGRP_MANAGER_LOG=info # or debug, trace
295148
296- ### External Tools Missing
297- ``` bash
298- # Check required tools are available
299- command -v useradd usermod userdel groupadd groupdel gpasswd chpasswd chage
149+ # Sudo group name (for sudo membership checks)
150+ export UGM_SUDO_GROUP=sudo # defaults to 'wheel' if unset
300151```
301152
302- ### Parsing Issues
303- ``` bash
304- # Inspect passwd/group files
305- getent passwd | head -n 5
306- getent group | head -n 5
307-
308- # Validate shells list
309- cat /etc/shells
310- ```
153+ ## Tests
311154
312- If problems persist, run with verbose logs:
313155``` bash
314- USRGRP_MANAGER_LOG=debug cargo run --release
156+ cargo test # Run all tests
315157```
316158
159+ What's covered:
160+ - Unit tests for parsers in ` src/sys/mod.rs `
161+ - Unit tests for filtering in ` src/search.rs `
162+
317163## Contributing & Support
318164
319165- Open issues or pull requests on GitHub
320- - Suggestions and feedback welcome!
166+ - See [ CONTRIBUTING.md] ( CONTRIBUTING.md ) for guidelines
167+ - Feedback and suggestions welcome!
321168
322169## License
323170
324- See [ LICENSE] ( https://github.com/firstpick/usrgrp-manager /blob/main/LICENSE ) for details.
171+ See [ LICENSE] ( https://github.com/Firstp1ck/UsrGrp-Manager-TUI /blob/main/LICENSE ) for details.
0 commit comments