# Task Node CLI

The task node CLI is a helpful tool used by node operators for 4 different reasons:

* Create a task staking wallet
* Create a distribution wallet
* Stake tokens on a task
* Show all tasks

The staking CLI can be started by running the command `yarn stake` in the root directory of the task node. The steps are:

* Clone the [task node repository](https://gitlab.com/koii-network/task-node) if you haven’t already done it.
* Run `yarn build`
* Run `yarn stake` in your terminal
* Enter the path to your wallet
* Next you will be prompted with four options&#x20;

```
? Select operation › - Use arrow-keys. Return to submit.
❯   Create a task staking wallet
    Create a task distribution wallet
    Stake tokens on a task
    Show all tasks
```

## Staking Wallet&#x20;

To create a staking wallet, select the "Create a task staking wallet" option and add the amount of KOII tokens you want to fund the wallet with.

```javascript
✔ Enter the path to your wallet … /Users/<YOUR_HOME>/.config/koii/id.json
/Users/giftea/.config/koii/id.json
✔ Select operation › Create a task staking wallet
create-task-staking-wallet
Connection to cluster established: https://k2-testnet.koii.live
Using account 2kG7HBGGVHZEhdbHQzvQGQUjLNGGiQvxshLu47UvnpBs containing 379.99414788 KOII to pay for fees
✔ Enter the amount to add to staking wallet … 20
Success
✨  Done in 586.68s.
```

## Distribution Wallet

To create a distribution wallet, select the "Create a task distribution wallet" option and add the amount of KOII tokens you want to fund the wallet with.

```
✔ Enter the path to your wallet … /Users/<YOUR_HOME>/.config/koii/id.json
/Users/giftea/.config/koii/id.json
✔ Select operation › Create a task distribution wallet
create-task-distribution-wallet
Connection to cluster established: https://k2-testnet.koii.live
Using account 2kG7HBGGVHZEhdbHQzvQGQUjLNGGiQvxshLu47UvnpBs containing 359.992541 KOII to pay for fees
✔ Enter the amount to add to distribution wallet … 30
Success
✨  Done in 664.06s.
```

## Stake Tokens

To stake tokens on a task, select the "Stake tokens on a task", add the task ID of the task you want to stake on and enter the amount you want to stake.

```bash
✔ Enter the path to your wallet … /Users/<YOUR_HOME>/.config/koii/id.json
/Users/giftea/.config/koii/id.json
✔ Select operation › Stake tokens on a task
stake-tokens
Connection to cluster established: https://k2-testnet.koii.live
Using account 2kG7HBGGVHZEhdbHQzvQGQUjLNGGiQvxshLu47UvnpBs containing 329.992531 KOII to pay for fees
✔ Enter the task id … GUU6Fe765opB2SUMpNo7utMFvyjeY6EPWBjYeHzAbXb8
✔ Enter the stake amount for task … 10
Success
✨  Done in 1039.91s.
```

## Show All Tasks

To view all tasks, select the "Show all tasks" option. You should see an array of tasks with their name and ID.

```bash
✔ Enter the path to your wallet … /Users/<YOUR_HOME>/.config/koii/id.json
/Users/giftea/.config/koii/id.json
✔ Select operation › Show all tasks
show-all-tasks
Connection to cluster established: https://k2-testnet.koii.live
Using account 2kG7HBGGVHZEhdbHQzvQGQUjLNGGiQvxshLu47UvnpBs containing 329.992531 KOII to pay for fees
[
  {
    name: 'DID-task-V2',
    taskId: '5RZrTKcumfnJ6z5fVuWSLuZKZCsjQARThQc5DjpF56gc'
  },
  {
    name: 'DDR',
    taskId: '5TK491kDMwSBFCKHxRQGBzV79uNRyYBcDiT5vNgL125g'
  },
  {
    name: 'dryRun',
    taskId: '7smY8E7f5BT5Gn5CKPkbSuro45ghAJtAkrV5WkUXcJ6G'
  },
  {
    name: 'RedesignedTask',
    taskId: 'BDXNWEjqfVFfWHWJfgJYpFVkWsXra8iKizn3v4Q8TdNS'
  },
  {
    name: 'Test1',
    taskId: 'GUU6Fe765opB2SUMpNo7utMFvyjeY6EPWBjYeHzAbXb8'
  }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://koii-network.gitbook.io/getting-started/koii-software-toolkit-sdk/task-node-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
