| 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. |
| 11 | set -eu |
| 12 | |
| 13 | BASE="${G1T_SITE:-https://g1t.sh}" |
| 14 | |
| 15 | if [ "${1:-}" = "--cli" ]; then |
| 16 | curl -fsSL "$BASE/install" | sh |
| 17 | fi |
| 18 | |
| 19 | # The plugin's marketplace is published only on g1t.sh, whichever g1t it |
| 20 | # works with (a self-hosted one is G1T_HOST to its hooks). |
| 21 | cat <<EOF |
| 22 | Install g1t's plugin for Claude Code: |
| 23 | |
| 24 | claude plugin marketplace add https://g1t.sh/flagon-io/g1t-plugins.git |
| 25 | claude plugin install g1t@g1t |
| 26 | |
| 27 | The plugin's hooks use the g1t CLI (0.3.2 or later) and Node 18 or later. |
| 28 | If you do not have the CLI yet, or have an older one, install it |
| 29 | (curl -fsSL $BASE/install | sh) and sign in with \`g1t auth login\`. |
| 30 | Then, in Claude Code, run /mcp and choose plugin:g1t:g1t to sign its tools |
| 31 | in. The plugin adds g1t's MCP server itself: skip \`claude mcp add\`. |
| 32 | |
| 33 | Guide: https://docs.g1t.sh/guides/claude-code-plugin/ |
| 34 | EOF |