Skip to content

Commit 6ee1c57

Browse files
authored
Merge pull request #66 from Gupta-02/main
feat: Add comprehensive package management features with web interface and update management
2 parents 7066039 + 8267294 commit 6ee1c57

12 files changed

Lines changed: 3037 additions & 110 deletions

README.md

Lines changed: 205 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ A cross-distro command-line utility that helps you search for packages and gener
2424
- [Installation (Recommended: pipx)](#installation-recommended-pipx)
2525
- [Alternative Installation (pip)](#alternative-installation-pip)
2626
- [Usage](#usage)
27-
- [File Structure](#file-structure)
27+
- [🔄 Auto-Update System](#🔄-auto-update-system)
28+
- [🏗️ Architecture](#🏗️-architecture)
2829
- [Contributing](#contributing)
2930
- [License](#license)
3031

@@ -41,6 +42,8 @@ archpkg-helper is designed to work across Linux distributions. While originally
4142
- Cross-distro support (not limited to Arch)
4243
- Clear, readable output and errors
4344
- One-command setup via `install.sh`
45+
- **Batch installation** - Install multiple packages at once with progress tracking
46+
- **🔄 Auto-update system** with background checking, secure downloads, and user control
4447

4548
## Quick Start (install.sh)
4649

@@ -135,6 +138,19 @@ However, using pipx is strongly recommended instead of breaking system protectio
135138

136139
After installation, the CLI is available as `archpkg`.
137140

141+
## Web Interface
142+
143+
ArchPkg Helper also provides a web interface for a more user-friendly experience:
144+
145+
```sh
146+
archpkg --web
147+
```
148+
149+
This starts a web server at `http://localhost:5000` where you can:
150+
- Browse a descriptive home page explaining the tool
151+
- Search for packages using a web form
152+
- View results with copy-to-clipboard functionality
153+
138154
---
139155

140156
### Example Commands
@@ -175,16 +191,22 @@ archpkg search firefox
175191

176192
This command will search for the `firefox` package across multiple package managers (e.g., pacman, AUR, apt).
177193

194+
#### 2. Install Multiple Packages (Batch Installation)
178195
#### 3. Install a Package
179196

180-
Once you have identified a package, use the install command to generate the correct installation command for your system:
197+
Install multiple packages at once with automatic validation and progress tracking:
181198

182199
```sh
183-
archpkg install firefox
200+
archpkg install firefox vscode git
184201
```
185202

203+
This command will:
204+
- Search for each package automatically
205+
- Select the best match for each
206+
- Install all packages sequentially
207+
- Show progress and a summary of successes/failures
186208

187-
This will generate an appropriate installation command (e.g., `pacman -S firefox` for Arch-based systems).
209+
Batch installation validates all packages first, then proceeds with installation. If any package fails validation, the entire batch is cancelled.
188210

189211
#### 4. Install a Package from AUR (Arch User Repository)
190212

@@ -206,16 +228,56 @@ archpkg install firefox --source pacman
206228
```
207229

208230

231+
#### 5. Install from GitHub
209232
#### 6. Remove a Package
210233

211-
To generate commands to remove a package:
234+
Install software directly from GitHub repositories:
212235

213236
```sh
214-
archpkg remove firefox
237+
archpkg github:user/repo
238+
```
239+
240+
Or using full URL:
241+
242+
Install software directly from GitHub repositories:
243+
244+
```sh
245+
archpkg github:user/repo
215246
```
216247

248+
Or using full URL:
249+
250+
```sh
251+
archpkg https://github.com/user/repo
252+
```
253+
254+
This feature will:
255+
- Clone the specified GitHub repository
256+
- Auto-detect the project type (Python, Node.js, CMake, etc.)
257+
- Build and install the software automatically
258+
- Clean up temporary files afterwards
259+
260+
**Supported project types:**
261+
- Python (setup.py, pyproject.toml)
262+
- Node.js (package.json)
263+
- CMake (CMakeLists.txt)
264+
- Makefile projects
265+
- Go (go.mod)
266+
- Rust (Cargo.toml)
267+
268+
**Examples:**
269+
```sh
270+
# Install a Python CLI tool
271+
archpkg github:pypa/pip
272+
273+
# Install a Node.js application
274+
archpkg github:microsoft/vscode
217275

218-
This will generate the command necessary to uninstall `firefox` from your system.
276+
# Install a Go tool
277+
archpkg github:golang/go
278+
```
279+
280+
**Note:** GitPython is recommended for better performance, but the tool will fallback to using git subprocess if not available.
219281

220282
---
221283

@@ -258,6 +320,142 @@ archpkg --version
258320
```
259321
---
260322

323+
## 🔄 Auto-Update System
324+
325+
archpkg-helper includes a comprehensive auto-update system that can automatically check for, download, and install package updates while maintaining security and giving you control over the process.
326+
327+
### Features
328+
329+
- **Automatic Update Checking**: Background service that periodically checks for package updates
330+
- **Secure Downloads**: Resumable downloads with integrity validation
331+
- **User Control**: Choose between automatic installation or manual approval
332+
- **Package Tracking**: Track installed packages and their update status
333+
- **Security Validations**: Checksum validation and command safety checks
334+
- **Atomic Operations**: Safe configuration and data management
335+
336+
### Quick Start
337+
338+
1. **Enable Auto-Updates**:
339+
```sh
340+
archpkg config auto_update_enabled true
341+
```
342+
343+
2. **Start Background Service**:
344+
```sh
345+
archpkg service start
346+
```
347+
348+
3. **Track Your First Package**:
349+
```sh
350+
archpkg install firefox # Uses --track by default
351+
```
352+
353+
### Auto-Update Commands
354+
355+
#### Check for Updates
356+
```sh
357+
# Check all tracked packages for updates
358+
archpkg update --check-only
359+
360+
# Check specific packages
361+
archpkg update firefox vscode --check-only
362+
```
363+
364+
#### Install Updates
365+
```sh
366+
# Install all available updates
367+
archpkg update
368+
369+
# Install updates for specific packages
370+
archpkg update firefox vscode
371+
```
372+
373+
#### Manage Configuration
374+
```sh
375+
# View all settings
376+
archpkg config --list
377+
378+
# Enable auto-updates
379+
archpkg config auto_update_enabled true
380+
381+
# Set update check interval (hours)
382+
archpkg config update_check_interval_hours 24
383+
384+
# Enable automatic installation (use with caution)
385+
archpkg config auto_install_updates true
386+
```
387+
388+
#### Manage Background Service
389+
```sh
390+
# Start the background update service
391+
archpkg service start
392+
393+
# Stop the service
394+
archpkg service stop
395+
396+
# Check service status
397+
archpkg service status
398+
```
399+
400+
#### View Tracked Packages
401+
```sh
402+
# List all tracked packages
403+
archpkg list-installed
404+
```
405+
406+
### Configuration Options
407+
408+
| Setting | Description | Default |
409+
|---------|-------------|---------|
410+
| `auto_update_enabled` | Enable/disable automatic update checking | `false` |
411+
| `auto_install_updates` | Automatically install updates when found | `false` |
412+
| `update_check_interval_hours` | Hours between update checks | `24` |
413+
| `max_concurrent_downloads` | Maximum simultaneous downloads | `3` |
414+
415+
### Security Features
416+
417+
- **Checksum Validation**: Downloaded packages are validated against known checksums
418+
- **Command Safety**: Installation commands are checked for dangerous patterns
419+
- **Source Validation**: Only trusted package sources are allowed
420+
- **Atomic Operations**: Configuration changes are atomic to prevent corruption
421+
422+
### How It Works
423+
424+
1. **Package Tracking**: When you install packages with `archpkg install`, they're automatically tracked
425+
2. **Background Checking**: The service periodically checks for updates from the original sources
426+
3. **Secure Downloads**: Updates are downloaded with integrity validation
427+
4. **User Approval**: You can review updates before installation (unless auto-install is enabled)
428+
5. **Safe Installation**: Commands are validated for safety before execution
429+
430+
### Examples
431+
432+
**Enable auto-updates for security packages**:
433+
```sh
434+
archpkg config auto_update_enabled true
435+
archpkg service start
436+
archpkg install firefox thunderbird --track
437+
```
438+
439+
**Manual update workflow**:
440+
```sh
441+
# Check for updates
442+
archpkg update --check-only
443+
444+
# Review what needs updating
445+
archpkg list-installed
446+
447+
# Install specific updates
448+
archpkg update firefox
449+
```
450+
451+
**Disable auto-updates**:
452+
```sh
453+
archpkg service stop
454+
archpkg config auto_update_enabled false
455+
```
456+
457+
---
458+
261459
## 🏗️ Architecture
262460

263461
The tool is structured as a **modular Python CLI** with:

0 commit comments

Comments
 (0)