A command-line interface for interacting with the Virak Cloud API, built with the Go programming language.
- About The Project
- Getting Started
- Usage
- Authentication
- Commands
- Documentation
- Project Structure
- Configuration
- Development
- Contributing
- License
The Virak CLI is a command-line interface that allows you to manage your Virak Cloud resources directly from your terminal.
To get a local copy up and running follow these simple steps.
- Go 1.24.4 or later
Download the latest release from GitHub Releases.
Choose the appropriate binary for your platform:
- Linux (amd64):
virak-cli-linux-amd64 - Linux (arm64):
virak-cli-linux-arm64 - macOS (amd64):
virak-cli-darwin-amd64 - macOS (arm64):
virak-cli-darwin-arm64 - Windows (amd64):
virak-cli-windows-amd64.exe - Windows (arm64):
virak-cli-windows-arm64.exe
- Download the binary file for your platform from the releases page.
- Make the binary executable (skip this step on Windows):
chmod +x virak-cli-* - Move the binary to a directory in your PATH, for example:
sudo mv virak-cli-* /usr/local/bin/virak-cli - Verify the installation:
virak-cli --version
Alternatively, download the compressed archive (.tar.gz for Linux/macOS, .zip for Windows), extract it, and follow the binary installation steps above.
For Debian-based systems, download the .deb package and install with:
sudo dpkg -i virak-cli_*.deb- Download the
.exefile for your Windows architecture from the releases page. - Create a folder for the CLI, for example
C:\Program Files\virak-cli\. - Move the downloaded
.exefile to that folder. - Add the folder to your system's PATH:
- Open System Properties (search for "environment variables" in Start menu).
- Click "Environment Variables".
- Under "System variables", find "Path" and click "Edit".
- Click "New" and add
C:\Program Files\virak-cli\. - Click "OK" to save.
- Open a new Command Prompt or PowerShell window and verify:
virak-cli --version
Alternatively, you can use the Windows archive (.zip) - extract it and follow the same steps.
Note: Releases are automated using GoReleaser, ensuring consistent and verified builds across platforms.
- Clone the repo
git clone https://github.com/virak-cloud/cli.git
- Build the project
go build -o virak-cli main.go
Alternatively, you can use go install:
go install github.com/virak-cloud/cli@latestUse the virak-cli command to interact with your Virak Cloud resources.
virak-cli [command]Before using the CLI, you need to authenticate:
virak-cli loginThis will open your browser for OAuth authentication. Alternatively, you can provide a token directly:
virak-cli login --token YOUR_TOKENYou can also use the command aliases log-in or auth:
virak-cli log-in --token YOUR_TOKENThe following commands are available:
virak-cli login: Authenticate with Virak Cloudvirak-cli logout: Log out from Virak Cloud
virak-cli bucket create: Create a new bucketvirak-cli bucket delete: Delete a bucketvirak-cli bucket events: View bucket eventsvirak-cli bucket list: List all bucketsvirak-cli bucket show: Show details of a bucketvirak-cli bucket update: Update a bucket
virak-cli dns domain create: Create a new domainvirak-cli dns domain delete: Delete a domainvirak-cli dns domain list: List all domainsvirak-cli dns domain show: Show details of a domainvirak-cli dns events: View DNS eventsvirak-cli dns record create: Create a new DNS recordvirak-cli dns record delete: Delete a DNS recordvirak-cli dns record list: List all DNS recordsvirak-cli dns record update: Update a DNS record
virak-cli instance create: Create a new instancevirak-cli instance delete: Delete an instancevirak-cli instance list: List all instancesvirak-cli instance metrics: View instance metricsvirak-cli instance reboot: Reboot an instancevirak-cli instance rebuild: Rebuild an instancevirak-cli instance service-offering list: List instance service offeringsvirak-cli instance show: Show details of an instancevirak-cli instance snapshot create: Create an instance snapshotvirak-cli instance snapshot delete: Delete an instance snapshotvirak-cli instance snapshot list: List instance snapshotsvirak-cli instance snapshot revert: Revert to an instance snapshotvirak-cli instance start: Start an instancevirak-cli instance stop: Stop an instancevirak-cli instance vm-image list: List VM imagesvirak-cli instance volume attach: Attach a volume to an instancevirak-cli instance volume create: Create a volume for an instancevirak-cli instance volume delete: Delete an instance volumevirak-cli instance volume detach: Detach a volume from an instancevirak-cli instance volume list: List instance volumesvirak-cli instance volume service-offering list: List volume service offerings
virak-cli cluster create: Create a new clustervirak-cli cluster delete: Delete a clustervirak-cli cluster list: List all clustersvirak-cli cluster scale: Scale a clustervirak-cli cluster show: Show details of a clustervirak-cli cluster start: Start a clustervirak-cli cluster stop: Stop a clustervirak-cli cluster update: Update a clustervirak-cli cluster update-service-offering: Update service offering for a clustervirak-cli cluster upgrade: Upgrade a clustervirak-cli cluster service events: View Kubernetes service eventsvirak-cli cluster versions list: List all Kubernetes versions
virak-cli network create: Create a new networkvirak-cli network create l2: Create a new L2 networkvirak-cli network create l3: Create a new L3 networkvirak-cli network delete: Delete a networkvirak-cli network firewall ipv4 create: Create an IPv4 firewall rulevirak-cli network firewall ipv4 delete: Delete an IPv4 firewall rulevirak-cli network firewall ipv4 list: List all IPv4 firewall rulesvirak-cli network firewall ipv6 create: Create an IPv6 firewall rulevirak-cli network firewall ipv6 delete: Delete an IPv6 firewall rulevirak-cli network firewall ipv6 list: List all IPv6 firewall rulesvirak-cli network instance connect: Connect an instance to a networkvirak-cli network instance disconnect: Disconnect an instance from a networkvirak-cli network instance list: List all instances in a networkvirak-cli network lb assign: Assign a load balancervirak-cli network lb create: Create a new load balancervirak-cli network lb deassign: Deassign a load balancervirak-cli network lb delete: Delete a load balancervirak-cli network lb haproxy live: View live HAProxy statsvirak-cli network lb haproxy log: View HAProxy logsvirak-cli network lb list: List all load balancersvirak-cli network list: List all networksvirak-cli network public-ip associate: Associate a public IPvirak-cli network public-ip disassociate: Disassociate a public IPvirak-cli network public-ip list: List all public IPsvirak-cli network public-ip staticnat disable: Disable static NATvirak-cli network public-ip staticnat enable: Enable static NATvirak-cli network port-forward create: Create a port forwarding rulevirak-cli network port-forward delete: Delete a port forwarding rulevirak-cli network port-forward list: List port forwarding rulesvirak-cli network service-offering list: List all network service offeringsvirak-cli network show: Show details of a networkvirak-cli network vpn disable: Disable VPNvirak-cli network vpn enable: Enable VPNvirak-cli network vpn show: Show VPN detailsvirak-cli network vpn update: Update VPN
virak-cli zone list: List all zonesvirak-cli zone networks: Manage zone networksvirak-cli zone resources: Manage zone resourcesvirak-cli zone services: Manage zone services
virak-cli finance wallet: Manage wallet balancesvirak-cli finance documents: Manage cost documentsvirak-cli finance payments: Manage payments
virak-cli user profile: Show user profilevirak-cli user ssh-key create: Create SSH keyvirak-cli user ssh-key delete: Delete SSH keyvirak-cli user ssh-key list: List SSH keysvirak-cli user token abilities: View token abilitiesvirak-cli user token validate: Validate token
For detailed CLI usage guides and examples, see the CLI Guides directory:
- CLI Overview - Getting started with the CLI
- Instances - Managing virtual machines
- Networks - Network and firewall management
- DNS - Domain and DNS record management
- Buckets - Object storage operations
- Kubernetes - Cluster management
- Finance - Billing and payments
- User - Account and SSH key management
- Zones - Zone and region management
These guides provide CLI equivalents for panel operations with practical examples.
virak-cli/
├── cmd/ # CLI command implementations
│ ├── bucket/ # Bucket (Object Storage) commands
│ ├── cluster/ # Kubernetes cluster commands
│ ├── dns/ # DNS management commands
│ ├── finance/ # Finance commands
│ ├── instance/ # VM instance commands
│ ├── network/ # Network management commands
│ ├── user/ # User management commands
│ ├── zone/ # Zone management commands
│ ├── login.go # Authentication login
│ ├── logout.go # Authentication logout
│ └── root.go # Root command
├── internal/ # Internal packages
│ ├── cli/ # CLI utilities and validation
│ ├── logger/ # Logging utilities
│ └── presenter/ # Output formatting
├── pkg/ # Reusable packages
│ ├── http/ # HTTP client and API calls
│ ├── responses/ # API response structures
│ └── urls/ # API endpoint URLs
├── main.go # Application entry point
├── go.mod # Go module file
├── go.sum # Go dependencies
├── LICENSE # License file
└── README.md # This file
The CLI can be configured via a configuration file located at ~/.virak-cli.yaml.
The configuration file can be used to store your API token and other settings.
Example configuration:
auth:
token: "your-api-token"
default:
zoneId: "your-default-zone-id"
zoneName: "your-default-zone-name"go build -o virak-cli main.gox
Run linters and formatters:
gofmt -w .
goimports -w .
golint ./...
go vet ./...This project uses GoReleaser for automated releases. Releases are triggered via GitHub Actions on tag pushes.
To create a new release:
- Ensure all changes are committed and pushed to the
masterbranch. - Tag the commit with a semantic version (e.g.,
v1.2.3):git tag v1.2.3 git push origin v1.2.3
- The release workflow will automatically:
- Build binaries for Linux, Windows, and macOS (AMD64 and ARM64).
- Create archives and Debian packages.
- Generate a changelog from GitHub commits.
- Publish the release to GitHub Releases.
The release process is configured in .goreleaser.yml and uses environment variables for API URLs.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request