Skip to main content

planbook-cli

Unofficial CLI for Planbook.com. Reads and writes lesson plans, schedules, grades, and attendance — built for people and AI agents.

Not affiliated with or supported by Planbook.com. It works on your own account with your own credentials. See SECURITY.md for what it does with them and docs/PRODUCTION-READINESS.md for what an official version would take.

No published API exists; this tool talks to the same endpoints the web app uses. See docs/API-NOTES.md for details. Run planbook endpoints for current coverage.

Install

pipx install planbook-cli
uv tool install planbook-cli

To update: pipx upgrade planbook-cli or uv tool upgrade planbook-cli.

Unreleased main: pipx install git+https://github.com/bryantclark/planbook-cli.

Development: clone, then uv pip install -e ".[dev]".

Quickstart

planbook auth import            # read the token from your browser
planbook check                  # session, hours left, and your class ids
planbook lessons set --class-id 12345678 --date 09/03/2026 \
  --title "Photosynthesis" --text "<p>Chloroplasts and light reactions.</p>"

For agents

The CLI describes itself, so nothing has to be inferred from help text or guessed from prose:

planbook schema                 # every command, flag and error kind as JSON
planbook check                  # the one-call preflight
planbook --error-json <cmd>     # failures as {"error": {kind, code, retryable, remedy}}
  • stdout is JSON on success and empty on failure. Branch on the exit code.
  • - on any text flag reads that value from stdin, so HTML never goes through a shell.
  • Every list answers to id; --raw returns the untouched wire body.
  • Every write has --dry-run, and is read back before it reports success.
  • Deletes that destroy records you did not name require --yes and report a cascade count.
  • lessons bulk --journal FILE makes an interrupted batch resumable with --resume.

AGENTS.md is the full contract.

Authentication

  • auth import (recommended) — reads the token from a browser you are already signed in to. On macOS, approve the Keychain prompt (Always Allow).
  • auth token — paste a bare JWT, Cookie: header, or "Copy as cURL" output. The fallback when the cookie store can't be read (Safari without Full Disk Access).

Both paths carry a full-account token with no scopes, consent, or revocation. See docs/PRODUCTION-READINESS.md for what should replace them.

Token storage: ~/.config/planbook/token.json (mode 0600). PLANBOOK_TOKEN overrides for CI.

Tokens last about 22 hours (1 hour for auth-server tokens). Re-run auth import daily.

Getting your token by hand

  1. Sign in to Planbook, open DevTools Network tab, filter api.planbook.com.
  2. Reload, click the getClasses2 request.
  3. Right-click > Copy > Copy as cURL.
  4. Run planbook auth token and paste.

Caveats

  • No published API exists; endpoints can change. See docs/API-NOTES.md.
  • Only api.planbook.com is used; the web app host is never scripted.
  • Requests are serialized. No parallelism.
  • Planbook's terms (2020-07-01) have no anti-automation clause but reserve rate limits and allow discretionary termination.
  • There's evidence of a sanctioned API-key mechanism. If you depend on this tool, ask support@planbook.com about it.

Agent discovery

Install the skill so Claude finds the CLI automatically:

mkdir -p ~/.claude/skills/planbook && cp skills/planbook/SKILL.md AGENTS.md docs/API-NOTES.md ~/.claude/skills/planbook/

SKILL.md carries the contract on its own; the other two are the full reference it points at. Or install the repo as a plugin.

Licence

MIT.

Releasing (maintainer)

Release-please gathers main merges into a version-bump PR. Merge it to tag and publish to PyPI.

feat: bumps minor, fix: bumps patch. Squash-merge PRs with a conventional title. To force a specific version, put Release-As: X.Y.Z on its own line in the squash commit body.

The release PR is opened by the Actions bot. GitHub doesn't run CI on bot-opened PRs, so close and reopen it once (gh pr close N && gh pr reopen N). To skip this permanently, give release-please a fine-grained PAT.

First publish: create planbook-cli on PyPI, add a trusted publisher (workflow publish.yml, environment pypi), add a GitHub environment named pypi.

Metadata

Release files for planbook-cli 0.3.0

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

Source distribution (sdist)

Source distribution for planbook-cli 0.3.0
File Size Uploaded
planbook_cli-0.3.0.tar.gz 183.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for planbook-cli 0.3.0
File Interpreter ABI Platform
planbook_cli-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 269.2 kB

Release files / planbook_cli-0.3.0.tar.gz

Download URL planbook_cli-0.3.0.tar.gz
Size 183.8 kB
Tags Source
SHA-256 checksum
How to use checksums
729916b06326fb14b65d542c746901fb8c0460098be2058803db040df7803f64
BLAKE2b-256 checksum
How to use checksums
2ddd311a1549e70f19702649bbc70030324d1129374a72b47141bd9238f556d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / planbook_cli-0.3.0-py3-none-any.whl

Download URL planbook_cli-0.3.0-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4f003fb042f5eaaba978741f2f7f5d495b7d7ca68625fc17d004ef81970cb45
BLAKE2b-256 checksum
How to use checksums
269373cabb10a7d81edaf223d2f0c4e1f5a9cb97e14dcad16213895d3626ec53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.2

2 release files

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