Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
42 linesCodeBlameRaw
1#!/bin/sh
2# Connects Claude Code on this machine to g1t. g1t's Claude Code plugin
3# records your sessions on g1t, loads an issue's work context, and adds
4# g1t's MCP server and commands; this prints the two commands that install
5# it. With --cli it also installs the g1t CLI, which the plugin's hooks use:
6#
7# curl -fsSL https://g1t.sh/install/claude.sh | sh
8# curl -fsSL https://g1t.sh/install/claude.sh | sh -s -- --cli
9#
10# It changes nothing else. An earlier version of this script installed a
11# hook in ~/.g1t; if that is there, it is brought up to date, and you can
12# remove it once the plugin is installed (see below).
13set -eu
14
15BASE="${G1T_SITE:-https://g1t.sh}"
16
17if [ "${1:-}" = "--cli" ]; then
18 curl -fsSL "$BASE/install" | sh
19fi
20
21if [ -f "$HOME/.g1t/hook.mjs" ]; then
22 curl -fsSL "$BASE/install/hook.mjs" -o "$HOME/.g1t/hook.mjs"
23 echo "Updated the earlier g1t hook in ~/.g1t/hook.mjs. The plugin replaces it:"
24 echo "once the plugin is installed, remove the \`node \"$HOME/.g1t/hook.mjs\"\`"
25 echo "entries from ~/.claude/settings.json, so a session is not recorded twice."
26 echo
27fi
28
29cat <<EOF
30Install g1t's plugin for Claude Code:
31
32 claude plugin marketplace add $BASE/flagon-io/g1t.git
33 claude plugin install g1t@g1t
34
35The plugin's hooks use the g1t CLI (0.3.2 or later) and Node 18 or later.
36If you do not have the CLI yet, or have an older one, install it
37(curl -fsSL $BASE/install | sh) and sign in with \`g1t auth login\`.
38Then, in Claude Code, run /mcp and choose plugin:g1t:g1t to sign its tools
39in. The plugin adds g1t's MCP server itself: skip \`claude mcp add\`.
40
41Guide: https://docs.g1t.sh/guides/claude-code-plugin/
42EOF