Easily book times in moco via a Terminal UI script. Especially helpful for repeatedly occurring stuff.
- Install uv (very nice python wrapper).
- Fill both
moco.yamlandsecret.yamlwith some activities that you often do. - Fill the project list manually, since most of the users won't have permissions to read those via API. This will help you navigate later.
- Run the script!
uv run --script moco.py - Press 'q' to quit.
Select if you want to book the fast 5 days or the next 7 days
Select a date
Select a project
Select a task
Select the time you've spend
Select an activity
Repeat!
Since most of the time you do not have full access, here is a trick: Create a manual entry in moco and perform this curl request:
curl --silent --request GET \
--url 'https://mycompany.mocoapp.com/api/v1/activities?from=2025-02-28&to=2025-02-28' \
--header 'authorization: Token token={{token}}'If you are lazy and have jq installed, use this to get the project ID and task ID:
curl --silent --request GET \
--url 'https://mycompany.mocoapp.com/api/v1/activities?from=2025-03-03&to=2025-03-03' \
--header "authorization: Token token=${token}"| jq -r '.[] | "\(.project.id) \(.project.name) \(.task.id) \(.task.name)"'





