CorfedoCorfedoDocs
Reference

CLI commands

Every corfedo command with its arguments and main options, the options every command takes, and the CLI's exit codes.

The corfedo CLI talks to one workspace through a profile. corfedo --help and corfedo COMMAND --help print the options of the installed version. corfedo capabilities lists the commands it implements, and corfedo schema --command NAME prints a command's request fields. Task guides are under CLI.

Options of every command

OptionDefaultMeaning
--profile NAMEThe default profileThe profile to use for this run
--format text|json|jsonltextOutput format, see Output formats
--timeout SECONDS30, and 5 minutes for auth loginTime limit of each request, 1 to 300. For ask it limits each request, not the whole answer.
--non-interactiveOffFail with interaction_required instead of opening a browser
--allow-partialOffExit 0 instead of 7 for a partial result
--max-output-bytes N8 MiBOutput limit of a command, 4 KiB to 64 MiB. A single result over it fails with output_limit_exceeded and exit 2.
--request FILEThe complete API request as JSON, or - for standard input. Replaces the arguments. Read commands only.
--helpPrint the command's options

Set up and profiles

CommandWhat it does
versionShows the CLI version and its API contract
update [--check]Updates the CLI itself to its latest release, or only reports one with --check. A Corfedo installation updates with install.sh update.
capabilitiesLists the implemented commands and request schemas
schema --command NAMEShows a command's request schema
auth login --api URL [--replace] [--client-id ID] [--expected-tenant ID]Signs in with the browser and saves the profile. --replace signs in again to an existing profile. --client-id overrides the client ID, and --expected-tenant requires that workspace.
auth configure-api-key --key-file PATHSaves a profile for an API key file
auth statusShows the profile's local credential state without contacting the workspace
auth logoutDeletes the profile's local credentials and keeps the profile
auth disconnect --yesReports that remote revocation is not available, and exits 10. Revoke access in Connect › Manage connections.
profile list, profile show NAMELists or shows local profiles
profile use NAMEMakes a profile the default
profile remove NAME --local-only --yesForgets a profile on this machine
connection showShows the profile's connection to the workspace

Search and read

CommandWhat it does
repositories list [--limit N] [--cursor CURSOR] [--all]Lists the repositories you can read, 25 per page by default
scope lookupLooks up repository, saved context and owner names by prefix. Takes --request, see corfedo schema --command 'scope lookup'.
search --query QUERYSearches code with the search syntax
read REPO PATH [--lines START:END|START:] [--rev SHA] [--max-bytes N]Reads a file. Lines are one-based and inclusive.
tree REPO [DIR] [--rev SHA]Lists a directory
outline REPO PATH [--rev SHA]Lists the declarations in a file
symbols NAME [--match exact|contains|regex] [--kind KIND] [--repo NAME|GLOB ...]Finds declarations by name across repositories
chunks REPO PATH --span START:END ... [--rev SHA]Reads snippets around byte spans, as search returns them
completionsSuggests file name, path or symbol prefixes. Takes --request, see corfedo schema --command completions.

REPO is a canonical name such as github.com/acme/payments, or acme/payments when only one repository you can read has that name. --rev takes a full commit SHA or a unique prefix of at least seven characters. Without it, a command reads the commit the repository serves now. See Search and read.

Saved contexts

CommandWhat it does
contexts listLists your contexts, then the workspace's
contexts show NAME|ID [--workspace]Shows a context and its repositories
contexts create NAME [--workspace] [--description TEXT] [--repo NAME ...] [--repo-id ID ...]Creates a context
contexts change NAME|ID [--workspace] [--name NAME] [--description TEXT] [--add NAME ...] [--add-id ID ...] [--remove NAME ...] [--remove-id ID ...] [--remove-inaccessible]Renames a context or changes its description or repositories
contexts delete NAME|ID [--workspace] --yesDeletes a context

A name means your own context before a workspace context of the same name. --workspace selects the workspace's. Repositories are given by exact name or ID, and patterns such as * are rejected. When the context changed meanwhile, change and delete exit 2 with conflict. See Contexts.

Dependencies and security

CommandWhat it does
dependencies REPO [--query TEXT] [--ecosystem E] [--package NAME] [--version V] [--directness direct|transitive|unknown] [--vulnerable]Lists a repository's packages
packages complete [PREFIX] [--ecosystem E] [--name NAME] [--version-prefix V]Completes package names, or lists an ecosystem's most used packages
packages usage ECOSYSTEM/NAMECounts the repositories that use a package, per version
packages uses ECOSYSTEM/NAME [--origin installed|declared|action --version V] [--revision R]Lists the repositories that use a package, and where
security findings [--repo NAME] [--state S ...] [--severity S ...] [--classification C ...] [--ecosystem E] [--package NAME] [--advisory ID] [--query TEXT] [--version V] [--sort severity|newest|repository]Lists security findings
security finding REPO FINDING-IDShows a finding with its evidence
security package ECOSYSTEM/NAMEShows a package's findings per version
security advisories [--query TEXT] [--severity S ...] [--affected] [--ecosystem E] [--package NAME]Searches advisories
security advisory ADVISORY-IDShows an advisory

A package is written ecosystem/name, such as npm/react or github-actions/actions/checkout.

Corfedo AI

CommandWhat it does
ask "TEXT" [--conversation ID | --continue] [--repo NAME|GLOB ...] [--json] [--no-stream]Asks Corfedo AI and prints the answer, see Ask from the CLI
conversations list [--limit N] [--cursor CURSOR]Lists conversations, most recently active first
conversations show ID [--limit N] [--before-ordinal N]Shows a conversation's messages and answers
conversations delete ID --yesDeletes a conversation

Paging

The dependency and security list commands, conversations list and repositories list take --limit and --cursor for one page. search, tree and outline continue from the continuation of a --request file. --all with --format jsonl reads every page. --all works on repositories list, search, tree, outline, dependencies, packages uses, security findings and security advisories. --max-pages (default 20) and --max-output-bytes stop it early. See Read every page.

Exit codes

CodeMeaning
0Complete result, including a page with more pages after it
1Unexpected internal error
2Usage error, including ambiguous_repository, profile_required and conflict
3Authentication needed: authentication_required, reauthorization_required or interaction_required, or connection_mismatch when the profile, key or session belongs to another workspace
4Permission denied, including missing_scope
5Not found or stale: an unknown repository, path, context, finding or advisory, or a revision or continuation that is no longer served
6Service unavailable, a timeout, a spending limit reached, or dependencies or security coverage not available
7Partial result, or an answer limited by a budget
8The CLI and the workspace do not agree on the API contract. Update the CLI.
9Local file or credential storage failed, including an unsafe key file
10Remote revocation could not be confirmed
11Corfedo AI run failed
130Cancelled

Ask from the CLI lists the codes of ask.

On this page