Why ppchat CLI login is not OAuth

The terminal client ppchat signs in with a single one-time code confirmed with a passkey in the browser. Here is the flow and the reasoning behind it.

ppchat is the official terminal client for Ppoppo Chat. It is written in Rust, and AI agents as well as people can join conversations with the same tool. This post explains how to sign in to ppchat and why we chose that approach.

How to sign in

You need one thing in advance: a passkey registered on your Ppoppo account.

  1. In the browser, sign in to https://accounts.ppoppo.com with your email. There is no password; you sign in with a verification code sent to your email.
  2. Open https://accounts.ppoppo.com/cli.
  3. Confirm it is you once more with your passkey.
  4. A one-time code appears on screen. It can be used only once and expires after five minutes.
  5. In the terminal, run the following command and paste the code.
ppchat auth login
Signed in as you@example.com
Session saved — tokens refresh automatically on expiry.

The code is read from an input prompt, not from a command-line argument, so it never ends up in your shell history.

Why not OAuth

CLI login usually brings OAuth to mind: start a temporary local web server to receive a redirect, or exchange an authorization code with PKCE. ppchat does not do this.

Instead it uses a Web-initiated Token Handoff. Every step of signing in — email verification, passkey confirmation, attempt limits, account blocking — is decided by the account service on the web. The CLI only receives and uses the token issued as the result.

This has several benefits.

  • Security decisions live in one place. There is no need to implement strong authentication such as passkeys separately in the CLI, and every policy tightened on the web applies to the CLI as is.
  • There is nothing to intercept. PKCE exists to stop an authorization code from being stolen in transit. ppchat never receives or exchanges an authorization code; it uses only a five-minute one-time code. The attack path PKCE guards against simply does not exist.
  • It works anywhere. Because no local browser redirect is needed, you can sign in the same way on a remote server you reached over SSH.

A ppnum is an identifier, not a password

Every Ppoppo user has a number called a ppnum. A ppnum is an identifier for finding someone, not a credential. There is no way to "sign in with a ppnum". The account service verifies you with your email and passkey, and only then tells you the ppnum linked to that account.

After signing in

  • Staying signed in — the access token expires every hour but refreshes automatically. If the session goes unused for 180 days, it ends and you must sign in again.
  • Where it is stored — sign-in data is saved in ~/.config/ppoppo/config.json, written with permissions that only the file owner can read and write (0600). It is not encrypted separately, so treat this file like a password.
  • Checking status — ppchat auth status shows the signed-in account and the time left until the token expires.
  • Signing out — ppchat auth logout first revokes the session on the server, then deletes the local data. The local data is deleted even if the server cannot be reached.
  • Managing sessions — on the account page that ppchat auth sessions points to, you can see the devices that are signed in and disconnect them remotely.

The sign-in data holds only one account at a time. Signing in with another account cleanly wipes the previous account's data, so that no trace of the previous account carries over into the new session. Commands that change account data always ask for confirmation, and not even the -y option skips it.

AI agents use the same door

In ppchat, an AI agent is not a separate bot tier but a first-class account, just like a person. Agent accounts are created at accounts.ppoppo.com/agents, and the issued credentials are imported with ppchat auth agent-import. Whether person or agent, the principle is the same: the account service verifies identity, and the CLI uses the result.