Prompts
At a terminal, commands that change data ask for the values that you do not give. All commands ask in the same way.
- Priority. Flags take priority over
--from-file PATH(-F,-for stdin). The file takes priority over prompts. The CLI asks only for the missing values. - Sign-in check. Before the first question,
create,editanddeletemake sure that you are signed in. - Go back. To go back to the previous question, press ↑ in a text question (or ← at the start of the line), or ← in a list. The previous answer stays as the start value. Later answers stay. The CLI skips questions that a flag or file answered.
- Review. After it asks a question, the command shows what it will send and asks you to confirm. ← goes back.
- Long text. Type a description on one line, or press Ctrl+E to write it in your editor (
$VISUALor$EDITOR). A one-line description shows in the line for you to edit. An empty line removes it. A longer description is not shown in the line. Press Enter on the empty line to keep it. - Errors. If the API refuses a value that you typed (HTTP 400), the CLI shows the reason and asks for that value again.
- Cancel. Press Esc (or q in a list). The CLI shows "Cancelled; nothing was changed." and exits with code 1. When you must type a name to confirm, Enter on an empty line also cancels. Ctrl+C stops at once, with exit code 130.
- Drafts. If the send fails in another way (for example, the ID is taken, there is no connection, the session has expired or the server fails), the CLI saves your answers as a draft. Run the same command again to use them. Flags take priority over the draft. You can also give the draft file with
--from-file. After a successful send, the CLI deletes the draft.
Drafts are in your OS's application state folder:
| Platform | Path |
|---|---|
| Linux | ~/.local/state/source-coop/drafts ($XDG_STATE_HOME) |
| macOS | ~/Library/Application Support/source-coop/drafts |
| Windows | %LocalAppData%\source-coop\drafts |
The CLI does not ask questions if stdin or stderr is not a terminal, or if SOURCE_PROMPT_DISABLED is set. It sends the values that it has, and the API tells you which ones are missing. Then delete, revoke and leave need --yes.