title | shortTitle | allowTitleToDifferFromFilename | intro | versions | type | ||
---|---|---|---|---|---|---|---|
Using {% data variables.product.prodname_classroom %} with {% data variables.product.prodname_cli %} | {% data variables.product.prodname_classroom %} CLI | true | You can use `gh`, the {% data variables.product.github %} command line interface, to work with {% data variables.product.prodname_classroom %} directly from your command line. |
| how_to |
{% data reusables.cli.about-cli %} For more information, see AUTOTITLE.
You can work with {% data variables.product.prodname_classroom %} in the {% data variables.product.prodname_cli %} to:
- List classrooms
- View classroom information
- List assignments
- List accepted assignments
- View assignment information
- Clone an assignment's starter code repository
- Clone a student’s assignment repository
{% data reusables.cli.cli-installation %}
Using the {% data variables.product.prodname_classroom %} extension with {% data variables.product.prodname_cli %}
If you have not already done so, run gh auth login
to authenticate with your {% data variables.product.prodname_dotcom %} account.
To install the {% data variables.product.prodname_classroom %} extension, run gh extension install github/gh-classroom
.
To use gh
to work with {% data variables.product.prodname_classroom %}, type gh classroom SUBCOMMAND
.
As an example of a series of commands you might use to work with {% data variables.product.prodname_classroom %}, you could:
- List your classrooms:
gh classroom list
- List the assignments for a specific classroom:
gh classroom assignments
- View information for a specific assignment:
gh classroom assignment
These sections give example subcommands for each of the available operations. {% data reusables.classroom.classroom-cli-prompt %}
On the command line, use gh classroom --help
for general help or gh classroom SUBCOMMAND --help
for help with a specific subcommand.
gh classroom list
List of classrooms you own.
gh classroom view
Display the classroom ID, classroom slug, title, and other information about a classroom.
gh classroom assignments
Display a list of assignments for a classroom.
gh classroom accepted-assignments
Display a list of accepted assignments and information about the student's assignments.
gh classroom assignment
Displays assignment information.
gh classroom clone starter-repo
Clones starter code repo used by an assignment. By default, the starter code is cloned into the current directory. To clone into a different directory, use the --directory
flag. If the directory does not exists, it will be created.
gh classroom clone student-repos
Clones student repositories from a given assignment. By default, the student repositories are cloned into the current directory a directory named after the assignment slug. To clone into a different directory, use the --directory
flag. If the directory does not exists, it will be created.
By default, all student repositories are cloned. To get a different number of repositories, use the --page NUMBER
and --per-page NUMBER
flags.