2025-11-25 00:03:35 +00:00
# Mining CLI Documentation
2025-12-30 19:43:02 +00:00
The `miner-ctrl` is the command-line interface for the Mining project. It allows you to manage miners directly from the terminal or start a REST API server.
2025-11-25 00:03:35 +00:00
## Installation
```bash
go install github.com/Snider/Mining/cmd/mining@latest
```
## Global Flags
- `--config string` : Config file (default is $HOME/.mining.yaml)
- `--help` : Help for the command
## Commands
### `serve`
Starts the mining service and interactive shell.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl serve [flags]
2025-11-25 00:03:35 +00:00
```
**Flags:**
- `--host` : Host to listen on (default "0.0.0.0")
- `-p, --port` : Port to listen on (default 8080)
- `-n, --namespace` : API namespace for the swagger UI (default "/")
### `start`
Start a new miner.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl start [miner-type] [flags]
2025-11-25 00:03:35 +00:00
```
### `stop`
Stop a running miner.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl stop [miner-name]
2025-11-25 00:03:35 +00:00
```
### `status`
Get status of a running miner.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl status [miner-name]
2025-11-25 00:03:35 +00:00
```
### `list`
List running and available miners.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl list
2025-11-25 00:03:35 +00:00
```
### `install`
Install or update a miner.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl install [miner-type]
2025-11-25 00:03:35 +00:00
```
### `uninstall`
Uninstall a miner.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl uninstall [miner-type]
2025-11-25 00:03:35 +00:00
```
### `update`
Check for updates to installed miners.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl update
2025-11-25 00:03:35 +00:00
```
### `doctor`
Check and refresh the status of installed miners.
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl doctor
2025-11-25 00:03:35 +00:00
```
### `completion`
Generate the autocompletion script for the specified shell (bash, zsh, fish, powershell).
**Usage:**
```bash
2025-12-30 19:43:02 +00:00
miner-ctrl completion [shell]
2025-11-25 00:03:35 +00:00
```