@contextdao/cli v4.0.1
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:
6 months ago
6 months ago
9 months ago
7 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
11 months ago
12 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago