Skip to main content

Mascope CLI

The operations CLI for Mascope, Ultra Trace's mass-spectrometry analysis platform. It installs, launches, backs up and manages a Mascope deployment — the application itself runs as Docker containers pulled from the project's registry.

Requirements

  • Python 3.12
  • Docker (with the compose plugin)

Quickstart

pip install mascope-cli

mascope init        # create a runtime home: config, compose files, secrets
mascope cert gen    # self-signed TLS cert (or install real certs)
mascope prod up     # pull and start the production stack

mascope init creates the runtime home at ~/.mascope (%LOCALAPPDATA%\Mascope on Windows) — the configuration TOMLs, docker compose files, and generated application secrets. Set MASCOPE_PATH to place it elsewhere. Re-running init is safe: existing files are kept and secrets are never regenerated. Put your own settings in the env overlay, .runtime/env/default/prod.mascope.toml, not in the TOMLs at the top of the home: those are the release's, and a CLI upgrade replaces them.

To try Mascope without a deployment, the self-contained demo stack ships in the runtime home as well:

docker compose -f docker-compose.demo.yaml up -d
# then open http://localhost:8080 — login demo@mascope.app / mascope-demo

Everyday operations

mascope prod ps                  # container status
mascope prod logs --follow       # stream logs
mascope prod update              # deploy the release this CLI was cut with
mascope prod db backup           # dump the database
mascope prod db restore --yes    # restore the latest dump
mascope logs query --grep error  # search the application's file logs
mascope env list                 # manage runtime environments
mascope export package <id>      # a dataset's archive, to deposit in a repository

Run mascope --help or mascope <command> --help for the full reference.

mascope prod update pulls the target release images, restarts the stack with them and runs any pending database migrations (preceded by an automatic pre-migration dump).

The deployed release

A runtime home made by pip install mascope-cli and mascope init has no source checkout to say which release it runs. Its CLI says it: each CLI version is cut with one Mascope release, and its compose file and config layers are that release's. So the CLI deploys that release and no other.

  • Moving to another release is installing its CLI, then mascope prod up:

    uv tool install mascope-cli==<calver>   # the CLI cut with the release
    mascope prod up --detach
    

    mascope prod up and mascope prod update refuse any other release, a --version or a MASCOPE_VERSION pin, latest included. The refusal names the CLI to install, read from the release's manifest (mascope-manifest.json, whose cli_version names it). Going back to an earlier release is the same, with its CLI.

  • The first prod up after the CLI is upgraded writes the new release's config layers and compose files over the home's (base.mascope.toml, prod.mascope.toml, dev.mascope.toml and the three docker-compose*.yaml). It keeps a copy of what it replaced under .runtime/replaced/, and does it once per CLI version, recorded in .runtime/config-files.json. It never touches .runtime/: not the env overlay .runtime/env/<env>/prod.mascope.toml, where your settings belong, and never the secrets.

  • The unattended update (mascope prod update --auto) finds the newest release and classifies it as before. When it is due - a fast update in the maintenance window, or a migration update past its grace or confirmed - and its CLI is newer, it exits with code 40 and writes the requirement to install (mascope-cli==<calver>) to .runtime/update/cli-to-install. Install that, then run --auto again as a new process, which applies it. The update unit (below) does both.

  • What ran last is kept in .runtime/deployed-release.json, written once the stack is up healthy on a release (prod update, --auto, and prod up --detach, which deploys the CLI's release). mascope prod doctor reports drift between the containers and the CLI's release until the prod up after an upgrade.

  • On a checkout install the checked-out tag says which release runs, and none of this applies.

Boot and maintenance units (Linux)

mascope prod units install installs the systemd units a server needs. Run it as the account that runs the deployment; it uses sudo for the privileged steps.

mascope prod units install --dry-run   # print what it would write and run
mascope prod units install
sudo systemctl enable --now mascope-update.timer   # opt in to unattended updates
  • mascope.service starts the stack at boot. It is enabled.
  • mascope-update.service and .timer run the unattended update nightly. On exit 40 the unit installs the CLI named in .runtime/update/cli-to-install with uv tool install, then runs --auto again. The timer stays off until you enable it.
  • The disk check and the assignment-run retention run on timers that are enabled.

The units run the mascope executable that installed them, on this runtime home, as this account. The update needs that executable to be a uv tool install mascope-cli. The scripts they run are copied to /usr/local/lib/mascope, so going back to an older CLI leaves them working. Their settings files are seeded once into /etc/mascope, and MASCOPE_PATH is added to /etc/environment when it is missing. Re-run the command after a CLI upgrade that changes the units; mascope prod units remove takes them out again. The full story is in docs/maintaining.md.

Limits of a wheel install

A wheel install starts a stack and moves it across releases with its CLI, but lacks some of what a server's source checkout gets from tooling/ubuntu.sh:

  • The system packages are yours to install. Docker, and uv for the unattended update. tooling/ubuntu.sh installs them on a checkout.
  • Only a release cut with a CLI can be deployed. A pre-release built without a CLI of its own, or the rolling latest, needs a checkout.

Development

The Mascope source checkout exposes additional developer commands (dev, test, agent, backend) that operate on the monorepo; they are not part of the standalone install. See the repository for the developer guide.

Metadata

Release files for mascope_cli 2026.11.19

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

Source distribution (sdist)

Source distribution for mascope_cli 2026.11.19
File Size Uploaded Provenance Actions
mascope_cli-2026.11.19.tar.gz 232.5 kB Without provenance Details for mascope_cli-2026.11.19.tar.gz

Built distribution (wheel)

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

Total release size: 506.2 kB

Release files / mascope_cli-2026.11.19.tar.gz

Download URL mascope_cli-2026.11.19.tar.gz
Size 232.5 kB
Tags Source
SHA-256 checksum
How to use checksums
219dedd8f1c42ec3788d94d2b5fe57702b54d599941894d44db8d6680f87017e
BLAKE2b-256 checksum
How to use checksums
71321b2bbf170b21c3b3348b714a6782e78079968351e936d239cd7af5d8908a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mascope_cli-2026.11.19-py3-none-any.whl

Download URL mascope_cli-2026.11.19-py3-none-any.whl
Size 273.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
094720adee915074ae961fe39ec7b3dd502b9810dacbebe9487a353961456fa8
BLAKE2b-256 checksum
How to use checksums
44e7ed3e3df4fd4873d05902062f9890da68c255fc7adc560a04617f1ef8de8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mascope_cli 2026.11.19

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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