Templates for Knative Functions. Users create
functions via func create -r <this-repo> -l <language> -t <template>.
# Example: create a Go function from the "hello" template
func create myfunc -r https://github.com/functions-dev/templates -l go -t helloAll files in a template directory are copied to the user's project (except manifest.yaml
which holds some metadata that the function will need and hidden files).
Templates are organized as <language>/<template>/. The -l flag matches the language
directory, the -t flag matches the template subdirectory:
go/hello/ → func create -l go -t hello
python/echo/ → func create -l python -t echo
rust/echo-cloudevents/ → func create -l rust -t echo-cloudevents
Available in all languages (go, node, python, quarkus, rust, springboot, typescript):
| Template | Description |
|---|---|
hello |
Returns {"message":"Hello <Language> World!"}. Simplest starting point. |
echo |
Echoes back the request. GET returns query string, POST returns body. |
echo-cloudevents |
Receives a CloudEvent, echoes the data back as a new CloudEvent. |
Go-specific:
| Template | Description |
|---|---|
go/blog |
Hugo-powered blog served as static files. Requires make to build before use. |
go/splash |
Static splash page serving HTML, CSS, and PNG files. |
Python-specific:
| Template | Description |
|---|---|
python/pdf-processing |
PDF operations (extract text, metadata, split, merge) via HTTP. |
python/mcp |
MCP server exposing basic tools (hello, add_numbers) via Model Context Protocol. |
python/mcp-ollama-rag |
RAG via MCP — combines Ollama with Chroma vector DB for document Q&A. Needs Ollama. |
python/sqlite |
REST API backed by SQLite. CRUD on tables with zero external dependencies. |
python/keycloak-auth |
Validates Keycloak JWT Bearer tokens via OIDC/JWKS. Protects endpoints with auth. |
For contributing to this repo, see CONTRIBUTING.md.