The University of Hong Kong · FACULTY OF MANAGEMENT

PMGM7023 Chap.7 Working Inside GitHub Copilot CLI

- one subject, every graph, every model, every mark
4 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 12 · PMGM7023

Working Inside GitHub Copilot CLI

The boundary comes before the task

The course requires all coursework to be completed with GitHub Copilot CLI, and the first tutorial spends its time on control rather than on analysis. Starting the tool from wherever a terminal happens to open usually means starting in your home directory, which grants the widest possible reach.

The instruction is to change directory into the course folder first and start the session there, so the working boundary contains only the materials for this task.

Permission mode is the second control. The default requires approval for each action, which is slower and shows exactly what is about to happen before it happens.

Approving a class of actions for a session is reasonable once the pattern is familiar, and approving everything is reasonable only where nothing important can be damaged. For assessed work on data you cannot easily recreate, per-action approval costs seconds and removes a whole class of accidents.

Point at the file you mean

A reference to a specific file gives the system the actual content.

Without one it works from a guess about what you meant, and a guess that happens to be plausible is the hardest kind to notice. Precision about what should be read is itself an analytical judgement, and it also keeps the working session small.

Why a long session degrades

A session fills with instructions, your messages, the replies, and everything read or returned along the way, and the space available is finite.

As it fills, older material is summarised: the goals and decisions survive, the exact wording and numbers may not. That is the mechanism behind a session that starts repeating itself, loses a constraint set an hour earlier, or answers about the wrong file.

Four controls follow from that. Check what is currently occupying the session when answers start drifting.

Summarise the older material when the current task genuinely continues the previous one, re-attaching any file whose details still matter. Start a fresh session when the task has changed, since carrying an old analysis into a new question is how a constraint from a previous dataset silently reappears.

Roll back a single turn when one step went wrong, rather than arguing with the result across several more.

The record is the deliverable

Tutorial work is submitted as a Markdown file and graded on whether the work is there, so what you leave behind is assessed rather than incidental.

A session summarised three times can still produce a correct final answer while no longer containing the intermediate outputs that show how it was reached. Save outputs as you go and keep the requests that produced them beside the results.

Sessions are saved automatically, so leaving cleanly and resuming later is the normal way to work across several days.

The second tutorial asks you to write a standing instruction and save it so it applies across your work. It is graded, and it is also the change that most improves every later session, provided every clause in it would visibly change an answer.

In this chapter

What this chapter covers

  • 01

    Trusted folder and permission mode as the first two decisions

  • 02

    Pointing at files rather than describing them

  • 03

    How a working session degrades, and the four controls for it

  • 04

    Keeping a record that can be submitted and checked

Worked example · free

A standing instruction that would change an answer

Q [10 marks]. AskSia-authored practice. Write a user-level standing instruction for a management student with no coding background who works mainly with survey and operational data. Every clause must be one a system could breach. The marks shown are an AskSia study allocation, not an official University marking scheme.
  • 2Fix the audience and the level of explanation.
  • 4Impose a shape on every reply and make figures traceable.
  • 4State a working boundary and a stopping condition.
I am a postgraduate management student with no programming background, working mainly with survey exports and operational records, and I care about the decision a number supports rather than the code. Explain what you are about to do in one plain sentence, show the result, then say what it does not establish. Quote the column names and row counts you used, and quote figures from the file rather than from memory. Never infer causation from a group difference; say correlated when that is what the evidence supports. Work only inside the folder I started you in, keep originals untouched and write output to new files. If a value looks like a placeholder code, stop and ask before treating it as data.
Sia tip — Test each clause by asking whether a reply could breach it. Be accurate and helpful cannot be breached; quote the column names you used can.
Glossary

Key terms

Trusted Folder
A trusted folder is the directory a session is started in and the limit of what it may read or change without a further approval.
Session Compaction
Session compaction is the automatic summarising of older conversation once the working space fills. Goals and decisions are preserved while exact details may be lost.
File Reference
A file reference points the system at specific content instead of a description of it, so the reply is built on the actual file rather than on an assumption about it.
Slash Command
A slash command is a built-in text shortcut that runs one predefined action in a session, such as inspecting current usage or starting a fresh conversation.
FAQ

Working Inside GitHub Copilot CLI FAQ

Why start Copilot CLI in a specific folder?

Because the folder you start in is the boundary of what can be read or changed without a further approval. Launching from a default location usually means starting in your home directory, which grants the widest possible reach for no benefit. Starting in the course folder keeps the materials, the data and the output together and makes any request to go outside it visible before it happens.

My session started answering about the wrong dataset. What went wrong?

The earlier task is still present in the working session and its file is still the most specific thing available. Summarising has kept the goals and dropped the details, so the constraint you set earlier may also have gone. Start a fresh session for the new task, point explicitly at the current file, and restate the one constraint that matters rather than correcting the answer repeatedly inside the old session.

Study strategy

Exam move

Set up the course folder and your standing instruction in the first week and treat both as fixed infrastructure. Save every tutorial output as you produce it rather than at the end, and keep the request beside the result. Before each tutorial, decide which permission mode the exercise justifies and stay with it.

Working through Working Inside GitHub Copilot CLI in PMGM7023? Sia is AskSia’s AI Management tutor — ask any PMGM7023 Working Inside GitHub Copilot CLI question and get a clear, step-by-step explanation grounded in how PMGM7023 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 4 of your The University of Hong Kong subjects - and 1,000+ Bibles across every Australian university.
Sia - your PMGM7023 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works