Docs/CLI Reference

CLI Reference

Complete command-line interface documentation for the Lubes CLI.

Installation

Install the Lubes CLI using your preferred method:

npm
npm install -g @lubes/cli
Homebrew (macOS/Linux)
brew install lubes/tap/lubes
Cargo (Rust)
cargo install lubes-cli
Binary download
# Linux/macOS
curl -fsSL https://lubes.dev/install.sh | sh

# Windows (PowerShell)
irm https://lubes.dev/install.ps1 | iex

Verify the installation:

lubes --version
# lubes 0.1.4

Configuration

Global Configuration

Global config is stored in ~/.lubes/config.toml:

# ~/.lubes/config.toml
[auth]
access_token = "your-access-token"
refresh_token = "your-refresh-token"

[defaults]
organization = "my-org"
project = "my-project"

[output]
format = "table"  # table, json, yaml

Project Configuration

Project-specific config in lubes.json:

{
  "projectId": "abc123",
  "organization": "my-org",
  "functions": {
    "directory": "./functions",
    "runtime": "deno"
  },
  "database": {
    "migrations": "./migrations"
  }
}

Environment Variables

VariableDescription
LUBES_ACCESS_TOKENOverride access token
LUBES_PROJECT_IDOverride project ID
LUBES_API_URLCustom API endpoint
LUBES_DEBUGEnable debug output

Commands

Global Options

OptionDescription
--help, -hShow help for command
--version, -VShow CLI version
--project, -pSpecify project ID
--output, -oOutput format (table, json, yaml)
--debugEnable debug output

lubes auth

Authentication commands

auth login

Log in to Lubes

lubes auth login
auth logout

Log out of Lubes

lubes auth logout
auth status

Show authentication status

lubes auth status
auth token

Print current access token

lubes auth token

lubes projects

Project management

projects list

List all projects

lubes projects list
projects create

Create a new project

lubes projects create my-project
projects delete

Delete a project

lubes projects delete my-project
projects info

Show project details

lubes projects info my-project

lubes db

Database operations

db query

Execute a SQL query

lubes db query "SELECT * FROM users"
db shell

Open interactive psql shell

lubes db shell
db migrations new

Create a new migration

lubes db migrations new create_users
db migrations up

Apply pending migrations

lubes db migrations up
db migrations down

Roll back last migration

lubes db migrations down
db branches list

List database branches

lubes db branches list
db branches create

Create a database branch

lubes db branches create dev

lubes functions

Edge functions

functions list

List deployed functions

lubes functions list
functions deploy

Deploy a function

lubes functions deploy hello-world
functions delete

Delete a function

lubes functions delete hello-world
functions logs

View function logs

lubes functions logs hello-world --follow
functions serve

Run functions locally

lubes functions serve

lubes storage

Object storage

storage buckets list

List storage buckets

lubes storage buckets list
storage buckets create

Create a bucket

lubes storage buckets create avatars
storage upload

Upload a file

lubes storage upload avatars photo.jpg
storage download

Download a file

lubes storage download avatars/photo.jpg
storage ls

List files in bucket

lubes storage ls avatars/

lubes env

Environment variables

env list

List environment variables

lubes env list
env set

Set a variable

lubes env set API_KEY xxx
env get

Get a variable value

lubes env get API_KEY
env remove

Remove a variable

lubes env remove API_KEY

lubes deploy

Deployment management

deploy list

List deployments

lubes deploy list
deploy create

Create a deployment

lubes deploy create
deploy rollback

Rollback to previous

lubes deploy rollback --to v42
deploy logs

View deployment logs

lubes deploy logs

lubes ssh-keys

SSH key management for Git access

ssh-keys list

List your SSH keys

lubes ssh-keys list
ssh-keys add

Add an SSH key (auto-detects ~/.ssh/id_*.pub)

lubes ssh-keys add "MacBook Pro"
ssh-keys add --key

Add SSH key from file or string

lubes ssh-keys add "Work" --key ~/.ssh/work_ed25519.pub
ssh-keys delete

Delete an SSH key

lubes ssh-keys delete abc123

lubes git

Git repository operations

git info

Show repository info and clone URLs

lubes git info
git branches

List Git branches

lubes git branches
git commits

List recent commits

lubes git commits --branch main -n 10

lubes update

CLI updates

update

Check and install CLI updates

lubes update

lubes version

Version information

version

Show CLI version details

lubes version

Interactive Mode (TUI)

The CLI includes an interactive terminal UI for managing your projects:

# Launch interactive mode
lubes tui

# Or simply
lubes

TUI Features

  • • Browse and switch between projects
  • • View real-time function logs
  • • Monitor database queries
  • • Manage deployments visually
  • • Execute SQL queries interactively

Next Steps