Skip to main content

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:

  1. Select a directory to archive (with tab completion)
  2. Choose archive format (tar or zip)
  3. 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:

  1. Select an archive file to extract (with tab completion)
  2. Archive format is auto-detected
  3. Contents are extracted to: {archive_name}_{timestamp}/

Supported Formats

Archive Creation

  • tar: Creates .tar.gz compressed archives
  • zip: Creates .zip compressed archives

Archive Extraction

  • tar: Supports .tar, .tar.gz, .tgz files
  • zip: Supports .zip files

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archive_cli-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archive_cli-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for archive_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 931c95f677b50c3558de8c4693af4007c389e8e7108da0a328db3591e6e27d6d
MD5 64d107dd4f947171d73c5cb263da3b73
BLAKE2b-256 fdbe906ef1b70e9a6d6d9d08cf6cd14901f0fe8cb0199e6dd4ad5dcf6663b13a

See more details on using hashes here.

File details

Details for the file archive_cli-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for archive_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7722ac581634ec90f390cae7dbff11acb749681ee634d2aae0c925b21e94204a
MD5 7ab07238b63a92c5d3b61065b3c12391
BLAKE2b-256 8c82c1a0d9bdbf9bfba38f0eb3770e7d6446d664dff3e2f93c826c394569e6a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page