Michael Freno 7bbba9f15c FRE-683: Add contacts & attachments management
- Implemented contact CRUD operations (list, add, edit, delete)
- Implemented attachment management (list, upload, download)
- Created internal/contact/manager.go for contact persistence
- Created internal/attachment/manager.go for attachment storage
- Added CLI commands in cmd/contacts.go and cmd/attachments.go
- Integrated contact and attachment commands into root CLI

Files:
- internal/contact/types.go - Contact data models
- internal/contact/manager.go - Contact CRUD operations
- internal/attachment/manager.go - Attachment file operations
- cmd/contacts.go - Contact CLI commands
- cmd/attachments.go - Attachment CLI commands

Contacts stored in ~/.config/pop/contacts.json
Attachments stored in ~/.config/pop/attachments/
2026-04-26 10:26:29 -04:00

pop

A ProtonMail CLI tool written in Go, similar to gog.

Features

  • Authentication: Login/logout with 2FA support
  • Session Management: Secure token storage in ~/.config/pop/
  • ProtonMail API Client: REST client with rate limiting and error handling
  • PGP Encryption: Full support for ProtonMail's PGP encryption via gopenpgp v2

Installation

# Build from source
git clone https://github.com/frenocorp/pop.git
cd pop
make build

# Install
make install

Usage

# Initialize login (interactive mode)
pop login

# Login with explicit credentials
pop login --email user@proton.me --password secret

# Check current session
pop session

# Logout
pop logout

Project Structure

pop/
├── cmd/
│   ├── root.go       # CLI root command
│   └── auth.go       # Authentication commands
├── internal/
│   ├── auth/         # Session management
│   │   └── session.go
│   ├── config/       # Configuration handling
│   │   └── config.go
│   └── api/          # ProtonMail API client
│       └── client.go
├── .github/
│   └── workflows/
│       └── ci.yml    # CI/CD pipeline
├── go.mod
├── go.sum
├── main.go
├── Makefile
└── README.md

Configuration

Configuration is stored in ~/.config/pop/config.json:

{
  "api_base_url": "https://api.protonmail.ch",
  "timeout_sec": 30,
  "rate_limit_requests": 100,
  "rate_limit_window_sec": 60
}

Session data is stored in ~/.config/pop/session.json:

{
  "uid": "user-uid",
  "access_token": "token",
  "refresh_token": "refresh",
  "expires_at": 0,
  "two_factor_enabled": false
}

Development

# Build
make build

# Run tests
make test

# Format code
make fmt

# Lint
make lint

# Clean build artifacts
make clean

Dependencies

License

MIT

Description
No description provided
Readme 173 KiB
Languages
Go 99.8%
Makefile 0.2%