A command-line tool to interact with CasaOS for testing and diagnosing purpose
Usage
A command line interface for CasaOS
Usage:
casaos-cli [command]
Services
app-management All compose app management and store related commands
local-storage All local storage related commands
message-bus All message bus related commands
Additional Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
version Show version
Flags:
-h, --help help for casaos-cli
-u, --root-url string root url of CasaOS API (default "localhost:80")
Additional help topics:
casaos-cli gateway All gateway related commands
casaos-cli user All user related commands
Use "casaos-cli [command] --help" for more information about a command.
Follow example steps below to add commands like casaos-cli message-bus list event-types
create command scaffold with cobra-cli add:
go run github.com/spf13/cobra-cli@latest add messageBus --config .cobra.yaml
go run github.com/spf13/cobra-cli@latest add messageBusList -p messageBusCmd --config .cobra.yaml
go run github.com/spf13/cobra-cli@latest add messageBusListEventTypes -p messageBusListCmd --config .cobra.yaml
It is important to include --config .cobra.yaml to attribute the scaffold code with correct license header.
update each messageBus*.go file with correct command format:
update short and long description for each command, and implement the logics
to verify the commands are created correctly, run
$ go run main.go message-bus list event-types --help
list event types
Usage:
CasaOS-CLI message-bus list event-types [flags]
Flags:
-h, --help help for event-types
Run go run github.com/spf13/cobra-cli@latest --help to see additional help message.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.