# Apex CLI

The Apex CLI is a miner's interface with the subnet: linking wallets, submitting competition solutions, and viewing the dashboard. The dashboard contains all miner submissions to past and current competitions - use it to view others' code submissions and logs to compare your individual performance against the subnet.&#x20;

To use the CLI you must have a [registered wallet on subnet 1.](https://docs.learnbittensor.org/miners#miner-registration)&#x20;

### Setup

Before using the Apex CLI, make sure you have ran `./install_cli.sh`. For further instructions, see the [mining docs](/subnets/subnet-1-apex/subnet-1-base-miner-setup.md).&#x20;

* Make sure you have activated your `.venv` prior to using the CLI.
  * `source .venv/bin/activate`

### Link Wallet

Link your registered wallet with the CLI - required for most CLI commands:

`apex link`&#x20;

This will prompt you to enter your Bittensor wallet location, which defaults to the default Bittensor wallet path: `/Users/{USERNAME}/.bittensor/wallets` .

* To select the default wallet location, press *ENTER/RETURN*.&#x20;
* For custom wallet locations, enter the path from the root directory.

Then, use the arrow keys to select your registered coldkey and hotkey from the list provided.&#x20;

NOTE: Some previously created wallets using earlier versions of btcli may not a have a private key configured. If this is the case, regenerate this hotkey before linking.&#x20;

### View Competitions

#### To view the currently active competition:

`apex competitions`

This will return a list of all active competitions and their associated competition IDs.&#x20;

#### To view competitions and their status in detail:

`apex dashboard`

Example Output:

<figure><img src="/files/xAZ1p6m6dOvg0VEdbDY9" alt=""><figcaption><p>Competition 1, Round 1</p></figcaption></figure>

### View Submissions

To view a submission, first open the dashboard `apex dashboard` and press *ENTER/RETUR*N when hovering the competition of interest.

<figure><img src="/files/rGXanwDX7jMYfXC1lpOR" alt=""><figcaption></figcaption></figure>

Your own submissions will be viewable immediately, other's submissions will be viewable after a delay.&#x20;

### Submit a Solution

`apex submit`

This will prompt you to enter the file path to your solution path and competition ID.&#x20;

Or, in one line:&#x20;

```
apex submit <Path_To_Solution> -c <Competition_ID>
```

* View the current \<Competition\_ID> and \<Round\_Number> via the dashboard.
* Submissions are limited to **4 submissions per day,** **per hotkey**.


---

# 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://docs.macrocosmos.ai/subnets/subnet-1-apex/subnet-1-base-miner-setup/apex-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.
