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;--rawreturns 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
--yesand report acascadecount. lessons bulk --journal FILEmakes 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
- Sign in to Planbook, open DevTools Network tab, filter
api.planbook.com. - Reload, click the
getClasses2request. - Right-click > Copy > Copy as cURL.
- Run
planbook auth tokenand paste.
Caveats
- No published API exists; endpoints can change. See docs/API-NOTES.md.
- Only
api.planbook.comis 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
release.yml, environment pypi), add a GitHub environment named pypi.
Metadata
Release files for planbook-cli 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| planbook_cli-0.3.1.tar.gz | 185.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| planbook_cli-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 270.8 kB
Release files / planbook_cli-0.3.1.tar.gz
| Download URL | planbook_cli-0.3.1.tar.gz |
|---|---|
| Size | 185.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da6f19e81d43c949259e9f51c887ac4309df44dc74792532378f6bc935bfa5bc
|
|
BLAKE2b-256 checksum How to use checksums |
6059824200e57deaee0a56f578d96101efbd99986caa5db243f2b68d48b36f79
|
| 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 4, 2026.
Transparency logRelease files / planbook_cli-0.3.1-py3-none-any.whl
| Download URL | planbook_cli-0.3.1-py3-none-any.whl |
|---|---|
| Size | 85.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb62d6a68d6ee0cc94256e4392cafbef8502b6f796ff44d856ee189f6dd6cc6f
|
|
BLAKE2b-256 checksum How to use checksums |
c470a698652c11377c88c8d783507c879d9accd7fd854a0fefdead0e3a718c0d
|
| 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 4, 2026.
Transparency log