Metadata-Version: 2.3
Name: mascope-cli
Version: 2026.7.7
Summary: Mascope's operations CLI: install, launch and back up a Mascope deployment.
Author: Karsa Oy
Author-email: Karsa Oy <support@karsa.fi>
License: Apache-2.0
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: mascope-runtime[logs]>=2026.7.7
Requires-Dist: typer>=0.15.2,<0.16
Requires-Dist: rich>=13.7.1,<14
Requires-Dist: pandas>=2.0.0 ; extra == 'demo'
Requires-Dist: requests>=2.32.0,<3 ; extra == 'demo'
Requires-Dist: alembic>=1.18.1 ; extra == 'dev'
Requires-Dist: sqlalchemy~=2.0 ; extra == 'dev'
Requires-Dist: psycopg2-binary>=2.9.11 ; extra == 'dev'
Maintainer: Oskari Kausiala
Maintainer-email: Oskari Kausiala <oskari.kausiala@karsa.fi>
Requires-Python: >=3.12, <3.13
Project-URL: Bug Tracker, https://github.com/karsa-oy/mascope/issues
Project-URL: homepage, https://karsa.fi/
Project-URL: repository, https://github.com/karsa-oy/mascope
Provides-Extra: demo
Provides-Extra: dev
Description-Content-Type: text/markdown

# Mascope CLI

The operations CLI for [Mascope](https://karsa.fi/), Karsa'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

```sh
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) — configuration TOMLs you can edit,
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.

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

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

## Everyday operations

```sh
mascope prod ps                  # container status
mascope prod logs --follow       # stream logs
mascope prod update              # update the stack to the latest release
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
```

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). Move to a specific release with
`mascope prod update --version v1.2.0`, or pin the deployed version for all
commands with `MASCOPE_VERSION`; without a pin the stack follows the
`latest` release images.

## 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](https://github.com/karsa-oy/mascope) for the developer guide.
