The telnyx-edge CLI is the primary tool for deploying and managing Edge Compute functions.
Installation
# macOS (Homebrew)
brew tap telnyx/tap
brew install telnyx-edge
# Linux / macOS (direct download)
# Download from https://github.com/team-telnyx/edge-compute/releases
wget -qO- https://github.com/team-telnyx/edge-compute/releases/latest/download/telnyx-edge-linux-amd64.tar.gz | tar xz
sudo mv telnyx-edge /usr/local/bin/
# Verify installation
telnyx-edge --help
Authentication
Login with OAuth
Opens a browser window for OAuth authentication. After successful login, credentials are stored locally.
API Key Authentication
# Set API key directly
telnyx-edge auth api-key set YOUR_API_KEY
# Clear stored API key
telnyx-edge auth api-key clear
Check Authentication Status
Returns your authenticated organization and user info.
Logout
Clears stored credentials.
Function Management
Create a New Function
telnyx-edge new-func -l=<language> -n=<name>
| Flag | Description | Options |
|---|
-l, --language | Function language | ts, js, go, python, quarkus |
-n, --name | Function name | Alphanumeric, hyphens allowed |
--language defaults to ts when omitted.
Examples:
# Create a TypeScript function (default)
telnyx-edge new-func -l=ts -n=my-webhook
# Create a Python function
telnyx-edge new-func -l=python -n=my-webhook
# Create a Go function
telnyx-edge new-func -l=go -n=call-handler
# Create a Java (Quarkus) function
telnyx-edge new-func -l=quarkus -n=enterprise-app
This creates a new directory with func.toml plus language-specific files:
| Language | Scaffolded files |
|---|
ts | index.ts, package.json, tsconfig.json |
js | index.js, package.json |
go | handler.go, go.mod |
python | function, pyproject.toml |
quarkus | src/, pom.xml, mvnw, .mvn, README.md, .gitignore |
Deploy a Function
Deploys the function from the current directory. Reads configuration from func.toml.
Options:
| Flag | Description |
|---|
--from-dir | Deploy from a specific directory |
--timeout | Deployment monitoring timeout (Go duration: 2m, 300s; default 5m0s) |
Examples:
# Deploy from current directory
cd my-function
telnyx-edge ship
# Deploy from a specific directory
telnyx-edge ship --from-dir=./my-function
After deployment, the CLI outputs your function URL:
✓ Function deployed successfully
URL: https://my-webhook-abc123.telnyxcompute.com
Delete a Function
telnyx-edge delete-func <function-name>
This permanently deletes the function and all its versions. This action cannot be undone.
Example:
telnyx-edge delete-func my-old-function
List Functions
Lists all functions in your organization with their status and URLs.
Inspect Revisions
telnyx-edge revisions list <function-name>
Lists the most recent revisions for a function (newest first). Each successful ship produces an immutable revision that can be rolled back to with rollback.
Roll Back a Function
telnyx-edge rollback <function-name> <revision-id>
Instantly retargets traffic to an existing, immutable revision across all clusters — there is no rebuild or re-upload. Only revisions that reached deploy_ok can be rolled back to. Use revisions list <function-name> to see available revision ids.
Secrets Management
Secrets are encrypted environment variables that are injected at runtime.
Add a Secret
telnyx-edge secrets add <name> "<value>"
Examples:
# Add a single secret
telnyx-edge secrets add DATABASE_URL "postgres://user:pass@host:5432/db"
# Add an API key
telnyx-edge secrets add OPENAI_API_KEY "sk-..."
Secrets are available as environment variables in your function:
import os
db_url = os.environ.get('DATABASE_URL')
List Secrets
Lists secret names (values are not displayed for security).
Delete a Secret
telnyx-edge secrets delete <name>
Example:
telnyx-edge secrets delete OLD_API_KEY
Bindings
These commands manage the org-level Telnyx credential (one per organization) behind the Telnyx API binding. They’re account-level — the per-function flow needs none of them: declaring [telnyx] in func.toml wires the binding automatically on ship.
Create a Binding
telnyx-edge bindings create
Provisions the org-level Telnyx credential. One per organization.
View Current Binding
Shows binding configuration and status.
Validate Binding
telnyx-edge bindings validate
Tests that the binding is working correctly by making a test API call.
Regenerate Binding Tokens
telnyx-edge bindings update
Regenerates binding tokens. Use this if you suspect credentials have been compromised.
Delete Binding
telnyx-edge bindings delete
Removes the binding. Functions will no longer have automatic Telnyx API access.
Generate Binding Types
Writes telnyx-env.d.ts at the project root so env.<BINDING> is type-safe in function code, folding every declared binding into one global Env interface. Re-run after changing a binding declaration.
The [telnyx] binding and telnyx-edge types are TypeScript-only. types generates a .d.ts declaration file consumed by tsc; it has no effect on js, go, python, or quarkus runtimes.
System Commands
Check CLI Status
Shows authentication status and connectivity to Edge Compute services.
Get Help
# General help
telnyx-edge --help
# Command-specific help
telnyx-edge new-func --help
telnyx-edge ship --help
Update CLI
# macOS (Homebrew)
brew upgrade telnyx-edge
# Linux / direct install
# Download from https://github.com/team-telnyx/edge-compute/releases
wget -qO- https://github.com/team-telnyx/edge-compute/releases/latest/download/telnyx-edge-linux-amd64.tar.gz | tar xz
sudo mv telnyx-edge /usr/local/bin/
Configuration File
Each function has a func.toml configuration file. The new-func scaffold generates the [edge_compute] block (func_id, func_name); the runtime infers the language from the files you scaffolded with -l. Add a [telnyx] block to wire the Telnyx API binding:
# func.toml
[edge_compute]
func_id = "60c5ce48-…" # created by new-func
func_name = "my-webhook"
[telnyx]
binding = "MY_TELNYX" # becomes env.MY_TELNYX after `telnyx-edge types`
[env_vars]
LOG_LEVEL = "info"
API_ENDPOINT = "https://api.example.com"
[build]
# Optional build settings
entry_point = "main.py"
Configuration Fields
| Field | Description | Required |
|---|
func_id | Function id (created by new-func, reused on later ships) | Yes |
func_name | Function name (used in URL) | Yes |
language | Runtime language | No — inferred from new-func -l |
[telnyx] | Telnyx API binding declaration (binding = "NAME") | No |
[env_vars] | Environment variables | No |
[build] | Build configuration | No |
See Environment Variables for more configuration options.
Common Workflows
First Deployment
# 1. Login
telnyx-edge auth login
# 2. Create function
telnyx-edge new-func -l=python -n=my-first-function
# 3. Edit code
cd my-first-function
# ... edit your code ...
# 4. Deploy
telnyx-edge ship
Adding Secrets
# 1. Add secrets
telnyx-edge secrets add DATABASE_URL "postgres://..."
telnyx-edge secrets add API_KEY "secret-key"
# 2. Redeploy to pick up secrets
telnyx-edge ship
Troubleshooting
”Not authenticated” Error
# Re-authenticate
telnyx-edge auth logout
telnyx-edge auth login
Deployment Fails
# Check function configuration
cat func.toml
# Verify you're in the right directory
ls -la
# Check CLI status
telnyx-edge status
Function Not Responding
# Check function exists
telnyx-edge list
# Redeploy
telnyx-edge ship
Next Steps