Skip to main content

FuncHub - A tool registry and dynamic loader for AI agents

Project description

FuncHub

⚠️ Security Warning: FuncHub dynamically loads and executes code from remote Git repositories. Only install tools from sources you trust, and use in isolated environments.

FuncHub is a bilingual (Python + NestJS) tool registry and dynamic loader designed for AI Agents. It allows developers to publish, discover, install, and dynamically invoke tool functions.

Features

  • Dual SDKs: Python SDK + NestJS SDK, sharing the same design philosophy
  • Semver version management: Supports ^1.2.3, 1.x, latest, branch names, etc.
  • GitHub publishing integration: Automatic Fork + PR workflow via GitHub API v3
  • Cache management: .version file tracks installed versions; expired cache auto-refetches
  • Private registry support: Supports custom indexes and mirrors via config
  • Safety confirmation: Interactive confirmation on install; --yes to bypass

Installation

Python

pip install funchub-sdk

NestJS

npm install funchub-nestjs

Quick Start

1. Configure GitHub Token

# Python
funchub login --token ghp_xxxxxxxxxxxx

# NestJS
npx funchub login --token ghp_xxxxxxxxxxxx

2. Search for Tools

funchub search scraper
funchub search web

3. Install a Tool

# Install latest version
funchub install web_scraper

# Install with version constraint
funchub install web_scraper@^1.0

# Install development branch
funchub install web_scraper@main

4. List Installed Tools

funchub list

5. Use a Tool in Code

Python:

from funchub import FuncHub

hub = FuncHub()
scraper = hub.load("web_scraper")
result = scraper(url="https://example.com")

NestJS:

import { FuncHub } from '@funchub/nestjs';

const hub = new FuncHub();
const scraper = await hub.load('web_scraper');
const result = await scraper({ url: 'https://example.com' });

Command Reference

Command Description
funchub login --token <PAT> Save GitHub Personal Access Token
funchub config set <key> <value> Set configuration (e.g., custom registry)
funchub publish --version v1.0.0 Publish current directory as a tool
funchub publish --version v1.0.0 --force Overwrite existing tool with same name
funchub publish --version v1.0.0 --dry-run Preview without actual submission
funchub search <query> Search for tools in the registry
funchub install <name>@<constraint> Install a tool
funchub list List locally installed tools
funchub update <name> Update a tool to latest version
funchub update --all Update all installed tools
funchub info <name> Show tool details
funchub uninstall <name> Remove local tool cache

Publishing a Tool

  1. Create a funchub.json or funchub.yaml tool definition file in your project root:
{
  "name": "my_tool",
  "description": "My awesome tool",
  "version": "1.0.0",
  "entry_point": "src/index:handler",
  "parameters": {
    "type": "object",
    "properties": {
      "input": { "type": "string" }
    }
  }
}
  1. Publish:
funchub publish --version v1.0.0

If you have write access to the registry repo, the tool is committed directly. Otherwise, a Fork + PR is automatically created.


Decorator Usage (Python)

from funchub import funchub_tool

@funchub_tool(
    name="web_scraper",
    description="Scrape web page title",
    version="1.0.0"
)
def scrape_url(url: str) -> str:
    """Scrape the title from a URL."""
    import requests
    from bs4 import BeautifulSoup
    resp = requests.get(url)
    soup = BeautifulSoup(resp.text, 'html.parser')
    return soup.title.string if soup.title else "No title found"

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funchub_sdk-0.1.3.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

funchub_sdk-0.1.3-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file funchub_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: funchub_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for funchub_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1e6882646793c5d9b99aa2d09da32dd133ae8000efe5725e774814c3b49361e2
MD5 3b44e6ccb69b04beca0bbf6c3d4105fc
BLAKE2b-256 141e1fc03bbdacdae2c40e51f8d849fd4ffd4c937d1f0a2360ad39e8876134bf

See more details on using hashes here.

File details

Details for the file funchub_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: funchub_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for funchub_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 79ce6560703366bf02071a8675ea7a59141d715db67d8d5e60e00f3eb130222a
MD5 547949e2d03f7bce8cbd2406fc769fdf
BLAKE2b-256 29c5947303d8805cca143b839403845e833f8d239709e06cfb81e2d88a3f5237

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page