All notable changes to pm, the PushMetrics command-line tool (pushmetrics-cli on PyPI). Newest first. Dates are the day the version reached PyPI. Upgrade with pipx upgrade pushmetrics-cli.

0.4.2 - 2026-11-17

Changed

  • pm now names itself to the server with an X-PushMetrics-Client header on every request, and switches workspaces with a POST (on older servers it falls back to the GET it used before). A later PushMetrics server will refuse changes from a pm signed in with pm login in the browser that does not send this header, so upgrade if you sign in that way; pm login --token and PM_API_JWT are not affected.
  • pm accepts only a plain server address as the API URL: http(s)://host[:port][/path]. A URL with a user name, password, query or fragment is refused, with a message that says where to fix it (--api-url, PM_API_URL or the profile), including one already saved in config.toml.

Fixed

  • When the API, or a proxy in front of it, answers an error with an HTML page or plain text instead of JSON, pm shows the status, for example failed: 502 Bad Gateway, instead of the whole response.
  • When personal access tokens are switched off on the server, pm login --token no longer points at the tokens page.
  • When a personal access token is rejected, pm login --token and pm whoami name the server and profile they checked, and how to use another profile, so a token made on another server no longer reads as a bad token.
  • Piping pm into a command that stops reading early, such as pm report list | head -5, no longer prints a Python "BrokenPipeError" message. pm stops quietly and exits with code 141, like other command-line tools when the reader goes away.
  • When a workspace accepts only approved network addresses and this machine is not on one, pm says so and what to do (connect through your organization's network or VPN, or ask a workspace admin to add the address), instead of "Personal access tokens are not enabled on this server" or "bearer token rejected".

0.4.1 - 2026-11-15

Changed

  • pm usage forecast says "within the included messages" or "still over the included messages" after a what-if, the same words as the forecast line, and lines up the amounts under "Ways to save".
  • pm usage forecast --help says --schedule takes at most 5 rules per command, the most the server tries in one what-if.
  • pm help lists usage, and pm usage --help shows the forecast command's whole summary instead of a cut-off one. pm agent status --help says it checks the directory in --path, not "this repository".

Fixed

  • After a 404, pm no longer suggests a pm <group> list command that does not exist. pm usage forecast says the server does not have the usage forecast yet, and pm whoami and pm login say to check the API URL with pm config list.
  • When the server cannot work out a pm usage forecast change, pm shows its reason on its own, without the request URL. Giving one report two changes names the four options to choose from.
  • When pm login --token or the token exchange fails, pm shows the server's message instead of the raw response. A 404, which means the API URL is wrong, now says to check it with pm config list, and no longer points at the tokens page.

0.4.0 - 2026-11-15

Added

  • pm agent setup writes the PushMetrics instructions for an AI agent into the file your agent reads: CLAUDE.md, AGENTS.md, GEMINI.md, .cursor/rules/pushmetrics.mdc or .github/copilot-instructions.md. Running it again replaces only the PushMetrics block and leaves the rest of the file as it is. It never writes your token; it prints the lines for you to run in the shell that starts your agent, then checks the token with pm whoami if one is set.
  • pm agent status shows which agent instruction files in a directory have current PushMetrics instructions, and whether a token is set in this shell. It makes no network call.
  • pm help --json prints every command with its arguments and options as JSON, so an AI agent can read what pm accepts; pm help <topic> --json prints one topic.
  • pm usage forecast shows where this period's message usage is heading against the messages your workspace includes, and ways to save. --pause, --weekdays-only, --half-as-often and --schedule <uid>=<RRULE> show what a change to a report's schedules would save, and --remove-blocked what removing blocked addresses would save; nothing is changed. A server without the usage forecast answers with an API error.

0.3.0 - 2026-11-13

Added

  • pm token create NAME --scope read makes a read-only token: it can read and query metrics views; SQL, runs and changes are refused. Without --scope, tokens have full access as before.
  • pm token create NAME --scope read checks that the server really made a read-only token. If it did not (a server older than read-only tokens), pm revokes the token at once, or, if that fails, prints its id and the pm token revoke command to run. Either way it prints no token and exits with status 1.
  • pm whoami shows the session's token_scope (full, read, or unknown on an older server), and pm token list has a SCOPE column.
  • When the server refuses a request because the token is read-only, pm adds a hint that tells an AI agent to stop and ask the person it works for instead of looking for another token.

Fixed

  • An API error whose body has Windows line endings, such as a proxy's error page, no longer ends each line with a stray space.

0.2.0 - 2026-11-12

Added

  • pm schedule lists, creates, updates, pauses, resumes and runs a report's schedules. pm schedule run delivers to all its destinations: it asks first in a terminal and needs --yes otherwise.
  • pm deliverability lists the email addresses the email provider blocks for this workspace and shows one address's history; admins can unblock an address.
  • pm config list shows PM_CLIENT among the environment overrides, and the cleaned-up value pm actually sends when it differs from what you set.

Fixed

  • Text from the server in tables and key: value output no longer carries terminal control characters, so it cannot change your terminal.
  • Multi-line text from the server, such as report YAML or a database comment, keeps its line breaks but loses other control characters.

0.1.1 - 2026-11-11

Added

  • PM_CLIENT tells PushMetrics which tool runs pm (for example ci or claude-code). pm sends it with every request as pm/<version> (client=<name>; py/<version>). It is not a secret and does not change what the token can do.
  • pm config list shows the config home, where pm keeps its configuration and tokens (config_home with --json), and lists PM_CONFIG_HOME with the environment overrides. When PM_CONFIG_HOME points somewhere other than the default, the Not logged in error also names the config home.

Changed

  • A request refused because the organization has no active subscription now says what to do: pm needs an active PushMetrics subscription for this workspace's organization. Start a trial or upgrade in the web app.
  • Help and login text name the token settings page by its new name, Settings > CLI & API.

Fixed

  • pm config set writes config.toml in one step, so an interrupted write cannot leave a broken file. A new config.toml is readable only by you, an existing one keeps its permissions, and a config.toml that is a symbolic link stays a link.
  • An unreadable or invalid config.toml gives an error that names the file and how to fix it, instead of a traceback.
  • pm help metrics-view no longer fails on Windows when its output is piped or redirected.

0.1.0 - 2026-10-16

Added

  • First release of pm, published on PyPI as pushmetrics-cli, for Python 3.9 or newer.
  • pm login --token logs in with a personal access token, from a hidden prompt or from stdin, and stores it in the operating system's credential store. PM_API_TOKEN works without storing anything and wins over a stored token. pm whoami shows who you are; pm logout forgets the token.
  • Command groups for reports and runs (pm report, pm run), report blocks (pm sql, pm chart, pm email, pm slack, pm sftp, pm tableau, pm slides, pm explore, pm metrics-view, pm block, pm saved-block), and the rest of the workspace (pm database, pm user, pm role, pm folder, pm token, pm workspace and more). pm help shows the map of every group.
  • --json on every command, before or after the action. Data goes to stdout, messages and errors to stderr. pm exits with 0 on success, 1 when a command fails and 2 when the command line is wrong.
  • Profiles for several workspaces: --profile <name>, pm config set and pm config list.