> For the complete documentation index, see [llms.txt](https://docs.nuvolos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nuvolos.com/how-to-guides/workflows-for-instructors/setting-assignments/course-evaluation-using-cli.md).

# Course Evaluation using CLI

<mark style="color:$primary;">**Outcome**</mark>\
You generate a table that links each Student Instance ID in a Space to the corresponding student's name and email, using the Nuvolos CLI from a terminal inside a Nuvolos Application - giving you a mapping you can match against assignment hand-ins for grading or evaluation.

<mark style="color:$primary;">**Before you start**</mark>

* **Owner** or **Editor** access to the course Space.
* A Nuvolos Application with terminal access (e.g., the Terminal Application).
* &#x20;You know which course Space you want to generate the mapping for.

When grading or auditing assignment activity, you often need to connect a Student Instance ID - for example single\_user\_inst\_1b114824 - back to the student who owns it. This guide shows how to generate that mapping yourself, using the Nuvolos CLI from a terminal inside a Nuvolos Application.

This is a self-serve workflow: once set up, you can rerun it at any point in the course - before each deadline, at the end of the term, or whenever your evaluation system needs a refresh.

**Who this is for**

Instructors and teaching assistants who need a list connecting each Student Instance in a course Space to the corresponding student's name, email, and role.

**How it works**

There is no single API call that returns the full mapping in one step. Instead, the process:

1. Lists every Instance in the Space, excluding the Master Instance.
2. For each Instance, lists its members and keeps only those explicitly added to that Instance - filtering out roles inherited from the Space or organization level.
3. Combines the results into a single table with name, email, status, role, and Instance ID.

The steps below automate this end to end.

{% stepper %}
{% step %}
**Create an API key**

1. Open your Nuvolos user profile and go to API access.
2. Create a new API key.
3. Start (or restart) a Nuvolos Application with terminal access inside the course Space, so the CLI operates on the correct set of Instances.

{% hint style="info" %}
Tip:   For a general walkthrough of key creation and CLI setup, see the CLI installation guide referenced at the end of this page.
{% endhint %}
{% endstep %}

{% step %}
**Install the required tools**

From the terminal, install jq (used to parse JSON output) and the Nuvolos CLI:

{% code overflow="wrap" %}

```sql
mamba install -c conda-forge --freeze-installed jq
pip install --upgrade nuvolos-cli
```

{% endcode %}

Using `--upgrade` ensures you always run the current CLI release rather than a version pinned to a specific point in time.
{% endstep %}

{% step %}
**Generate the mapping**

Run the following script. It loops through every non-master Instance in the Space, pulls the explicitly assigned members of each, and formats the result as a Markdown table.

{% code overflow="wrap" %}

```sql
for inst in $(nuvolos instances list -f json | jq -r '.[] | select(.slug != "master") | .slug'); do
  nuvolos instances members -i "$inst" -f json \
    | jq --arg inst "$inst" '.[] | select(.role_source == "EXPLICIT") + {instance: $inst}'
done | jq -r -s '
  ["name", "email", "active", "role", "role_source", "instance"],
  ["---", "---", "---", "---", "---", "---"],
  (.[] | [.name, .email, .active, .role, .role_source, .instance] | map(tostring))
  | "| " + join(" | ") + " |"
'
```

{% endcode %}

{% endstep %}
{% endstepper %}

The output is a Markdown table:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>name</strong></td><td valign="top"><strong>email</strong></td><td valign="top"><strong>active</strong></td><td valign="top"><strong>role</strong></td><td valign="top"><strong>role_source</strong></td><td valign="top"><strong>instance</strong></td></tr><tr><td valign="top">Jane Doe</td><td valign="top">jane.doe@example.edu</td><td valign="top">true</td><td valign="top">EDITOR</td><td valign="top">EXPLICIT</td><td valign="top">single_user_inst_1b114824</td></tr></tbody></table>

Saving or reformatting the output:

* `> mapping.md`  - append this to the command above to save the result to a file instead of printing it to the terminal.
* Export as CSV - the final `jq` block can be adapted to comma-separated output, useful if your evaluation system expects CSV rather than Markdown.

**Reading the results:**

* Each row represents one student explicitly assigned to a Student Instance.
* The instance column is the Instance ID (or slug) you'll match against your assignment records.
* If a Student Instance shows more than one row, this is usually a teaching assistant or test account rather than a data error - the role column will typically make this clear.

### Where to go next

* For creating a Nuvolos API key and installing the CLI, see [CLI installation guide](https://docs.nuvolos.com/reference/nuvolos-cli-and-python-api/installing-the-cli).
* For the full command reference, including options beyond what this page uses, see [Using the CLI](https://docs.nuvolos.com/reference/nuvolos-cli-and-python-api/using-the-cli).
* For listing and filtering Instances or Instance members directly, see [Listing Instances](https://nuvolos-cli.readthedocs.io/en/latest/instance_management/#listing-instances) and [Listing Instance members](https://nuvolos-cli.readthedocs.io/en/latest/instance_management/#listing-instance-members).
* For reviewing and exporting grades once hand-ins are matched to students, see [Assignments, grading, and feedback](https://docs.nuvolos.com/how-to-guides/workflows-for-instructors/setting-assignments).
