Skip to main content

CLI Tools & Terminal

Calmo Bridge includes an integrated terminal that allows you to execute CLI commands on your local machine directly from Calmo conversations. The terminal provides real-time output streaming, full shell integration, and a seamless approval workflow—all without leaving the Bridge interface.

Overview

When connected via Local Bridge, Calmo has access to powerful command execution capabilities:

Integrated Terminal

Full terminal emulation with shell prompt, colors, and real-time output streaming

Command Approval

Review commands in a dedicated approval panel before they execute

Process Management

Start, monitor, and terminate long-running processes

Activity History

Track all executed commands with status indicators and full output

How It Works

The command execution flow integrates seamlessly with your chat workflow:
1

Chat with Calmo

Ask Calmo to run a command in the chat panel (right sidebar):“Hey, can you check what pods are running in the staging namespace?”
2

Review Command

The command appears in the Command Approval panel at the top right:
Command Approval panel showing pending command
kubectl get ns | grep argo
🟢 LOW RISK    [Deny] [Always] [Allow]
3

Approve or Deny

Choose your action:
  • Deny - Reject the command
  • Always - Auto-approve this pattern in the future
  • Allow - Execute just this once
4

Watch Execution

Output streams in real-time to the Terminal panel (bottom center):
Terminal showing real-time command execution
$ kubectl get ns | grep argo
argo-cd        Active   45d
argo-workflows Active   32d
 Command completed
5

Continue Conversation

Calmo sees the output and continues the conversation in the chat panel. You can ask follow-up questions or request additional commands.

Visual Workflow

┌────────────────────────────────────────────────────┐
│ 💬 Chat: "Check pods in staging"                  │
└────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────┐
│ ⚠️ Command Approval Panel                          │
│ kubectl get pods -n staging                        │
│ 🟢 LOW RISK  [Deny] [Always] [Allow] ←─── Click   │
└────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────┐
│ 🖥️ Terminal Panel                                  │
│ $ kubectl get pods -n staging                      │
│ NAME                  READY   STATUS    RESTARTS   │
│ api-server-abc123     1/1     Running   0          │
│ ✓ Command completed                                │
└────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────┐
│ 💬 Chat: "All pods are running healthy in staging"│
└────────────────────────────────────────────────────┘

Integrated Terminal

Terminal Panel

The Terminal panel lives in the bottom section of the center area, below the file editor: Features:
  • Shell Prompt - Shows current working directory
  • Real-Time Output - Command results stream as they happen
  • Color Support - ANSI colors and formatting preserved
  • Interactive - Supports prompts and user input
  • Resizable - Drag the divider to adjust height
  • Persistent - History persists across commands
Example Output:
$ kubectl get pods -A
NAMESPACE     NAME                          READY   STATUS
kube-system   coredns-787d4945fb-4zvhc     1/1     Running
kube-system   metrics-server-7b4f8b59f6    1/1     Running
...
 Command completed

Terminal vs. Activity Tabs

The bottom panel has two tabs:
TabPurposeShows
TerminalReal-time command executionCurrent command output, shell prompt, live streaming
ActivityCommand historyPast commands with timestamps, status, and expandable output
Switch between them to see live execution or review past commands.
Activity tab showing command history

Command Approval Workflow

Approval Panel

The Command Approval panel appears in the top right of the interface: Layout:
┌───────────────────────────────────────────┐
│ ⚠️ Command Approval         (3 commands)  │
├───────────────────────────────────────────┤
│ kubectl get ns | grep argo                │
│ 🟢 LOW RISK                               │
│         [Deny] [Always] [Allow]           │
├───────────────────────────────────────────┤
│ kubectl get pods -A | grep argo           │
│ 🟢 LOW RISK                               │
│         [Deny] [Always] [Allow]           │
└───────────────────────────────────────────┘
Elements:
  • Command - The exact command to be executed
  • Risk Badge - Color-coded risk level
  • Three Action Buttons - Deny, Always, Allow
  • Queue Count - Number of pending commands (in header)

Approval Actions

DenyRejects the command. Calmo will be notified that you denied it.Use when:
  • Command looks incorrect or dangerous
  • You want Calmo to try a different approach
  • The command would affect the wrong environment
Result: Command is not executed, marked as denied in activity history

Risk Levels

Commands are automatically classified by risk:
Low Risk - Safe read operations that don’t modify stateExamples:
kubectl get pods
kubectl describe deployment api-server
kubectl logs my-pod-abc123
git status
git log
ls -la
cat config.yaml
docker ps
Recommendation: Safe to use “Always” for frequently-used patterns

Command Execution

Basic Examples

Infrastructure Operations:
# Check Kubernetes resources
kubectl get pods -n production
kubectl describe deployment api-server
kubectl logs my-pod-abc123 --tail=100 --follow

# View cluster status
kubectl get nodes
kubectl top pods -n monitoring

# Check Argo CD applications
kubectl get applications -n argocd
Development Workflows:
# Git operations
git status
git log --oneline -10
git diff HEAD~1
git branch -a

# Package management
npm install
pip install -r requirements.txt
poetry install
pnpm build

# Docker operations
docker ps
docker logs container-id
docker-compose up -d
System Administration:
# File system operations
ls -la /path/to/project
cat config.yaml
find . -name "*.log" -mtime -1
tree -L 2

# Process inspection
ps aux | grep node
top -bn1
df -h

Common Use Cases

Kubernetes Troubleshooting

A typical debugging workflow with the integrated terminal:
1

Check Pod Status

You: “Check if there are any failing pods in staging”Terminal:
$ kubectl get pods -n staging
NAME                     READY   STATUS             RESTARTS
api-server-7d4f8b-x9k2p  0/1     CrashLoopBackOff   5
worker-6b8c9d-abc12      1/1     Running            0
 Command completed
2

Describe Problem Pods

Calmo: “I see the api-server pod is in CrashLoopBackOff. Let me get more details.”Terminal:
$ kubectl describe pod api-server-7d4f8b-x9k2p -n staging
Events:
  Type     Reason     Age   Message
  ----     ------     ----  -------
  Warning  BackOff    2m    Back-off restarting failed container
 Command completed
3

View Logs

Calmo: “Let me check the container logs for errors.”Terminal:
$ kubectl logs api-server-7d4f8b-x9k2p -n staging
Error: Cannot connect to database at postgres:5432
Connection refused
 Command completed
4

Root Cause Found

Calmo: “The pod can’t connect to the database. The postgres service might be down or misconfigured.”
All of this happens in the same window—chat on the right, terminal output in the center.

Development Environment Setup

# Clone and setup a new project
git clone https://github.com/org/repo.git
cd repo
npm install
npm run dev
The terminal shows real-time progress for each step.

Infrastructure as Code

# Terraform workflow
cd terraform/staging
terraform init
terraform plan -out=plan.tfplan
terraform apply plan.tfplan

# Kustomize + kubectl
kustomize build overlays/staging | kubectl apply -f -

Log Analysis

# Search logs for errors
kubectl logs deployment/api -n production | grep -i error

# Tail logs in real-time
kubectl logs -f pod/api-server-abc123 -n production

# Get logs from specific container
kubectl logs pod/my-pod -c init-container -n staging --tail=50
The terminal preserves colors and formatting, making log analysis easier.

Long-Running Processes

The terminal supports processes that run continuously:

Starting Background Processes

# Development servers
npm run dev

# Port forwarding
kubectl port-forward svc/api 8080:80 -n staging

# Log tailing
kubectl logs -f deployment/api -n production

# Watch commands
watch -n 5 kubectl get pods

Managing Processes

While Running:
  • Output streams continuously to the terminal
  • You can continue chatting with Calmo
  • New commands can be approved and queued
Stopping Processes:
  • Ask Calmo: “Stop the port-forward process”
  • Calmo will terminate the running process
  • Or manually close the terminal tab
Long-running processes continue in the background even if you switch to the Activity tab. Switch back to Terminal to see live output.

Working Directory

Commands execute in the context of your configured workspaces:

Workspace Context

If you’ve added /Users/pankaj/local_code/calmo-ci as a workspace:
# Calmo understands the workspace structure
$ pwd
/Users/pankaj/local_code/calmo-ci

# Can navigate within it
$ cd environments/staging
$ ls
kustomization.yaml  deployment.yaml  service.yaml

Multiple Workspaces

With multiple workspaces, Calmo asks which one to use: You: “List the files in this project” Calmo: “Which workspace? You have:
  • calmo-demos
  • calmo-ci
  • calmo-gmail”
You: “calmo-ci” Terminal:
$ cd /Users/pankaj/local_code/calmo-ci && ls
environments/  base/  README.md  kustomization.yaml

Activity Panel

Command History

The Activity tab shows all executed commands:
Activity panel with command history and status indicators
Each Entry Shows:
  • Status Icon:
    • Approved - Manually approved by you
    • Auto-approved - Matched an always-allow pattern
    • Denied - Rejected by you
  • Timestamp - When the command ran (e.g., “1d ago”, “2h ago”)
  • Command - The full command that was executed
  • Expand Arrow - Click to see full output
Features:
  • Searchable - Find past commands by text
  • Clickable - Click to expand and see full output
  • Copyable - Click the copy icon to copy the command
  • Filterable - Filter by status (approved, denied, auto-approved)

Managing History

Clear History:
  • Click Clear button to remove all history
  • Useful for decluttering after long sessions
Export History:
  • Commands are logged for your audit trail
  • Logs persist across bridge restarts

Environment & Shell

Shell Integration

Commands run in your default shell with full environment: macOS/Linux:
  • Uses your default shell (bash, zsh, fish)
  • Sources shell profile (.bashrc, .zshrc)
  • Environment variables available
  • PATH and aliases work
  • Shell functions available
Windows:
  • Uses PowerShell or cmd.exe (configurable)
  • Environment variables available
  • PATH settings honored

Environment Variables

Your shell environment is fully available:
$ echo $KUBECONFIG
/Users/pankaj/.kube/config

$ echo $NODE_ENV
development

$ which kubectl
/usr/local/bin/kubectl
Custom variables from your .bashrc/.zshrc are accessible.

Best Practices

1. Use Specific Commands

Target your commands to limit output and improve clarity:
# Good: Specific and bounded
kubectl logs deployment/api -n staging --tail=50

# Avoid: Unbounded output
kubectl logs deployment/api -n staging

2. Preview Before Applying

For infrastructure changes, always preview first:
# First, preview
terraform plan
kubectl diff -f manifest.yaml

# Then apply (separate approval)
terraform apply
kubectl apply -f manifest.yaml

3. Scope Operations

Limit scope to reduce risk and improve performance:
# Good: Namespaced
kubectl get pods -n specific-namespace

# Risky: All namespaces (slow, verbose)
kubectl get pods -A

4. Use Filters and Limits

Make output manageable:
# Limit results
kubectl get events --sort-by='.lastTimestamp' --field-selector type!=Normal | head -n 20

# Use grep
kubectl get pods -A | grep -i error

# Tail logs
kubectl logs deployment/api --tail=100

5. Set Up Auto-Approve Wisely

Safe to auto-approve:
kubectl get
kubectl describe
kubectl logs
git status
git log
ls
cat
pwd
Never auto-approve:
kubectl delete
kubectl apply
rm
terraform destroy
git push

Troubleshooting

Command Not Found

If commands fail with “command not found”:
  1. Verify installation
    which kubectl
    which terraform
    
  2. Check PATH
    echo $PATH
    
  3. Use full path
    /usr/local/bin/kubectl get pods
    
  4. Restart bridge to reload environment

Permission Denied

If commands fail with permission errors:
  • Commands run with your user permissions (not root)
  • Some operations may need sudo (use with caution)
  • Check file/directory permissions
  • Verify you’re in the correct workspace

Output Not Showing

If command output doesn’t appear in the terminal:
  1. Check Terminal tab - Ensure you’re on Terminal (not Activity)
  2. Scroll down - Output might be below viewport
  3. Wait - Some commands take time to produce output
  4. Check Activity tab - Command might have completed

Command Stuck

If a command seems stuck:
  1. Check for approval - Ensure you clicked Allow
  2. Long-running - Some commands take time (e.g., kubectl apply)
  3. Interactive prompt - Command might be waiting for input
  4. Ask Calmo to stop - “Cancel the current command”

Terminal Not Responding

If the terminal becomes unresponsive:
  1. Refresh - Click the refresh icon
  2. Restart bridge - Quit and relaunch the application
  3. Check logs - Look for errors in Activity Log

For assistance with CLI tools and terminal usage, contact our support team at [email protected].