When something is wrong¶
This page shows what we do when sfe does not work the way we expect. We ask sfe itself, with two commands: sfe doctor, which checks the tools, the sign-ins and the setup and prints the fix for each problem, and sfe status, which lists every system and whether we are signed in to it. We also learn to read the exit code, the small number sfe leaves behind when a command ends. Everything on this page only reads, so none of it can change a system.
Video, about three minutes, with narration and captions.
Before you start¶
- sfe is installed. If typing
sfegivescommand not found, we go to the first row of the table at the end of this page. - We have a terminal open. The Terminal app on the Mac is fine.
Two kinds of screens on this page
Some pictures come from our own working machine, where everything is signed in. The pictures that show a red cross or NOT ready come from a clean test home folder with nothing signed in, so we can see what a missing sign-in looks like without signing anybody out. We say which is which under each picture.
Steps¶
1. Run the doctor¶
The doctor checks one group of things at a time. A group is a section of the report, such as tools, salesforce, aws or agents. We start with the tools, because the list is short.

Every line is one check: a mark, what was checked, and on the right what the doctor found. A line that is not fine also prints a fix: line below it with the command or the step that puts it right. The last line is the verdict.
If we type sfe doctor with no group, it runs every group. That takes longer, because it tries each sign-in over the network. Two options help:
| Option | What it does |
|---|---|
sfe doctor <group> |
checks one group only, for example sfe doctor aws |
sfe doctor --offline |
leaves out everything that needs the network |
sfe doctor --fix |
applies the fixes that are safe: local, reversible, and needing no sign-in. We run this one ourselves; it is not read-only, so we do not run it in this wiki |
2. Read the marks¶
Each line starts with one of four marks.
| Mark | Colour | What it means | What we do |
|---|---|---|---|
| ✔ | green | The check passed | Nothing |
| ✖ | red | A required item is missing or broken. sfe cannot do its job without it | Run the command on the fix: line below it |
| ▲ | yellow | An optional item is missing or broken. sfe still works without it | Run the fix if we want that item. Otherwise we leave it |
| ○ | grey | Not applicable or switched off, for example an agent that is not on this Mac | Nothing |
The last line counts the red ones. When all is well it says Everything required is in place, and when something optional is missing it adds how many. When a required item is missing it says how many problems there are, how many are optional, and points to sfe setup, the guided setup that signs in to each system, one confirmed step at a time.
3. Read a sign-in problem and its fix¶
Now a Mac where nothing is signed in. We ask about Salesforce, one of the groups.

This picture is from the clean test home folder. Reading it from the top:
- The red cross is the Salesforce production login (SRM, the Student Relationship Management org). It is required, so sfe cannot read Salesforce until it is signed in.
- The line under it,
fix:, is the exact command to run. It opens the browser sign-in. We run it ourselves, and we type any password, code or approval ourselves. sfe never types a credential, and neither does an agent. - The three yellow triangles are sandboxes: DevFull, QAFull and Staging. A sandbox is a practice copy of production, used for testing. They are optional, and the note says each needs an invitation from Microsoft Entra, the company sign-in system, before the login works.
- The last line says
1 problem(s) to fix, 3 optional.
After we run a fix, we run sfe doctor salesforce again. The red cross should turn into a green tick.
4. Read the lines that say nothing to fix¶
A grey circle is not a problem. Here is one for the ORC database, which is off until someone asks for it.

Same clean test home folder. The line says off, and what to type if we ever turn it on. The verdict under it still says everything required is in place.
5. Check the agents¶
An agent is a coding assistant, such as Claude Code or Codex, that can call sfe's tools. The agents group checks that each agent on this Mac has sfe's tools, its skill and its guard. MCP is the way an agent finds tools to call. The guard is the small check that refuses any command that would change something. The picture is from our working machine.

A green tick means the agent has everything. A grey circle with agent not on this machine means that agent is not installed here, which is fine. A yellow triangle would carry its own fix line, such as sfe agent install --for claude.
6. Read the status¶
sfe status is shorter than the doctor. It says which systems are switched on, which environment each one points at, and whether we are signed in. An environment is one copy of a system: dev, qa, stage and prod. Production is the live one, so sfe marks it [PRODUCTION] wherever it shows it.
The first lines of the real answer say which configuration is in use and whether agents may write. We cut them off here with tail, so the picture shows only the table. -q leaves out the narration. On our own screen we type the command without -q and without tail.

From our working machine. The columns are:
| Column | What it tells us |
|---|---|
system |
the tool sfe reads: Salesforce, Dynatrace, AWS and the rest |
on |
whether sfe uses that system at all |
env |
the environment it points at now |
where |
what that environment is, with [PRODUCTION] on the live ones |
login |
who we are signed in as, or logged in. same sign-in as teams means the Microsoft services share one sign-in |
On the clean test home folder the same command says NOT ready and why.

From the clean test home folder. A NOT ready row names the system. We then run sfe doctor <system> to get the fix line for it.
7. Read the exit code¶
Every command ends with an exit code, a number that other programs and scripts can read. It is 0 when all is well. The help of sfe lists the rest, on its last line:

| Code | Meaning | What to do |
|---|---|---|
| 0 | ok | Nothing |
| 1 | error: the command ran and something failed | Read the message and the hint: line under it |
| 2 | usage or configuration: a mistyped command, a missing value, or sfe not set up | Check what we typed with sfe help, or finish the setup with sfe start |
| 3 | refused by the read-only policy: the command would change something | Nothing to fix. We read with sfe and make changes through the steps in How changes work |
| 4 | login needed: a sign-in is missing or expired | Run sfe doctor <system> and then the fix line it prints |
To see one, we mistype a command and then ask the shell for the code with echo $?. The shell keeps the exit code of the last command in $?.

The error says what is wrong, the hint: line says what to try, and the code is 2.
8. Read back what happened¶
Two more commands read what sfe did on this Mac. We do not run them here, because their lists show our own commands, but this is what they are for:
| Command | What it shows |
|---|---|
sfe audit |
the latest commands sfe ran on this machine, with timings, and any that were refused |
sfe audit --blocked |
only the commands that were refused |
sfe trace --last 5 |
the latest runs, each with what ran, where, the verdict and the time each step took |
What we should see¶
sfe doctorends withEverything required is in place, in green.sfe statusshows a name orlogged inin thelogincolumn of every system we use, and noNOT ready.- Commands end with exit code
0.
Troubleshooting¶
| What we see | Likely cause | What to do |
|---|---|---|
NOT ready, not logged in, or exit code 4 |
The sign-in for that system is missing or has expired | Run sfe doctor <system>. It prints the fix line. We run that command ourselves and type every password and code ourselves. Then we run the command that failed again |
command not found: sfe right after the install |
The terminal was open before the install put sfe on the PATH, the list of folders the shell looks in |
Open a new terminal. If it is still not found, run export PATH="$HOME/.local/bin:$PATH". See Install |
sfe is not set up yet, exit code 2 |
No pack is active. A pack is the folder that holds a team's systems and environments | Run sfe start, or follow Turn on the pack |
ServiceNow's answer was ... characters, more than ... sfe reads in one go |
The answer was too long to read in one go. It is not a sign-in problem | Ask for fewer rows with --limit, or a shorter window with --since |
the ServiceNow sign-in in the sfe Chrome has run out |
The ServiceNow sign-in in the sfe Chrome has run out, and a fresh page did not get back in either (sfe tries that once by itself) | Run the sfe browser open line it prints, sign in in that window, and run the command again. sfe doctor servicenow checks it with one small read |
<name> was added after this server started |
A tool was added with sfe configure while the agent was running, and sfe could not load it there |
Restart the agent, or reconnect its sfe MCP server |
| An agent does not see the sfe tools | The agent was not restarted, or sfe was not installed into it | Run sfe doctor agents and sfe agent list. Then run the fix line it prints, such as sfe agent install --for claude, and restart the agent. See Connect our agents |
refused by the read-only policy, exit code 3 |
The command would change something, and write access is closed for that system and environment | Nothing to fix, and we never work around it. sfe write status shows what is open. Changes go through the steps in How changes work |
| The answer is slow | The doctor and the status try every sign-in over the network, and the first call after a sign-in is slower. A very busy Mac is slower too | Ask for less: sfe doctor <group>, sfe doctor --offline, or sfe status --fast, which skips the login checks. sfe trace --last 5 shows how long each step took |
unknown command, exit code 2 |
A typing mistake, or a command that does not exist | Run sfe help, or sfe cheat. See Command reference |
the configuration is not the one a person accepted |
The seal is on and the setup changed. The seal is a signature on what a person decided for agents | Run sfe pack use <team> to look at the setup and accept it again |
the seal is unsound |
The seal's key file changed owner or mode | sfe seal check says what to put right |
Next¶
- Updating sfe, for when the doctor says something is out of date.
- Command reference, to find the command we need.
- Sign-ins, one page for each system we sign in to.
Last reviewed: 2026-12-03