HCC Docs

CLI

hcc is in the @hcc/cli package, and runs on Node.

npm install --save-dev @hcc/cli

Run hcc --help to see this list in your terminal.

hcc deploy

Scans your exports and deploys them: to test, or with --live to live and test. It writes hcc.gen.ts and .hcc/versions. Commit both.

OptionWhat it does
--liveDeploy to live and to test. Needs a live key (the Deploy preset). Also removes frozen versions no call uses
--no-testWith --live: live only
--checkWrite nothing and change nothing. Exits 1 if anything differs, or a frozen version is missing. For CI
--api-key <key>Default: HCC_TEST_API_KEY or HCC_API_KEY (with --live: HCC_API_KEY) from the environment, .dev.vars or .env
--api-url <url>The HCC API. Default: HCC_API_URL, else the hosted API
--config <path>Default: hcc.config.ts in this folder

hcc dev

Attaches a dev session, so the test environment's flow events reach your machine. With an hcc.config.ts, it also deploys to test on every save. See Local development.

hcc dev --forward-to http://localhost:8790/hcc -- wrangler dev --port 8790
OptionWhat it does
--forward-to <url>Where your server listens (localhost only)
--webhooks-to <url>Where your webhook handler listens (localhost only). Without it, copies are printed instead
--api-key <key>A test key. Default: HCC_TEST_API_KEY or HCC_API_KEY from the environment, .dev.vars or .env
--api-url <url>The HCC API. Default: HCC_API_URL, else the hosted API
--no-syncDon't deploy on save. hcc.gen.ts still follows your code
--sync-toolsOn save, also sync tools to agents that aren't test branches. Live calls use those tools
--config <path>Default: hcc.config.ts in this folder
-- <command>Run your server too. It stops when hcc dev does

hcc generate

Writes hcc.gen.ts and the current .hcc/versions, with no key and no network. Takes --config <path>.

hcc prune

Removes the .hcc/versions that no call and no active version needs. Commit the result. It needs a live key, and deploys nothing. See During a deploy.

In CI

hcc deploy --check # fails if the commit is missing what a deploy would write
# ship your server, then:
hcc deploy --live

Use a key with the Deploy preset. See API keys and scopes.