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:
.versionfile tracks installed versions; expired cache auto-refetches - Private registry support: Supports custom indexes and mirrors via config
- Safety confirmation: Interactive confirmation on install;
--yesto 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
- Create a
funchub.jsonorfunchub.yamltool 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" }
}
}
}
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file funchub_sdk-0.1.1.tar.gz.
File metadata
- Download URL: funchub_sdk-0.1.1.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f5baeab58ffcebc73e055a8d885cff6103318e7ea5617359213f06809888006
|
|
| MD5 |
933ba3fca0a671661240f0c7cf8e11d4
|
|
| BLAKE2b-256 |
a4af990c734c19965886c01dbc0e0177d0908d38fb464193da1a914f8b7b5ebb
|
File details
Details for the file funchub_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: funchub_sdk-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d0d19428309782d61d94312cd354f9954dad18e34530de8920f7bb53077c8c2
|
|
| MD5 |
d7de79b4b19f048103ac33fb191dc5fd
|
|
| BLAKE2b-256 |
90d192fbadfda7f3038b098b6c47905410dbad05d586f0ea6d2bdaefc0dbea0e
|