CorfedoCorfedoDocs

Sign in and profiles

Connect the Corfedo CLI to a workspace with browser sign-in or an API key file, and switch between saved profiles.

A CLI profile is a named connection to one workspace. It holds the workspace address and how to sign in, never a password or token. Commands use the default profile unless you pass --profile NAME.

Sign in with your browser

corfedo auth login --api https://corfedo.example.com/

The CLI opens your browser and prints the sign-in link. Sign in, choose which repositories the CLI may read and select Allow. Approve access explains the repository choice.

The CLI asks for every permission. Under Permissions each one is a checked box. Clear any you do not want the CLI to have.

To sign in to a second workspace, name its profile:

corfedo auth login --api https://corfedo.example.com/ --profile work

The CLI keeps credentials in the macOS Keychain or the Linux desktop keyring, or else in files only your user can read under ~/.config/corfedo. It renews them while you work.

Sign in on a machine without a browser

On Linux without a desktop, for example over SSH, the CLI only prints the link.

  1. Open the link in a browser on any computer and sign in.
  2. The browser goes to a http://localhost:…/corfedo/callback page that does not load. Copy its address and paste it into the CLI after Address:.

If you forward that port over SSH instead, sign-in finishes without pasting.

Check the result

corfedo connection show

Check: it prints the connection's workspace, client, expiry and repositories.

Use an API key file

API keys suit CI, scripts and services that run without a person.

  1. In your workspace, open Connect › Manage connections and select Create API key.
  2. Create the key and select Download key file. This is the only time you can download it.
  3. Store the file where only you can read it, then configure a profile with its absolute path:
chmod 600 /home/me/.config/corfedo-ci.json
corfedo auth configure-api-key --key-file /home/me/.config/corfedo-ci.json --profile ci
corfedo connection show --profile ci

The workspace address comes from the key file. The file must be a regular file, not a symbolic link, and not readable by group or others. The key keeps the permissions chosen when it was created.

Switch and manage profiles

corfedo profile list lists profiles and marks the default. corfedo profile use NAME changes the default, and --profile NAME picks a profile for one command. CLI commands lists the other profile and auth commands.

To sign in again to an existing profile, for example to change its permissions, pass --replace with the same workspace address:

corfedo auth login --api https://corfedo.example.com/ --profile work --replace

Remove access

For a browser sign-in, corfedo auth logout deletes the credentials on this machine. corfedo profile remove NAME --local-only --yes forgets any profile, also an API key profile. Neither revokes access. To revoke access, open Connect › Manage connections and select Revoke for the signed-in client or API key.

Troubleshooting

MessageFix
credential_store_unavailableThe profile's keyring is locked, for example over SSH. Sign in to the desktop to unlock it, or sign in again with --replace.
That address does not finish this sign-inPaste the whole address from the same sign-in, starting with http://localhost. If the sign-in took longer than five minutes, run auth login again.
profile_requiredPass --profile NAME, or set a default with corfedo profile use NAME.
authentication_required or reauthorization_requiredSign in again with --replace.
missing_scopeThe connection lacks a permission the command needs. The message names it. Sign in again with --replace and keep it checked.
profile_existsAdd --replace to sign in again to that profile.
workspace_moved (a warning)The workspace has a new address, and the old one still works. Sign in again with the new address.
Browser sign-in fails before you can sign inThe installation may not reach https://clients.corfedo.ai/cli.json, which describes the CLI. Ask whoever runs Corfedo to allow HTTPS to it.

On this page