Set up it2

The fastest path is to give the setup task to your coding agent. The same
commands are provided below for manual installation.

Prerequisites

  • macOS
  • iTerm2 running with Preferences → General → Magic → Enable Python API
    selected
  • Go, as required by the repository's go.mod

Ask your coding agent

Paste this prompt into the coding agent you want to use with it2:

Install and configure it2 on this Mac.

1. Check that Go satisfies https://github.com/tmc/it2/blob/main/go.mod.
2. Run: go install github.com/tmc/it2/cmd/it2@latest
3. Find the installed binary using `go env GOBIN`; if that is empty, use
   `$(go env GOPATH)/bin`. Do not edit my shell startup files without asking.
4. Confirm that iTerm2 is running and its Python API is enabled. If either
   requires a UI action, stop and tell me exactly what to do.
5. Run: it2 auth request
6. Verify the connection with: it2 session current
7. Report the installed version, the observed session ID, and any settings or
   files you changed. Do not claim success unless `it2 session current` exits 0.

Use the checked-in it2 skill for later terminal commands:
https://github.com/tmc/it2/blob/main/plugins/it2/SKILL.md

Continue to Install the it2 agent skill after setup if your
agent supports reusable skills.

Set up by hand

Install the binary and add its directory to this shell's PATH:

go install github.com/tmc/it2/cmd/it2@latest
go_bin_dir=$(go env GOBIN)
[ -n "$go_bin_dir" ] || go_bin_dir="$(go env GOPATH)/bin"
export PATH="$go_bin_dir:$PATH"

Request API access, then verify the connection:

it2 version
it2 auth request
SID=$(it2 session current)
printf 'Current session: %s\n' "$SID"

Approve any access prompt in iTerm2. The final command prints your current
iTerm2 session UUID; your value will differ.

Next steps