A CLI tool for creating and extracting archives with interactive prompts
Project description
Archive CLI
A simple and interactive command-line tool for creating and extracting archives. Features intelligent path completion and supports both tar.gz and zip formats.
Features
- Interactive prompts with tab completion for file/directory paths
- Dual format support: Create and extract tar.gz and zip archives
- Auto-generated naming: Archives and extraction directories use timestamp-based names
- Format detection: Automatically detects archive format when extracting
- Professional structure: Clean, modular codebase with separation of concerns
Installation
# Install dependencies
uv sync
# Install as a CLI tool (optional)
uv pip install -e .
Usage
Basic Commands
# Using uv run
PYTHONPATH=src uv run python -m archive_cli.archive_cli --help
# If installed as CLI tool
archive-cli --help
Creating Archives
# Start the archive command
PYTHONPATH=src uv run python -m archive_cli.archive_cli archive
# Or if installed as CLI tool
archive-cli archive
The tool will prompt you to:
- Select a directory to archive (with tab completion)
- Choose archive format (tar or zip)
- Archives are created in current directory with format:
{dirname}_{timestamp}.{ext}
Extracting Archives
# Start the unarchive command
PYTHONPATH=src uv run python -m archive_cli.archive_cli unarchive
# Or if installed as CLI tool
archive-cli unarchive
The tool will prompt you to:
- Select an archive file to extract (with tab completion)
- Archive format is auto-detected
- Contents are extracted to:
{archive_name}_{timestamp}/
Supported Formats
Archive Creation
- tar: Creates
.tar.gzcompressed archives - zip: Creates
.zipcompressed archives
Archive Extraction
- tar: Supports
.tar,.tar.gz,.tgzfiles - zip: Supports
.zipfiles
Examples
# Example workflow
PYTHONPATH=src uv run python -m archive_cli.archive_cli archive
# Enter path: ./my_project
# Choose format: tar
# Creates: my_project_20240916_143052.tar.gz
PYTHONPATH=src uv run python -m archive_cli.archive_cli unarchive
# Enter path: ./my_project_20240916_143052.tar.gz
# Extracts to: my_project_20240916_143127/
Development
This project uses uv for dependency management and follows a modular structure:
src/archive_cli/
\x00\x00 __init__.py
\x00\x00 archive_cli.py # Main CLI entry point
\x00\x00 cmd/ # Command implementations
\x00\x00 __init__.py
\x00\x00 archive.py # Archive creation logic
\x00\x00 unarchive.py # Archive extraction logic
\x00\x00 lib/ # Shared utilities
\x00\x00 __init__.py
\x00\x00 prompt.py # Interactive prompt functions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file archive_cli-1.0.0.tar.gz.
File metadata
- Download URL: archive_cli-1.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
931c95f677b50c3558de8c4693af4007c389e8e7108da0a328db3591e6e27d6d
|
|
| MD5 |
64d107dd4f947171d73c5cb263da3b73
|
|
| BLAKE2b-256 |
fdbe906ef1b70e9a6d6d9d08cf6cd14901f0fe8cb0199e6dd4ad5dcf6663b13a
|
File details
Details for the file archive_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: archive_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7722ac581634ec90f390cae7dbff11acb749681ee634d2aae0c925b21e94204a
|
|
| MD5 |
7ab07238b63a92c5d3b61065b3c12391
|
|
| BLAKE2b-256 |
8c82c1a0d9bdbf9bfba38f0eb3770e7d6446d664dff3e2f93c826c394569e6a5
|