Skip to content

Commit e8e9d15

Browse files
authored
Merge pull request #1 from betegon/rename-to-sentry-cli-next
refactor: rename CLI from sry to sentry-cli-next
2 parents d4c626a + 2facf07 commit e8e9d15

File tree

24 files changed

+126
-126
lines changed

24 files changed

+126
-126
lines changed

DEVELOPMENT.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Development Guide
22

3-
This guide explains how to develop and test the sry CLI and OAuth proxy locally.
3+
This guide explains how to develop and test the Sentry CLI and OAuth proxy locally.
44

55
## Prerequisites
66

@@ -10,11 +10,11 @@ This guide explains how to develop and test the sry CLI and OAuth proxy locally.
1010
## Project Structure
1111

1212
```
13-
sry/
13+
sentry-cli-next/
1414
├── apps/
1515
│ └── oauth-proxy/ # Hono server for device flow OAuth
1616
└── packages/
17-
└── cli/ # The sry CLI
17+
└── cli/ # The Sentry CLI
1818
```
1919

2020
## Setup
@@ -28,8 +28,8 @@ bun install
2828
2. Create a `.env` file in the project root:
2929

3030
```
31-
SRY_CLIENT_ID=your-sentry-oauth-client-id
32-
SRY_CLIENT_SECRET=your-sentry-oauth-client-secret
31+
SENTRY_CLIENT_ID=your-sentry-oauth-client-id
32+
SENTRY_CLIENT_SECRET=your-sentry-oauth-client-secret
3333
```
3434

3535
Get these from your Sentry OAuth application settings.
@@ -51,7 +51,7 @@ This starts the proxy on `http://127.0.0.1:8723` (matching your Sentry OAuth app
5151

5252
```bash
5353
cd packages/cli
54-
SRY_OAUTH_PROXY_URL=http://127.0.0.1:8723 bun run src/bin.ts auth login
54+
SENTRY_OAUTH_PROXY_URL=http://127.0.0.1:8723 bun run src/bin.ts auth login
5555
```
5656

5757
## Testing the Device Flow
@@ -62,7 +62,7 @@ SRY_OAUTH_PROXY_URL=http://127.0.0.1:8723 bun run src/bin.ts auth login
6262

6363
```bash
6464
cd packages/cli
65-
SRY_OAUTH_PROXY_URL=http://127.0.0.1:8723 bun run src/bin.ts auth login
65+
SENTRY_OAUTH_PROXY_URL=http://127.0.0.1:8723 bun run src/bin.ts auth login
6666
```
6767

6868
3. You'll see output like:
@@ -104,16 +104,16 @@ When creating your Sentry OAuth application, set:
104104

105105
### OAuth Proxy
106106

107-
| Variable | Description |
108-
| ------------------- | ------------------------------ |
109-
| `SRY_CLIENT_ID` | Sentry OAuth app client ID |
110-
| `SRY_CLIENT_SECRET` | Sentry OAuth app client secret |
107+
| Variable | Description |
108+
| ---------------------- | ------------------------------ |
109+
| `SENTRY_CLIENT_ID` | Sentry OAuth app client ID |
110+
| `SENTRY_CLIENT_SECRET` | Sentry OAuth app client secret |
111111

112112
### CLI
113113

114-
| Variable | Description | Default |
115-
| --------------------- | --------------- | ------------------------------ |
116-
| `SRY_OAUTH_PROXY_URL` | OAuth proxy URL | `https://sry-oauth.vercel.app` |
114+
| Variable | Description | Default |
115+
| ------------------------ | --------------- | ------------------------------ |
116+
| `SENTRY_OAUTH_PROXY_URL` | OAuth proxy URL | `https://sry-oauth.vercel.app` |
117117

118118
## Deploying the OAuth Proxy
119119

@@ -122,8 +122,8 @@ cd apps/oauth-proxy
122122
bunx vercel
123123

124124
# Set environment variables in Vercel dashboard or via CLI:
125-
bunx vercel env add SRY_CLIENT_ID
126-
bunx vercel env add SRY_CLIENT_SECRET
125+
bunx vercel env add SENTRY_CLIENT_ID
126+
bunx vercel env add SENTRY_CLIENT_SECRET
127127
```
128128

129129
After deployment, update the default `OAUTH_PROXY_URL` in `packages/cli/src/lib/oauth.ts` to your Vercel URL.

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
# sry
1+
# sentry-cli-next
22

33
A gh-like CLI for Sentry.
44

55
## Setup
66

77
```bash
88
# Login via OAuth (device flow)
9-
sry auth login
9+
sentry auth login
1010
```
1111

1212
You'll be given a URL and a code to enter. Once you authorize, the CLI will automatically receive your token.
1313

1414
Or use an API token directly:
1515

1616
```bash
17-
sry auth login --token YOUR_SENTRY_API_TOKEN
17+
sentry auth login --token YOUR_SENTRY_API_TOKEN
1818
```
1919

2020
## Commands
2121

2222
### Auth
2323

2424
```bash
25-
sry auth login # Login via OAuth device flow
26-
sry auth logout # Logout
27-
sry auth status # Check auth status
25+
sentry auth login # Login via OAuth device flow
26+
sentry auth logout # Logout
27+
sentry auth status # Check auth status
2828
```
2929

3030
### Organizations
3131

3232
```bash
33-
sry org list # List all orgs
34-
sry org list --json # Output as JSON
33+
sentry org list # List all orgs
34+
sentry org list --json # Output as JSON
3535
```
3636

3737
### Projects
3838

3939
```bash
40-
sry project list # List all projects
41-
sry project list my-org # List projects in org
42-
sry project list --platform javascript # Filter by platform
40+
sentry project list # List all projects
41+
sentry project list my-org # List projects in org
42+
sentry project list --platform javascript # Filter by platform
4343
```
4444

4545
### Issues
4646

4747
```bash
48-
sry issue list --org my-org --project my-project # List issues
49-
sry issue list --org my-org --project my-project --json
50-
sry issue get 123456789 # Get issue by ID
51-
sry issue get 123456789 --event # Include latest event
48+
sentry issue list --org my-org --project my-project # List issues
49+
sentry issue list --org my-org --project my-project --json
50+
sentry issue get 123456789 # Get issue by ID
51+
sentry issue get 123456789 --event # Include latest event
5252
```
5353

5454
### API
5555

5656
```bash
57-
sry api /organizations/ # GET request
58-
sry api /issues/123/ --method PUT --field status=resolved
59-
sry api /organizations/ --include # Show headers
57+
sentry api /organizations/ # GET request
58+
sentry api /issues/123/ --method PUT --field status=resolved
59+
sentry api /organizations/ --include # Show headers
6060
```
6161

6262
## Development
6363

6464
This is a Turborepo monorepo with:
65-
- `packages/cli` - The sry CLI
65+
- `packages/cli` - The Sentry CLI
6666
- `apps/oauth-proxy` - OAuth proxy server (deployed on Vercel)
6767

6868
```bash
@@ -76,4 +76,4 @@ bun run build # Build binary
7676

7777
## Config
7878

79-
Stored in `~/.sry/config.json` (mode 600).
79+
Stored in `~/.sentry-cli-next/config.json` (mode 600).

apps/oauth-proxy/api/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const SENTRY_OAUTH_AUTHORIZE = "https://sentry.io/oauth/authorize/";
1717
const SENTRY_OAUTH_TOKEN = "https://sentry.io/oauth/token/";
1818

1919
// These are set in Vercel environment variables
20-
const CLIENT_ID = process.env.SRY_CLIENT_ID ?? "";
21-
const CLIENT_SECRET = process.env.SRY_CLIENT_SECRET ?? "";
20+
const CLIENT_ID = process.env.SENTRY_CLIENT_ID ?? "";
21+
const CLIENT_SECRET = process.env.SENTRY_CLIENT_SECRET ?? "";
2222

2323
// Device flow configuration
2424
const DEVICE_CODE_EXPIRES_IN = 900; // 15 minutes
@@ -157,13 +157,13 @@ function authorizePage(error?: string): string {
157157
return `<!DOCTYPE html>
158158
<html>
159159
<head>
160-
<title>sry CLI - Authorize</title>
160+
<title>Sentry CLI - Authorize</title>
161161
<meta name="viewport" content="width=device-width, initial-scale=1">
162162
<style>${HTML_STYLE}</style>
163163
</head>
164164
<body>
165165
<div class="container">
166-
<h1>🔐 sry CLI</h1>
166+
<h1>🔐 Sentry CLI</h1>
167167
<p class="subtitle">Enter the code shown in your terminal</p>
168168
<form method="GET" action="/device/verify">
169169
<input type="text" name="user_code" placeholder="XXXX-0000" maxlength="9" required autofocus>
@@ -179,7 +179,7 @@ function successPage(): string {
179179
return `<!DOCTYPE html>
180180
<html>
181181
<head>
182-
<title>sry CLI - Success</title>
182+
<title>Sentry CLI - Success</title>
183183
<meta name="viewport" content="width=device-width, initial-scale=1">
184184
<style>${HTML_STYLE}</style>
185185
</head>
@@ -196,7 +196,7 @@ function errorPage(message: string): string {
196196
return `<!DOCTYPE html>
197197
<html>
198198
<head>
199-
<title>sry CLI - Error</title>
199+
<title>Sentry CLI - Error</title>
200200
<meta name="viewport" content="width=device-width, initial-scale=1">
201201
<style>${HTML_STYLE}</style>
202202
</head>
@@ -220,7 +220,7 @@ const app = new Hono();
220220
app.use("*", cors());
221221

222222
// Health check
223-
app.get("/", (c) => c.json({ status: "ok", service: "sry-oauth-proxy" }));
223+
app.get("/", (c) => c.json({ status: "ok", service: "sentry-oauth-proxy" }));
224224

225225
// ─────────────────────────────────────────────────────────────────────────────
226226
// Device Flow Endpoints

apps/oauth-proxy/dev.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const PORT = Number(process.env.PORT) || 8723;
1717
const SENTRY_OAUTH_AUTHORIZE = "https://sentry.io/oauth/authorize/";
1818
const SENTRY_OAUTH_TOKEN = "https://sentry.io/oauth/token/";
1919

20-
const CLIENT_ID = process.env.SRY_CLIENT_ID ?? "";
21-
const CLIENT_SECRET = process.env.SRY_CLIENT_SECRET ?? "";
20+
const CLIENT_ID = process.env.SENTRY_CLIENT_ID ?? "";
21+
const CLIENT_SECRET = process.env.SENTRY_CLIENT_SECRET ?? "";
2222

2323
const DEVICE_CODE_EXPIRES_IN = 900;
2424
const POLLING_INTERVAL = 5;
@@ -39,7 +39,7 @@ const SCOPES = [
3939

4040
if (!(CLIENT_ID && CLIENT_SECRET)) {
4141
console.error(
42-
"❌ Missing SRY_CLIENT_ID or SRY_CLIENT_SECRET. Create a .env file in the project root."
42+
"❌ Missing SENTRY_CLIENT_ID or SENTRY_CLIENT_SECRET. Create a .env file in the project root."
4343
);
4444
process.exit(1);
4545
}
@@ -158,13 +158,13 @@ function authorizePage(error?: string): string {
158158
return `<!DOCTYPE html>
159159
<html>
160160
<head>
161-
<title>sry CLI - Authorize</title>
161+
<title>Sentry CLI - Authorize</title>
162162
<meta name="viewport" content="width=device-width, initial-scale=1">
163163
<style>${HTML_STYLE}</style>
164164
</head>
165165
<body>
166166
<div class="container">
167-
<h1>🔐 sry CLI</h1>
167+
<h1>🔐 Sentry CLI</h1>
168168
<p class="subtitle">Enter the code shown in your terminal</p>
169169
<form method="GET" action="/device/verify">
170170
<input type="text" name="user_code" placeholder="XXXX-0000" maxlength="9" required autofocus>
@@ -180,7 +180,7 @@ function successPage(): string {
180180
return `<!DOCTYPE html>
181181
<html>
182182
<head>
183-
<title>sry CLI - Success</title>
183+
<title>Sentry CLI - Success</title>
184184
<meta name="viewport" content="width=device-width, initial-scale=1">
185185
<style>${HTML_STYLE}</style>
186186
</head>
@@ -197,7 +197,7 @@ function errorPage(message: string): string {
197197
return `<!DOCTYPE html>
198198
<html>
199199
<head>
200-
<title>sry CLI - Error</title>
200+
<title>Sentry CLI - Error</title>
201201
<meta name="viewport" content="width=device-width, initial-scale=1">
202202
<style>${HTML_STYLE}</style>
203203
</head>
@@ -220,7 +220,7 @@ const app = new Hono();
220220
app.use("*", cors());
221221

222222
app.get("/", (c) =>
223-
c.json({ status: "ok", service: "sry-oauth-proxy", mode: "development" })
223+
c.json({ status: "ok", service: "sentry-oauth-proxy", mode: "development" })
224224
);
225225

226226
app.post("/device/code", (c) => {
@@ -422,7 +422,7 @@ Endpoints:
422422
423423
To test with the CLI:
424424
cd packages/cli
425-
SRY_OAUTH_PROXY_URL=http://127.0.0.1:${PORT} bun run src/bin.ts auth login
425+
SENTRY_OAUTH_PROXY_URL=http://127.0.0.1:${PORT} bun run src/bin.ts auth login
426426
`);
427427

428428
export default {

apps/oauth-proxy/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@sry/oauth-proxy",
2+
"name": "@sentry/oauth-proxy",
33
"version": "0.1.0",
4-
"description": "OAuth proxy server for sry CLI device flow",
4+
"description": "OAuth proxy server for Sentry CLI device flow",
55
"type": "module",
66
"scripts": {
77
"dev": "bun run --env-file=../../.env dev.ts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "sry",
2+
"name": "sentry-cli-next",
33
"version": "0.1.0",
44
"private": true,
55
"description": "A gh-like CLI for Sentry",

packages/cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "@sry/cli",
2+
"name": "@sentry/cli",
33
"version": "0.1.0",
44
"description": "A gh-like CLI for Sentry",
55
"type": "module",
66
"bin": {
7-
"sry": "./src/bin.ts"
7+
"sentry": "./src/bin.ts"
88
},
99
"scripts": {
1010
"dev": "bun run src/bin.ts",
11-
"build": "fossilize -o sry src/bin.ts",
12-
"build:all": "FOSSILIZE_PLATFORMS=darwin-arm64,darwin-x64,linux-x64,linux-arm64,win-x64 fossilize -o sry src/bin.ts",
11+
"build": "fossilize -o sentry src/bin.ts",
12+
"build:all": "FOSSILIZE_PLATFORMS=darwin-arm64,darwin-x64,linux-x64,linux-arm64,win-x64 fossilize -o sentry src/bin.ts",
1313
"typecheck": "tsc --noEmit"
1414
},
1515
"devDependencies": {

packages/cli/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ const routes = buildRouteMap({
1616
docs: {
1717
brief: "A gh-like CLI for Sentry",
1818
fullDescription:
19-
"sry is a command-line interface for interacting with Sentry. " +
19+
"sentry is a command-line interface for interacting with Sentry. " +
2020
"It provides commands for authentication, viewing issues, and making API calls.",
2121
hideRoute: {},
2222
},
2323
});
2424

2525
export const app = buildApplication(routes, {
26-
name: "sry",
26+
name: "sentry",
2727
versionInfo: {
2828
currentVersion: "0.1.0",
2929
},

packages/cli/src/commands/api.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* sry api
2+
* sentry api
33
*
44
* Make raw authenticated API requests to Sentry.
55
* Similar to 'gh api' for GitHub.
66
*/
77

88
import { buildCommand } from "@stricli/core";
9-
import type { SryContext } from "../context.js";
9+
import type { SentryContext } from "../context.js";
1010
import { rawApiRequest } from "../lib/api-client.js";
1111

1212
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
@@ -162,9 +162,9 @@ export const apiCommand = buildCommand({
162162
"The endpoint should start with '/api/0/' or be a full URL. " +
163163
"Authentication is handled automatically using your stored credentials.\n\n" +
164164
"Examples:\n" +
165-
" sry api /api/0/organizations/\n" +
166-
" sry api /api/0/issues/123/ --method PUT --field status=resolved\n" +
167-
" sry api /api/0/projects/my-org/my-project/issues/",
165+
" sentry api /api/0/organizations/\n" +
166+
" sentry api /api/0/issues/123/ --method PUT --field status=resolved\n" +
167+
" sentry api /api/0/projects/my-org/my-project/issues/",
168168
},
169169
parameters: {
170170
positional: {
@@ -211,7 +211,7 @@ export const apiCommand = buildCommand({
211211
},
212212
},
213213
async func(
214-
this: SryContext,
214+
this: SentryContext,
215215
flags: ApiFlags,
216216
endpoint: string
217217
): Promise<void> {

0 commit comments

Comments
 (0)