Skip to content
4 min read

fj repo

Work with repositories

fj repo [OPTIONS] <COMMAND>

Every command also accepts the global flags: --host, --debug, --no-pager, --json-fields.

fj repo list

List repositories you have access to on the current host

fj repo list [OPTIONS]

Options

  • -L, --limit <LIMIT> — Maximum number of repositories to fetch [default: 30]
  • --page <PAGE> — Page of results to fetch [default: 1]
  • -s, --search <SEARCH> — Search query (uses /repos/search)
  • --json — Emit raw JSON instead of a table

fj repo view

View a repository

fj repo view [OPTIONS] [REPO]

Arguments

  • [REPO]owner/name slug. Inferred from the git remote when omitted

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --json — Emit JSON instead of a table
  • --web — Open the repo’s web page

fj repo clone

Clone a repository over git

fj repo clone [OPTIONS] <REPO> [DIR]

Arguments

  • <REPO>owner/name slug
  • [DIR] — Optional destination directory

fj repo create

Create a new repository

fj repo create [OPTIONS] <REPO>

Arguments

  • <REPO>[owner/]name. Without an owner, the authenticated user is used

Options

  • -d, --description <DESCRIPTION> — Repository description
  • --private — Make the repository private
  • --init — Initialize with a commit
  • --clone — Clone the new repo into the current directory
  • --web — Open the new repo in your browser

fj repo fork

Fork a repository

fj repo fork [OPTIONS] [REPO]

Arguments

  • [REPO] — Source repo owner/name. Inferred when omitted

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --org <ORG> — Place the fork under this organization instead of your user account
  • --name <NAME> — New repository name
  • --clone — Clone the fork after creation

fj repo sync

Sync a fork with its upstream default branch

fj repo sync [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --branch <BRANCH> — Branch to sync. Defaults to the repo’s default branch

fj repo edit

Edit a repository’s description, visibility, default branch

fj repo edit [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --description <DESCRIPTION> — Repository description
  • --website <WEBSITE> — Repository website URL
  • --default-branch <DEFAULT_BRANCH> — Default branch name
  • --private <PRIVATE> — Force private/public. Accepts true or false [possible values: true, false]
  • --description-editor — Open $EDITOR for the description

fj repo rename

Rename a repository (in-place)

fj repo rename [OPTIONS] <REPO> <NEW_NAME>

Arguments

  • <REPO> — Repository as owner/name
  • <NEW_NAME> — New repository name

fj repo archive

Archive a repository (read-only)

fj repo archive [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo unarchive

Unarchive a repository

fj repo unarchive [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo delete

Delete a repository. Destructive

fj repo delete [OPTIONS] <REPO>

Arguments

  • <REPO> — Repository as owner/name

Options

  • -y, --yes — Skip the confirmation prompt

fj repo branches

List branches

fj repo branches [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --json — Emit JSON instead of a table

fj repo topics

Manage repo topics (tags)

fj repo topics [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg
  • --set <SET> — Set the topic list (comma-separated). Omit to just print

fj repo mirror

Migrate or mirror a repo from another git host

fj repo mirror [OPTIONS] <SOURCE_URL>

Arguments

  • <SOURCE_URL> — Source URL (e.g. https://github.com/foo/bar.git)

Options

  • --dest <DEST> — Destination as [owner/]name. Defaults to the source’s basename under your user account
  • --mirror — Migrate as a pull-mirror instead of a one-shot import
  • --private — Make the destination repo private
  • --description <DESCRIPTION> — Description for the new repo
  • --auth-user <AUTH_USER> — Username for HTTP source-auth
  • --auth-pass <AUTH_PASS> — Password / token for HTTP source-auth
  • --service <SERVICE> — Service hint: git, github, gitea, gitlab, gogs [default: git]
  • --interval <INTERVAL> — Refresh interval for pull-mirrors (e.g. 8h, 1d)

fj repo mirror-sync

Manually trigger a sync on a pull-mirror

fj repo mirror-sync [OPTIONS] [REPO]

Arguments

  • [REPO] — Pull-mirror repository as owner/name (inferred from the git remote when omitted)

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repository arg

fj repo watch

Watch a repo (subscribe to its notifications)

fj repo watch [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo unwatch

Stop watching a repo

fj repo unwatch [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo star

Star a repo

fj repo star [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo unstar

Unstar a repo

fj repo unstar [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as owner/name

Options

  • -R, --repo <REPO_FLAG> — Alias for the positional repo arg

fj repo starred

List your starred repos

fj repo starred [OPTIONS]

Options

  • -L, --limit <LIMIT> — Maximum number of repositories to fetch [default: 30]
  • --json — Emit JSON instead of a table

fj repo set-default

Pin which repo fj targets in this directory (like gh repo set-default)

fj repo set-default [OPTIONS] [REPO]

Arguments

  • [REPO] — Repository as <owner>/<name> to pin for this directory

Options

  • --view — Print the currently pinned default, if any
  • --unset — Remove the pinned default

fj repo deploy-key

Manage repository deploy keys

fj repo deploy-key [OPTIONS] <COMMAND>

fj repo deploy-key list

List deploy keys on the repo

fj repo deploy-key list [OPTIONS]

Options

  • -R, --repo <REPO> — Target repository as <owner>/<name>. Inferred from the git remote when omitted
  • --json — Emit JSON instead of a table

fj repo deploy-key add

Add a deploy key (read-only by default)

fj repo deploy-key add [OPTIONS] <TITLE>

Arguments

  • <TITLE> — Key title

Options

  • -R, --repo <REPO> — Target repository as <owner>/<name>. Inferred from the git remote when omitted
  • --key <KEY> — Public key string. Use --from-file path (or - for stdin) instead for files
  • --from-file <FROM_FILE> — Read the key from a file (or - for stdin)
  • --allow-write — Allow the key to push (default is read-only)

fj repo deploy-key delete

Delete a deploy key by id

fj repo deploy-key delete [OPTIONS] <ID>

Arguments

  • <ID> — Deploy key id

Options

  • -R, --repo <REPO> — Target repository as <owner>/<name>. Inferred from the git remote when omitted
  • -y, --yes — Skip the confirmation prompt
Contributors
  • Stephen Way