CLI
Public npm package @hostfunc/cli supports login, init, list, deploy, run, logs, and secrets set flows.
Step-by-Step Guide
1.Install and authenticate
Install the CLI globally, then sign in once per environment. hostfunc login opens your browser to authorize the device; use --token for CI or headless environments.
bash
npm install -g @hostfunc/cli# Browser sign-in (recommended) — prints a code, opens your browserhostfunc login --url https://hostfunc.io# CI / headless — use a workspace API token insteadhostfunc login --token <api-token> --url https://hostfunc.io2.Project configuration
CLI uses hostfunc.json in your project and token credentials stored in your hostfunc credentials directory.
hostfunc.jsonstores base URL and optional defaultfnId.- Credentials are stored in
~/.hostfunc/credentials.jsonby default. - Credential path can be overridden with
HOSTFUNC_CREDENTIALS_DIRorHOSTFUNC_CREDENTIALS_FILE.
3.Core commands
These commands are implemented and supported in current CLI.
bash
hostfunc init --fnId <fn_id>hostfunc listhostfunc deployhostfunc run --payload ./payload.jsonhostfunc logs --executionId <execution_id>hostfunc secrets set CLAUDE_API_KEY <value>4.Command to API mapping
CLI operations map directly to org-scoped API routes.
login(browser) ->POST /api/auth/device/code+/device/token, thenPOST /api/cli/device/exchangelogin --token->GET /api/cli/loginlist->GET /api/cli/functionsdeploy->POST /api/cli/functions/deployrun->POST /api/cli/functions/runlogs->GET /api/cli/executions/logssecrets set->POST /api/cli/secrets