Account
Account: sign up or sign in with an emailed code
The same two commands create a new account or sign in to an existing one.
-
Already signed in?
cofactor setup status --jsonsucceeds (it calls the API; a 401 means the session is dead, andwhoamialone is offline and only checks expiry): skip tosource. -
Ask the human: "What email address should I use?"
-
Ask the human for the organization name now, so
verifysucceeds the first time: "If this is a new Cofactor account, I'll name the organization<name from the product or repository>. OK, or is it an existing account?" A new account needs the name. An existing account must not be given a new one: seeworkspace. Existing account: leave--organizationout below, or pass an organization it already has. -
Show the human the Terms (https://runcofactor.com/terms) and Privacy policy (https://runcofactor.com/privacy). Ask: "Do you accept them?" Only on a yes:
bashcofactor signup --email <email> --accept-terms --organization "<name>" --json
The organization is remembered with the email until verified, so
verifybelow needs no--organization. Leave--organizationout for an existing account that has not named one. Output:{email, codeExpiresInSeconds, next}. A refusal printsError (CODE): messageplus a next step; under--jsonit is{code, error, next}(seetroubleshooting). Errors without a catalog code (for example HTTP 401 or 429) print as plain text; see troubleshooting. The email, organization and API are remembered outside the project until verified. -
Ask the human: "What is the 8-digit code from the email?" One thing only.
-
Verify (the email and organization are remembered from step 4):
bashcofactor signup verify --code <8 digits> --json
Only if the CLI still asks for an organization (an existing account with several, or a name that matched none of its own), pass
--organization <id|slug|name>(seeworkspace). Success output:{user, organization, appUrl, created, trackingUrl, next}. The session is saved; the token is never printed. -
Re-read, do not trust the exit code:
bashcofactor setup status --json
It must succeed. Then
cofactor whoami --jsonshows the user and organization.
Now give the human the tracking link: trackingUrl from the signup verify --json output in step 6. Say "Open this to watch my progress." (see overview, "Progress page"). It signs them in to the progress page without a password; it works once, within 24 hours. Show it only to the human: do not write it to files, commits, issues or chat channels, and do not paste it into a page that previews links (a preview spends it). If they say it expired or was already used, run cofactor open --no-open and give them the link it prints right away (that one lasts 5 minutes). Post a first update: cofactor setup update --step connect-agent "Signed in to Cofactor from <your coding agent>.".
If the code expired or was lost: re-run step 4 for a new code (a short wait applies between sends; the error says how long). After 5 wrong guesses a code stops working; run step 4 again for a new one, and if it says to wait, wait (up to 30 minutes after a lockout).
Accounts that require MFA, and accounts that must use the browser login (cofactor login), cannot use emailed codes: run cofactor login (the human approves in a browser), then continue at workspace.
Do not paste the code anywhere but --code. Do not run signup verify twice with guesses.
Next: cofactor setup guide workspace