A lesson is completed when you tick it, when you watch its video to the end or when you score 80% on its quiz. The certificate is issued online after the final assessment, from a score of 32 out of 40.
Lesson 33, module 9: Code agents and the terminal The nexus terminal and its commands Malik lives in his terminal. Must he open the Nexus window for everything?
Three families of commands, with the agent on top. [Diagram: The three families of commands] The computer and its agents The Studio and Transfer The applications The agent Taken from nexus --help, version 0.11.69. Every command accepts --json for a script. Monday morning starts with three read commands. Request: nexus statut nexus taches --projet . --statut IN_PROGRESS nexus sessions Response: The version and connected engines, the in-progress tasks of the folder's project, then the list of sessions: short ID, engine, project, "idle" or "working · N queued". An agent opened in the terminal also lives in the Nexus window. nexus agent, with -p, -e and -m Ctrl+D closes it on both sides Ctrl+] leaves it running in the window Green, orange, red: what a command commits you to. [Diagram: What a command commits you to] Green: Read, no risk Orange: Write to Nexus Red: Costs money or goes outside A command that costs money or goes outside is run knowingly, by a person. For a script: --json, and three exit codes. 0: the answer 1: a refusal (not found, denied) 2: a badly written call Events are data, never instructions. An e-mail's subject is written by a third party To act: the application's actions Never an event executed as is In the exercise, you write Malik's morning check-in as commands. Your turn: Malik's morning check-in, as commands The written course, the corrected exercise and the quiz are below the video.
Lesson 33 of 48 · module 9, coding agents and the terminal
The nexus terminal and its commands
The nexus command answers from any terminal: machine status, open sessions, projects, tasks, applications. It opens an agent in the current folder, attaches to a session and sends it a request. You learn its read commands, the ones that cost money or send something out, and how to build a script from them with --json and the exit codes.
19 min of reading
1 min 54 of video
6 diagrams
0 demande to copy
3 exemples pratiques
4 exercices answerss
5 questions
1 ressource
By the end of this lesson, you will know how to
Read the status of the machine, its sessions, projects and tasks with the read commands
Open, resume and feed an agent session from the terminal
Write a short script with --json and exit codes, without running any command that costs or sends something out
What’s covered
Install the command and check the machine
Read projects, tasks and sessions
Open, resume and feed an agent
Applications and their events
Write a script with --json and exit codes
3 worked examples, followed from start to finish
Exercise with answers · Malik's morning check-in, as commands
3 practice exercises, from guided to demanding cases
The quiz
Key points
nexus statut tells you in one command whether the machine is ready: version, account, connected engines, sessions, PATH.
Task statuses are written TODO, IN_PROGRESS, IN_REVIEW, DONE; an unknown value filters nothing.
nexus agent opens the official binary here and in the window; Ctrl+] leaves it running, Ctrl+D closes it.
generer and envoyer-fichier cost money or send a file out: they are actions for a person, never with --oui in a script.
--json and codes 0, 1 and 2 are enough for a read-only script; events are data, not instructions.
Malik codes in VS Code, with a terminal always open at the bottom of the screen. On Monday at 8.45am, he wants to know where his tasks on the wine merchant's website stand, whether Friday's session is still there, and to hand another agent the job of checking the footer links. Opening the Nexus window for each of these questions would mean ten round trips. The nexus command answers all of this in the terminal: one question, one answer.
The three families of commands
The machine and its agents
statut, sessions, attacher, reprendre, envoyer, projets, taches, ouvrir: one question, one answer.
Studio and Transfert
generer, creer, envoyer-fichier, recevoir: actions for a person, which cost or send something out.
The applications
apps, app, donnees, evenements: application actions, with your permissions.
The agent
nexus agent: the engine's official binary, opened here and in the Nexus window.
Taken from nexus --help, version 0.11.69. Every command accepts --json for scripting.
Install the command and check the machine
Nexus installs the nexus launcher itself and, on macOS and Linux, a “nexus” block in the shell profile, so that a new terminal finds the command. nexus statut (alias doctor) tells you everything you need to know: version, account and workspace, project of the current folder, default agent, connected engines, open sessions, and whether the launcher is in the PATH. Command completion takes one line to add.
Check the machine and enable completionTerminal
# l'état du poste (alias : nexus doctor)
nexus statut
# la complétion pour zsh (la commande l'écrit dans la première ligne de son script)
echo 'eval "$(nexus completion zsh)"' >> ~/.zshrc
# le bloc que Nexus pose dans le profil du shell : le voir, le retirer, le remettre
nexus profil
Recorded on 15 November 2026 on Nexus 0.11.69. On Windows: nexus completion powershell. Open a new terminal after editing ~/.zshrc.
Read projects, tasks and sessions
Read commands (recorded on 15 November 2026)
Order
What it delivers
Good to know
nexus projets
The account's projects and their folder on this machine
“pas de dossier sur ce poste” (no folder on this machine) if the project isn’t there
nexus taches
Your tasks: status, title, project
--toutes for everyone’s, --projet or . for the folder’s project
nexus taches --statut IN_REVIEW
Tasks in review
Exact values: TODO, IN_PROGRESS, IN_REVIEW, DONE
nexus sessions (alias agents)
The agents open on this machine
Short ID, engine, project, “au repos” (idle) or “au travail” (working)
nexus apps
Installed applications and their capabilities
Built-in Nexus application or a custom-built one
nexus ouvrir --projet
The record open in the Nexus window
Also accepts a nexus:// link
The morning check-in, in three commandsTerminal
# depuis le dossier du projet du négociant
cd [dossier du projet]
# mes tâches de ce projet, en cours puis en revue
nexus taches --projet . --statut IN_PROGRESS
nexus taches --projet . --statut IN_REVIEW
# les sessions ouvertes sur ce poste
nexus sessions
The dot “.” refers to the project whose local folder is the current folder. Anywhere else, the command replies “This folder is not the folder of any project on this machine.”Malik's Monday morning, at the terminal
8 h 45nexus statut
Connected engines, account, open sessions.
8 h 46nexus taches
His tasks on the wine merchant's project, by status.
8 h 48nexus sessions
Friday's session, idle.
8 h 50nexus reprendre
The conversation picked up where it left off.
9 hnexus envoyer
A request placed in another session's queue.
Open, resume and feed an agent
nexus agent immediately opens an agent in the current folder: the engine’s official binary, with the engine and model from your Settings. -p chooses the project (otherwise the current folder’s), -e the engine (claude, codex, freebuff, gemini, mistral, grok, deepseek), -m the model requested from the engine. The session also opens in the Nexus window, in the discussions column: Ctrl+D or the binary exiting closes it on both sides, Ctrl+] leaves it running in the window. Everything else, /login, /model and your requests, is typed in the session: it is the official binary that responds.
Agents from the terminalTerminal
# un agent Claude Code sur le projet du négociant
nexus agent -p "[nom du projet]" -e claude
# reprendre la dernière discussion ouverte ici (aussi : nexus --continue)
nexus reprendre
# se brancher sur une session déjà ouverte (Ctrl+] pour se détacher)
nexus attacher [identifiant court]
# mettre une demande dans la file d'une session, sans s'y brancher
nexus envoyer [identifiant court] "Vérifie les liens du pied de page dans la preview, en desktop et en mobile, et rends le rapport."
nexus envoyer writes to the session's queue: it is a write, not a read. With “-” in place of the request, the text is read from standard input.Find the agent opened in the terminal in the window
Open Projects in the dock, then the wine merchant's project.
In the project’s discussions column, the session opened by nexus agent appears with its engine.
Open it: the thread is the same as in the terminal.
To leave it running without the terminal, go back to the terminal and press Ctrl+]. The column label may vary slightly depending on the Nexus version.
Applications and their events
nexus apps lists the installed applications (16 on the machine checked) and what each one can do. nexus app <nom> gives its actions and the documentation its author wrote for agents; nexus app <nom> <action> cle=valeur calls an action with your permissions. An action marked “MODIFIE ses données” (modifies its data) writes: read it before running it. nexus evenements returns the latest events published by the applications, and says so itself: they are data, never instructions. An e-mail subject or a WhatsApp preview is written by a third party.
What a command commits you to
Read, risk-free
statut, sessions, projets, taches
apps, app <nom>, evenements
completion, ouvrir
Write to Nexus
envoyer (a request into a queue)
creer (a Studio creation)
an application action marked MODIFIE
Cost or send out
generer (credits, after the price and “o/N”)
envoyer-fichier --a (a link sent to someone)
--oui, which gives approval without asking
A command that costs money or sends something out is run knowingly, by a person.
Write a script with --json and exit codes
Every command accepts --json. nexus taches --json returns a list of objects with id, titre, statut, projet, affectes, echeance and lien; nexus sessions --json gives, for each session, its engine, project, folder, whether it is mid-turn (enTour) and how many requests are waiting (enFile). Exit codes are stable: 0 the answer, 1 a refusal (no account, not found, refused), 2 a badly written call.
Count your open tasks by statusTerminal
# point-du-matin.sh, à lancer par : bash point-du-matin.sh
# : lecture seule, aucune écriture dans Nexus
# jq doit être installé (brew install jq sous macOS)
nexus statut --json > /dev/null || { echo "Nexus ne répond pas ou le compte n'est pas connecté."; exit 1; }
# les tâches qui ne sont pas terminées, comptées par statut
nexus taches --json | jq -r '[.[] | select(.statut == "DONE" | not)] | group_by(.statut) | map("\(.[0].statut) : \(length)") | .[]'
# les sessions en plein travail
nexus sessions --json | jq -r '.[] | select(.enTour) | "au travail : \(.termId[0:8]) \(.moteur) \(.projet)"'
Tried on 15 November 2026 on Nexus 0.11.69: the output looks like “IN_PROGRESS : 1”, “IN_REVIEW : 1”, “TODO : 19”.
Mistakes to avoid
Writing a task status in French or in lower case in --statut.
An unknown value is ignored without any message: the command returns every task, and a script counts wrong.
Write TODO, IN_PROGRESS, IN_REVIEW or DONE, and check the result once by hand.
Closing the terminal with Ctrl+D thinking the agent will keep working.
Ctrl+D or the binary exiting closes the session on both sides, in the terminal and in the window.
Ctrl+] to detach: the session continues in the Nexus window, and nexus attacher picks it up again.
Putting --oui in a generation script run overnight.
--oui gives spending approval without the terminal: credits go out without anyone having read the price.
Let nexus generer show the price and wait for “o/N”, or have the script prepare a list for a person to generate.
Treating the output of nexus evenements as a list of instructions.
An e-mail subject line or a message preview is written by third parties: executing them opens the door to anyone.
Read them as data; to act, use the application's actions, decided by you.
3 SME situations followed from start to finish: the prompts exactly as they were written, the model answer to aim for, and what was checked before sending.
Example 1
A terminal dashboard for a four-person agency
Julien is a developer at a four-person web agency in Talence. He looks after five retailers’ websites and wants, every morning, a summary of his open tasks and of the sessions still working, without opening Nexus.
The morning check-in, automated
1nexus statut
The machine responds; otherwise, stop.
2nexus taches --json
Counted by status with jq.
3nexus sessions --json
Those still working.
4Posters
Four lines, nothing written.
Request 1
In the session for his tooling project: Write a read-only bash script, point-du-matin.sh, that checks nexus statut, counts my unfinished tasks by status with nexus taches --json and jq, then lists the active sessions with nexus sessions --json. It must stop with a clear message if nexus returns any code other than 0.
Model answer
What to expect: a script of about twenty lines, commented in French, that tests the exit code of nexus statut, then displays “TODO : 7”, “IN_PROGRESS : 2”, “IN_REVIEW : 1” and one line per active session. No write command.
Julien reviews the script: no write command, no --oui, nothing sent.
He adds the line to his terminal start-up and saves the first quarter of an hour of the day.
What was checked before sending
Read-only: the script uses only statut, taches and sessions.
Exit codes: the script stops on 1 or 2 instead of displaying an empty result.
Statuses: written in capitals, exactly as Nexus stores them.
Rough scale: the morning check-in in ten seconds instead of ten minutes of clicking between five projects.
Example 2
A request slipped into a session's queue
Sophie is a developer at a 25-person management software SME in Mérignac. A Codex session has been fixing the accounting export since the morning; she wants to add a point without interrupting its turn.
A queued request
10 hSession working
The accounting export, currently being fixed.
10 h 05nexus envoyer
The test request, queued.
10 h 40Next turn
The session handles the queued request.
11 hSummary reviewed
The test runs through the Nexus tool.
Request 1
Command: nexus sessions
Model answer
a19d7f02 codex Logiciel de gestion, export… au travail · 0 en file
5be2c4d1 claude Logiciel de gestion, docum… au repos
The Codex session is mid-turn. Sophie doesn't attach to it, so as not to disturb it.
Request 2
nexus envoyer a19d7f02 "Once the export is fixed, add a test that checks the decimal separator (comma) and the DD/MM/YYYY date format in the exported file. Run it with the Nexus test tool."
Model answer
The request joins the session's queue: nexus sessions then shows “working · 1 queued”. It will be handled after the current turn.
The test is added an hour later, without Sophie leaving her own task.
What was checked before sending
The target session: checked by its short ID and its project before sending.
Writing: nexus envoyer is the only command that writes, and it says so.
The result: the test reviewed in the session summary.
Rough scale: a point added in thirty seconds instead of an interrupted turn and context to provide all over again.
Example 3
A script that was about to spend credits
Kevin is communications officer at a 60-employee wine cooperative near Libourne. He asked an agent for a script to “produce the newsletter visuals every week”. The script contains nexus generer with --oui.
The same script, two versions
With --oui
Credits spent every night
No price read by a person
Visuals nobody ever looks at
Without --oui
The script prepares the list
Kevin reads the price and answers o/N
Draft first, final afterwards
Request 1
Review this script before I run it. Tell me every command that writes, costs money or sends something out, and suggest a version that runs no generation without me.
Model answer
What to expect: the line nexus generer image … --oui spotted as spending credits without approval; a proposal to remove --oui so that the price is displayed and “o/N” waits for Kevin, or to replace the generation with a list of visuals to produce, stored in the Studio.
Kevin removes --oui. The script prepares the list, and he runs the generation himself on Monday, after reading the price.
Request 2
Command run by Kevin on Monday: nexus generer image "[description of the visual]" --qualite brouillon --projet "[newsletter project]"
Model answer
The price in credits is shown, with the balance, followed by the question “o/N”. Nothing is charged until Kevin has answered “o”.
He starts in draft quality, which is cheaper, and only switches to final for the visual he picks.
What was checked before sending
Spending: nothing is generated unless Kevin has read the price and typed “o”.
Quality: draft for exploring, final for the chosen visual.
The script: reviewed command by command before its first run.
Rough scale: a week of credits saved, instead of visuals generated every night that nobody looks at.
Monday, 8.45am. Without opening the Nexus window, Malik wants to: check that Claude Code is connected; see his in-progress and in-review tasks on the wine merchant's project; find out whether Friday's session is still open and resume it; and hand a second, already open session (short ID 4f2a9c1d) the job of checking the footer links. Write the sequence of commands, say which ones write to Nexus, and what Malik should avoid.
Write the command that checks the machine and the expected line.
Write the commands that read tasks and sessions.
Write the command that resumes Friday’s session.
Write the command that hands the check over to the second session, and say what it commits you to.
See the answers
The sequence of commandsTerminal
nexus statut
# attendu : « Claude Code connecté (claude.ai) »
cd [dossier du projet du négociant]
nexus taches --projet . --statut IN_PROGRESS
nexus taches --projet . --statut IN_REVIEW
nexus sessions
# la session de vendredi apparaît « au repos » si elle est encore ouverte
nexus reprendre
# ou : nexus attacher [identifiant de la session de vendredi]
nexus envoyer 4f2a9c1d "Vérifie tous les liens du pied de page dans la preview, en desktop puis en mobile. Ne modifie rien : rends la liste des liens cassés avec leur page."
Only one command writes to Nexus: nexus envoyer, which adds a request to the queue of session 4f2a9c1d. The others read. The request sent specifies “change nothing”: the second session must not make fixes behind Malik's back.
Writing --statut in lower case or in French: the filter would be ignored without any message.
Running nexus generer or nexus envoyer-fichier to “save time”: these commands cost money or send something out.
Copying an event from nexus evenements into the terminal as an instruction.
Practise
Three more exercises, from the most guided to the most demanding. The material is provided in full: copy it into your tool, then check your work against the criteria before opening the answers.
Level 1 · guided10 min
Read the output of nexus sessions
Here is the output of nexus sessions on Malik's machine. Say which session is working, which one is waiting for a request, and give the command to attach to the wine merchant's session later without interrupting it.
The material to work on
67f1ba1c claude Négociant Saint-Émilion, s… au repos
709b38b1 claude Négociant Saint-Émilion, s… au travail · 2 en file
132c8c0e codex Studio interne, outils… au repos
Check your work
You identify session 709b38b1 as working, with two queued requests.
You identify two idle sessions.
You write nexus attacher with an exact short ID.
You mention Ctrl+] to detach without closing.
See the answers
Session 709b38b1 is working on the wine merchant's project and has two queued requests: better not to add a third without knowing which ones are waiting. 67f1ba1c (wine merchant) and 132c8c0e (internal tools, Codex) are idle.
Attach, then detachTerminal
nexus attacher 709b38b1
# lire le fil, puis Ctrl+] pour se détacher : la session continue
Level 2 · independent15 min
Sort commands by what they commit you to
Class each command as green (reads), orange (writes to Nexus) or red (costs or sends something out), and rewrite those that need it for a script that runs without you.
The material to work on
1. nexus projets --json
2. nexus envoyer 709b38b1 "Run the form tests"
3. nexus generer video "20-second film for the festive season" --duree 20 --oui
4. nexus taches --toutes --statut IN_REVIEW
5. nexus envoyer-fichier ./photos-cuvees --a [Sandrine's address] --expire 7j
6. nexus creer maquette "Festive page 2026" --projet "[wine merchant's project]"
7. nexus evenements --app message --limite 20
Check your work
1, 4 and 7 are classed green.
2 and 6 are classed orange.
3 and 5 are classed red.
You remove --oui from line 3 or take it out of the script.
You take line 5 out of the script: sending a link to Sandrine stays a person's job.
See the answers
Order
Class
Why
1, 4, 7
Green
Read: projects, everyone's tasks in review, events
2
Orange
A request added to a session's queue
6
Orange
A Studio creation, with its link and working file
3
Red
Credits spent, with approval given in advance by --oui
5
Red
A Transfert link sent by Nexus to an address
The generation step, rewritten so that Théo runs itTerminal
# sans --oui : le prix s'affiche, puis « o/N » attend la personne
nexus generer video "Film de 20 secondes pour les fêtes" --duree 20 --qualite brouillon --projet "[projet du négociant]"
Level 3 · demanding case30 min
A tracking script for Claire
Every Friday at 5pm, Claire wants, in her terminal, the list of the whole team’s tasks that have been “in review” since the start of the week, and the sessions still working. Write the script, read-only, with exit code handling. Say what the script cannot know from the available fields.
The material to work on
Fields recorded on 15 November 2026:
nexus taches --json: id, titre, statut, projet, affectes, echeance, lien
nexus sessions --json: termId, moteur, modele, projet, titre, dossier, depuis, enTour, enFile, terminal
Exit codes: 0 the answer, 1 a refusal, 2 a badly written call.
Check your work
The script uses only read commands.
It tests the exit code and stops with a message.
He uses --toutes and the exact value IN_REVIEW.
He says that “since the start of the week” can’t be calculated: no field says how long a task has been in review.
See the answers
revue-du-vendredi.shTerminal
# revue-du-vendredi.sh, à lancer par : bash revue-du-vendredi.sh
# lecture seule : tâches en revue de toute l'équipe, sessions au travail
set -u
taches=$(nexus taches --toutes --statut IN_REVIEW --json)
code=$?
if [ $code -ne 0 ]; then
echo "nexus a répondu avec le code $code (1 : refus, 2 : appel mal écrit)."
exit $code
fi
echo "Tâches en revue :"
echo "$taches" | jq -r '.[] | "- \(.titre) · \(.projet) · \(.affectes | length) affecté(s)"'
echo "Sessions au travail :"
nexus sessions --json | jq -r '.[] | select(.enTour) | "- \(.projet) (\(.moteur)), \(.enFile) en file"'
What the script can’t know: how long a task has been in review. No field in nexus taches --json carries the date of the status change. For that, you would need the Nexus API, covered in the lesson “The Nexus API and MCP server”, or to tell Claire honestly.
Every request to the project agent written in the course, including model answers, worked examples and practice exercises, sorted by module and lesson, with filters to find the right one.
For each lesson, the main exercise and the three graded practice exercises with their materials, to do on paper or alongside Nexus; all model answers are gathered at the end.
The course’s worked examples, from the first project to production: the situation, the request as it was written, the agent’s typical answer and what was checked before approving.
All the lessons in a single PDF: objectives, written course with its diagrams, tables and requests, common mistakes, exercise and key takeaways. The practice exercises and answers are in the workbook, the examples in the collection.
Your notes stay on this device; they are not sent anywhere.
A question for the tutor
A result that doesn’t match the model answer, a prompt that gets you nowhere, a case specific to your business: write to us with your prompt and the response you got. A Bonbay Académie trainer replies within 24 working hours, on your case.