{"id":13937779,"url":"https://github.com/education/teachers_pet","last_synced_at":"2025-07-20T00:31:06.901Z","repository":{"id":10820549,"uuid":"13096521","full_name":"github-education-resources/teachers_pet","owner":"github-education-resources","description":"Command line tool to help teachers use GitHub in their classrooms","archived":true,"fork":false,"pushed_at":"2016-10-08T07:32:09.000Z","size":398,"stargazers_count":188,"open_issues_count":35,"forks_count":74,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-07-06T12:17:55.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://education.github.com/guide","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github-education-resources.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-25T14:45:56.000Z","updated_at":"2025-06-06T15:23:41.000Z","dependencies_parsed_at":"2022-08-29T00:30:13.861Z","dependency_job_id":null,"html_url":"https://github.com/github-education-resources/teachers_pet","commit_stats":null,"previous_names":["github-education-resources/teachers_pet","education/teachers_pet"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/github-education-resources/teachers_pet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-education-resources%2Fteachers_pet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-education-resources%2Fteachers_pet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-education-resources%2Fteachers_pet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-education-resources%2Fteachers_pet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github-education-resources","download_url":"https://codeload.github.com/github-education-resources/teachers_pet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github-education-resources%2Fteachers_pet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048489,"owners_count":23868738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:52.753Z","updated_at":"2025-07-20T00:31:06.320Z","avatar_url":"https://github.com/github-education-resources.png","language":"Ruby","readme":"__Notice:__ We have [released](https://github.com/blog/2055-teachers-manage-your-courses-with-classroom-for-github) a web based tool for teachers. `teachers_pet` will remain availble, but we recommend teachers use [Classroom for GitHub](https://classroom.github.com) instead.\n\n# teachers_pet [![Build Status](https://travis-ci.org/education/teachers_pet.svg?branch=master)](https://travis-ci.org/education/teachers_pet) [![Gem Version](https://badge.fury.io/rb/teachers_pet.svg)](http://badge.fury.io/rb/teachers_pet)\n\n**WARNING: This documentation may contain unreleased changes. See [rubydoc.info/gems/teachers_pet](http://rubydoc.info/gems/teachers_pet) for the version of this README corresponding to the latest release.**\n\nCommand line tool to help teachers use GitHub in their classrooms.\n\n## Philosophy\n\nEach class is an 'organization' on GitHub. This allows the instructors (GitHub organization Owners) to create, push, pull, and administer all repositories. This achieves two goals:\n\n* Instructors can push code starter code to all students\n* Instructors can easily browse/pull student code at any time during the assignment to assist in questions, check on progress\n\nEach student is given a team in the organization. The team name is the same as the student's GitHub username.\n\n## Installation\n\n[Install Ruby 1.9.3+](https://www.ruby-lang.org/en/installation/), then run\n\n```bash\ngem install teachers_pet\n```\n\nIf you've used this tool before, get the newest version using\n\n```ruby\ngem update teachers_pet\n```\n\nTo use the latest-and-greatest code from this repository, see the instructions in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Typical workflow\n\n...when using the [sandboxing](https://education.github.com/guide/sandboxing) method with [private repositories](https://education.github.com/guide/private_repos):\n\n### Basic setup\n\n1. Create an organization (you will be an owner by default). The organization should reflect the name of your course. See [the classroom guide](https://education.github.com/guide#2-create-an-organization-for-your-class) for more info.\n1. Have each student/instructor create GitHub accounts.\n1. Create a `students` file (you can use an alternate filename and specify with the `--students` option if you like)\n    * Individual assignments: one username per line\n    * Group assignments: one team per line in the format `teamName username username username`\n1. Add the GitHub username of all instructors to an `Owners.csv` file (one per line)\n1. Run the following:\n\n    ```bash\n    teachers_pet create_student_teams ...\n    teachers_pet add_to_team --members Owners.csv ...\n    ```\n\n### Assignments\n\n```bash\nteachers_pet create_repos ...\nteachers_pet push_files ...\n# Multiple times:\nteachers_pet open_issue ...\n\n# Then, after the assignment is due,\nteachers_pet clone_repos ...\n```\n\n## Authentication\n\nThe scripts will ask for your GitHub password in order to run. If you have [two factor authentication](https://help.github.com/articles/about-two-factor-authentication) (2FA) enabled, [create a personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use) (replace `github.com` with your host for GitHub Enterprise):\n\nhttps://github.com/settings/tokens/new?description=teachers_pet\u0026scopes=repo%2Cpublic_repo%2Cwrite%3Aorg%2Crepo%3Astatus%2Cread%3Aorg%2Cuser%2Cadmin%3Aorg\n\nOnce created, specify the token using the `--token` option, or if you add the `TEACHERS_PET_GITHUB_TOKEN` environment variable to your `.bash_profile` (or equivalent – example below), it will be picked up by `teachers_pet`.\n\n```bash\n# replace YOUR_TOKEN_HERE below\necho \"\\n\\nexport TEACHERS_PET_GITHUB_TOKEN=YOUR_TOKEN_HERE\" \u003e\u003e ~/.bash_profile\nsource ~/.bash_profile\n```\n\n## Actions\n\n**To learn the options for each action, run**\n\n```bash\nteachers_pet help\n# or\nteachers_pet help COMMAND\n```\n\n### Giving others access\n\nYou may need to give other people access to various repositories using teams – the `add_to_team` command can help do this in bulk.\n\n### Creating assignments\n\nWhen using the [sandboxing](https://education.github.com/guide/sandboxing) setup, you will need to create the repositories for the students.  For each assignment, use the `create_repos` action to create a repository for each student.  The repositories are technically created per team, but if you use `create_student_teams` first, then there will be one team per student.\n\n### Forks\n\nIf you need to grab the list of users who have forked a particular repository – e.g. to use with another command – you can run the `forks` command, and the results will be written to a file.\n\n### Collaborator access\n\nGive [collaborator access](https://help.github.com/articles/what-are-the-different-access-permissions#collaborator) to everyone who has forked your repository using `add_collaborators`.  Mostly useful for GitHub demonstrations, where usernames can quickly be collected via `forks`, and then the students can be quickly given access to a repository.\n\n### Pushing starter files\n\nWhen creating repositories for students, you will often want to include boilerplate files.  After running `create_repos`, create a canonical copy of the starter files (e.g. [`.gitignore`](https://github.com/github/gitignore#readme), `Makefile`s, etc.) in a repository.  From the local clone of the repository, use the `push_files` action to place that code in the repositories for each student.  This works by creating a Git remote for each student repository, and doing a `git push` to each one.\n\n### Opening issues\n\nAfter running `create_repos`, instructors can open issues in student repos as a way to list requirements of the assignment, goals, or instructions for patching, using the `open_issue` command.\n\n### Clone repositories for grading\n\nWhen grading, use the `clone_repos` command to clone all the repositories in the organization that match the username-repository naming scheme that is generated when `create_repos` is run.\n\n### Merge all open pull requests\n\nWhen running a GitHub workshop, it's nice to be able to merge a bunch of pull requests on a particular repository all at once. `merge_pull_requests` will handle this for you.\n\n## Related projects\n\n* https://education.github.com/guide\n* https://github.com/hogbait/6170_repo_management\n* https://github.com/UCSB-CS-Using-GitHub-In-Courses/github-acad-scripts\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducation%2Fteachers_pet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feducation%2Fteachers_pet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducation%2Fteachers_pet/lists"}