Repository commands

Create, clone and edit repositories, work with branches, commits and releases, search, and move repositories from GitHub.

The guides are Repositories, Branches and protection, Releases, Search and Move from GitHub.

sailfork repo

Create, inspect and clone repositories.

sailfork repo create

Create a repository. Changes something.

sailfork repo create <NAME> [flags]
ArgumentWhat it is
<NAME>A name for your own repository, or org/name for one in an org you belong to
FlagWhat it does
--about <ABOUT>Description shown on the repository page.
--publicAnyone can read it.
--privateOnly you and people you add can read it (the default)
--object-format <OBJECT_FORMAT>The hash objects are named with, fixed for the repository's life (default sha1) One of sha1, sha256.

Examples:

sailfork repo create my-app --private --about "My app"
sailfork repo create acme/site --public

sailfork repo list

List your repositories. Also repo ls. Read-only.

sailfork repo list [flags]
FlagWhat it does
--owner <HANDLE>Only repositories of this user or organization.
--visibility <VISIBILITY>Only public or only private repositories. One of public, private.
--limit <LIMIT>Most rows to print. Default 30.

Examples:

sailfork repo list
sailfork repo list --owner acme --visibility private --limit 100
sailfork repo list --json=name,visibility

sailfork repo view

Show a repository. Also repo show. Read-only.

sailfork repo view

Examples:

sailfork repo view -R acme/site
sailfork repo view --jq .defaultBranch
sailfork repo view -R acme/site --json=cloneUrl,branches

sailfork repo clone

Clone a repository. Changes something.

sailfork repo clone <REPO> [DIRECTORY] [GIT_ARGS...] [flags]
ArgumentWhat it is
<REPO>owner/repo or a clone URL
[DIRECTORY]Directory to clone into (default: the repository name)
[GIT_ARGS...]Extra arguments passed to git clone
FlagWhat it does
--protocol <PROTOCOL>Transport for owner/repo: https (default) or ssh; ssh falls back to https when the SSH port is unreachable. One of https, ssh. Default https.
--sparse <FOLDER>Check out only this folder, and fetch only its files (git's sparse checkout in cone mode over a blobless partial clone); repeat for more. The clone still commits and pushes; git sparse-checkout add FOLDER adds more. Repeatable.
--fullClone the whole repository, ignoring the clone defaults its admins set.

Examples:

sailfork repo clone acme/site
sailfork repo clone acme/site site-copy -- --depth 1

sailfork repo edit

Change a repository's description, visibility or default branch. Changes something.

sailfork repo edit [flags]
FlagWhat it does
--about <ABOUT>New description.
--visibility <VISIBILITY>Make it public or private. One of public, private.
--default-branch <DEFAULT_BRANCH>Branch that pull requests target by default.
--clone-sparse <FOLDER>Folders repo clone checks out when the cloner passes no options (repeat for more); replaces the list. Repeatable.
--clone-blobless <BOOL>Whether repo clone makes a blobless partial clone when the cloner passes no options. One of true, false.
--clear-clone-defaultsRemove the repository's clone defaults.

Examples:

sailfork repo edit --about "The marketing site"
sailfork repo edit -R acme/site --visibility public
sailfork repo edit -R acme/site --default-branch trunk

sailfork repo delete

Schedule a repository for deletion (14 days). Also repo rm. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork repo delete [flags]
FlagWhat it does
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

Examples:

sailfork repo delete -R acme/site --dry-run
sailfork repo delete -R acme/site --yes

sailfork repo purge

Purge a repository scheduled for deletion now, with all its data, instead of after 14 days. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork repo purge [flags]
FlagWhat it does
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

sailfork repo fork

Fork a repository: its branches and tags, without copying any data. Changes something.

sailfork repo fork [flags]
FlagWhat it does
--owner <HANDLE>Fork into this organization instead of your own account.
--name <NAME>Name the fork this instead of the repository's name.

sailfork repo forks

List a repository's forks. Read-only.

sailfork repo forks [flags]
FlagWhat it does
--owner <HANDLE>Only repositories of this user or organization.
--visibility <VISIBILITY>Only public or only private repositories. One of public, private.
--limit <LIMIT>Most rows to print. Default 30.

sailfork repo restore

Bring back a repository scheduled for deletion, before the 14 days pass. Changes something.

sailfork repo restore

Examples:

sailfork repo restore -R acme/site

sailfork repo log

List the commits of a branch, newest first. Read-only.

sailfork repo log [flags]
FlagWhat it does
--ref <REF>Branch, tag or commit (default: the default branch)
--path <PATH>Only commits that changed this file or folder, as git log -- path (follows a rename)
--limit <LIMIT>Most commits to print. Default 30.
--skip <SKIP>Skip this many of the newest commits. Default 0.

Examples:

sailfork repo log --limit 10
sailfork repo log --path crates/cli/src/cmd/pr.rs --ref main
sailfork repo log --limit 30 --skip 30 --json

sailfork repo cat

Print a file as it is at a branch, tag or commit, without a clone or a caisson. Read-only.

sailfork repo cat <PATH> [flags]
ArgumentWhat it is
<PATH>Path of the file in the repository
FlagWhat it does
--ref <REF>Branch, tag or commit (default: the default branch)
--rawWrite the file's bytes to stdout even when it is binary.

Examples:

sailfork repo cat README.md
sailfork repo cat crates/cli/src/cli.rs --ref v1.2.0
sailfork repo cat logo.png --raw > logo.png

sailfork repo commit-file

Write, create or delete one file and commit it straight to a branch, without a clone or a caisson. Changes something.

sailfork repo commit-file <PATH> [flags]
ArgumentWhat it is
<PATH>Path of the file in the repository
FlagWhat it does
-f, --file <FILE>Local file with the new content, or - for stdin (text, at most 1 MiB)
--deleteDelete the file instead (needs --expect)
--expect <VERSION>The version the change starts from, as repo cat --json prints it; leave it out to create a file that must not exist yet.
-m, --message <MESSAGE>Commit message. Required.
-b, --branch <BRANCH>Branch to commit to (default: the default branch)
--new-branch <NAME>Commit onto this new branch instead.
--base <SHA>With --new-branch: the commit it starts from (default: the tip of --branch)

sailfork repo tree

List a folder as it is at a branch, tag or commit. Read-only.

sailfork repo tree [PATH] [flags]
ArgumentWhat it is
[PATH]Folder to list (default: the root)
FlagWhat it does
--ref <REF>Branch, tag or commit (default: the default branch)
--after <CURSOR>Continue after this cursor: the next a listing of 1,000 entries ends with.

Examples:

sailfork repo tree
sailfork repo tree crates/cli --ref feat/x --json

sailfork repo find

List the files matching a glob at a branch, tag or commit, without a clone or a caisson. Read-only.

sailfork repo find <PATTERN> [PATH] [flags]
ArgumentWhat it is
<PATTERN>Glob over paths: * within a folder, ** across folders; no / matches the name anywhere
[PATH]Only look under this folder
FlagWhat it does
--ref <REF>Branch, tag or commit (default: the default branch)
--limit <N>Most paths to return, 1 to 2000 (default 200)

Examples:

sailfork repo find '*.rs' crates/cli --ref feat/x
sailfork repo find '**/*.md' --limit 20 --json

sailfork repo test

Run tests or any command against a branch, tag or commit in a throwaway sandbox, without a caisson. Changes something. Supports --dry-run.

sailfork repo test [COMMAND...] [flags]
ArgumentWhat it is
[COMMAND...]One argument runs as a shell command line; several run as program and arguments
FlagWhat it does
--ref <REF>Branch, tag or commit to test (default: the default branch)
--cmd <COMMAND>The command line to run, by /bin/sh -c (or put the command after --)
--image <IMAGE>Image of the sandbox (default buildpack-deps:noble-scm: git, curl, python3 without pip; try python:3.12-slim, node:22, rust:1, golang:1.23)
--minutes <N>Minutes until the sandbox stops anyway, 1 to 1440 (default 60)
--on <HOST_NAME>Drydock host to run on, by name (default any online host with room)
--wait <SECS>Seconds to wait for a queued sandbox to start, 0 to fail at once when no host has room (default 60, at most 600); after it the sandbox stays queued and its id is printed.
--timeout <SECS>Seconds before the command is killed (default 120, at most 3600)
--env <KEY=VALUE>Environment variable for the command; repeat for more. Repeatable.
--dry-runSay what would run and start nothing.

Examples:

sailfork repo test -R acme/shop --ref feat/x -- cargo test
sailfork repo test -R acme/shop --image node:22 -- 'npm ci && npm test'
sailfork repo test -R acme/shop --dry-run -- make check

sailfork repo compare

Show how one branch, tag or commit differs from another. Read-only.

sailfork repo compare <BASE> [HEAD] [flags]
ArgumentWhat it is
<BASE>The base: a branch, tag or commit
[HEAD]What to compare against it (default: the default branch)
FlagWhat it does
-p, --patchPrint the changes as a unified diff.

Examples:

sailfork repo compare main feat/login
sailfork repo compare v1.2.0 --patch
sailfork repo compare main feat/login --json --jq '.commits | length'

sailfork repo refs

List where a symbol is defined and every line that references it. Read-only.

sailfork repo refs <SYMBOL> [flags]
ArgumentWhat it is
<SYMBOL>The exact name of the function, type or variable (case-sensitive)
FlagWhat it does
--path <PATH>Only files whose path contains this.
--ref <REF>Branch, tag or commit (default: the default branch)
--limit <LIMIT>Most references to print (1 to 1000) Default 100.

Examples:

sailfork repo refs load_config
sailfork repo refs RepoRecord --path crates/server --limit 300
sailfork repo refs fetchUser -R acme/site --ref feat/x --json --jq '.references[].path'

sailfork branch

List and delete a repository's branches.

sailfork branch list

List the repository's branches, the default one first. Also branch ls. Read-only.

sailfork branch list

Examples:

sailfork branch list
sailfork branch list -R acme/app --json --jq '.items[].name'

sailfork branch delete

Delete a branch; the default branch and protected branches stay. Also branch rm, branch remove. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork branch delete <NAME> [flags]
ArgumentWhat it is
<NAME>Branch name
FlagWhat it does
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

Examples:

sailfork branch delete feat/login --dry-run
sailfork branch delete feat/login --yes

sailfork commit

Show a commit, or the pull requests that contain it.

sailfork commit view

Show a commit's message and changes. Also commit show. Read-only.

sailfork commit view <SHA> [flags]
ArgumentWhat it is
<SHA>Commit sha (or its start)
FlagWhat it does
--statPrint only the files and their line counts.
--patchPrint the full diff.

Examples:

sailfork commit view 3f2a9c1
sailfork commit view 3f2a9c1 --stat
sailfork commit view 3f2a9c1 --patch | less

sailfork commit prs

List the pull requests that contain a commit. Read-only.

sailfork commit prs <SHA>
ArgumentWhat it is
<SHA>Commit sha (or its start)

Examples:

sailfork commit prs 3f2a9c1
sailfork commit prs 3f2a9c1 --json --jq '.items[].number'

sailfork release

Publish a tag with notes and downloadable files, and list or edit releases.

sailfork release list

List releases, drafts first when you can write, then newest published first. Also release ls. Read-only.

sailfork release list

Examples:

sailfork release list
sailfork release list -R acme/app --json --jq '.items[] | select(.draft) | .tag'

sailfork release view

Show a release with its notes and files. Also release show. Read-only.

sailfork release view <TAG>
ArgumentWhat it is
<TAG>Release tag

Examples:

sailfork release view v1.4.0
sailfork release view v1.4.0 -R acme/app --json --jq '.assets[].name'

sailfork release create

Create a release and upload its files; it stays a draft until every file is up. Changes something.

sailfork release create <TAG> [FILE...] [flags]
ArgumentWhat it is
<TAG>Tag to release; a published release needs it to exist in the repository already
[FILE...]Files to upload as downloads, named by their file name
FlagWhat it does
-t, --title <TITLE>Release title (default: the tag)
-n, --notes <NOTES>Release notes in Markdown.
--notes-file <FILE>Read the notes from a file, or - for stdin.
--draftKeep it a draft after the upload; publish it later with release edit --draft false
--prereleaseMark it as not production ready.

Examples:

sailfork release create v1.4.0 dist/app-linux.tar.gz dist/SHA256SUMS --title "App 1.4" --notes-file CHANGELOG.md
sailfork release create v1.5.0-rc.1 --prerelease --notes "Release candidate"
sailfork release create v2.0.0 dist/app.zip --draft

sailfork release upload

Add files to a release (a draft keeps them hidden until it is published). Changes something.

sailfork release upload <TAG> <FILE...> [flags]
ArgumentWhat it is
<TAG>Release tag
<FILE...>Files to upload as downloads, named by their file name
FlagWhat it does
--clobberReplace a file of the same name that the release already has.

Examples:

sailfork release upload v1.4.0 dist/app-macos.tar.gz
sailfork release upload v1.4.0 dist/SHA256SUMS --clobber

sailfork release edit

Change a release's title, notes, or whether it is a draft or a prerelease; publish a draft with --draft false. Changes something.

sailfork release edit <TAG> [flags]
ArgumentWhat it is
<TAG>Release tag
FlagWhat it does
-t, --title <TITLE>New title.
-n, --notes <NOTES>New notes in Markdown.
--notes-file <FILE>Read the new notes from a file, or - for stdin.
--draft <BOOL>false publishes a draft, true turns a published release back into a draft. One of true, false.
--prerelease <BOOL>Mark it as a prerelease (true) or as production ready (false) One of true, false.

Examples:

sailfork release edit v1.4.0 --draft false
sailfork release edit v1.4.0 --title "App 1.4" --notes-file CHANGELOG.md
sailfork release edit v1.5.0-rc.1 --prerelease false

sailfork release delete

Delete a release and its files; the git tag stays. Also release rm, release remove. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork release delete <TAG> [flags]
ArgumentWhat it is
<TAG>Release tag
FlagWhat it does
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

Examples:

sailfork release delete v1.4.0 --dry-run
sailfork release delete v1.4.0 --yes

Search code, issues and pull requests.

sailfork search code

Search the code of the default branch (or --ref) of a repository or of everything you can read. Read-only.

sailfork search code <QUERY> [flags]
ArgumentWhat it is
<QUERY>Text to find (a pattern with --regex)
FlagWhat it does
--path <PATH>Only files whose path contains this.
--lang <LANG>Only this language, as language names it.
--ref <BRANCH>Search this branch's head instead of the default branch.
--regexTreat the query as a regular expression.
--caseMatch case.
--limit <LIMIT>Most files to print (1 to 100) Default 20.
--all-reposSearch every repository you can read instead of -R or the current clone.

Examples:

sailfork search code "fn merge_pull"
sailfork search code "TODO" --path crates/cli --lang Rust --limit 50
sailfork search code "impl\s+Drop" --regex --ref feat/x
sailfork search code "oauth" --all-repos --json --jq '.files[].path'

sailfork search symbols

Find where functions, types, classes and other symbols are defined, by name. Read-only.

sailfork search symbols <QUERY> [flags]
ArgumentWhat it is
<QUERY>Part of the name to find (case-insensitive)
FlagWhat it does
--kind <KIND>Only this kind: function, method, struct, enum, union, trait, interface, class, type, module, macro, const or static.
--path <PATH>Only files whose path contains this.
--ref <REF>Branch, tag or commit (default: the default branch)
--limit <LIMIT>Most definitions to print (1 to 200) Default 30.

Examples:

sailfork search symbols merge_pull
sailfork search symbols Config --kind struct --path crates/server
sailfork search symbols handler --ref v1.2.0 --json --jq '.symbols[] | "\(.path):\(.line)"'

sailfork search issues

Search a repository's issues. Read-only.

sailfork search issues <QUERY...> [flags]
ArgumentWhat it is
<QUERY...>Words to find in the title and body, plus qualifiers: is:open|closed|merged|draft, author:, label:, assignee:, head:, base:, status:, priority:
FlagWhat it does
--limit <LIMIT>Most rows to print. Default 30.

Examples:

sailfork search issues login is:open label:bug
sailfork search issues "author:@me status:in-progress" -R acme/site

sailfork search prs

Search a repository's pull requests. Read-only.

sailfork search prs <QUERY...> [flags]
ArgumentWhat it is
<QUERY...>Words to find in the title and body, plus qualifiers: is:open|closed|merged|draft, author:, label:, assignee:, head:, base:, status:, priority:
FlagWhat it does
--limit <LIMIT>Most rows to print. Default 30.

Examples:

sailfork search prs is:merged author:ana base:main
sailfork search prs "redirect" -R acme/site --limit 10

sailfork browse

Open the repository, a pull request or an issue in the browser. Read-only.

sailfork browse [TARGET] [flags]
ArgumentWhat it is
[TARGET]A pull request number, or a path inside the repository
FlagWhat it does
--no-openPrint the URL instead of opening it.

Examples:

sailfork browse
sailfork browse 12
sailfork browse src/main.rs --no-open

sailfork migrate

Move repositories over from GitHub.

sailfork migrate installations

List the GitHub installations Sailfork can read for you. Read-only.

sailfork migrate installations

Examples:

sailfork migrate installations
sailfork migrate installations --json

sailfork migrate orgs

List the GitHub organizations and account of an installation. Read-only.

sailfork migrate orgs [flags]
FlagWhat it does
--installation <ID>GitHub installation id from migrate installations (default: your only one)

Examples:

sailfork migrate orgs
sailfork migrate orgs --installation 1234567

sailfork migrate repos

List the GitHub repositories you could bring over. Read-only.

sailfork migrate repos [flags]
FlagWhat it does
--installation <ID>GitHub installation id from migrate installations (default: your only one)
--org <NAME>Only repositories of this GitHub organization or account.
--limit <LIMIT>Most rows to print. Default 30.

Examples:

sailfork migrate repos
sailfork migrate repos --org acme --limit 100 --json=org,name,visibility,sizeMb

sailfork migrate start

Start copying GitHub repositories; the copy runs on the server and survives closing the terminal. Changes something. Supports --dry-run.

sailfork migrate start <REPOS...> [flags]
ArgumentWhat it is
<REPOS...>GitHub repositories as org/name
FlagWhat it does
--installation <ID>GitHub installation id from migrate installations (default: your only one)
--into <HANDLE>Land in this Sailfork organization (default: your own account)
--as <NAME>Name on Sailfork when it should differ (one repository only)
--privateMake public repositories private on Sailfork.
--after <AFTER>What to do with the GitHub original once the copy is ready. One of archive, mirror, pull, leave.
--without <PARTS>Parts to leave on GitHub, comma separated (items, releases, wiki, rules, access, lfs); migrate bring fetches them later. Repeatable. One of items, releases, wiki, rules, access, lfs.
--dry-runSay what would be copied and change nothing.

Examples:

sailfork migrate start acme/api
sailfork migrate start acme/api acme/web --into acme --after pull
sailfork migrate start acme/api --as api-v2 --private --dry-run
sailfork migrate start acme/api --without items,wiki

sailfork migrate status

Show one move, or all of yours, with how far each got. Also migrate ls. Read-only.

sailfork migrate status [ID]
ArgumentWhat it is
[ID]Move id from migrate start or migrate status; leave out to list all

Examples:

sailfork migrate status
sailfork migrate status 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --json

sailfork migrate retry

Run a failed or blocked move again, for example after GitHub access was granted. Changes something.

sailfork migrate retry <ID>
ArgumentWhat it is
<ID>Move id

Examples:

sailfork migrate retry 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47

sailfork migrate cancel

Stop a move; the copy made so far is removed. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork migrate cancel <ID> [flags]
ArgumentWhat it is
<ID>Move id
FlagWhat it does
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

Examples:

sailfork migrate cancel 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --dry-run
sailfork migrate cancel 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --yes

sailfork migrate switch

Make the Sailfork copy the repository's home, and choose what happens to the GitHub original. Changes something. Asks before it acts unless you pass --yes. Supports --dry-run.

sailfork migrate switch <ID> [flags]
ArgumentWhat it is
<ID>Move id; its copy must be ready
FlagWhat it does
--after <AFTER>What happens to the GitHub original: archive it, mirror it from Sailfork, keep pulling from it, or leave it. Required. One of archive, mirror, pull, leave.
-y, --yesConfirm; required when there is no terminal to ask on.
--dry-runSay what would happen and change nothing.

Examples:

sailfork migrate switch 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --after pull --dry-run
sailfork migrate switch 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --after archive --yes

sailfork migrate bring

Bring more from GitHub into a ready or switched copy: parts left out at the start, or a fresh pass. Changes something.

sailfork migrate bring <ID> [PARTS...] [flags]
ArgumentWhat it is
<ID>Move id from migrate status
[PARTS...]Parts to bring: items (issues and pull requests), releases, wiki, rules (branch protection), access (collaborators and teams), lfs. Leave out with --drop to clear what is still waiting
FlagWhat it does
--dropForget the parts still waiting to come, for example when the GitHub repository is gone.

Examples:

sailfork migrate bring 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 items,wiki
sailfork migrate bring 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 lfs --json
sailfork migrate bring 7d2c1a9e-4b5f-4c1d-9a3e-0f6b8d2e1c47 --drop

Loading Sailfork