Skip to content

Commit a5ca263

Browse files
betegonclaudegithub-actions[bot]
authored
refactor(init): use shared DRY_RUN_FLAG and add -n alias (#676)
## Summary - Replace inline `--dry-run` flag definition with shared `DRY_RUN_FLAG` from `lib/mutate-command.ts` - Add missing `-n` alias via `DRY_RUN_ALIASES` — every other mutation command has this ## Test plan - [ ] `sentry init --dry-run` still works - [ ] `sentry init -n` now works (was missing before) - [ ] `sentry init --help` shows dry-run flag 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent ca14e7c commit a5ca263

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

docs/src/content/docs/commands/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Initialize Sentry in your project (experimental)
2323
| Option | Description |
2424
|--------|-------------|
2525
| `-y, --yes` | Non-interactive mode (accept defaults) |
26-
| `--dry-run` | Preview changes without applying them |
26+
| `-n, --dry-run` | Show what would happen without making changes |
2727
| `--features <features>...` | Features to enable: errors,tracing,logs,replay,metrics,profiling,sourcemaps,crons,ai-monitoring,user-feedback |
2828
| `-t, --team <team>` | Team slug to create the project under |
2929

plugins/sentry-cli/skills/sentry-cli/references/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Initialize Sentry in your project (experimental)
1717

1818
**Flags:**
1919
- `-y, --yes - Non-interactive mode (accept defaults)`
20-
- `--dry-run - Preview changes without applying them`
20+
- `-n, --dry-run - Show what would happen without making changes`
2121
- `--features <value>... - Features to enable: errors,tracing,logs,replay,metrics,profiling,sourcemaps,crons,ai-monitoring,user-feedback`
2222
- `-t, --team <value> - Team slug to create the project under`
2323

src/commands/init.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { warmOrgDetection } from "../lib/init/prefetch.js";
2727
import { runWizard } from "../lib/init/wizard-runner.js";
2828
import { validateResourceId } from "../lib/input-validation.js";
2929
import { logger } from "../lib/logger.js";
30+
import { DRY_RUN_ALIASES, DRY_RUN_FLAG } from "../lib/mutate-command.js";
3031

3132
const log = logger.withTag("init");
3233

@@ -209,11 +210,7 @@ export const initCommand = buildCommand<
209210
brief: "Non-interactive mode (accept defaults)",
210211
default: false,
211212
},
212-
"dry-run": {
213-
kind: "boolean",
214-
brief: "Preview changes without applying them",
215-
default: false,
216-
},
213+
"dry-run": DRY_RUN_FLAG,
217214
features: {
218215
kind: "parsed",
219216
parse: String,
@@ -230,6 +227,7 @@ export const initCommand = buildCommand<
230227
},
231228
},
232229
aliases: {
230+
...DRY_RUN_ALIASES,
233231
y: "yes",
234232
t: "team",
235233
},

src/lib/init/local-ops.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,8 @@ async function createSentryProject(
878878
orgSlug: options.org ?? "(dry-run)",
879879
projectSlug: slug,
880880
projectId: "(dry-run)",
881-
dsn: "(dry-run)",
882-
url: "(dry-run)",
881+
dsn: "https://key@o0.ingest.sentry.io/0",
882+
url: "https://sentry.io/dry-run",
883883
},
884884
};
885885
}

0 commit comments

Comments
 (0)