Skip to content

feat(slash-commands): add /weather and /exchange commands#250

Draft
AnayDhawan wants to merge 1 commit into
crynta:mainfrom
AnayDhawan:feat/weather-currency-tools
Draft

feat(slash-commands): add /weather and /exchange commands#250
AnayDhawan wants to merge 1 commit into
crynta:mainfrom
AnayDhawan:feat/weather-currency-tools

Conversation

@AnayDhawan
Copy link
Copy Markdown

What

Two new slash commands — /weather <city> and /exchange <FROM> <TO> [amount] — that run directly in the composer without invoking the AI model. Results are injected into the chat as local messages.

Why

Closes #249. Quick factual lookups shouldn't cost tokens or require waiting for a model response.

How

Added a local-run outcome type to SlashOutcome. When returned, composer.tsx awaits the execute function and injects user + result messages directly via Chat.messages setter, bypassing the transport layer entirely. API calls go through the existing ai_http_request Tauri command. /weather reads the OWM key from the OS keychain via secrets_get; /exchange uses frankfurter.app (no key needed).

Testing

  • pnpm exec tsc --noEmit clean
  • /weather Mumbai — returns conditions table
  • /weather New York imperial — returns °F
  • /exchange USD INR — returns rate
  • /exchange USD INR 500 — returns converted amount
  • /weather with no OWM key — returns helpful setup message

Notes for reviewer

/weather requires a free OpenWeatherMap key saved in Settings → API Keys (account: openweathermap). /exchange works out of the box.

@ResourceMint
Copy link
Copy Markdown

Lowkey a good idea to have this in the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: /weather and /exchange slash commands

2 participants