Skip to content

CLI Tool

The Nebion CLI lets you access your environments from the terminal — SSH into containers, view logs, and open environment URLs.

$ nebioncli hub
Nebion CLI | Org: ACME Corp | Website
Projects
Website (8) x1
API Backend v5
Mobile App (3) x1
Docs (1)
Staging (1)
Environments — Website
TitleStatusBranchDeploy
pr-87ERRORfeature/auth1h
pr-86SUCCESSnebion-routes1d
pr-85SUCCESSfix/nav-links3d
pr-82SUCCESSredesign5d
pr-79SUCCESSfeature/search7d
devSUCCESSdev7d
fix/nav-links pr-85
Branch: fix/nav-links Author: Jane Doe URL: pr-85.website.com
tab panel s ssh l logs u url / filter ? help
$ nebioncli ssh -p mysite -e 42 -c php
  Connected to pr-42.mysite.com (php)
  web@pr-42:~$$ nebioncli doctor
   .nebion.yml         valid
   Docker Compose      valid
   Routing             configured
   All checks passed$ nebioncli logs -f
  [nginx] GET /api/users → 200 (12ms)
  [php]   Cache cleared successfully

Install

bash
curl -fsSL https://nebion.wsagency.io/sites/default/files/cli/install | bash
bash
# Download the binary for your platform:
#   nebioncli-linux-amd64    (Linux x86_64)
#   nebioncli-linux-arm64    (Linux ARM64)
#   nebioncli-darwin-amd64   (macOS Intel)
#   nebioncli-darwin-arm64   (macOS Apple Silicon)
#   nebioncli-windows-amd64  (Windows x86_64)
#
# From: https://your-nebion-instance/cli/download/{binary-name}
# Then rename to nebioncli and place in your PATH

Verify installation:

bash
nebioncli version

Getting Started

After logging in, run nebioncli hub to open an interactive dashboard where you can browse all projects and environments, view logs, and SSH into containers.

Login

bash
nebioncli login

Your browser opens to the Nebion login page. After authenticating, return to the terminal. You stay logged in until you explicitly log out.

bash
# Login to a custom instance
nebioncli login --host https://custom.nebion.io

# Login without auto-opening browser
nebioncli login --no-browser

# Use a custom OAuth2 client ID
nebioncli login --client-id my-client

Commands

hub - Interactive Dashboard

bash
nebioncli hub

Opens a full-screen terminal dashboard for browsing projects and environments. The hub provides a two-panel layout: a project list on the left and environment details on the right, with built-in access to logs, deployment history, and diagnostics.

Navigation:

KeyAction
TabSwitch between project list and environment list
EnterSelect item / open action menu
/Filter current list
EscGo back / close panel
?Show all keybindings
qQuit

Environment actions (when an environment is selected):

KeyAction
sSSH into environment
lOpen log viewer
uOpen environment URL in browser
mView deployment history
dView diagnostics (failed environments)
oSwitch organization
rRefresh data

The log viewer supports follow mode (f), service filtering (s), text search (g), and line wrapping (w).

doctor - Validate Configuration

bash
nebioncli doctor

Run from your project root to validate .nebion.yml and your Docker Compose file before deploying. The doctor checks for common configuration issues that would cause deployment failures.

Checks performed:

SectionWhat it validates
Configuration.nebion.yml exists, valid YAML syntax, no unknown fields
Docker ComposeCompose file exists, valid syntax, services defined
Routingnginx_service matches a compose service, valid traefik_port
Deployment TasksTasks have required fields (command, service), services exist in compose
ActionsActions have required fields (name, command, service), result: file commands use $NEBION_ACTION_OUTPUT
VariablesReserved nebion_ prefix not used, compose ${VAR} references resolve

Outputs a color-coded report with pass, warning, and error indicators. Exits with code 1 if any errors are found, 0 otherwise.

The doctor also suggests corrections for typos in field names (e.g., nginx-service suggests nginx_service).

ssh - Connect to a Container

bash
# Interactive selection (project > environment > container)
nebioncli ssh

# Direct connection
nebioncli ssh -p myproject -e 42 -c php

# Connect to manual environment
nebioncli ssh -p myproject -e staging -c nginx
FlagShortDescription
--project-pProject name or ID
--environment-ePR number or environment name
--container-cContainer name (e.g., php, nginx)

Press Esc at any prompt to cancel.

action - Run Environment Actions

The action CLI command is not yet available. Actions can currently be triggered from the UI.
bash
# List available actions for an environment
nebioncli action list

# Run an action (interactive project/environment selection)
nebioncli action run cache-clear

# Run with explicit project and environment
nebioncli action run db-dump --project mysite --env pr-42

# Download artifact from the last file-producing action run
nebioncli action download db-dump

# Download from a specific run
nebioncli action download --run-id abc123
SubcommandDescription
listShow available actions for an environment
run <action-id>Trigger an action
download <action-id>Download the artifact from a file action
FlagShortDescription
--project-pProject name or ID
--environment-ePR number or environment name
--run-idSpecific action run ID (for download)

Actions are defined in .nebion.yml. See Actions for configuration details.

logs - View Container Logs
bash
# Interactive selection
nebioncli logs

# Fetch last 500 lines
nebioncli logs -n 500

# Follow logs in real-time (Ctrl+C to stop)
nebioncli logs -f

# Direct access
nebioncli logs -p myproject -e 42 -c php -f
FlagShortDescription
--project-pProject name or ID
--environment-ePR number or environment name
--container-cContainer name
--lines-nNumber of lines (default: 100)
--follow-fStream new logs in real-time
url - Open Environment URL
bash
# Interactive selection, opens in browser
nebioncli url

# Open PR-42's URL
nebioncli url 42

# Output URL to stdout (for scripting)
nebioncli url --pipe
nebioncli url -p myproject -e 42 --pipe

The CLI auto-detects the project if you run it from inside a Git repository that matches a Nebion project.

org - Manage Organizations
bash
# List your organizations
nebioncli org list

# Show current organization
nebioncli org current

# Switch organization (interactive)
nebioncli org switch

# Switch by name or ID
nebioncli org switch "ACME Corp"
nebioncli org switch 5

All other commands (ssh, logs, url) operate within the active organization.

logout / update / version
bash
# Remove stored credentials
nebioncli logout

# Download and install the latest CLI version
nebioncli update

# Show version
nebioncli version

MCP Server

bash
nebioncli mcp

The mcp command starts a Model Context Protocol (MCP) server over stdio. It exposes read-only Nebion operations as tools that an MCP client — such as Claude Code — can call directly, letting an AI assistant inspect your projects, environments, deployment status, logs, and failure diagnostics from your editor or chat.

You don't run nebioncli mcp yourself; your MCP client launches and talks to it. It reuses the credentials from nebioncli login and the active organization from nebioncli org switch, so it acts as the logged-in user with exactly their access to organizations and projects. No extra OAuth setup is needed in the client.

Read-only

The MCP server exposes inspection tools only. Deploying, stopping, or modifying environments is not supported.

Connect from Claude Code

Make sure nebioncli is logged in and on your PATH, then register the server:

bash
claude mcp add nebion -- nebioncli mcp

The -- separates Claude Code's own flags from the command it should run. After adding the server, Claude Code can call the Nebion tools in any session.

Choosing a scope: claude mcp add accepts a --scope flag that controls where the server is registered:

ScopeFlagStored inUse for
Local--scope local (default)Your user settings, this project onlyPersonal use on a single project
Project--scope project.mcp.json (committed to the repo)Sharing the server with your whole team via Git
User--scope userYour user settings, all projectsPersonal use across every project

When you share the server at project scope, the .mcp.json file is committed to Git, so everyone on the team gets it. For it to work for all of them, nebioncli must resolve from each person's PATH — use the bare nebioncli command (as shown above), not an absolute path that only exists on your machine.

Available tools

All eight tools are read-only:

ToolParametersDescription
whoamiCurrent authenticated user and the organizations they belong to (id, name, role)
list_projectsProjects in the active organization
list_environmentsproject_idEnvironments (PR and manual) for a project, with status, URL, branch, and PR metadata
get_environment_statusenvironment_idDeployment task history and current status for an environment
get_logsenvironment_id (plus optional service, limit, cursor, hours)Container logs for an environment from the log aggregation system
get_deploy_diagnosticsenvironment_idDiagnostics for the most recent failed deployment — the failed task and error details, plus the raw output as a fallback
get_task_detailenvironment_id, task_idParsed steps for a specific deployment task
get_task_logenvironment_id, task_idRaw, unparsed Semaphore/Ansible log for a specific deployment task

Building from source

Prebuilt binaries are available from the Install section, so most users never need a Go toolchain. If you do build nebioncli yourself, the MCP server requires Go 1.25 or newer.

Configuration

Storage Location & Files

The CLI stores configuration and credentials in your user config directory:

PlatformDirectory
Linux~/.config/nebioncli/
macOS~/.config/nebioncli/
Windows%APPDATA%\nebioncli\

If XDG_CONFIG_HOME is set, the CLI uses $XDG_CONFIG_HOME/nebioncli/ instead.

Files

FilePurpose
config.jsonInstance URL, active organization
credentials.jsonOAuth2 tokens (access + refresh)
id_ed25519 / id_ed25519.pubSSH keypair for container access

Files are created automatically on first login or ssh use. The private key never leaves your machine - the CLI sends your public key to Nebion and receives a short-lived certificate.

Warning: credentials.json contains sensitive tokens. It is created with 0600 permissions (owner read/write only). Do not share this file or commit it to version control.

Directory Permissions

bash
chmod 700 ~/.config/nebioncli
chmod 600 ~/.config/nebioncli/credentials.json
chmod 600 ~/.config/nebioncli/config.json
chmod 600 ~/.config/nebioncli/id_ed25519
chmod 644 ~/.config/nebioncli/id_ed25519.pub

Resetting Configuration

To completely reset the CLI:

bash
rm -rf ~/.config/nebioncli
nebioncli login

This removes credentials, configuration, and SSH keys. New keys are generated on next use.

Multiple Instances

The CLI supports one Nebion instance at a time. To switch:

bash
nebioncli login --host https://other.nebion.io

This replaces existing credentials.

Uninstall

Linux / macOS:

bash
rm $(which nebioncli)
rm -rf ~/.config/nebioncli

Windows: Delete the nebioncli.exe binary and the %APPDATA%\nebioncli directory.