# CLI The `playmolecule` command-line entry point exists for one job: authenticating against an HTTP backend in environments where launching a Python interpreter to call {py:func}`~playmolecule.login` is awkward (CI, container init scripts, shell-only operators). ```text playmolecule {login,logout} ``` ## `playmolecule login` Authenticate against the HTTP backend configured in `PM_EXECUTOR` (or the HTTP entry in `PM_REGISTRIES`). On success, a session cookie is written under `PM_COOKIE_CACHE_DIR` (default `~/.cache/playmolecule/cookies/`) and used by every subsequent PlayMolecule call from this user. ```text playmolecule login [--email EMAIL] [--password PASSWORD] ``` | Option | Source if not provided | |--------------|-----------------------------------------------------------------------------------------------------------------------------| | `--email` | `PLAYMOLECULE_EMAIL`, then `PM_EMAIL`. Required. | | `--password` | `PLAYMOLECULE_PASSWORD`, then `PM_PASSWORD`, then an interactive prompt (via `getpass`). | Exits non-zero on failure, printing the underlying error. ### Examples ```bash # Interactive — prompt for the password playmolecule login --email you@example.com # CI-friendly — credentials from environment export PM_EMAIL=ci@example.com export PM_PASSWORD='••••••••••' playmolecule login ``` ## `playmolecule logout` Clears the cached cookie for the current user, both in memory and on disk. ```text playmolecule logout ``` Always exits zero, even if there was no active session. ## See also - [Log in to the HTTP backend](../howto/log-in-to-the-http-backend.md) - [Environment variables](environment-variables.md) - {py:func}`~playmolecule.login` - {py:func}`~playmolecule.logout`