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