MTP milestone tracking, from the terminal.
Checking off a trainee's 21 MDI training goals means clicking through writable.site page by page. This syncs them once and answers from a local copy.
How it works · Install · Usage
Real output from the CLI against a local cache seeded with fictional trainees.
The MDI Membership Training Program (MTP) tracks each trainee through 21 goals, from
"Join MDI" to "Completion Ceremony", and the records live as pages on writable.site. Seeing
where one person stands, or how a whole cohort is doing, takes a lot of clicking. mtp-cli
pulls every MTP page into SQLite in one sync, answers lookups offline, and can mark a goal
done or not done straight from the command line.
|
1 · Connect
|
2 · Sync
|
3 · Ask and update
|
Not published to PyPI; install from source. Python 3.8+.
git clone https://github.com/parthchandak02/mtp-cli.git
cd mtp-cli
pip install .
mtp-cli setup # opens writable.site and asks for your token URLmtp-cli sync # pull all trainees and milestones
mtp-cli list --status 2 # everyone in progress (1-5)
mtp-cli search Rivera # by name, or by status number
mtp-cli get "Rivera, Sam" # one trainee, all 21 goals
mtp-cli complete "Rivera, Sam" 13 # mark goal 13 done today (--date to backdate)
mtp-cli uncomplete "Rivera, Sam" 13 # undo itReads come from the local cache, so run sync again to see changes made on the site.
Names are matched as exact Last, First, or as a partial first or last name.
All commands
| Command | |
|---|---|
setup |
First-time setup: find and save your writable.site token URL |
validate |
Test the token and connection |
sync |
Pull all trainees and milestones into the SQLite cache |
list [--status N] |
Cached trainees, optionally filtered by status 1-5 |
search <query> |
Trainees by name, or by status number |
get <name> |
Trainee detail with every milestone and its date |
complete <name> <goal> [--date] |
Mark a milestone done (defaults to today) |
uncomplete <name> <goal> |
Mark a milestone not done |
stats |
Counts of trainees and milestones, and trainees per status |
Configuration
~/.mtp-cli/.env (or environment variables; see .env.example):
| Variable | Default | |
|---|---|---|
WRITABLE_TOKEN_URL |
Required. Your token URL, of the form https://writable.site/u/<name>/tokens/<id>#secret=<secret> |
|
WRITABLE_WS_URL |
wss://b2.writable.site/_API |
WebSocket endpoint |
MTP_DB_PATH |
~/.mtp-cli/mtp.db |
SQLite cache |
MTP_CONFIG_DIR |
~/.mtp-cli |
Where .env is read from |
Finding the token by hand: log into writable.site, open DevTools, Network tab, filter ws,
refresh, open the WebSocket connection's Messages tab and find the frame containing
"useToken". The URL in that frame is the token.
Data model
- Protocol: writable.site Datapages API v0.0 over WebSocket; auth with the
useTokencall. - Trainee pages:
isMTP,lastName,firstName,team,division,mentor,status(1 not yet started, 2 in progress, 3 completed program, 4 paused, 5 left),note. - Milestone pages:
isMTP,goal(1-21),person(page reference),howDone(1 not yet, 2 done as MTP, 3 learned elsewhere, 4 waived),completedDate. - Goal names: defined in
GOAL_NAMESinmtp_cli/client.py. - Cache: SQLite in WAL mode, tables
traineesandmilestones, each row keeping the raw page JSON.
