@azin-tech/cli
v0.0.15
Published
Azin CLI — manage cloud infrastructure from the terminal
Maintainers
Readme
Azin CLI
Terminal interface for managing cloud infrastructure on Azin. Every backend action is available as a direct command.
Install
curl -fsSL https://azin.run/cli/install.sh | bashOr via npm:
npm install -g @azin-tech/cliThe shell installer prompts for Azin skill installation. Interactive global npm installs also offer skill installation. Today the supported coding agents are Claude Code and Codex. If you skip this step, you can install them later with zin skills install --agent <claude|codex>.
Update
Via install script (re-downloads the latest binary and auto-updates skills):
curl -fsSL https://azin.run/cli/install.sh | bashVia npm:
npm update -g @azin-tech/cli
zin skills install --agent claude # update Claude Code skills
zin skills install --agent codex # update Codex skillsInteractive global npm installs also offer skill installation automatically. Non-interactive installs skip prompts.
Or use the /zin-update skill in Claude Code — it detects your install method, shows what's new, updates the binary, and updates skills automatically.
Quick Start
# 1. Create an account (or re-authenticate)
zin signup # opens browser for Google/GitHub OAuth
zin signup --no-browser # headless mode — prints URL, polls for completion
# 2. Check who you are
zin whoami
# 3. Connect integrations
zin connector github # connect GitHub (needed for repo-based deploys)
zin connector gcp # connect GCP (only needed on paid plans — Hobby uses shared infra)
# 4. Enable deploy permission
zin apikey toggle-deploy $(zin apikey list --json | jq -r '.[0]._id')
# 5. Create a project and link your repo
zin project create --name "My App"
zin init -p my-app
# 6. Check environment status
zin status -e productionAfter running zin init, the -p flag is no longer needed — the CLI reads the project from zin.json in your repo.
Commands
zin whoami
Show current user, organization, linked project, and deploy permission for the current API key.
zin whoami # human-readable
zin whoami --json # JSON outputzin signup
Create an Azin account via browser-based OAuth (Google or GitHub). The CLI is self-contained — no web console needed.
zin signup # opens browser for OAuth, saves API key automatically
zin signup --no-browser # headless mode — prints URL, polls for completionzin login
Authenticate with an existing API key, or re-authenticate via browser.
zin login # interactive prompt — paste an API key
zin login -k zin_k_... # pass key directly
zin login --browser # re-authenticate via browser OAuth (same flow as signup)
zin login -u https://... # override API URLzin apikey
Manage API keys directly from the CLI. Keys default to deploy-disabled for safety.
zin apikey create my-key # create key (deploy disabled)
zin apikey create my-key --deploy # create key with deploy permission
zin apikey list # list all keys
zin apikey list --json # JSON output
zin apikey toggle-deploy <id> # toggle deploy permission on/off
zin apikey revoke <id> # permanently revoke a keyzin init
Link the current directory to an Azin project by creating a zin.json file.
zin init # interactive project picker
zin init -p my-project # specify project slug directlyzin context
List all organizations, projects, and environments you have access to.
zin context # hierarchical view
zin context --json # JSON outputzin project
Manage projects — list, create, update, and delete.
zin project list # list all projects
zin project get my-project # project details
zin project create --name "My App" # create (auto-selects GCP project if only one)
zin project create --name "My App" --gcp-project my-gcp-id # explicit GCP project
zin project create --name "My App" --slug my-app # explicit slug
zin project update my-project --name "New Name" # rename
zin project delete my-project # delete (typed confirmation)
zin project delete my-project --force # delete (skip confirmation)
zin project delete my-project -y # skip confirmation prompt
zin project gcp-list # list available GCP projectsDelete requires typing the project slug to confirm. Use --force or -y for scripts. --gcp-project accepts a human-readable GCP project ID (e.g. my-gcp-project) and is optional when only one GCP project is connected.
zin environment
Manage environments within a project — list, create, update, fork, and delete. Alias: env-mgmt.
zin environment list -p my-project # list environments
zin environment get production -p my-project # environment details
zin environment create --name staging -p my-project # create
zin environment create --name staging --color "#3b82f6" -p my-project # create with color
zin environment update staging --name "Staging v2" -p my-project # rename
zin environment update staging --color "#ef4444" -p my-project # change color
zin environment fork production --name staging-copy -p my-project # fork (deep clone)
zin environment fork production --name copy --color "#10b981" -p my-project
zin environment delete staging -p my-project # delete (typed confirmation)
zin environment delete staging -p my-project --force # delete (skip confirmation)
zin environment delete staging -p my-project -y # skip confirmation promptFork deep-clones services and configuration from the source environment.
zin console
Open the Azin web console in the browser. Navigates directly to the project or environment page.
zin console -e production # open environment page
zin console -p my-project # open project overviewzin status
Quick environment overview — services, deployment status, and config issues.
zin status -e production
zin status -e prod --jsonzin logs
View service logs with optional severity filtering.
zin logs api -e production # last 100 lines
zin logs api -e prod -n 50 # last 50 lines
zin logs api -e prod --severity error # errors only
zin logs api -e prod -f # poll for new logs (Ctrl+C to stop)
zin logs api -e prod --json # JSON outputzin service
Full service lifecycle management.
# List & inspect
zin service list -e prod
zin service get api -e prod
# Create services
zin service create app --image nginx --tag latest -e prod
zin service create app --repo <id> --branch main -e prod
zin service create app --name my-api --image nginx --tag latest -e prod # explicit name
zin service create database --engine postgres --ver 16 -e prod
zin service create database --engine postgres --ver 16 --edition enterprise -e prod
zin service create cache --engine redis --ver 7 -e prod
zin service create scheduled-task --source docker --image img --tag v1 --schedule "0 * * * *" -e prod
zin service create scheduled-task --source github --repo <id> --branch main --schedule "0 * * * *" -e prod
zin service create background-job --source docker --image img --tag v1 -e prod
zin service create background-job --source github --repo <id> --branch main -e prod
zin service create volume --name data --size 10 -e prod
zin service create volume --name data --size 10 --storage-class standard --access-mode ReadWriteOnce -e prod
zin service create bucket --name assets -e prod
# Modify
zin service rename api --to new-api -e prod
zin service delete api redis -e prod
zin service restore api -e prod
# Diagnostics
zin service status api -e prod
zin service metrics api -e prod
zin service builds api -e prod
zin service outputs api -e prod
zin service open api -e prod # open public URL in browserzin service set
Configure service resources, scaling, health checks, and type-specific settings.
# Resources & scaling
zin service set resources api --cpu 500m --memory 256Mi -e prod
zin service set scaling api --min 1 --max 5 --target-cpu 80 -e prod
# Source (Docker)
zin service set source api --type docker --image nginx --tag latest -e prod
# Source (GitHub)
zin service set source api --type github --repo <id> --branch main --path src/ -e prod
zin service set source api --type github --repo <id> --branch main --build-type auto --start-command "npm start" -e prod
zin service set source api --type github --repo <id> --branch main --build-type dockerfile -e prod
zin service set source api --type github --repo <id> --branch main --dockerfile Dockerfile --build-context . -e prod
zin service set source api --type github --repo <id> --branch main --auto-deploy -e prod
# Partial updates (omit --type to keep existing source, only change specified fields)
zin service set source api --build-type dockerfile -e prod # switch to Dockerfile build
zin service set source api --branch develop -e prod # change branch only
zin service set source api --auto-deploy -e prod # enable auto-deploy only
# Health & readiness checks
zin service set health-check api --path /health --port 8080 --timeout 5 -e prod
zin service set readiness-check api --path /ready --port 8080 --timeout 3 -e prod
# Scheduled tasks
zin service set schedule cron --schedule "0 * * * *" --timezone UTC -e prod
zin service set schedule cron --concurrency Forbid --timeout 300 --retries 3 --command "npm run task" -e prod
# Background jobs
zin service set job worker --command "npm start" --replicas 2 -e prod
# Databases & caches
zin service set database mydb --instance-size db-f1-micro --storage 50 --ha --backups -e prod
zin service set cache redis --instance-size M1 --ha --persistence -e prod
# Volumes & buckets
zin service set volume data --size 20 --storage-class standard --access-mode ReadWriteOnce -e prod
zin service set bucket assets --versioning --cdn --public-access --static-website -e prod
zin service set bucket assets --no-versioning --no-cdn -e prod # disable flags
# Environment variables (injected into the container at deploy time)
zin service set env api --var NODE_ENV=production -e prod
zin service set env api --var NODE_ENV=production --var PORT=3000 -e prod # multiple vars
# Note: replaces ALL existing vars — pass every variable you want to keep
# Secret bindings
zin service bind-secret api --secret s1 --env DB_PASS -e prod
zin service unbind-secret api --secret s1 --env DB_PASS -e prod
# Bucket rules
zin service add-bucket-rule assets --type cors --rule '{"origins":["*"]}' -e prod
zin service remove-bucket-rule assets --type cors --index 0 -e prodzin endpoint
Manage service network endpoints.
zin endpoint add api --protocol http --port 8080 -e prod
zin endpoint add api --protocol http --port 8080 --target-port 3000 -e prod
zin endpoint add api --protocol http --port 8080 --domain example.com -e prod
zin endpoint remove api --index 0 -e prod
zin endpoint update api --index 0 --port 443 --protocol https -e prod
zin endpoint update api --index 0 --target-port 3000 -e prod
zin endpoint set-public api --index 0 --enabled -e prod
zin endpoint set-public api --index 0 -e prod # disable (--enabled defaults to false)
zin endpoint set-cdn api --index 0 --enabled --ttl 3600 -e prod
zin endpoint set-cdn api --index 0 -e prod # disable CDNzin domain
Manage custom domains.
zin domain list -e prod
zin domain create api.example.com -e prod
zin domain verify <domain-id> -e prod
zin domain connect <domain-id> --service api --endpoint-index 0 -e prod
zin domain disconnect <domain-id> -e prod
zin domain delete <domain-id> -e prodzin connect
Create service-to-service connections (sets environment variables automatically).
zin connect list -e prod
zin connect add --from api --to redis --env REDIS_URL --output connectionString -e prod
zin connect remove --from api --to redis --env REDIS_URL -e prodzin volume
Mount and unmount persistent volumes.
zin volume mount data --to api --path /data -e prod
zin volume unmount data --from api --path /data -e prodzin secret
Manage encrypted secrets.
zin secret list -e prod
zin secret create DB_PASS --value hunter2 -e prod
zin secret create DB_PASS --value hunter2 --scope project -e prod # project-scoped
zin secret update <id> --value newval -e prod
zin secret rename <id> --name NEW_NAME -e prod
zin secret delete <id> -e prod
zin secret retry <id> --value hunter2 -e prod # retry a failed synczin env
Manage environment variables — individual CRUD plus bulk .env file sync.
# Individual CRUD
zin env set DB_HOST localhost -e prod # add a variable
zin env update 0 --value newval -e prod # update by index
zin env update 0 --name NEW_NAME -e prod # rename by index
zin env remove 3 -e prod # remove by index
# Project-level variables
zin env set-project API_URL https://... -e prod # add project var
zin env update-project 0 --value new -e prod # update project var
zin env remove-project 2 -e prod # remove project var
zin env move 0 --to project -e prod # promote env var to project scope
zin env move 0 --to environment -e prod # move project var to env scope
# Bulk .env file sync
zin env pull -e production # fetch remote → .env file
zin env pull .env.prod -e prod # custom output file
zin env pull --include-project -e prod # include project-level vars as comments
zin env pull -y -e prod # skip overwrite confirmation
zin env push -e production # merge .env with remote
zin env push --replace -e prod # full replace (removes missing vars)
zin env push --project-level -e prod # push to project-level vars
zin env push --dry-run -e prod # preview changes without applying
zin env push -y -e prod # skip confirmationzin deploy
Trigger and manage deployments. Auto-deploy is enabled by default — after the first deployment, pushing to the tracked branch automatically triggers a build and deploy. Manual zin deploy is only needed for the initial deployment or if auto-deploy has been disabled.
Deploy permission: API keys have deployments disabled by default. Enable it per key in the Azin console under Settings > API Keys. Check with zin whoami.
zin deploy -e production # preflight + confirm + deploy
zin deploy -e production -y # skip confirmation (CI/CD)
zin deploy -e production --dry-run # show what would deploy
zin deploy -e production --retry # retry last failed deployment
zin deploy status -e prod # current deployment status
zin deploy history -e prod # recent deployments
zin deploy cancel -e prod # cancel running deployment
zin deploy preflight -e prod # run preflight check only
zin deploy autodeploy --enabled -e prod # enable auto-deploy on push
zin deploy autodeploy --disabled -e prod # disable auto-deployzin changes
View and manage pending changes before deploying.
zin changes list -e prod
zin changes discard 2 -e prod # discard change by index
zin changes discard-all -e prodzin alert
Configure alert settings and notification channels.
zin alert list -e prod # list alert events
zin alert list --state open -e prod # only open alerts
zin alert settings -e prod
zin alert settings update --min-severity warning -e prod
zin alert settings update --enabled -e prod # enable alerts
zin alert settings update --disabled -e prod # disable alerts
zin alert settings update --notify-on-resolved -e prod # notify on resolved
zin alert settings update --no-notify-on-resolved -e prod # disable resolved notifications
zin alert ack <alert-id> -e prod
zin alert dismiss <alert-id> -e prod
zin alert channel add --type email --target [email protected] -e prod
zin alert channel add --type webhook --target https://hook.example.com --label "My Hook" -e prod
zin alert channel add --type email --target [email protected] --disabled -e prod # create disabled
zin alert channel update <id> --target [email protected] -e prod
zin alert channel update <id> --label "Renamed" -e prod # change label
zin alert channel update <id> --disabled -e prod # disable channel
zin alert channel update <id> --enabled -e prod # enable channel
zin alert channel delete <id> -e prodzin skills
Install Azin skills for a supported coding agent.
zin skills install --agent claude # Install to ~/.claude/skills/
zin skills install --agent codex # Install to ~/.codex/skills/
zin skills install --json # JSON outputClaude Code exposes these as /zin-setup, /zin-deploy, /zin-status, /zin-fix, and /zin-update. Codex installs the same skill directories under ~/.codex/skills/.
zin connector
Connect GitHub accounts and GCP projects. Required before deploying — GitHub for repo-based services, GCP for custom infrastructure (Hobby plan uses shared GCP).
zin connector list # list connected GitHub accounts and GCP projects
zin connector list --json # JSON output
zin connector github # connect GitHub (opens browser for OAuth)
zin connector github --no-browser # prints OAuth URL instead of opening browser
zin connector github --json # returns OAuth URL without opening browser or polling
zin connector gcp # connect GCP — auto-runs installer via gcloud if available
zin connector gcp --json # returns curl command without pollinggithub opens the browser for GitHub OAuth, then auto-links accounts that already have the Azin GitHub App installed. gcp creates an installer session — if gcloud CLI is installed locally, the installer runs automatically via Cloud Shell SSH. Otherwise it prints a curl command to run manually in Google Cloud Shell. After the installer lists available GCP projects, you select which to connect and choose a region interactively.
zin repo
Explore connected GitHub repositories.
zin repo status -e prod # GitHub connection status
zin repo list -e prod # list repositories
zin repo list --search myapp -e prod # search repositories
zin repo tree <repo-id> -e prod # browse file tree
zin repo tree <repo-id> --path src/ --branch main -e prod # specific path and branch
zin repo read <repo-id> --path README.md -e prod # read files
zin repo read <repo-id> --path src/index.ts --branch dev -e prod # specific branchContext Resolution
The CLI resolves project and environment from multiple sources in this order:
| Context | Priority |
|---------|----------|
| Project | -p flag > ZIN_PROJECT env var > zin.json > ~/.zin/config.json |
| Environment | -e flag > ZIN_ENVIRONMENT env var > ~/.zin/config.json |
Environment is intentionally not stored in zin.json — it's always a runtime choice so you don't accidentally deploy to the wrong place.
CI/CD
All commands support --json for machine-readable output and -y to skip confirmation prompts:
# GitHub Actions example
zin login -k $ZIN_API_KEY
zin deploy -e production -y --json# Sync .env from CI
zin env push -e staging -y --replaceExit codes: 0 on success, 1 on error (auth failure, validation errors, no changes, etc.).
Global Options
-V, --version Show version number
-h, --help Show help for any commandEvery subcommand accepts -h for usage details:
zin service -h
zin deploy -h
zin endpoint add -h