CorfedoCorfedoDocs

Ask from the CLI

Authenticate for AI, ask about selected repositories and control output, continuation and cancellation.

corfedo ask sends one message to Corfedo AI. The connection needs both Ask Corfedo AI and Search and read code, which auth login requests. If you cleared either on the Authorize page, ask exits with missing_scope.

corfedo auth login --api https://corfedo.example.com/
corfedo ask "How are search requests routed?" --repo acme/search
corfedo ask "Which modules call that code?" --continue

Use your workspace URL in place of the example. To sign in again to an existing profile, pass --profile NAME --replace.

An API key with Ask Corfedo AI also works with a CLI profile. Corfedo AI answers only while an administrator has turned it on for the API. See Request access to Corfedo AI.

Select a conversation and sources

corfedo ask "Explain the next step" --conversation 11111111-1111-4111-8111-111111111111
corfedo ask "Explain indexing" --repo acme/search --repo 'acme/web-*'

--continue uses the last conversation remembered for the selected CLI profile. It cannot be combined with --conversation. A CLI profile with no remembered conversation reports no_previous_conversation.

Repeat --repo to restrict sources by name or glob. Quote globs to keep your shell from expanding them. Corfedo AI answers the CLI with the AI profile chosen for the API, see AI profiles. --profile NAME picks the CLI connection, not the AI profile.

Output

OptionOutput
Default textProvisional progress on a terminal, replaced by the final answer
--json or --format jsonlEvents as JSON lines, followed by a result record
--format jsonOnly the result envelope
--no-streamWait without streaming progress

When output is redirected, only the answer is printed. JSON results retain the answer, rendered citations, revisions, outcome and usage.

corfedo ask "Where is request validation?" --json
corfedo ask "Summarize validation" --format json --no-stream

Timeouts and cancellation

--timeout limits each request, not the whole answer. A long answer can end with reauthorization_required when the sign-in can no longer be renewed. Sign in again with --replace.

The first Ctrl+C cancels the answer and exits 130. A second exits at once.

Exit codes

CodeMeaning
0Completed answer
7Answer cut short by the run's budget, time or cost limit
11Run ended in failure
130Cancelled
2Usage error or conflict, including conversation_busy, client_message_conflict, other_source, profile_unavailable or an ambiguous repository
3Sign in again (authentication_required, reauthorization_required)
4Missing permission (missing_scope), named in the message, or Corfedo AI turned off for the CLI (permission_denied)
5Repository not found
6Monthly AI spending limit reached, or the answer stream failed

--allow-partial changes a limited outcome's exit 7 to 0 and preserves the outcome in output. spending_limit_reached reports the limit reset time. Repository resolution errors include candidate names. See conversation management to inspect previous answers.

On this page