- Imported packages from separate repos: - github.com/Snider/config -> pkg/config - github.com/Snider/display -> pkg/display - github.com/Snider/help -> pkg/help - github.com/Snider/i18n -> pkg/i18n - github.com/Snider/updater -> pkg/updater - Moved core code from root to pkg/core - Flattened nested package structures - Updated all import paths to github.com/Snider/Core/pkg/* - Added Display interface to Core - Updated go.work for workspace modules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
50 lines
1.1 KiB
Markdown
50 lines
1.1 KiB
Markdown
# CLI Documentation (`cmd/demo-cli`)
|
|
|
|
The `demo-cli` is a command-line interface application built to demonstrate the capabilities of the Config Module and serve the frontend application. It uses the `cobra` library for command management.
|
|
|
|
## Installation
|
|
|
|
You can run the CLI directly using `go run`:
|
|
|
|
```bash
|
|
go run ./cmd/demo-cli <command>
|
|
```
|
|
|
|
Or build it into a binary:
|
|
|
|
```bash
|
|
go build -o demo-cli ./cmd/demo-cli
|
|
./demo-cli <command>
|
|
```
|
|
|
|
## Commands
|
|
|
|
### `serve`
|
|
|
|
The `serve` command starts an HTTP server that serves both the Angular frontend and a demo API endpoint.
|
|
|
|
**Usage:**
|
|
|
|
```bash
|
|
go run ./cmd/demo-cli serve
|
|
```
|
|
|
|
**Features:**
|
|
- **Frontend Serving**: Serves static files from `ui/dist/config/browser`.
|
|
- **API Endpoint**: Exposes a demo endpoint at `/api/v1/demo`.
|
|
- **Port**: Listens on port `8080`.
|
|
|
|
**Example Output:**
|
|
```
|
|
Listening on :8080...
|
|
```
|
|
|
|
Access the application at `http://localhost:8080`.
|
|
|
|
### Root Command
|
|
|
|
Running the CLI without any subcommands prints the help message or executes the default action (if configured).
|
|
|
|
```bash
|
|
go run ./cmd/demo-cli
|
|
```
|