Skip to main content

arc provider

arc provider handles provider package operations, currently publishing a provider's AUP resource tree to Cloudflare Pages so it can be referenced by URL.

arc provider handles operations on provider packages themselves (the npm packages that implement AFS providers), as opposed to arc afs, which operates on what a provider exposes once mounted.

bash
arc provider <subcommand> [options]

Global flags (see Overview): --json, --view, --instance / -i (which local ARC instance; omit for default), and --home (instance root; to pick which instance, use --instance).

arc provider publish-resources

Publish a provider package's aup/ tree to CF Pages, under /_providers/<name>@<version>/. This is how a provider's companion resources (like UI snippets referenced from AUP) become fetchable by URL.

Usage

bash
arc provider publish-resources <package> [options]
  • package (required): npm package name, e.g. @aigne/afs-ocap, or a path to the package directory
  • --cloud <fs|cf|none>: deploy target: fs writes a local Pages dir, cf pushes to Cloudflare Pages, none stages into ~/.afs/blocklets-staging without pushing, for batch deploys where only the last command should push (default fs)
  • --pages-root <path>: local Pages store root, only for --cloud fs (default ~/.arc/pages)
  • --cf-account-id <id>: Cloudflare account ID, used for --cloud cf read operations
  • --cf-api-token <token>: Cloudflare API token, used for --cloud cf read operations
  • --deployment <id>: Cloudflare deployment id (staging/prod/...), resolves pagesProject from runtimes/cloudflare/instances.json; mutually exclusive with --project
  • --project <name>: Pages project name, an escape hatch for projects not in instances.json; mutually exclusive with --deployment; defaults to afsd-blocklets when neither is set

The --deployment/--project exclusion is declared and enforced, not just documented:

bash
$ arc provider publish-resources @aigne/afs-ocap --deployment foo --project bar
ERROR: Arguments deployment and project are mutually exclusive

A real package publishes to --cloud fs without either flag (the cumulative-staging count keeps growing with every publish to that store, so yours will differ):

bash
$ arc provider publish-resources ./providers/runtime/ocap --cloud fs --pages-root /tmp/pages
Published 23 file(s) to /_providers/ocap@2.0.0-beta.48/
  package:  ./providers/runtime/ocap
  provider: ocap@2.0.0-beta.48
  bytes:    170952
  target:   local Pages store (cumulative staging: 1983 file(s))
  deploy:   deploy-1789005081569-e83ray