documentation/CLI.md · main · 2026-10-13

CLI

The gitsocial command line has global flags, core commands, an import command, scripting support, exit codes and environment variables.

Command Structure · Core Commands · Import · Scripting · Reference Format · Exit Codes · Environment Variables

Command Structure

gitsocial [--json] <command> [subcommand] [args] [flags]

--help on a command shows all its flags. Global flags:

ExtensionDocCovers
socialSOCIAL.mdposts, comments, lists, timeline, followers
pmPM.mdissues, milestones, sprints, boards
reviewREVIEW.mdpull requests, feedback, forks
releaseRELEASE.mdreleases, artifacts, SBOM
memoMEMO.mdmemos across tiers

Each extension has init, status and config, and memo has one init for each tier. Content is on gitmsg/<extension>, and only social init takes -b to name another branch.

Core Commands

gitsocial status

Shows the repository, the cache, and each extension's branch, last fetch and item counts.

gitsocial status

gitsocial fetch

Fetches followed repositories, registered forks and identity bindings, then reports unread notifications.

gitsocial fetch                      # everything
gitsocial fetch <url>                # one repository
gitsocial fetch --list reading       # one list

The first fetch in a workspace asks whether to track the default branch only or every upstream branch. --all-branches, --json or a non-interactive stdin answer without asking. The answer is saved per workspace.

gitsocial push

Sends the gitmsg/* branches, state refs, tags, the default branch when it is ahead, and the heads of open pull requests to each resolved remote. A push to an s3 remote with site.publish then rebuilds the site. Flags and remote resolution are in S3.md.

gitsocial push [remote...]
gitsocial push --dry-run       # print the plan, send nothing
gitsocial push --site-only     # rebuild the site, send no refs

gitsocial serve

Shows the site of the workspace in a browser. It starts a loopback bucket in the process, pushes the workspace to it and serves the site app from the bucket. A change to a branch, a tag or a state ref pushes again, and a failed push keeps the last build served. The site has no HTML pages. Ctrl-C stops it.

gitsocial serve                      # serving http://127.0.0.1:4747/gitsocial/<repo>/
gitsocial serve --addr 127.0.0.1:8080
ItemValue
bucket root~/.cache/gitsocial/serve/<hash>/, kept between runs
remotegitsocial-serve, in the environment of the serve process; no git config is written
pushforced: a rewritten branch, tag or state ref replaces that of the bucket, and no merge is written to the workspace
git hooksnot run: core.hooksPath is the null device in the environment of the serve process
pollgit for-each-ref refs/heads refs/tags refs/gitmsg every 2 s; one push at a time
tracking refsrefs/remotes/gitsocial-serve/* and refs/gitsocial/tracking/gitsocial-serve/*, deleted on exit and written again from the bucket at the next start

gitsocial mirror

Mirrors a forge-hosted project into a bucket: fetch from the forge, import issues, pull requests, releases and discussions, then push data and code, and rebuild the site. Run it again, or from cron, to refresh the mirror; a run that stops before it completes continues at the next run.

gitsocial mirror <forge-url> <s3-url> --url <public-url>   # cold start: clone, import, push
gitsocial mirror <s3-url>                                  # in a workspace: attach the bucket, import, push
gitsocial mirror                                           # refresh
gitsocial mirror --dry-run <forge-url> <s3-url>            # the provider checklist and the plan

gitsocial clone

git clone with s3:// support: it normalizes provider URLs and writes the helper alias to the local config of the clone, so plain git works in the clone.

gitsocial clone <url> [directory]

gitsocial remote

gitsocial remote add [name] <url> [--default] [--site]    # --default adds it to gitsocial.pushRemote; --site sets site.publish
gitsocial remote default [name...]                        # set the default push remotes, or print the current resolution
gitsocial remote put <key> <file> [--remote <name>]       # upload one file to the bucket root, e.g. an installer

add normalizes an s3 URL; the accepted forms are in S3.md. Any other URL is added as an ordinary git remote.

gitsocial config

Core configuration in refs/gitmsg/core/config, the site keys, and the credential store.

gitsocial config get <key> | set <key> <value> | list
gitsocial config site set <key> <value>          # see STATIC-SITE.md
gitsocial config credentials set <host>          # see S3.md

gitsocial settings

User settings, stored in the personal bare repository and synced between machines with gitsocial personal sync. Keys are in SETTINGS.md.

gitsocial settings get <key> | set <key> <value> | list

list prints each key, its value, and the key's description on the line below:

fetch.parallel = 4
  Concurrent fetch workers.
fetch.timeout = 30
  Per-repo fetch timeout in seconds.
fetch.workspace_mode = (per-repo)

--json adds a description field, left out for a key the registry does not carry.

gitsocial personal

The personal bare repository that holds settings and personal-tier memos. See SETTINGS.md.

gitsocial personal init [--remote <url>]
gitsocial personal sync [--push-only | --fetch-only]
gitsocial personal status

gitsocial fork

Registers other repositories as forks of this one. Issues and pull requests of a fork appear here, and when you change one, GitSocial adopts it into this repository. An edit to an item of a different repository stays a proposal until its owner accepts it.

gitsocial fork add <url>
gitsocial fork remove <url>
gitsocial fork list
gitsocial fork create <destination>     # fork on a forge or a bucket, clone it, wire origin and upstream

Forks are for two-way collaboration on the same items. Lists (gitsocial social list) are for one-way following. A repository can be both.

gitsocial explore

gitsocial explore [--list <name>] [--limit <n>]   # cached repositories
gitsocial related <repository>         # repositories sharing lists or authors with it

gitsocial log

Activity log of this repository, or of the timeline with --scope timeline.

gitsocial log [--type post,comment] [--after <date>] [--author <email>] [--limit <n>]

Search across every extension, with per-type filters and grouping.

gitsocial search "query"
gitsocial search --type pr --state open --json
gitsocial search --type issue --labels bug --assignee [email protected]
gitsocial search --type pr --group-by state --count-only

Inline prefixes, in the order the parser reads them:

PrefixFilters by
author:<email>author name or email
repo:<url>repository URL
repository:<url>repository URL, the long form of repo:
type:<type>item type, the values --type takes
hash:<prefix>commit hash prefix
commit:<prefix>commit hash prefix, the long form of hash:
list:<name>list name or ID
after:<YYYY-MM-DD>items after the date
before:<YYYY-MM-DD>items before the date
assignee:<email>assignee email, or a part of it; implies type:issue
reviewer:<email>reviewer email, or a part of it; implies type:pr
label:<name>a label, without case; a comma-separated list matches any
labels:<name>the same as label:, the name of the flag

A token with any other prefix is text, not a filter: state:open searches for "state:open". Any space character ends a value.

gitsocial show

gitsocial show <ref>          # any item; the extension is detected

gitsocial history

gitsocial history <ref>       # the edit history of any message

gitsocial notifications

gitsocial notifications [--all] [--type mention,follow] [--limit <n>]
gitsocial notifications count
gitsocial notifications read <id> | read-all
gitsocial notifications unread <id> | unread-all

gitsocial id

Signature verification and identity resolution. The trust model is in IDENTITY.md.

gitsocial id verify <commit>
gitsocial id resolve <email>

The domain source is off by default. To enable it, run gitsocial settings set identity.dns_verification true.

gitsocial tui

gitsocial tui

Keys are in TUI-KEYS.md.

gitsocial rpc

JSON-RPC over stdio for editor integration. See RPC.md.

gitsocial rpc

gitsocial docs

gitsocial docs keybindings [--json]

Import

gitsocial import copies issues, milestones, releases, pull requests and discussions from a forge into the extensions. The origin remote is the default source. Re-running skips what is already imported.

gitsocial import [url]              # everything: pm, release, review, social, in that order
gitsocial import pm [url]           # milestones, issues and their comments
gitsocial import release [url]      # releases and artifact metadata
gitsocial import review [url]       # fork registrations, pull requests and their comments
gitsocial import social [url]       # discussions and their comments
gitsocial import pm --state open --limit 100 --dry-run

Scripting

gitsocial pm issue list --labels kind/wontfix --json | jq -r '.[].id' | xargs -I {} gitsocial pm issue close {}
gitsocial review pr list --json | jq -e 'length > 0' >/dev/null && echo "PRs pending review"
echo "Hello world" | gitsocial social post -          # stdin as the body
cat CHANGELOG.md | gitsocial release create -

Reference Format

References follow GITMSG.md §1.3:

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3Permission denied
4Network error
5Not a git repository

Environment Variables

VariablePurpose
XDG_CONFIG_HOMEconfig root, default ~/.config; gitsocial uses <root>/gitsocial
GITSOCIAL_PERSONAL_REPOpath of the personal bare repository, default ~/.config/gitsocial/personal
GITSOCIAL_EDITOReditor for messages; if it is not set, gitsocial uses $EDITOR, $VISUAL, then vi
GM_PAGERpager for output; if it is not set, gitsocial uses $PAGER
GITSOCIAL_PPROFcpu, mem or trace: write a profile to /tmp/gitsocial-cpu.pprof, /tmp/gitsocial-mem.pprof or /tmp/gitsocial.trace on exit
TERM_PROGRAMread by the TUI; Apple_Terminal widens the layout margin
S3 credentials, endpoints and tuningsee S3.md