Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @ceramicnetwork/cli

Ceramic CLI

A command line interface that allows you to interact with the Ceramic protocol.

Getting started

Installation

To install the ceramic cli globally you can run:

$ npm install -g @ceramicnetwork/cli

Usage

To get an overview of the available commands run:

$ ceramic -h

To start an instance of the Ceramic daemon, make sure you have ipfs running locally and execute:

$ ceramic daemon

Development

Not yet implemented commands

ceramic user did

Show the DID of the user.

ceramic user sign <payload>

Ask the user to sign a given payload.

ceramic user encrypt <payload>

Ask the user to encrypt a given payload.

ceramic user decrypt <JWE | CWE>

Ask the user to decrypt a given JWE or CWE.

Contributing

We are happy to accept small and large contributions. Make sure to check out the Ceramic specifications for details of how the protocol works.

License

Index

References

CeramicCliUtils

Re-exports CeramicCliUtils

CeramicDaemon

Re-exports CeramicDaemon

CreateOpts

Re-exports CreateOpts

S3StateStore

Re-exports S3StateStore

makeCeramicConfig

Re-exports makeCeramicConfig

Variables

Const ACCESS_LOG_FMT

ACCESS_LOG_FMT: "ip=:remote-addr ts=:date[iso] method=:method original_url=:original-url base_url=:base-url path=:path:params http_version=:http-version req_header:req[header] status=:status content_length=:res[content-length] content_type=":res[content-type]" ref=:referrer user_agent=":user-agent" elapsed_ms=:total-time[3] error_message=":error-message" error_code=:error-code" = "ip=:remote-addr ts=:date[iso] method=:method original_url=:original-url base_url=:base-url path=:path:params http_version=:http-version req_header:req[header] status=:status content_length=:res[content-length] content_type=":res[content-type]" ref=:referrer user_agent=":user-agent" elapsed_ms=:total-time[3] error_message=":error-message" error_code=:error-code"

Const DEFAULT_CLI_CONFIG_FILE

DEFAULT_CLI_CONFIG_FILE: "config.json" = "config.json"

Const DEFAULT_CLI_CONFIG_PATH

DEFAULT_CLI_CONFIG_PATH: string = path.join(os.homedir(), '.ceramic')

Const DEFAULT_HOSTNAME

DEFAULT_HOSTNAME: "0.0.0.0" = "0.0.0.0"

Const DEFAULT_NETWORK

DEFAULT_NETWORK: TESTNET_CLAY = Networks.TESTNET_CLAY

Const DEFAULT_PORT

DEFAULT_PORT: 7007 = 7007

Const IPFS_DHT_SERVER_MODE

IPFS_DHT_SERVER_MODE: boolean = process.env.IPFS_DHT_SERVER_MODE === 'true'

Const IPFS_GET_TIMEOUT

IPFS_GET_TIMEOUT: 60000 = 60000

Const config

config: Command = program.command('config')

Const dagJoseFormat

dagJoseFormat: Format<string | DagJWS | DagJWE> = convert(dagJose)

Const pin

pin: Command = program.command('pin')

Const schemas

schemas: Command = program.command('schema')

Functions

buildIpfsConnection

  • buildIpfsConnection(network: string, logger: DiagnosticsLogger, ipfsEndpoint?: string): Promise<IpfsApi>

createIPFS

  • createIPFS(path: string): Promise<IpfsApi>

errorHandler

  • errorHandler(logger: DiagnosticsLogger): ErrorRequestHandler

logRequests

  • logRequests(loggerProvider: LoggerProvider): any[]

makeCeramicConfig

  • makeCeramicConfig(opts: CreateOpts): CeramicConfig

makeDID

  • makeDID(ceramic: CeramicApi, seed?: string): DID

parseQueryObject

  • parseQueryObject(opts: Record<string, any>): Record<string, string | boolean | number>
  • Takes a query object and parses the values to give them proper types instead of having everything as strings

    Parameters

    • opts: Record<string, any>

    Returns Record<string, string | boolean | number>

upconvertLegacySyncOption

  • upconvertLegacySyncOption(opts: Record<string, any> | undefined): void
  • Converts 'sync' option sent as a bool by outdated http-clients to the current format of an enum. The old behaviors don't map directly to the new behaviors, so we take the best approximation. TODO remove this once we no longer need to support clients older than v1.0.0

    Parameters

    • opts: Record<string, any> | undefined

    Returns void