Repository navigation
refactor: Rename commands to shortcuts - #118
Merged
Merged
Conversation
This rename distinguishes between CLI commands (like 'infer config') and
chat shortcuts (like '/config' and '/help') used within the interactive
chat interface.
Key Changes:
- Renamed internal/commands → internal/shortcuts
- Updated all type definitions (Command → Shortcut, CommandResult → ShortcutResult)
- Updated variable names (commandRegistry → shortcutRegistry)
- Updated function names (GetSelectedCommand → GetSelectedShortcut)
- Updated constructor names (NewConfigCommand → NewConfigShortcut)
- Updated user-facing help text ("for commands" → "for shortcuts")
Fixes confusion between actual CLI commands and chat interface shortcuts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Eden Reich <[email protected]>
Clean up old internal/commands directory now that all functionality has been moved to internal/shortcuts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Eden Reich <[email protected]>
Contributor
Author
|
@claude CI is failing. |
Contributor
|
Claude finished @edenreich's task —— View job CI Failures Fixed ✅Successfully fixed the CI linter failures in the commands-to-shortcuts refactor. Completed:
What was fixed:
Results:
The refactoring issues have been resolved. The CI should pass now that the test files correctly reference the new --- | Current run |
- Change CommandOption to ShortcutOption in autocomplete_test.go - Change .Command to .Shortcut field references - Change commands.Registry to shortcuts.Registry in components_factory_test.go Co-authored-by: Eden Reich <[email protected]>
…larity standard go-library imports are not named imports only the internals are named for clarity and consistency. Also ran go fmt ./... Signed-off-by: Eden Reich <[email protected]>
…ering logic Signed-off-by: Eden Reich <[email protected]>
Signed-off-by: Eden Reich <[email protected]>
Signed-off-by: Eden Reich <[email protected]>
Contributor
|
🎉 This PR is included in version 0.42.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closed
This was referenced Sep 26, 2026
edenreich
pushed a commit
that referenced
this pull request
Sep 26, 2026
) Resolves #1332 ## Summary `infer agents add <name>` only accepted a bare name for the five agents hardcoded in `config/agent_defaults.go`; every other catalog entry (e.g. `grafana-agent`) failed with `URL is required for unknown agent`. This adds a catalog fallback: when a name has no built-in defaults and no URL was passed, the CLI fetches the published agents catalog (`inference-gateway/agents` `catalog.json`) and derives the entry from it, mirroring exactly what the registry site's `deriveInstallCommand`/`deriveImage` helpers render today. ## Changes - New `cmd/agents/catalog.go`: fetches `https://raw.githubusercontent.com/inference-gateway/agents/main/catalog.json` (best-effort, nil on any failure) and resolves an entry into `config.AgentDefaults`: - URL from `spec.server` (`<scheme>://localhost:<port>`, defaults http/8080, free port picked like the built-in defaults), - OCI image from `spec.deployment.cloudrun/kubernetes.image` when declared, else `ghcr.io/inference-gateway/<name>:<version>` when `spec.scm.url` points at the inference-gateway GitHub org (the registry's fallback; this is what fires for all six current entries), - `run: true` only when an image could be derived. - `cmd/agents/agents.go`: consulted after built-in defaults (which still win), before the existing `URL is required for unknown agent` error (unchanged, still names the URL argument); help text updated. - `cmd/agents/catalog_test.go`: table-driven tests via httptest covering the scm-derived image, deployment-declared image winning, third-party URL-only entries, unknown names, and an unreachable catalog. ## Behavior - `infer agents add grafana-agent` now writes a working entry: URL `http://localhost:<free port>`, OCI `ghcr.io/inference-gateway/grafana-agent:0.3.9`, `run: true`. - Offline/catalog-unreachable: the five built-ins behave exactly as before; unknown names still error with `URL is required for unknown agent ...`. - Explicitly passing a URL skips the catalog entirely (no network on that path). ## Downstream - inference-gateway/registry: PR #118's registry-side workaround (rendering the full `<name> <url> --oci <image> --run` form for non-built-in agents) can now be dropped; follow-up issue filed. no docs ticket: docs update filed separately (agents add catalog resolution documented in the [DOCS] issue). Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #116
Generated with Claude Code