← Back to PRs

#6039: fix: improve type safety in gateway registration

by Bharadwajreddy1406 open 2026-02-01 06:44 View on GitHub →
cli
improvement : Added types for the methods calls runDaemonInstall, runDaemonRestart, runDaemonStart, runDaemonStatus, runDaemonStop, runDaemonUninstall, in register.ts from daemon-cli/types.js <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds explicit TypeScript option types to the gateway CLI command registrations (daemon lifecycle commands and the gateway RPC/health/probe commands) to improve type safety. Most changes are local to `src/cli/gateway-cli/register.ts` and tighten the `.action()` handler signatures so downstream helpers like `runDaemon*` and `callGatewayCli` receive more precise option shapes. <h3>Confidence Score: 3/5</h3> - Likely safe, but there’s at least one import/type issue that may break type-checking in some setups. - Changes are mostly type annotations and import reordering, but `DaemonInstallOptions`/`DaemonStatusOptions` are imported from `../daemon-cli.js` (a JS module) which is likely not exporting those types, and could cause build/typecheck failures depending on TS module resolution and how types are emitted/declared. - src/cli/gateway-cli/register.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs