Skip to content

cub worker key add

cub worker key add

Register a public key for a worker

Synopsis

Register a public key against a worker's identity.

Either generate a keypair here with --generate, which stores the private key locally and registers the public half, or register a public key you already have with --public-key.

--generate takes an alias or a path. A bare name is an alias stored under ~/.confighub/keys, which is what "cub auth login --private-key=" looks up; anything containing a path separator is written there instead.

The private key never reaches ConfigHub in either case.

Examples:

  # Generate a keypair for a worker and register the public half
  cub worker key add my-worker --generate my-worker

  # Register a public key you already have
  cub worker key add my-worker --public-key ./worker.pub.jwk

  # Record which host holds the private key
  cub worker key add my-worker --generate ci --description "CI runner, us-east"
cub worker key add <worker> [flags]

Options

      --description string   note recording which host or pipeline holds the private key
      --generate string      generate an Ed25519 keypair, store the private key under this alias (or path), and register the public half
  -h, --help                 help for add
      --public-key string    file holding the public key as a JWK, or - for stdin

Options inherited from parent commands

      --component string   the Component of --variant, when that names the variant alone; --variant <component>/<variant> says the same in one flag
      --context string     The context to use for this command
      --debug              Debug output
      --space string       space to operate in, by slug or UUID. Omitted, a list or bulk operation spans the organization and a single entity is named as <space>/<slug>
      --variant string     variant to operate in, as <component>/<variant>, or as <variant> with --component: the space naming that Component whose Variant label is <variant>. The same scope as --space, named by what it is rather than by the space's slug; the two cannot be combined

SEE ALSO