# Function

URL: https://docs.hanzo.ai/docs/cli/function

> The `hanzo function` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/function) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/function) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Your serverless code: publish it, call it over HTTP, watch every run and what it cost.

[API reference →](https://docs.hanzo.ai/docs/openapi/function)

```bash
hanzo function list
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                               | What it does                                                                                                                                                                                  |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hanzo function create --name <name>` | Publishes a serverless function under the caller's org and answers 201 with it.                                                                                                               |
| `hanzo function deployments`          | What is live right now — each function's current record IS its live deployment, so this is the deployment inventory.                                                                          |
| `hanzo function get <name>`           | One function with everything a detail page needs in one round-trip: its definition, its 7-day rollup, its trigger, its twenty most recent invocations and the NAMES of the secrets it mounts. |
| `hanzo function invocations <name>`   | One function's past runs, newest first — each with its status, HTTP code, method, time and duration.                                                                                          |
| `hanzo function invoke <name>`        | Runs a function and records a REAL invocation.                                                                                                                                                |
| `hanzo function list`                 | Every serverless function the caller's org has published, each with its real 7-day rollup.                                                                                                    |
| `hanzo function logs <name>`          | The output of a function's most recent run — its error text when that run failed, else what it printed.                                                                                       |
| `hanzo function metrics`              | The org's serverless dashboard over a window: a per-function invocation costLine and how those invocations ended.                                                                             |
| `hanzo function rm <name>`            | Removes one of the caller org's functions and answers 204.                                                                                                                                    |
| `hanzo function secrets`              | The NAMES of the secrets the caller org's functions mount.                                                                                                                                    |
| `hanzo function triggers`             | What calls the caller org's functions — one row per function.                                                                                                                                 |
