https://github.com/zeabur/cli
Zeabur's official command line tool
https://github.com/zeabur/cli
cli deployment-automation devops go golang zeabur
Last synced: 6 months ago
JSON representation
Zeabur's official command line tool
- Host: GitHub
- URL: https://github.com/zeabur/cli
- Owner: zeabur
- License: mpl-2.0
- Created: 2023-07-05T07:29:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-20T04:10:21.000Z (7 months ago)
- Last Synced: 2025-03-30T17:11:46.883Z (6 months ago)
- Topics: cli, deployment-automation, devops, go, golang, zeabur
- Language: Go
- Homepage: https://zeabur.com/
- Size: 607 KB
- Stars: 46
- Watchers: 5
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Zeabur CLI
[Zeabur](https://zeabur.com/)'s official command line tool
> Note: Zeabur CLI is currently in beta, and we are still working on it. If you have any questions or suggestions, please feel free to contact us.
## How cool it is
1. Manage your Zeabur resources with CLI
2. Login with browser or token
3. Intuitive and easy to use
4. The design of the context makes it easier for you to manage services.
5. The seamless integration of interactive and non-interactive modes.## Quick Start
### 1. Install
No need to install, you can use it directly with npx. Make sure you have Node.js installed.
### 2. Login
If you can open the browser:
```shell
npx zeabur auth login
```Or you can use token to login:
```shell
npx zeabur auth login --token
```Zeabur CLI will open a browser window and ask you to login with your Zeabur account.
### 3. Manage your resources(Interactive mode, recommended)
[](https://asciinema.org/a/Olf52EUOCrKU6NGJMbYTw24SL)
```shell
# list all projects
npx zeabur project ls# set project context, the following commands will use this project context
# you can use arrow keys to select the project
npx zeabur context set project# list all services in the project
npx zeabur service ls# set service context(optional)
npx zeabur context set service# set environment context(optional)
npx zeabur context set env# restart the service
npx zeabur service restart# get the latest deployment info
npx zeabur deployment get# get the latest deployment log(runtime)
npx zeabur deployment log -t=runtime# get the latest deployment log(build)
npx zeabur deployment log -t=build
```### 4. Manage your resources(Non-interactive mode)
Non-interactive mode is useful when you want to use Zeabur CLI in a script(such as CI/CD pipeline, etc.)
Note: you can add `-i=false` to all commands to disable interactive mode.
**In fact, if the parameters are complete, it's same whether you use interactive mode or not.**```shell
# list all projects
npx zeabur project ls -i=false# set project context, the following commands will use this project context
npx zeabur context set project --name
# or you can use project id
# npx zeabur context set project --id# list all services in the project
npx zeabur service ls# set service context(optional)
npx zeabur context set service --name
# or you can use service id
# npx zeabur context set service --id# set environment context(optional)(only --id is supported)
npx zeabur context set env --id# restart the service
# if service context is set, you can omit the service name; so does environment context
npx zeabur service restart --env-id --service-name
# or you can use service id
# npx zeabur service restart --env-id --service-id# get the latest deployment info(if contexts are set, you can omit the parameters)
npx zeabur deployment get --env-id --service-name
# or you can use service id
# npx zeabur deployment get --env-id --service-id# get the latest deployment log(runtime)(service id is also supported)
npx zeabur deployment log -t=runtime --env-id --service-name
# get the latest deployment log(build)(service id is also supported)
npx zeabur deployment log -t=build --env-id --service-name
```5. More commands
```shell
npx zeabur --help
```## Development Guide
[Development Guide](docs/development_guide.md)
## Acknowledgements
1. GitHub
* GitHub provides us a place to store the source code of this project and running the CI/CD pipeline.
* [cli/cli](https://github.com/cli/cli) provides significant inspiration for the organizational structure of this project.
* [cli/oauth](https://github.com/cli/oauth) we write our own CLI browser OAuth flow based on this project.