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.1.0.tar.gz (31.4 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.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: benchops-0.1.0.tar.gz
  • Upload date:
  • Size: 31.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 a30b97f3935332432995b71a8ace347377d1147a129548d38b3444d4c07ba221
MD5 f70e5b1a7212279ef549a37a4bb142e1
BLAKE2b-256 36a030e7c04f25fbee62ea84ef39f5c268bdf07e353ec7e200cfd85cb0afbeec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: benchops-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9d17c7cd2b6cb4ef6daeb73f8c62b49890399aecf81770786814f5f63d773fe
MD5 ea3a317bc7be9db59946810f79e54a07
BLAKE2b-256 1700737fbab62bb1b0256a3706e6ca7df38f21f19bb8372b19a12a6c81cc8bdf

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

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

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