Command-line tool and AI agents
schoolstack-cli runs the same actions as the web pages, as a chosen user. While the site runs,
it sends each change to the running server through /var/lib/schoolstack/school.sock (only root
and the schoolstack account can use it, so run the tool with sudo), so nothing needs to stop;
when the site is stopped, it changes the data files itself.
schoolstack-cli --data FILE adduser "Name" email "password"creates an account.schoolstack-cli --data FILE set-password email "password"gives an account a new password.schoolstack-cli --data FILE make-admin emailmakes an account an administrator (on the server, useschoolstack-make-admin).schoolstack-cli --data FILE import-people --as admin-email people.csv > new-accounts.csvadds everyone in a spreadsheet file, the same file as Add many people (name, email, role, class code), as that administrator. Nobody is added if a row has a mistake (the rows to fix are listed). It writes each new person's temporary password tonew-accounts.csv: give them out privately, then delete the file.schoolstack-cli --data FILE exec --as email ACTION '{json}'runs an action, for exampleexec --as tess@example.org class.create '{"name":"Art"}'.schoolstack-cli --data FILE exportprints the whole school as one file (the backups use it).schoolstack-cli --data FILE mcpstarts the MCP server, so AI agents can use every action.command.listandcommand.describe(queries) list the actions and their parameters.
Every action is listed in the reference.
Example: To make a class for a new teacher without signing in, the owner runs
sudo schoolstack-cli --data /var/lib/schoolstack/school.json exec --as tom@school.org class.create '{"name":"Physics"}';
Tom sees "Physics" on his Classes page straight away.
Related: Server options · Where the data lives