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.3.0.tar.gz (32.3 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.3.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: benchops-0.3.0.tar.gz
  • Upload date:
  • Size: 32.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 27340d3c4cb16a1c320470563902669492fb3bdfa57bc2f96466399fca2b106a
MD5 0327f4b7efd2dba75737f6f6c51a9730
BLAKE2b-256 6b1835481d92eabb806d939525ba7bdb6c14844e8652954a26e94091ac93844b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: benchops-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9bb2823c68b3d2a9fcfcee0224f69c3f57a97c2f32859ff07eb68cbe7857573
MD5 c84cd6084fbff0adf43b3ec276a02380
BLAKE2b-256 1e096e80f2eab0741e57e5085e8b68233b4e2a6a63654233df7d5ba980fea8c3

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

This release

0.3.0 This release

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