Skip to content

feat(cli): add models command to query available models on AIGNE Hub - #924

Open
lban2049 wants to merge 20 commits into
mainfrom
feat-hub-models-command
Open

lban2049 wants to merge 20 commits into
mainfrom
feat-hub-models-command

Conversation

@lban2049

@lban2049 lban2049 commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Related Issue

https://team.arcblock.io/task/task/667216838186237952

Major Changes

  • Add aigne hub models command with two subcommands:
    • aigne hub models check <model> - Check if a specific model is available on the connected hub
    • aigne hub models list - List available models with optional filters (--type, --search, --limit)
  • Support filtering models by type (chat, image, video, embedding) and searching by model name keyword
  • Include proper error handling for network failures and hub connection states

Screenshots

image image

Test Plan

  • Run aigne hub models list to verify model listing works
  • Run aigne hub models list --type chat to verify type filtering
  • Run aigne hub models list --search gpt to verify search functionality
  • Run aigne hub models check openai/gpt-4o to verify availability check
  • Run commands without hub connection to verify error handling
  • Run pnpm test in packages/cli to verify unit tests pass

Checklist

  • This change requires documentation updates, and I have updated the relevant documentation. If the documentation has not been updated, please create a documentation update issue and link it here
  • The changes are already covered by tests, and I have adjusted the test coverage for the changed parts
  • The newly added code logic is also covered by tests
  • This change adds dependencies, and they are placed in dependencies and devDependencies
  • This change includes adding or updating npm dependencies, and it does not result in multiple versions of the same dependency [check the diff of pnpm-lock.yaml]

Summary by AIGNE

Release Notes

New Feature:

  • Added aigne hub models command with check and list subcommands for managing AIGNE Hub models
  • models check verifies model availability on the hub
  • models list displays available models with filtering options (type, search, limit)
  • Both commands include proper authentication and error handling

Test:

  • Added comprehensive test coverage for new hub models functionality
  • Included unit tests for API utility functions and command handlers

@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown

Image description AIGNE CodeSmith

Walkthrough

This changeset implements a new AIGNE Hub models feature for the CLI, adding hub models check and hub models list commands. The implementation includes a utility module for API interactions with proper TypeScript interfaces, authentication, and error handling. The feature allows users to verify model availability and browse available models with filtering options (type, search, limit). Comprehensive test coverage is included for both command handlers and utility functions.

Changes

Files Summary
packages/cli/src/commands/hub.ts, packages/cli/src/utils/aigne-hub-models.ts Implements new models command with check and list subcommands. Adds utility module with checkModelAvailability() and fetchHubModels() functions, TypeScript interfaces for API responses, and authenticated HTTP requests with error handling.
packages/cli/test/commands/hub.test.ts, packages/cli/test/utils/aigne-hub-models.test.ts Adds comprehensive test coverage for hub models functionality including mock functions, test cases for both subcommands with filtering options, error handling scenarios, and unit tests for utility functions with mocked API responses.

This branch has not been deployed

No deployments
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.

2 participants