Skip to content

Commit d0d9566

Browse files
authored
Merge pull request #39 from Cyber-Syntax:feat/cli
Add CLI functionality and cleanup options
2 parents 3aa2484 + bb718f3 commit d0d9566

12 files changed

Lines changed: 1247 additions & 233 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ This file provides guidance to agents when working with code in this repository.
55
## General Guidelines
66

77
1. Modern Python First: Use Python 3.12+ features extensively - built-in generics, pattern matching, and dataclasses.
8-
2. Type Safety: Full type annotations on all functions including return types. Use modern syntax (`dict[str, int]`, `str | None`).
9-
3. KISS Principle: Aim for simplicity and clarity. Avoid unnecessary abstractions or metaprogramming.
10-
4. DRY with Care: Reuse code appropriately but avoid over-engineering. Each command handler has single responsibility.
8+
2. KISS Principle: Aim for simplicity and clarity. Avoid unnecessary abstractions or metaprogramming.
9+
3. DRY with Care: Reuse code appropriately but avoid over-engineering. Each command handler has single responsibility.
1110

1211
## Test after any change
1312

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
All notable changes to this project will be documented in this file. Commits automatically generated by github actions.
33

4+
## v0.7.0-beta
5+
### BREAKING CHANGES
6+
This release introduces a new command-line interface (CLI) for AutoTarCompress, enabling users to perform all operations via terminal commands. The previous interactive menu mode still exists but may be deprecated in future releases. Users are encouraged to transition to the CLI for better automation and scripting capabilities. For detailed usage instructions, please refer to the updated documentation in [docs/wiki.md](docs/wiki.md).
7+
48
## v0.6.3-beta
59
## v0.6.2-beta
610
## v0.6.1-beta

README.md

Lines changed: 91 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,28 @@ Turkish: [README.tr.md](https://github.com/Cyber-Syntax/AutoTarCompress/blob/mai
1010
1111
---
1212

13-
# **About AutoTarCompress**
13+
# **AutoTarCompress**
1414

1515
> [!NOTE]
16-
> AutoTarCompress is a command-line tool for Linux that simplifies the process of creating and managing compressed backups of your important directories. It offers features like compressing, encryption, decryption.
16+
> AutoTarCompress is a robust backup and archive management tool that provides both command-line interface (CLI) and interactive menu functionality for creating, encrypting, and managing backup archives.
1717
>
1818
> - Detailed information: [wiki.md](docs/wiki.md)
1919
20+
## **✨ Features**
21+
22+
- **Create compressed backups** using tar and xz compression
23+
- **Encrypt/decrypt backups** with GPG encryption
24+
- **Extract backup archives** to restore files
25+
- **Clean up old backups** with configurable retention policies
26+
- **Backup information display** showing file details and metadata
27+
- **🆕 Command-line interface** for scriptable automation
28+
- **Interactive menu** for user-friendly operation
29+
- **Configurable backup directories** and ignore patterns
30+
- **Logging and error handling** for reliable operation
31+
2032
---
2133

22-
## **💡 How to Use**
34+
## **💡 Installation**
2335

2436
1. Open a terminal and clone this repo (make sure you have git installed):
2537

@@ -33,10 +45,6 @@ git clone https://github.com/Cyber-Syntax/AutoTarCompress.git
3345
cd AutoTarCompress
3446
```
3547

36-
cd AutoTarCompress
37-
chmod +x install.sh
38-
./install.sh
39-
4048
3. Make executable and run the install script:
4149

4250
```bash
@@ -49,28 +57,95 @@ chmod +x install.sh && ./install.sh
4957
source ~/.bashrc # or ~/.zshrc
5058
```
5159

52-
5. Configure
60+
5. Go to configuration file and set your preferences:
61+
62+
```bash
63+
vim ~/.config/autotarcompress/config.conf
64+
```
65+
66+
---
67+
68+
## **🚀 Usage**
69+
70+
AutoTarCompress now offers two ways to use it:
71+
72+
### **🔥 New: Command-Line Interface (Recommended for automation)**
5373

54-
Copy the example config and edit as needed:
74+
The CLI provides scriptable access to all backup operations:
5575

5676
```bash
57-
mkdir -p ~/.config/autotarcompress
58-
cp config_files_example/config.json ~/.config/autotarcompress/config.json
59-
# Edit ~/.config/autotarcompress/config.json to match your needs
77+
# Show all available commands
78+
autotarcompress --help
79+
80+
# Create a backup
81+
autotarcompress backup
82+
83+
# Encrypt the latest backup
84+
autotarcompress encrypt --latest
85+
86+
# Encrypt a backup from a specific date
87+
autotarcompress encrypt --date 15-01-2024
88+
89+
# Encrypt a specific backup file
90+
autotarcompress encrypt backup_15-01-2024_10-30-45.tar.xz
91+
92+
# Decrypt the latest encrypted backup
93+
autotarcompress decrypt --latest
94+
95+
# Extract the latest backup
96+
autotarcompress extract --latest
97+
98+
# Clean up old backups (uses config defaults)
99+
autotarcompress cleanup
100+
101+
# Clean up keeping only 5 most recent backups
102+
autotarcompress cleanup --keep 5
103+
104+
# Show last backup information
105+
autotarcompress info
60106
```
61107

62-
Or, just run the tool and follow the prompts to generate a config interactively.
108+
### **📋 Interactive Menu (Original experience)**
63109

64-
## Run the script
110+
For users who prefer an interactive experience:
65111

66112
```bash
67-
autotarcompress
113+
autotarcompress interactive
68114
```
69115

70-
Follow the on-screen instructions to create, encrypt, or extract backups.
116+
Or simply run without arguments (default behavior):
117+
118+
```bash
119+
autotarcompress
120+
```
71121

72122
---
73123

124+
## **📚 CLI Commands Overview**
125+
126+
AutoTarCompress provides the following commands:
127+
128+
- `backup` — Create a backup archive
129+
- `encrypt` — Encrypt a backup file
130+
- `decrypt` — Decrypt an encrypted backup file
131+
- `extract` — Extract a backup archive
132+
- `cleanup` — Remove old backups
133+
- `info` — Show information about the last backup
134+
- `interactive` — Launch the interactive menu (legacy mode)
135+
136+
For detailed options, usage examples, configuration, and migration notes, see [docs/wiki.md](docs/wiki.md).
137+
138+
### Quick Example
139+
140+
```bash
141+
autotarcompress backup
142+
autotarcompress encrypt --latest
143+
autotarcompress cleanup --keep 7
144+
autotarcompress info
145+
```
146+
147+
See the [wiki](docs/wiki.md) for advanced usage and full documentation.
148+
74149
## **🙏 Support This Project**
75150

76151
If this script has been helpful:

0 commit comments

Comments
 (0)