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.io

2.Project configuration

CLI uses hostfunc.json in your project and token credentials stored in your hostfunc credentials directory.

  • hostfunc.json stores base URL and optional default fnId.
  • Credentials are stored in ~/.hostfunc/credentials.json by default.
  • Credential path can be overridden with HOSTFUNC_CREDENTIALS_DIR or HOSTFUNC_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, then POST /api/cli/device/exchange
  • login --token -> GET /api/cli/login
  • list -> GET /api/cli/functions
  • deploy -> POST /api/cli/functions/deploy
  • run -> POST /api/cli/functions/run
  • logs -> GET /api/cli/executions/logs
  • secrets set -> POST /api/cli/secrets

Related Documentation