Command Line Interface for Joystream community and governance activities
To run a command in developemnt environment (without installing the package):
-
Navigate into the CLI root directory
-
Execute any command like this:
$ ./bin/run COMMAND
Alternatively:
-
Navigate into the CLI root directory
-
Execute
yarn link(if that doesn't work, considersudo yarn link) -
Execute command from any location like this:
$ joystream-cli COMMAND
$ npm install -g @joystream/cli
$ joystream-cli COMMAND
running command...
$ joystream-cli (-v|--version|version)
@joystream/cli/0.1.0 linux-x64 node-v13.12.0
$ joystream-cli --help [COMMAND]
USAGE
$ joystream-cli COMMAND
...When using the CLI for the first time there are a few common steps you might want to take in order to configure the CLI:
- Set the correct node endpoint. You can do this by executing
api:setUrior any command that requires an api connection. To verify the current endpoint you can executeapi:getUri. - In order to use the accounts/keys that you may already have access to within Pioneer, you need to dowload the backup json file(s) (https://testnet.joystream.org/#/accounts) and import them into the CLI by executing
account:import /path/to/backup.json. - By executing
account:chooseyou can choose one of the imported accounts, that will then serve as context for the next commands (you can check currently selected account usingaccount:info). If you just want to use the development Alice or Bob account, you can access them without importing by providing an additional flag:account:choose --showSpecial. - The context should now be fully set up! Feel free to use the
--helpflag to investigate the available commands or take a look at the sections below. - You may also find it useful to get the first part of the command (before the colon) autocompleted when you press
[Tab]while typing the name in the console. Executingautocompletecommand will provide the instructions on how to set this up (see documentation below).
joystream-cli account:choosejoystream-cli account:create NAMEjoystream-cli account:currentjoystream-cli account:export PATHjoystream-cli account:forgetjoystream-cli account:import BACKUPFILEPATHjoystream-cli account:transferTokens RECIPIENT AMOUNTjoystream-cli api:getUrijoystream-cli api:inspectjoystream-cli api:setUri [URI]joystream-cli autocomplete [SHELL]joystream-cli council:infojoystream-cli help [COMMAND]joystream-cli working-groups:application WGAPPLICATIONIDjoystream-cli working-groups:createOpeningjoystream-cli working-groups:decreaseWorkerStake WORKERIDjoystream-cli working-groups:evictWorker WORKERIDjoystream-cli working-groups:fillOpening WGOPENINGIDjoystream-cli working-groups:increaseStakejoystream-cli working-groups:leaveRolejoystream-cli working-groups:opening WGOPENINGIDjoystream-cli working-groups:openingsjoystream-cli working-groups:overviewjoystream-cli working-groups:slashWorker WORKERIDjoystream-cli working-groups:startAcceptingApplications WGOPENINGIDjoystream-cli working-groups:startReviewPeriod WGOPENINGIDjoystream-cli working-groups:terminateApplication WGAPPLICATIONIDjoystream-cli working-groups:updateRewardAccount [ACCOUNTADDRESS]joystream-cli working-groups:updateRoleAccount [ACCOUNTADDRESS]joystream-cli working-groups:updateWorkerReward WORKERID
Choose default account to use in the CLI
USAGE
$ joystream-cli account:choose
OPTIONS
--showSpecial Whether to show special (DEV chain) accounts
See code: src/commands/account/choose.ts
Create new account
USAGE
$ joystream-cli account:create NAME
ARGUMENTS
NAME Account name
See code: src/commands/account/create.ts
Display information about currently choosen default account
USAGE
$ joystream-cli account:current
ALIASES
$ joystream-cli account:info
$ joystream-cli account:default
See code: src/commands/account/current.ts
Export account(s) to given location
USAGE
$ joystream-cli account:export PATH
ARGUMENTS
PATH Path where the exported files should be placed
OPTIONS
-a, --all If provided, exports all existing accounts into "exported_accounts" folder inside given path
See code: src/commands/account/export.ts
Forget (remove) account from the list of available accounts
USAGE
$ joystream-cli account:forget
See code: src/commands/account/forget.ts
Import account using JSON backup file
USAGE
$ joystream-cli account:import BACKUPFILEPATH
ARGUMENTS
BACKUPFILEPATH Path to account backup JSON file
See code: src/commands/account/import.ts
Transfer tokens from currently choosen account
USAGE
$ joystream-cli account:transferTokens RECIPIENT AMOUNT
ARGUMENTS
RECIPIENT Address of the transfer recipient
AMOUNT Amount of tokens to transfer
See code: src/commands/account/transferTokens.ts
Get current api WS provider uri
USAGE
$ joystream-cli api:getUri
See code: src/commands/api/getUri.ts
Lists available node API modules/methods and/or their description(s), or calls one of the API methods (depending on provided arguments and flags)
USAGE
$ joystream-cli api:inspect
OPTIONS
-M, --module=module
Specifies the api module, ie. "system", "staking" etc.
If no "--method" flag is provided then all methods in that module will be listed along with the descriptions.
-a, --callArgs=callArgs
Specifies the arguments to use when calling a method. Multiple arguments can be separated with a comma, ie.
"-a=arg1,arg2".
You can omit this flag even if the method requires some aguments.
In that case you will be promted to provide value for each required argument.
Ommiting this flag is recommended when input parameters are of more complex types (and it's hard to specify them as
just simple comma-separated strings)
-e, --exec
Provide this flag if you want to execute the actual call, instead of displaying the method description (which is
default)
-m, --method=method
Specifies the api method to call/describe.
-t, --type=type
Specifies the type/category of the inspected request (ie. "query", "consts" etc.).
If no "--module" flag is provided then all available modules in that type will be listed.
If this flag is not provided then all available types will be listed.
EXAMPLES
$ api:inspect
$ api:inspect -t=query
$ api:inspect -t=query -M=members
$ api:inspect -t=query -M=members -m=memberProfile
$ api:inspect -t=query -M=members -m=memberProfile -e
$ api:inspect -t=query -M=members -m=memberProfile -e -a=1
See code: src/commands/api/inspect.ts
Set api WS provider uri
USAGE
$ joystream-cli api:setUri [URI]
ARGUMENTS
URI Uri of the node api WS provider (if skipped, a prompt will be displayed)
See code: src/commands/api/setUri.ts
display autocomplete installation instructions
USAGE
$ joystream-cli autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ joystream-cli autocomplete
$ joystream-cli autocomplete bash
$ joystream-cli autocomplete zsh
$ joystream-cli autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
Get current council and council elections information
USAGE
$ joystream-cli council:info
See code: src/commands/council/info.ts
display help for joystream-cli
USAGE
$ joystream-cli help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Shows an overview of given application by Working Group Application ID
USAGE
$ joystream-cli working-groups:application WGAPPLICATIONID
ARGUMENTS
WGAPPLICATIONID Working Group Application ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/application.ts
Create working group opening (requires lead access)
USAGE
$ joystream-cli working-groups:createOpening
OPTIONS
-c, --createDraftOnly If provided - the extrinsic will not be executed. Use this flag if you only want to create
a draft.
-d, --useDraft Whether to create the opening from existing draft.
If provided without --draftName - the list of choices will be displayed.
-g, --group=group (required) [default: storageProviders] The working group context in which the command
should be executed
Available values are: storageProviders.
-n, --draftName=draftName Name of the draft to create the opening from.
-s, --skipPrompts Whether to skip all prompts when adding from draft (will use all default values)
See code: src/commands/working-groups/createOpening.ts
Decreases given worker stake by an amount that will be returned to the worker role account. Requires lead access.
USAGE
$ joystream-cli working-groups:decreaseWorkerStake WORKERID
ARGUMENTS
WORKERID Worker ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/decreaseWorkerStake.ts
Evicts given worker. Requires lead access.
USAGE
$ joystream-cli working-groups:evictWorker WORKERID
ARGUMENTS
WORKERID Worker ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/evictWorker.ts
Allows filling working group opening that's currently in review. Requires lead access.
USAGE
$ joystream-cli working-groups:fillOpening WGOPENINGID
ARGUMENTS
WGOPENINGID Working Group Opening ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/fillOpening.ts
Increases current role (lead/worker) stake. Requires active role account to be selected.
USAGE
$ joystream-cli working-groups:increaseStake
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/increaseStake.ts
Leave the worker or lead role associated with currently selected account.
USAGE
$ joystream-cli working-groups:leaveRole
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/leaveRole.ts
Shows an overview of given working group opening by Working Group Opening ID
USAGE
$ joystream-cli working-groups:opening WGOPENINGID
ARGUMENTS
WGOPENINGID Working Group Opening ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/opening.ts
Shows an overview of given working group openings
USAGE
$ joystream-cli working-groups:openings
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/openings.ts
Shows an overview of given working group (current lead and workers)
USAGE
$ joystream-cli working-groups:overview
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/overview.ts
Slashes given worker stake. Requires lead access.
USAGE
$ joystream-cli working-groups:slashWorker WORKERID
ARGUMENTS
WORKERID Worker ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/slashWorker.ts
Changes the status of pending opening to "Accepting applications". Requires lead access.
USAGE
$ joystream-cli working-groups:startAcceptingApplications WGOPENINGID
ARGUMENTS
WGOPENINGID Working Group Opening ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/startAcceptingApplications.ts
Changes the status of active opening to "In review". Requires lead access.
USAGE
$ joystream-cli working-groups:startReviewPeriod WGOPENINGID
ARGUMENTS
WGOPENINGID Working Group Opening ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/startReviewPeriod.ts
Terminates given working group application. Requires lead access.
USAGE
$ joystream-cli working-groups:terminateApplication WGAPPLICATIONID
ARGUMENTS
WGAPPLICATIONID Working Group Application ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/terminateApplication.ts
Updates the worker/lead reward account (requires current role account to be selected)
USAGE
$ joystream-cli working-groups:updateRewardAccount [ACCOUNTADDRESS]
ARGUMENTS
ACCOUNTADDRESS New reward account address (if omitted, one of the existing CLI accounts can be selected)
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/updateRewardAccount.ts
Updates the worker/lead role account. Requires member controller account to be selected
USAGE
$ joystream-cli working-groups:updateRoleAccount [ACCOUNTADDRESS]
ARGUMENTS
ACCOUNTADDRESS New role account address (if omitted, one of the existing CLI accounts can be selected)
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.
See code: src/commands/working-groups/updateRoleAccount.ts
Change given worker's reward (amount only). Requires lead access.
USAGE
$ joystream-cli working-groups:updateWorkerReward WORKERID
ARGUMENTS
WORKERID Worker ID
OPTIONS
-g, --group=group (required) [default: storageProviders] The working group context in which the command should be
executed
Available values are: storageProviders.