Table of contents
Viewing a user's profile
You can view a user's profile with fj user view. It will print their username,
full name, pronouns, follower count, website, email, bio, and join date, if that
information is available to you.
You can view someone's repositories with fj user repos, the organizations they
are a member of with fj user orgs, their followers with fj user followers,
the people they follow with fj user following, and their public activity with
fj user activity.
For all of the above commands, the username of the person to view is taken as a command line argument. If none is given, it shows your own profile info.
Following and blocking
You can follow & unfollow other users with fj user follow and
fj user unfollow, and block & unblock other users with fj user block and
fj user unblock.
SSH & GPG Keys
SSH can be managed with the fj user key commands. Given a path to an SSH
public key file, fj user key upload will upload that key to your account. Any
commits you sign with the matching private key will then show as "verified" on
Forgejo.
Note!:
Currently forgejo-cli will fail, if the SSH key of the host is unknown to
the local machine. This typically happens if you are connecting to a host
for the first time. If you see an error message like
Preparing...Error: invalid or unknown remote ssh hostkey; class=Ssh (23); code=Certificate (-17)
this is an indication of that problem. To resolve this you need to add
the SSH keys of the host to your list of known hosts. This can be done
by using git to connect to the host. It will them prompt you to
accept the SSH key of the host. Alternatively, you can directly add
the host keys to the list of trusted keys by following the steps below:
# If the .ssh directory doesn't already exist on your system
mkdir -p $HOME/.ssh
# Scan the intended host for SSH keys and add them to the known_hosts file.
# If that file already exists make sure to use >> instead of >
# Otherwise that file will be overwritten and you need to
# confirm the keys of other hosts again when you connect to them
ssh-keyscn -H [name of the host to connect to] >> $HOME/.ssh/known_hosts
fj user key list lets you see the keys you've uploaded, fj user key view
shows information on a specific public key, and fj user key delete lets you
disconnect a public key from your account. It does not delete the key from
your local machine.
GPG keys can be managed in much the same way with the fj user gpg commands.
Instead of taking a path to a key file, it takes the email associated with the
key, or the ID of the key. By default, it will verify your ownership of the key.
If you do not want it to, use --no-verify. fj user gpg verify can be used to
verify later on, if you wish.
Uploading and verify GPG keys requires the gpg binary to be present on your PATH.