paashup-cli
is a command-line tool for managing your paashup environment, including Docker containers, hosts, images, and Netbox configurations. This tool provides various commands to list, inspect, start, stop, and execute operations on Docker containers, as well as managing Docker hosts, images, and Netbox configurations.
using docker:
docker run -it --rm -v ./:/go golang:1.22 go build -buildvcs=false -ldflags "-X main.version=<VERSION> -X main.PLATFORM_URL=<PLATFORM_URL> -X main.PLATFORM_PUB_KEY=<PUB_KEY>" -o bin/ ./...
To install paashup-cli
, ensure you have Go installed and run:
go get github.com/saashup/paashup-cli
First you need to define the netbox source:
paashup-cli netbox set-config name http://netbox.local mytoken
For autocompletion, download the completion script (autocompletion.bash) and then source it like this:
PROG=paashup-cli source autocompletion.bash
For Stack jsonschema generation, you can use the following command:
paashup-cli doc jsonschema
paashup-cli
provides multiple commands categorized under platforms, Docker resources, Netbox configurations, and stack deployments.
--format, -f
: Choose betweenyaml
,json
, orjson-pretty
formats. Default isjson
.
The CLI is structured with several main commands, each with its own set of subcommands.
Manage platforms within your paashup environment.
-
Create an Account
paashup-cli platform account create <username> <password>
Creates a new account. Example:
paashup-cli platform account create user1 password123
-
Login in Platform
paashup-cli platform login <username> <password>
-
Initialize a Platform
paashup-cli platform init
Initializes a platform. Example:
paashup-cli platform init
-
List Platforms
paashup-cli platform ls
Manage Netbox configurations for your paashup environment.
-
Set Netbox Configuration
paashup-cli netbox set-config NAME NETBOX_URL NETBOX_TOKEN
Sets a Netbox configuration. Example:
paashup-cli netbox set-config myconfig http://netbox.example.com token123
-
Use Netbox Configuration
paashup-cli netbox use NAME
Selects a Netbox configuration by name. Example:
paashup-cli netbox use myconfig
Manage and deploy stacks.
-
Deploy a Stack
paashup-cli stack deploy YAMLFILE
Deploys a stack from a YAML file. Example:
paashup-cli stack deploy stack.yaml
Manage Docker resources including containers, hosts, images, volumes, and registries.
-
Docker Container Commands
-
List Containers
paashup-cli docker container ls [hostname]
Lists all containers. Example:
paashup-cli docker container ls myhost
-
Get Logs
paashup-cli docker container logs <hostname> <containername>
Fetches logs for a specific container. Example:
paashup-cli docker container logs myhost mycontainer
-
Start a Container
paashup-cli docker container start [--nowait] <hostname> <containername>
Starts a specific container. Example:
paashup-cli docker container start --nowait myhost mycontainer
-
Stop a Container
paashup-cli docker container stop [--nowait] <hostname> <containername>
Stops a specific container. Example:
paashup-cli docker container stop --nowait myhost mycontainer
-
Inspect a Container
paashup-cli docker container inspect <hostname> <containername>
Inspects a specific container. Example:
paashup-cli docker container inspect myhost mycontainer
-
Execute Command in a Container
paashup-cli docker container exec <hostname> <containername> '<command>'
Executes a command within a specific container. Example:
paashup-cli docker container exec myhost mycontainer 'ls -la'
-
-
Docker Host Commands
-
List Hosts
paashup-cli docker host ls
Lists all hosts. Example:
paashup-cli docker host ls
-
Inspect a Host
paashup-cli docker host inspect <hostname>
Inspects a specific host. Example:
paashup-cli docker host inspect myhost
-
-
Docker Image Commands
-
List Images
paashup-cli docker image ls
Lists all images. Example:
paashup-cli docker image ls
-
-
Docker Volume Commands
-
List Volumes
paashup-cli docker volume ls
Lists all volumes. Example:
paashup-cli docker volume ls
-
-
Docker Registry Commands
-
List Registries
paashup-cli docker registry ls
Lists all registries. Example:
paashup-cli docker registry ls
-
-
Set Netbox Configuration
paashup-cli netbox set-config myconfig http://netbox.example.com token123
-
Initialize a Platform
paashup-cli platform init
-
Deploy a Stack
paashup-cli stack deploy stack.yaml
-
List All Containers
paashup-cli docker container ls
-
Start a Container
paashup-cli docker container start --nowait myhost mycontainer
-
Get Logs from a Container
paashup-cli docker container logs myhost mycontainer
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.