|Docs

Exit codes

Every invideo CLI command ends with an exit code. Zero means it worked. Any other code says what went wrong and what to do next. The list comes from the CLI itself:

invideo help exit-codes

Codes

Read the exit code first, then the message. A refused command prints one line to stderr in plain words, even with --json; --json shapes the answer on stdout, not the error. Scripts branch on the exit code.

CodeMeaningFix
0It worked.Nothing to do.
1It failed, on invideo's side or for an unknown reason.Read the message. If it fails again, file it with invideo feedback bug.
2Usage error, or a request that cannot be done as asked.Fix the command. Check its flags with --help.
3Conflict: the timeline changed since your read. Read it again.Run invideo edit show again for a new state token, and rebuild the change.
4Not signed in: run invideo auth login.Run invideo auth login.
5A limit: credits or quota.Stop, and tell the person.
6Held by moderation: a safety review, not a refusal.Stop checking, and tell the person it is under review. Do not resend.
7Transient: nothing ran.Run the same command again.
8Needs the person's confirmation.Stop, and ask the person to confirm it in invideo.
9Update required.Run invideo update, then run the command again.
10--wait ran out of --timeout. The job goes on.Run invideo status <url> --wait again to follow it. Do not resend the command that started it.

How --wait and --timeout work with the codes

A command that starts something (a generation, an export or an upload) returns the URL to follow at once. It does not wait for the job unless you ask.

  • --wait follows a job. invideo status <url> --wait checks back until the job is over. It follows jobs in any of your projects.
  • --wait retries code 7. Only invideo status takes --wait, and while it waits it tries again when nothing ran. Any other command refuses --wait with code 2. To retry another command after code 7, run it again.
  • --timeout stops the wait. --timeout <s> stops waiting after that many seconds, with code 10. The job goes on in invideo; run invideo status <url> --wait later to pick it up.
invideo status <sequence-url> <thread-url> --wait --timeout 600

The command that started the job returns <sequence-url> and <thread-url>. invideo status follows jobs and saves nothing. To save a file, run invideo notebook show <sequence-url> --out <dir> after the job is over.

Mistakes to avoid

These are the mistakes agents make with exit codes, and what to do instead.

AvoidInstead
Running a paid command again after a timeout to check on it.Run invideo status <url> --wait on the URL it gave.
Sending the same edit change again after code 3.Read the edit again with invideo edit show, and rebuild the change on the new token.
Asking the person for a password or a code after code 4.Run invideo auth login. With no browser, run it with INVIDEO_NO_BROWSER=1.
Raising --max-credits on your own after code 5.Stop, and tell the person the price.