Skip to main content

Shimmer — a shiny Pebble client

A 100% compatible, drop-in replacement for ops.pebble.Client that drives Pebble through its CLI instead of the unix socket — for environments where the socket isn't reachable (such as a Rock or a Juju container).

Shimmer parity demo

The same deploy-and-verify routine run over ops.pebble.Client (unix socket, left) and shimmer.PebbleCliClient (CLI, right) — identical results.

Overview

PebbleCliClient implements the same interface as ops.pebble.Client: same method signatures, same return types, same raised exceptions. Under the hood it translates each call into a pebble CLI command, parses the output back into the same Python objects ops returns, and maps CLI errors onto the matching exceptions. The contract is parity — code written against ops.pebble.Client should run unchanged against Shimmer.

Installation

# From PyPI
uv pip install pebble-shimmer

# Development version
git clone https://github.com/tonyandrewmeyer/shimmer
cd shimmer
uv pip install -e .

Usage

Construct the client, then use it exactly like ops.pebble.Client — the methods, arguments, return types, and exceptions are the same:

from shimmer import PebbleCliClient as Client

client = Client()
client.replan_services()
for service in client.get_services():
    print(service.name, service.current.value)

The whole point is that there's nothing new to learn: the full method surface is documented by ops.pebble.Client. Swapping ops.pebble.Client for shimmer.PebbleCliClient is the only change.

The constructor is where Shimmer differs, since it talks to a binary rather than a socket:

client = Client(
    socket_path="/var/lib/pebble/default/.pebble.socket",  # sets PEBBLE / PEBBLE_SOCKET
    pebble_binary="/snap/bin/pebble",  # path to the pebble binary (default: "pebble")
    timeout=5.0,  # default per-command timeout in seconds
)

socket_path doesn't open a socket — it points Shimmer at the daemon by setting PEBBLE (its parent directory) and PEBBLE_SOCKET for the CLI. For drop-in parity the constructor also accepts opener and base_url, but those only configure the socket transport, so Shimmer accepts and ignores them. The ops.pebble exceptions are re-exported from shimmer for convenience, but they are the same objects, so except ops.pebble.APIError keeps working too.

Demo and verification

The GIF above is a recording of demo.md — a Showboat document that runs one deploy-and-verify routine against the real socket client, then the same code against Shimmer, and diffs the two outputs to prove they're identical. It's reproducible:

uv run python demo.py            # rebuild demo.md (verifies parity live)
uv run python demo.py --record   # re-record demo.cast (needs tmux + asciinema)
agg demo.cast demo.gif           # regenerate the GIF from the cast

Parity is also exercised in CI by tests/integration/test_parity.py, which runs the same operations through both clients and asserts equal results.

Limitations and parity notes

CLI invocation is the source of every limitation here — each call spawns a pebble process, so there's more per-call overhead than the socket transport, and some streaming is buffered rather than incremental.

A few methods can't fully match the socket client:

  • exec() raises ExecError from wait() or wait_output() if Pebble can't be reached, where ops.pebble.Client raises ConnectionError from exec().
  • list_files() can't be used with a path that contains *, ?, or [, because the CLI treats it as a pattern. This also affects ops.Container.exists() and ops.Container.isdir().
  • Methods that only read take about 5 seconds to fail if Pebble can't be reached, because the CLI retries for that long.
  • notify() supports custom notices only (Pebble's CLI only exposes pebble notify for custom notices).
  • abort_change() raises NotImplementedError: the Pebble CLI exposes no command to abort a change, so there is no way to back this through the CLI.
  • get_warnings() works by reading pebble warnings --format json (Pebble surfaces warnings as notices of type warning) and mapping the result back to ops.pebble.Warning, so it stays drop-in with ops.pebble.Client. ack_warnings() still raises NotImplementedError: pebble okay acks by local CLI state, not by timestamp, so ops's timestamp semantics cannot be reproduced.

get_system_info(), get_services(), get_checks(), list_files(), get_changes(), get_change(), get_notices(), get_notice(), get_warnings(), and get_identities() use Pebble's structured --format json output, so they return the same rich data as ops.pebble.Client (change kind/tasks/err, check thresholds, real file ownership, local identity user IDs). This requires Pebble v1.32.0 or later (which added --format to pebble version).

Comparison with ops.pebble.Client

ops.pebble.Client PebbleCliClient
Transport Unix socket pebble CLI
Requires Socket access pebble binary
Performance Higher Moderate (per-call process spawn)
API Native 100% compatible

Troubleshooting

Pebble binary not found — pass the full path: Client(pebble_binary="/snap/bin/pebble").

Connection error — confirm the daemon is up and PEBBLE points at its home directory (or pass socket_path=); check pebble version.

More

Metadata

Release files for pebble-shimmer 1.2.0

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

Source distribution (sdist)

Source distribution for pebble-shimmer 1.2.0
File Size Uploaded Provenance Actions
pebble_shimmer-1.2.0.tar.gz 52.9 kB With provenance Details for pebble_shimmer-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pebble-shimmer 1.2.0
File Interpreter ABI Platform Actions
pebble_shimmer-1.2.0-py3-none-any.whl Python 3 none any Details for pebble_shimmer-1.2.0-py3-none-any.whl

Total release size: 79.2 kB

Release files / pebble_shimmer-1.2.0.tar.gz

Download URL pebble_shimmer-1.2.0.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
39455258172036dce0ba073dabdfdb46deda0308a5f3f9c291f0760ba7853fb4
BLAKE2b-256 checksum
How to use checksums
ee3c1ae50fa8ffbe9e8d4a8b84c4b29c6b7b9805acb068712d4e06b423945e8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / pebble_shimmer-1.2.0-py3-none-any.whl

Download URL pebble_shimmer-1.2.0-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
994ff8ef160c8a6496f70318c972e5cd3b60af7463fb604cce12a35adcc8c80d
BLAKE2b-256 checksum
How to use checksums
38e1a53d5e0f8dc0f1178fd58c9d1d2047c65038872a4b14fb71ba82927b212e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for pebble-shimmer 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pebble_shimmer-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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