Skip to content

About

Minimal wrapper for nctl to make managing deploio apps easy

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

56 Commits

Folders and files

Repository files navigation

deploio-cli (deploio / depl)

A CLI for Deploio that wraps nctl commands with a simpler interface.

Requirements

  • Ruby 3.3+
  • nctl version 1.10.0 or higher
  • rclone (brew install rclone) — only needed for deploio pg backups on economy-tier databases

Installation

From source (development)

git clone https://github.com/renuo/deploio-cli.git
cd deploio-cli
bin/setup

bin/setup installs the dependencies and puts deploio and depl binstubs into ~/.local/bin (override with INSTALL_DIR), so this checkout runs from any directory. The binstubs are pinned to the Ruby that ran bin/setup; run it again after changing the Ruby version.

As a gem

gem install deploio-cli

Shell Completion

Enable autocompletion by adding the line for your shell to its rc file:

# ~/.zshrc
eval "$(deploio completion)"

# ~/.bashrc
eval "$(deploio completion --shell bash)"

After setup, completions work for:

  • Commands: deploio <TAB> → shows all commands and subcommands
  • Options: deploio logs --<TAB> → shows --tail, --lines, --app, etc.
  • Apps (dynamic): deploio logs --app <TAB> → fetches available apps from server

Configuration

App naming convention

Apps are referenced using <project>-<app> format, where:

  • project is your Deploio project name (e.g., deploio-landing-page)
  • app is the environment/app name (e.g., develop, production)

Example: deploio-landing-page-develop

Automatic app detection

When you run a command without --app, the CLI will automatically detect the app by matching your git remote URL against nctl apps:

cd ~/projects/deploio-landing-page
deploio logs --tail  # Automatically detects app from git remote

If multiple apps match (e.g., develop and production), you'll be prompted to select one.

Usage

deploio - CLI for Deploio (wraps nctl)

AUTHENTICATION
  deploio auth:login              Authenticate with nctl
  deploio auth:logout             Log out
  deploio auth:whoami             Show current user and organization
  deploio login                   Shortcut for auth:login

APPS
  deploio apps                    List all apps
  deploio apps -p PROJECT         List apps in a specific project
  deploio apps --chf              Show estimated monthly price (CHF) for each app
  deploio apps:info -a APP        Show app details

PROJECTS
  deploio projects                List all projects
  deploio projects --chf          Show estimated total price (CHF) for each project

BUILDS
  deploio builds                  List all builds
  deploio builds -a APP           List builds for a specific app

SERVICES
  deploio services                            List all services
  deploio services -p PROJECT                 List services in a specific project
  deploio services -p PROJECT --url List services with connection URLs (requires -p)
  deploio services -p PROJECT --connected-apps  Show which apps use each service (requires -p)
  deploio services --chf                    Show estimated monthly price (CHF) for each service

POSTGRESQL
  deploio pg                                  List all PostgreSQL databases
  deploio pg:info NAME                        Show database details
  deploio pg backups list NAME                List available backups
  deploio pg backups download NAME            Download the latest backup
  deploio pg backups capture NAME             Capture a new backup

LOGS
  deploio logs -a APP             Show recent logs
  deploio logs -a APP --tail      Stream logs continuously
  deploio logs -a APP -n 200      Show last N lines

EXECUTION
  deploio exec -a APP -- CMD      Run command in app container
  deploio run -a APP -- CMD       Alias for exec

OTHER
  deploio completion              Generate zsh completion script
  deploio completion -s bash      Generate bash completion script
  deploio version                 Show version

FLAGS
  -a, --app APP                   App in <project>-<app> format
  -o, --org ORG                   Organization
  --dry-run                       Print commands without executing
  --no-color                      Disable colored output

Examples

Authentication

# Login to nctl
deploio login

# Check current user
deploio auth:whoami

Working with apps

# List all apps
deploio apps

# List apps in a specific project
deploio apps -p myproject

# List apps with estimated monthly prices (CHF)
deploio apps --chf

# Show app info
deploio apps:info -a myproject-staging

Working with projects

# List all projects
deploio projects

# List projects with estimated total prices (apps + services)
deploio projects --chf

# Output as JSON
deploio projects --json

### Working with services

```bash
# List all services
deploio services

# List services in a specific project
deploio services -p myproject

# List services with estimated monthly prices (CHF)
deploio services --chf

# List services with connection URLs (requires --project)
deploio services -p myproject --url

# Show which apps are connected to each service (requires --project)
deploio services -p myproject --connected-apps

# Combine options
deploio services -p myproject --url --connected-apps --chf

# Output as JSON
deploio services --json

Note: Prices (--chf) are fetched from the Nine calculator API and cached locally in ~/.deploio/prices.json for 24 hours.

Logs and execution

# View logs
deploio logs -a deploio-landing-page-develop

# Stream logs
deploio logs -a deploio-landing-page-develop --tail

# Run a command
deploio exec -a deploio-landing-page-develop -- rails console

# With git remote matching (auto-detected)
cd ~/projects/deploio-landing-page
deploio logs --tail
deploio exec -- rails console

Development

Running tests

bin/check
bin/fastcheck

Release

  1. Bump the version in lib/deploio/version.rb, run bundle install, update CHANGELOG.md and commit to main.

  2. Tag the commit with the bare version and push the tag:

    git tag -a 1.2.3 -m 1.2.3
    git push origin 1.2.3
  3. Create a GitHub release for the tag with the changelog section as notes.

Semaphore runs the tests on the tag and, when they pass, promotes the release pipeline, which pushes the gem to rubygems.org. It fails when the tag does not match the gem version.

Testing commands

After bin/setup, deploio runs this checkout, so changes take effect immediately. After adding or changing commands or options, refresh the autocompletion options:

eval "$(deploio completion)"               # zsh
eval "$(deploio completion --shell bash)"  # bash

License

MIT

Copyright

Renuo AG

About

Minimal wrapper for nctl to make managing deploio apps easy

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages