@sigit / si Mirror · read-only
Fork 0

Mirror of github.com/getsigit/si.

Mirrored from https://github.com/getsigit/si.git

Synced Nov 24, 08:15 UTC

1 # sigit-si-cli
2
3 `si` is the command line interface for [sigit.si](https://sigit.si) — sign in,
4 manage repositories, review pull requests, triage issues, search code, and
5 drive Cloud Sessions, all from the terminal.
6
7 ## Install
8
9 ```sh
10 cargo install --path crates/cli
11 ```
12
13 This installs a binary named `si`. Prebuilt binaries are also available:
14
15 ```sh
16 npm install -g @getsigit/si # npm
17 pipx install sigit-si-cli # PyPI (or: uvx --from sigit-si-cli si)
18 dotnet tool install --global SiGit.Cli # .NET
19 ```
20
21 Or download a binary for your platform from
22 [GitHub Releases](https://github.com/getsigit/si/releases); each asset has a
23 `.sha256` file next to it.
24
25 ## Usage
26
27 ```sh
28 si auth login # sign in with your sigit.si account
29 si repo list # your repositories
30 si repo create my-project --private
31 si repo clone seto/my-project # clone with your sign-in, no token in the URL
32 si auth setup-git # or let plain `git clone` use it too
33
34 # Inside a repo checkout, si infers OWNER/NAME from the sigit.si git remote —
35 # --repo is only needed when you're not standing in one.
36 si pr list
37 si pr view 42
38 si pr create --title "Fix the thing" --base main
39
40 si issue list --state open
41 si issue create --title "Bug: ..." --body "Steps to reproduce..."
42
43 si code search "TODO" --ref main
44 si code view README.md
45
46 si status set HEAD --state success --context ci/test
47 si status view # the checks on HEAD
48
49 si run start --repo seto/app "Fix the failing build"
50 si run list
51 si run view 12 # status and the end of the transcript
52
53 si site publish --wait # publish the default branch as a site
54 si site view
55
56 si session new --title "Refactor auth"
57 si models
58 si billing show
59
60 si auth signup # also: resend, reset-password, delete-account
61
62 si browse # open the current repo on sigit.si
63 si api repos # raw escape hatch for any endpoint
64 ```
65
66 Pass `--json` to any read command for machine-readable output.
67
68 ### As an MCP server
69
70 <!-- mcp-name: si.sigit/cli -->
71
72 `si mcp` serves these same commands to an AI agent as
73 [MCP](https://modelcontextprotocol.io) tools over stdio:
74
75 ```jsonc
76 {
77 "mcpServers": {
78 "sigit": { "command": "si", "args": ["mcp"] }
79 }
80 }
81 ```
82
83 There is nothing to authenticate — the server reuses the token `si auth login`
84 stored. Point your editor at the directory of a checkout and repository tools
85 default to the repo you're standing in, so the agent can say "list the open
86 pull requests" without naming one; `create_pull_request` likewise defaults its
87 head to the checked-out branch.
88
89 Trim the tool list when an agent doesn't need all of it:
90
91 ```sh
92 si mcp --read-only # drop every tool that writes
93 si mcp --toolsets repo,issue,pr,code # or SIGIT_TOOLSETS=repo,issue
94 ```
95
96 Toolsets are `account`, `repo`, `issue`, `pr`, `code`, `hook`, `session`, and
97 `billing`. sigit.si also hosts a remote MCP server at `/api/v1/mcp` for clients
98 that would rather connect over HTTP than spawn a binary.
99
100 ### Environments
101
102 ```sh
103 si --environment dev repo list # a local sigit.si server (localhost:3000)
104 SIGIT_HOST=staging.example.com si repo list
105 ```
106
107 Credentials are stored per-environment in `~/.sigit/token` (or
108 `~/.sigit-dev/token`). `SIGIT_TOKEN` overrides the stored token, which is how
109 CI authenticates without an interactive login.
110
111 ## Workspace layout
112
113 - **`crates/sigit-si-api`** — a standalone, typed Rust client for the sigit.si
114 JSON API. No CLI dependencies (clap, dialoguer, …); usable from any Rust
115 project that wants to talk to sigit.si.
116 - **`crates/cli`** — the `si` binary: command parsing, terminal rendering, git
117 remote resolution, and credential storage, built on top of `sigit-si-api`.
118
119 Issues, pull requests, and code search have no REST surface on sigit.si yet —
120 they're served over the same MCP (Model Context Protocol) JSON-RPC endpoint
121 the AI agent uses. `sigit-si-api` speaks that transport internally; it's not
122 visible at the call site.
123
124 ## MCP Registry listings
125
126 This repo publishes two entries to the
127 [official MCP Registry](https://registry.modelcontextprotocol.io), one per way
128 of reaching the same tools, so registry-aware clients can add either in one
129 click:
130
131 | Listing | File | What it is |
132 | --- | --- | --- |
133 | `si.sigit/cli` | `server.json` | This CLI: a cargo package listing that runs `si mcp` over stdio. |
134 | `si.sigit/sigit` | `server-sigit.json` | The hosted server at `sigit.si/api/v1/mcp`, a remote Streamable-HTTP listing. The endpoint `sigit-si-api` talks to, and the official server siGit Code bakes in. |
135
136 The CLI holds `server.json` because it's what this repo ships, and that's the
137 filename `mcp-publisher` defaults to. Sibling listings are named after their
138 own leaf, so the file says which entry it publishes.
139
140 Both go out through the `release-mcp-registry.yml` workflow, and both prove
141 namespace ownership with a DNS TXT record on `sigit.si` rather than GitHub
142 OIDC, so one credential covers the pair. A package listing has a second hurdle:
143 the registry fetches the crate from crates.io and looks for the
144 `mcp-name: si.sigit/cli` marker in its README, which is why that marker sits in
145 this file. Crate versions are immutable, so a release that ships without the
146 marker can never be listed, and fixing it costs a new version. The internal
147 setup and release runbook live with the server (private `sigit-si` repo).
148
149 To cut a release, bump `[workspace.package].version` and the `sigit-si-api`
150 dependency in the root `Cargo.toml`, and the `version` in
151 `packaging/npm/si/package.json` and its lockfile (`release-npm.yml` fails when
152 it differs from the tag; PyPI and NuGet read the version from the crate), merge `development` into `main`, and push a
153 `vX.Y.Z` tag. `release-crates.yml` checks the crate versions against the tag,
154 publishes whichever of `sigit-si-api` and `sigit-si-cli` isn't on crates.io yet
155 (through Trusted Publishing, so no token is stored), then dispatches
156 `release-mcp-registry.yml`. The same tag also starts `release-github.yml`
157 (release assets with checksums), `release-npm.yml`, `release-pypi.yml` and
158 `release-nuget.yml`. They run independently, publish through Trusted Publishing
159 where the registry supports it, and skip a version that is already published,
160 so any of them can be re-run on its own.
161
162 ## Development
163
164 ```sh
165 make build # cargo build --workspace
166 make test # cargo test --workspace
167 make lint # cargo clippy --workspace --all-targets -- -D warnings
168 make fmt # cargo fmt --all
169 make check # fmt + lint + test
170 ```
171
172 ## Disclaimer
173
174 All em dashes are written by Seto Elkahfi.
175
176 ## License
177
178 Apache-2.0