🖥️ CLI Client

Command-line interface for Zipity secure file sharing

📦 Download CLI Package

Get the complete CLI client with installation instructions and dependencies.

Download zipity-cli.zip

Includes: zipity_cli.py, requirements.txt, README.md

🚀 Installation

1

Create Virtual Environment

Create a Python virtual environment to isolate dependencies:

python -m venv zipity-env source zipity-env/bin/activate # On Windows: zipity-env\Scripts\activate
2

Install Dependencies

Install the required Python packages:

pip install -r requirements.txt
3

Make Executable (Linux/macOS)

Make the CLI script executable:

chmod +x zipity_cli.py
4

Add to PATH (Optional)

Add the CLI to your system PATH for easy access:

# Create a symlink sudo ln -s $(pwd)/zipity_cli.py /usr/local/bin/zipity # Or add to your shell profile echo 'export PATH="$PATH:$(pwd)"' >> ~/.bashrc source ~/.bashrc

💻 Usage

📤 Upload File

Upload a file and get a secure shareable link

python zipity_cli.py upload document.pdf

📊 Check Status

Check the status of an uploaded file

python zipity_cli.py status abc123-def456-ghi789

🌐 Custom Server

Use a custom Zipity server

python zipity_cli.py --server https://zipity.example.com upload file.txt

❓ Get Help

Show help and available options

python zipity_cli.py --help

🔌 API Reference

Use these endpoints directly with curl or any HTTP client:

POST
/api/upload
Upload a file and get a shareable link
curl -X POST -F "file=@document.pdf" http://zipity.home.cluebyfour.ca/api/upload
GET
/api/status/{file_id}
Check the status of an uploaded file
curl http://zipity.home.cluebyfour.ca/api/status/abc123-def456-ghi789
GET
/download/{token}
Download a file using the access token
curl -O http://zipity.home.cluebyfour.ca/download/your-access-token

📝 Examples

Basic File Upload

$ python zipity_cli.py upload presentation.pptx ✅ File uploaded successfully! 📁 File: presentation.pptx 📏 Size: 2.5 MB 🔗 Share URL: http://zipity.home.cluebyfour.ca/download/abc123 ⏰ Expires: 2024-01-02T10:30:00 🆔 File ID: abc123-def456-ghi789

Check Upload Status

$ python zipity_cli.py status abc123-def456-ghi789 📁 File: presentation.pptx 📏 Size: 2.5 MB 📅 Uploaded: 2024-01-01T10:30:00 🔍 Accessed: No ⏰ Expires: 2024-01-02T10:30:00 💀 Expired: No

Batch Upload

# Upload multiple files for file in *.pdf; do python zipity_cli.py upload "$file" done

Integration with Other Tools

# Upload and get URL for sharing URL=$(python zipity_cli.py upload file.txt | grep "Share URL" | cut -d' ' -f3) echo "Share this file: $URL"

Using with curl

# Upload file curl -X POST -F "file=@document.pdf" http://zipity.home.cluebyfour.ca/api/upload # Response: { "success": true, "file_id": "abc123-def456-ghi789", "share_url": "http://zipity.home.cluebyfour.ca/download/token123", "expires_at": "2024-01-02T10:30:00", "file_size": 1024, "original_filename": "document.pdf" }

⚙️ Configuration

Environment Variables

export ZIPITY_SERVER=https://zipity.example.com export ZIPITY_API_KEY=your-api-key-here # If implemented

Configuration File

Create ~/.zipity/config:

[default] server = https://zipity.example.com api_key = your-api-key-here

🔧 Troubleshooting

Common Issues:
  • Connection refused: Make sure the Zipity server is running
  • File too large: Check server's MAX_CONTENT_LENGTH setting
  • Permission denied: Ensure the script is executable

Debug Mode

python zipity_cli.py --verbose upload file.txt

Check Server Logs

# Docker docker-compose logs -f zipity # Local tail -f app.log