Skip to main content

benchops

A cross-platform CLI tool that synchronizes local Frappe development environments with remote servers.

benchops automates the repetitive "ship my app to the server" workflow: it builds your app locally, packages it into a compressed archive, uploads it to the target server over SSH, extracts it into the remote bench, and runs the Frappe housekeeping commands to apply the changes — all with output streamed to your terminal in real time.

Features

  • Server management — define remote servers in a local TOML config (~/.benchops/config.toml) with a friendly interactive CLI.
  • Secure authentication — store server passwords in your OS credential store (keyring) or use an SSH private key.
  • Real-time streaming — every local and remote command streams its stdout and stderr to your terminal as it runs.
  • Lean transfers — source tarballs exclude .git, __pycache__, node_modules, and *.pyc to keep uploads small.
  • One-command deploy — build, archive, upload, extract, migrate, and clear cache with a single invocation.

Requirements

  • Python >= 3.14.6
  • uv (recommended) or pip
  • SSH access to the target server (password or key)

Installation

git clone <your-repo-url> benchops
cd benchops
uv sync

Install the CLI into your environment so the benchops command is available:

uv run pip install -e .
# or, if you built a distribution:
uv build && uv pip install --python .venv/bin/python dist/benchops-0.1.0-py3-none-any.whl

Verify it works:

benchops --help

Quick start

1. Initialize the configuration

benchops init

This creates ~/.benchops/config.toml with an empty [servers] table.

2. Register a server

benchops server add

You will be prompted for:

Field Description
alias Short name used to reference the server
host Hostname or IP address
port SSH port (default: 22)
user SSH username
bench_path Remote path to the bench directory

You can also pass everything non-interactively:

benchops server add --alias dev1 --host 192.168.1.10 --port 22 --user frappe --bench-path /home/frappe/bench

List your configured servers:

benchops server list

3. Configure authentication

benchops server set-auth dev1

You will be asked to choose between:

  • password — prompted securely (hidden input, double confirmation) and stored in your system keyring.
  • key — path to your SSH private key (default ~/.ssh/id_rsa), stored in the server's configuration.

4. Deploy

Run benchops deploy from the directory that contains your app (either inside the local bench's apps/ folder or directly):

benchops deploy <app_name> <server_alias>

For example:

benchops deploy myapp dev1

The deploy pipeline:

  1. Config & auth — loads the server settings and its credentials.
  2. Local build — runs bench build --app <app_name> in the app's parent directory.
  3. Archive — compresses <app_name> into a .tar.gz (excluding .git, __pycache__, node_modules, and *.pyc) in a temporary directory.
  4. Connect — opens an SSH connection to the server.
  5. Transfer & extract — uploads the tarball and extracts it into {bench_path}/apps.
  6. Remote operations — runs bench --site all migrate and bench clear-cache inside {bench_path}.
  7. Cleanup — closes the connection and reports success.

Configuration

All server definitions live in ~/.benchops/config.toml:

[servers]
dev1 = {host = "192.168.1.10", port = 22, user = "frappe", bench_path = "/home/frappe/bench", private_key_path = "/home/mohammad/.ssh/id_rsa"}
staging = {host = "staging.example.com", port = 22, user = "deploy", bench_path = "/srv/bench"}

Passwords are not stored in this file — they are kept in the operating system's credential store via keyring.

Development

uv sync            # install dependencies
uv build           # build wheel + sdist
uv publish         # upload to PyPI (set UV_PUBLISH_TOKEN first)

License

MIT

Download files

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

Source Distribution

benchops-0.4.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

benchops-0.4.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file benchops-0.4.0.tar.gz.

File metadata

  • Download URL: benchops-0.4.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchops-0.4.0.tar.gz
Algorithm Hash digest
SHA256 70cb915fba1f159be66a47a6628bb683e77e1979b6be104d160b7b683e5d80ab
MD5 c80b9a4ace8b9548adbd8fe43a60044f
BLAKE2b-256 5c8ee077a74b9f7b258c60070fc2d1a194ba3a2a190c9ffe8bd7f4a0e9aa2c58

See more details on using hashes here.

File details

Details for the file benchops-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: benchops-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.4 {"installer":{"name":"uv","version":"0.12.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchops-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f42ddd4e63684b2b5348c385f9a7063c266085057ec3e30f166a69b571de3db7
MD5 f7aed161c8a4752a75e356127bdc3239
BLAKE2b-256 e172a96109650d9c497314d302f76dcca170079f904baaee5f236e70ac5f87d2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 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