|
| 1 | +# Godon CLI |
| 2 | + |
| 3 | +A Nim-based CLI tool for controlling and managing the Godon optimizer breeders via the Godon Control API. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- List, create, show, update, and delete breeder configurations |
| 8 | +- YAML-based configuration files |
| 9 | +- RESTful API integration |
| 10 | +- Cross-platform support (currently Linux x86_64) |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +### Binary Download |
| 15 | + |
| 16 | +Download the latest release from the [GitHub Releases](https://github.com/godon-dev/godon-cli/releases) page: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Download and extract (replace VERSION with actual version) |
| 20 | +wget https://github.com/godon-dev/godon-cli/releases/download/VERSION/godon-cli-VERSION-x86_64-linux.tar.gz |
| 21 | +tar -xzf godon-cli-VERSION-x86_64-linux.tar.gz |
| 22 | + |
| 23 | +# Make executable and move to PATH |
| 24 | +chmod +x godon_cli |
| 25 | +sudo mv godon_cli /usr/local/bin/ |
| 26 | +``` |
| 27 | + |
| 28 | +### Docker |
| 29 | + |
| 30 | +Docker images are built from the [godon-images](https://github.com/godon-dev/godon-images) repository and include the CLI binary. |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +### Basic Commands |
| 35 | + |
| 36 | +```bash |
| 37 | +# Show help |
| 38 | +godon_cli --help |
| 39 | + |
| 40 | +# List all breeders |
| 41 | +godon_cli breeder list |
| 42 | + |
| 43 | +# Connect to a different API server |
| 44 | +godon_cli --hostname api.example.com --port 9090 breeder list |
| 45 | +``` |
| 46 | + |
| 47 | +### Breeder Management |
| 48 | + |
| 49 | +#### Create a Breeder |
| 50 | + |
| 51 | +Create a YAML configuration file `breeder.yaml`: |
| 52 | + |
| 53 | +```yaml |
| 54 | +name: "genetic-optimizer-1" |
| 55 | +config: > |
| 56 | + {"setting1": "value1", "setting2": 42, "optimization_target": "performance"} |
| 57 | +``` |
| 58 | +
|
| 59 | +Then create the breeder: |
| 60 | +
|
| 61 | +```bash |
| 62 | +godon_cli breeder create --file breeder.yaml |
| 63 | +``` |
| 64 | + |
| 65 | +#### Show Breeder Details |
| 66 | + |
| 67 | +```bash |
| 68 | +godon_cli breeder show --id 550e8400-e29b-41d4-a716-446655440000 |
| 69 | +``` |
| 70 | + |
| 71 | +#### Update a Breeder |
| 72 | + |
| 73 | +Create an update configuration file `breeder_update.yaml`: |
| 74 | + |
| 75 | +```yaml |
| 76 | +uuid: "550e8400-e29b-41d4-a716-446655440000" |
| 77 | +name: "updated-genetic-optimizer" |
| 78 | +description: "Updated optimizer configuration" |
| 79 | +config: > |
| 80 | + {"setting1": "new_value1", "setting2": 100} |
| 81 | +``` |
| 82 | +
|
| 83 | +Then update: |
| 84 | +
|
| 85 | +```bash |
| 86 | +godon_cli breeder update --file breeder_update.yaml |
| 87 | +``` |
| 88 | + |
| 89 | +#### Delete a Breeder |
| 90 | + |
| 91 | +```bash |
| 92 | +godon_cli breeder purge --id 550e8400-e29b-41d4-a716-446655440000 |
| 93 | +``` |
| 94 | + |
| 95 | +## Configuration |
| 96 | + |
| 97 | +The CLI connects to the Godon API using these default settings: |
| 98 | + |
| 99 | +- **Hostname**: `localhost` |
| 100 | +- **Port**: `8080` |
| 101 | +- **API Version**: `v0` |
| 102 | + |
| 103 | +You can override these using command-line flags: |
| 104 | + |
| 105 | +```bash |
| 106 | +godon_cli --hostname api.example.com --port 9090 --api-version v1 breeder list |
| 107 | +``` |
| 108 | + |
| 109 | +## API Specification |
| 110 | + |
| 111 | +This CLI is designed to work with the [Godon Control API](https://github.com/godon-dev/godon-images) which follows OpenAPI 3.0 specification. |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +This project is licensed under the GNU Affero General Public License v3.0. See the [LICENSE](LICENSE) file for details. |
| 116 | + |
| 117 | +## Releasing |
| 118 | + |
| 119 | +Releases are automated through GitHub Actions: |
| 120 | + |
| 121 | +1. Create a new release on GitHub with a semantic version tag (e.g., `1.0.0`, `1.0.0-alpha.1`) |
| 122 | +2. GitHub Actions will automatically build and upload `godon-cli-VERSION-x86_64-linux.tar.gz` |
| 123 | +3. The compressed archive will be available in the release assets |
| 124 | + |
| 125 | +**Version format**: Must follow [Semantic Versioning](https://semver.org/) (e.g., `1.0.0`, `2.1.3`, `1.0.0-alpha.1`, `1.0.0+build.1`) |
| 126 | + |
| 127 | +## Changelog |
| 128 | + |
| 129 | +See the [GitHub Releases](https://github.com/godon-dev/godon-cli/releases) page for version history and changes. |
0 commit comments