Skip to main content

koggi

  • PostgreSQL backup & restore CLI (early foundation).

Quick start

postgresql backup & restore CLI

1. INSTALL

pip install koggi

2. save settings in project root

# project-root/.env
KOGGI_DEFAULT_DB_NAME=db_name
KOGGI_DEFAULT_DB_USER=postgres
KOGGI_DEFAULT_DB_PASSWORD=password
KOGGI_DEFAULT_DB_HOST=localhost
KOGGI_DEFAULT_DB_PORT=5432
KOGGI_DEFAULT_SSL_MODE=prefer
KOGGI_DEFAULT_BACKUP_DIR=./backups
KOGGI_DEFAULT_ALLOW_RESTORE=true

3. download binary files

koggi binaries download

4. backup

koggi pg backup

5. restore

koggi pg restore

rclone cloud backup & restore CLI

1. INSTALL

rclone is required for cloud backup features.

2. initialize settings

koggi rc init

Creates .koggi/rclone/setting.json interactively. You can specify remote name, project name, and files/glob patterns to backup.

3. backup

koggi rc backup

Uploads configured files to <remote>:<project_name>/<timestamp>.

  • Use --dry-run to preview the files that will be uploaded.

4. restore

koggi rc restore

Interactively select a remote backup to restore.

  • Safety: If restoring overwrites existing local files, the conflicting files are automatically archived into .koggi/backup/restore-YYYYMMDD_HHMMSS.zip before being replaced.

5. delete

koggi rc delete

Interactive menu to manage remote backups:

  • Delete a specific backup
  • Delete ALL backups
  • Keep recent N backups and delete the rest

DB configuration examples (PostgreSQL)

  • Prepare a .env with at least one profile (DEFAULT example):
KOGGI_DEFAULT_DB_NAME=example
KOGGI_DEFAULT_DB_USER=postgres
KOGGI_DEFAULT_DB_PASSWORD=secret
KOGGI_DEFAULT_DB_HOST=localhost
KOGGI_DEFAULT_DB_PORT=5432
KOGGI_DEFAULT_SSL_MODE=prefer
KOGGI_DEFAULT_BACKUP_DIR=./backups
  • .env (dev1 example):
KOGGI_DEV1_DB_NAME=example
KOGGI_DEV1_DB_USER=postgres
KOGGI_DEV1_DB_PASSWORD=secret
KOGGI_DEV1_DB_HOST=localhost
KOGGI_DEV1_DB_PORT=5432
KOGGI_DEV1_SSL_MODE=prefer
KOGGI_DEV1_BACKUP_DIR=./backups
KOGGI_DEFAULT_ALLOW_RESTORE=false
  • List profiles: koggi config list
  • Test connection: koggi config test DEFAULT
  • Create backup: koggi pg backup -p DEFAULT
  • Restore latest: koggi pg restore -p DEFAULT
  • Check binaries: koggi binaries which

Notes

  • Embedded binaries: Koggi can use packaged PostgreSQL tools.
    • Place binaries under src/koggi/_bin/<os>-<arch>/:
      • Example tags: windows-x86_64, darwin-arm64, linux-x86_64.
      • Required files: pg_dump[.exe], psql[.exe], pg_restore[.exe].
    • Or put them in cache: %LOCALAPPDATA%/koggi/bin/<tag>/ (Windows) or ~/.cache/koggi/bin/<tag>/ (Unix).
    • You can override via env: KOGGI_PG_DUMP, KOGGI_PSQL, KOGGI_PG_RESTORE.
  • If no embedded binary is found, Koggi falls back to system PATH.
  • This is Phase 1 scaffold based on plan.md; more features will follow.

Release files for koggi 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for koggi 0.1.8
File Size Uploaded
koggi-0.1.8.tar.gz 25.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for koggi 0.1.8
File Interpreter ABI Platform
koggi-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 61.6 kB

Release files / koggi-0.1.8.tar.gz

Download URL koggi-0.1.8.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96a2b4629ae82eb53f1033e4dab7021825af194a037854279faef5e26daa4a10
BLAKE2b-256 checksum
How to use checksums
1b842ce2615f9b1bf4c5377696d080f66af93f67ab902407a5ac451293c0e796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release files / koggi-0.1.8-py3-none-any.whl

Download URL koggi-0.1.8-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8fba383c1b8f6158ac00b11d90514754f707b0737e908117bcce30433dcb86e
BLAKE2b-256 checksum
How to use checksums
7aea81d34d054017e25cbe884647705f1b9e989d3dbb95aaadeddfc4154c7b4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page