4.0.1 • Published 6 months ago

@contextdao/cli v4.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Quick Start

CLI for context

This document provides instructions for getting started with Context. It includes commands for installing the CLI, developing and publishing smart documents, and keeping your local repository up to date with changes made by other team members.

Installation

npm install -g @contextdao/cli

BEFORE ctx init

Firstly, create a project working directory:

mkdir cooldapp

cd cooldapp

Initializing the project

Surely, you has just already executed this command.

ctx init <name>

The init command automatically create locally the context document repository structure:

cooldapp/ (dir) context.json (file) .env (file) data/ (dir) README.md (file) assets/ (dir)

Now you need indicate a Ethereum private key into the .ENV file inside the repository:

PRIVATEKEY=

The ethereum wallet uses for signing the transactions (commit, push, etc..).

context.json:

  • name: the main name of your context document

  • address: your Ethereum public address

  • network: devnet, testnet or mainnet

  • names: list of names and subnames with all their installed schemas, lastTx, document type, etc. type: 1=data, 0=schema prevTxId: Last transaction id (Arweave, IPFS, Filecoin, etc.) schemas: list of installed schemas assets: list of upload assets lastCommitTimestamp: last commit (timestamp)

Example:

{
  "name": "alice",
  "network": "devnet",
  "address": "",
  "names": {
    "alice": {
      "type": 1,
      "prevTxId": "eFhVioQaZYX6ihF8SRI2mlzppl4yn130voMflLZ1cMo",
      "schemas": {
        "web3/nft": {
          "name": "web3",
          "subname": "nft",
          "major": 1,
          "minor": 0,
          "patch": 0
        },
        "web3/contract": {
          "name": "web3",
          "subname": "contract",
          "major": 1,
          "minor": 0,
          "patch": 0
        }
      },
      "assets": {},
      "lastCommitTimestamp": 1694069616312
    }
  }
}

.env:

  • PRIVATEKEY: your private key (ethereum wallet). Be sure to never share your private key with anyone.

data:

This directory contains all JSON data of our context document. Names and Subnames.

Structure:

data/ / index.json (mandatory) / .json .json / .json .json <name_2>/ index.json <name_3>/ index.json <name_4>/ index.json

Example:

data/ alice/ index.json token/ 1.json 2.json team/ 0.json 1.json

README file

It´s a basic quick start of the context CLI. "The doc you´re reading now"

AFTER ctx init

Now, you can execute:

ctx read <name>

Commit and Push changes

Modify your JSON data of your context document following the "installed" schemas:

data//index.json

Example:

{
  "name": "bob project",
  "website": "www.bob.io"
}

An then:

ctx commit
ctx push

Available commands

      help                   Shows this help message
      init                   Init project : ctx init <level1> --network=<network> --type=<"data"|"schema"> --wallet --storage=<storage>
      status                 Check changes : ctx status
      commit                 Commit changes : ctx commit <level2?> --comments=<comments>
      push                   Publish a new version : ctx push <level2?>
      pull                   Pull remote changes : ctx pull <level2?>
      read                   Get any document or schema : ctx read <level1>/<level2>
      add                    Add a level2 : ctx add <level2> --type=<"data"|"schema">
      install, i             Install schema : ctx install <schema> <level2?>
      owner                  Change owner : ctx owner <address>
      link                   Link an asset: ctx link <level2> <filename. eg: lion.jpg> <path. eg: token/1/image>
      schemas                List of schemes containing <name> in the name and description : ctx schemas <name?>
      clone                  Clone document or schema : ctx clone <level1> --network=<network> --wallet
      send                   Send CTX tokens : ctx send <tokens> <level1>
      deposit                Deposit CTX tokens : ctx deposit <tokens> <level1?>
      withdraw               Withdraw CTX tokens : ctx withdraw <tokens> <level1?>

Available commands for curators

      register               Register names : ctx register <address> <level1?>
      invite                 Invite someone to use context : ctx invite <level1>

Command options

      --type                 Set type of repository. Values: data | schema. Commands: init, add
      --network              Set network. Values: devnet, testnet or mainnet. Commands: init, clone
      --wallet               Create a new wallet. Commands: init, clone
      --storage              Set storage. Values: arweave or ipfs. Commands: init, add
      --comments             Add comment to commit. Commands: commit
      --template             Init with template. Values: nft. Commands: init
      -v, --version          Show Context CLI version

Get started

Follow the context documentation doing click to the next link:

Context Documentation

4.0.1

6 months ago

4.0.0

6 months ago

2.23.1

9 months ago

3.0.1

7 months ago

2.15.4

10 months ago

2.15.2

10 months ago

2.15.3

10 months ago

3.0.0

8 months ago

2.15.0

10 months ago

2.15.1

10 months ago

2.22.1

9 months ago

2.20.0

10 months ago

2.22.0

9 months ago

2.24.1

9 months ago

2.24.0

9 months ago

2.22.2

9 months ago

2.24.2

9 months ago

3.1.0

7 months ago

2.18.0

10 months ago

2.16.0

10 months ago

2.14.0

10 months ago

2.21.0

10 months ago

2.23.0

9 months ago

2.13.8

11 months ago

2.13.7

11 months ago

2.13.6

11 months ago

2.13.4

11 months ago

2.13.5

11 months ago

2.11.0

11 months ago

2.11.1

11 months ago

2.2.0

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.4.3

1 year ago

2.6.0

12 months ago

2.4.2

1 year ago

2.4.5

1 year ago

2.8.0

12 months ago

2.4.4

1 year ago

2.5.7

1 year ago

2.13.2

11 months ago

2.13.3

11 months ago

2.13.0

11 months ago

2.10.1

11 months ago

2.3.0

1 year ago

2.12.0

11 months ago

2.10.0

11 months ago

2.7.0

12 months ago

2.9.0

11 months ago

2.7.2

12 months ago

2.7.1

12 months ago

2.4.6

1 year ago

2.1.2

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.1.4

1 year ago

2.0.5

1 year ago

2.1.3

1 year ago

2.0.4

1 year ago

2.0.11

1 year ago

2.0.7

1 year ago

2.1.5

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.8

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.7.4

1 year ago

1.7.3

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.2.0

1 year ago

1.6.0

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.1.1

1 year ago