TELA-CLI Workflows
Step-by-step development workflows, automation examples, and best practices for using TELA-CLI effectively.
Quick Start Workflow
Your First TELA Application
Complete workflow from idea to deployment in 10 minutes:
# 1. Start TELA-CLI
tela-cli
# 2. Connect to simulator for testing
endpoint simulator
# 3. Connect your wallet
wallet ./my-wallet.db
# 4. Create a simple HTML file
# (Outside TELA-CLI, create index.html)Create index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First TELA App</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.container {
background: rgba(255,255,255,0.1);
padding: 30px;
border-radius: 10px;
backdrop-filter: blur(10px);
}
</style>
</head>
<body>
<div class="container">
<h1>🚀 Hello TELA!</h1>
<p>This is my first decentralized web application!</p>
<p>Running on DERO blockchain with complete privacy.</p>
</div>
</body>
</html>Continue in TELA-CLI:
# 5. Test locally first
serve local ./
# 6. Deploy to blockchain
install-doc index.html
# 7. Create an INDEX (use the DOC SCID from step 6)
install-index
# 8. Serve your deployed app
serve [your-new-index-scid]
# 9. Rate your own content (optional)
rate [your-index-scid]
# Success! Your app is now running on the decentralized web! 🎉Development Workflows
Local Development & Testing
Perfect for iterative development:
# Set up development environment
endpoint simulator
port-start 8090
browser true
max-servers 10
# Create project directory
mkdir my-tela-app
cd my-tela-app
# Start local development server
serve local ./
# Edit files in your favorite editor
# Changes are reflected immediately at http://localhost:8090
# When ready, test file processing
file-info index.html
file-info style.css
file-info app.js
# Check if any files need compression
# Files over 15KB should be compressed
# Files over 18KB need shardingProduction Deployment
When your app is ready for mainnet:
# Switch to mainnet
endpoint mainnet
# Connect production wallet
wallet ./production-wallet.db
# Final local test
serve local ./my-tela-app
# Deploy individual DOCs
install-doc index.html
install-doc style.css
install-doc app.js
# Create production INDEX with MODs
install-index
# Verify deployment
search my indexes
serve [new-index-scid]
# Set metadata for discoverability
set-var [index-scid]
# Set: var_meta_category = "Productivity"
# Set: var_meta_tags = "#TELA #Productivity #WebApp"Advanced Workflows
Large Application Deployment
For complex applications with many files:
# 1. Analyze your project
endpoint simulator
wallet ./dev-wallet.db
# Check all files in project
file-info index.html
file-info large-bundle.js # Might be >18KB
file-info assets/image.svg
# 2. Handle large files
file-shard large-bundle.js
# Creates: large-bundle-1.js, large-bundle-2.js, etc.
# 3. Deploy regular files first
install-doc index.html
install-doc style.css
install-doc assets/icon.svg
# 4. Deploy shard files (append .shard to dURL)
install-doc large-bundle-1.js # dURL: large-bundle-1.tela.shard
install-doc large-bundle-2.js # dURL: large-bundle-2.tela.shard
install-doc large-bundle-3.js # dURL: large-bundle-3.tela.shard
# 5. Create INDEX with .shards tag
install-index
# dURL: myapp.tela.shards (indicates reconstruction needed)
# Include all regular DOCs + shard DOCs
# 6. Test the deployed application
serve [index-scid]
# TELA automatically reconstructs large-bundle.js from shardsContent Discovery & Analysis
Discover and analyze existing TELA content:
# 1. Set up indexer
endpoint mainnet
gnomon start
# Wait for initial sync...
# 2. Discover popular content
search min-likes 80
search indexes
# 3. Analyze interesting applications
search scid [interesting-scid]
search scid vars [interesting-scid]
search ratings [interesting-scid]
# 4. Clone for study
clone [interesting-scid]
# 5. Serve and explore
serve [interesting-scid]
# 6. Provide feedback
rate [interesting-scid]Multi-Network Content Management
Managing content across different networks:
# Deploy to testnet first
endpoint testnet
wallet ./testnet-wallet.db
# Deploy and test
install-doc index.html
install-index TestApp
serve [testnet-index-scid]
# Switch to mainnet for production
endpoint mainnet
wallet ./mainnet-wallet.db
# Re-deploy same content
install-doc index.html
install-index ProductionApp
serve [mainnet-index-scid]
# Compare deployments
scid-diff [testnet-scid] [mainnet-scid]Automation Examples
Bash Script Automation
Create scripts for repetitive tasks:
deploy-tela-app.sh:
#!/bin/bash
# TELA Application Deployment Script
# Usage: ./deploy-tela-app.sh <project-directory> <app-name> <network>
PROJECT_DIR="$1"
APP_NAME="$2"
NETWORK="$3"
if [ -z "$PROJECT_DIR" ] || [ -z "$APP_NAME" ] || [ -z "$NETWORK" ]; then
echo "Usage: $0 <project-directory> <app-name> <network>"
echo "Example: $0 ./my-app 'My TELA App' simulator"
exit 1
fi
# Create TELA-CLI command script
cat > deploy_commands.txt << EOF
endpoint $NETWORK
wallet ./wallet.db
serve local $PROJECT_DIR
install-doc $PROJECT_DIR/index.html
install-doc $PROJECT_DIR/style.css
install-doc $PROJECT_DIR/app.js
install-index $APP_NAME
list
exit
EOF
echo "🚀 Deploying TELA application: $APP_NAME"
echo "📁 Project directory: $PROJECT_DIR"
echo "🌐 Network: $NETWORK"
echo ""
echo "Starting deployment..."
# Run TELA-CLI with commands
tela-cli < deploy_commands.txt
echo "✅ Deployment script completed!"
echo "Check the output above for SCIDs and any errors."Usage:
chmod +x deploy-tela-app.sh
./deploy-tela-app.sh ./my-project "My Amazing App" simulatorPython Integration
Integrate TELA-CLI with Python workflows:
tela_manager.py:
#!/usr/bin/env python3
import subprocess
import json
import os
import sys
class TELAManager:
def __init__(self, network="simulator", wallet_path="./wallet.db"):
self.network = network
self.wallet_path = wallet_path
def run_tela_command(self, commands):
"""Run TELA-CLI commands and return output"""
# Create temporary command file
with open("temp_commands.txt", "w") as f:
f.write(f"endpoint {self.network}\n")
f.write(f"wallet {self.wallet_path}\n")
for cmd in commands:
f.write(f"{cmd}\n")
f.write("exit\n")
try:
# Run TELA-CLI with commands
result = subprocess.run(
["tela-cli"],
stdin=open("temp_commands.txt"),
capture_output=True,
text=True
)
return result.stdout, result.stderr
finally:
# Clean up
if os.path.exists("temp_commands.txt"):
os.remove("temp_commands.txt")
def deploy_project(self, project_dir, app_name):
"""Deploy a complete TELA project"""
print(f"🚀 Deploying {app_name} from {project_dir}")
# Find all deployable files
html_files = []
css_files = []
js_files = []
for root, dirs, files in os.walk(project_dir):
for file in files:
if file.endswith('.html'):
html_files.append(os.path.join(root, file))
elif file.endswith('.css'):
css_files.append(os.path.join(root, file))
elif file.endswith('.js'):
js_files.append(os.path.join(root, file))
# Build deployment commands
commands = []
# Deploy all files
for file_list, file_type in [(html_files, "HTML"), (css_files, "CSS"), (js_files, "JS")]:
for file_path in file_list:
commands.append(f"install-doc {file_path}")
print(f"📄 Queuing {file_type}: {os.path.basename(file_path)}")
# Create INDEX
commands.append(f"install-index {app_name}")
# Execute deployment
stdout, stderr = self.run_tela_command(commands)
print("📊 Deployment Results:")
print(stdout)
if stderr:
print("❌ Errors:")
print(stderr)
def search_content(self, query_type="all", filter_likes=0):
"""Search for TELA content"""
commands = []
if filter_likes > 0:
commands.append(f"search min-likes {filter_likes}")
commands.append(f"search {query_type}")
stdout, stderr = self.run_tela_command(commands)
return stdout, stderr
# Usage example
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: python3 tela_manager.py <project_dir> <app_name>")
sys.exit(1)
manager = TELAManager()
manager.deploy_project(sys.argv[1], sys.argv[2])Usage:
python3 tela_manager.py ./my-project "My Python-Deployed App"Content Analysis Workflow
Analyze and compare TELA applications:
# 1. Set up analysis environment
endpoint mainnet
gnomon start
search min-likes 70 # Focus on quality content
# 2. Find applications to analyze
search indexes
# Note interesting SCIDs
# 3. Deep analysis of selected apps
search scid [scid1]
search scid vars [scid1]
search ratings [scid1]
# 4. Clone for detailed examination
clone [scid1]
clone [scid2]
# 5. Compare implementations
scid-diff [scid1] [scid2]
# 6. Serve and test functionality
serve [scid1]
serve [scid2]
# 7. Provide ratings based on analysis
rate [scid1]
rate [scid2]Library Development Workflow
Create reusable TELA libraries:
# 1. Develop library components
endpoint simulator
wallet ./dev-wallet.db
# 2. Create library files
# utils.js - utility functions
# components.css - reusable styles
# templates.html - HTML templates
# 3. Test library locally
serve local ./my-library
# 4. Deploy library components
install-doc utils.js # dURL: utils.tela.lib
install-doc components.css # dURL: components.tela.lib
install-doc templates.html # dURL: templates.tela.lib
# 5. Create library INDEX
install-index MyLibrary # dURL: mylibrary.tela.lib
# 6. Verify library is discoverable
search libs
search durl mylibrary.tela.lib
# 7. Test library integration in other projects
# Include library SCIDs in your application INDEXsPerformance Optimization
Efficient Development Setup
# Configure for optimal development experience
port-start 8100 # Higher port range
max-servers 5 # Limit concurrent servers
browser true # Auto-open for testing
updates true # Allow updated content
page-size 10 # Smaller result pages
colors true # Better readability
# Set up fast indexing
gnomon start
# Wait for initial sync, then work normallyBatch Operations
Process multiple files efficiently:
# Create a batch deployment script
echo "Processing multiple files..."
# Check all files first
for file in *.html *.css *.js; do
if [ -f "$file" ]; then
file-info "$file"
fi
done
# Deploy in order: CSS, JS, then HTML
for file in *.css; do
[ -f "$file" ] && install-doc "$file"
done
for file in *.js; do
[ -f "$file" ] && install-doc "$file"
done
for file in *.html; do
[ -f "$file" ] && install-doc "$file"
done
# Finally create INDEX
install-index "Batch Deployed App"Error Recovery Workflows
Network Connection Issues
# Check current status
info
# If daemon is offline:
endpoint close
endpoint simulator # or your preferred network
# Test connection
search all
# If still failing, try different endpoint
endpoint 127.0.0.1:20000 # Direct IPDeployment Failures
# Check wallet balance first
balance
# If insufficient funds, get more DERO for simulator:
# (Simulator provides free DERO)
# Retry with different settings
install-doc index.html
# If fails due to size:
file-info index.html # Check size
# Consider compression or sharding
# If contract deployment fails:
# Check network connection
# Verify wallet has sufficient balance
# Try with higher ringsize for privacyContent Discovery Issues
# If search returns no results:
# 1. Check Gnomon status
info
# 2. Restart Gnomon if needed
gnomon stop
gnomon start
# 3. Wait for sync and try again
search all
# 4. If still no results, try different network
endpoint testnet
gnomon start
search allIntegration Workflows
TELA-CLI + Go API Integration
Combine CLI and programmatic access:
hybrid_deployment.go:
package main
import (
"fmt"
"os"
"os/exec"
"strings"
"github.com/civilware/tela"
"github.com/deroproject/derohe/walletapi"
)
func deployWithCLI(projectDir, appName string) (string, error) {
// Use CLI for file processing and local testing
cmd := exec.Command("tela-cli")
cmd.Stdin = strings.NewReader(fmt.Sprintf(`
endpoint simulator
serve local %s
exit
`, projectDir))
output, err := cmd.CombinedOutput()
if err != nil {
return "", fmt.Errorf("CLI test failed: %v\n%s", err, output)
}
fmt.Printf("✅ Local testing completed\n")
// Use Go API for programmatic deployment
wallet, err := loadWallet() // Your wallet loading logic
if err != nil {
return "", err
}
// Process files programmatically
docs, err := processProjectFiles(projectDir)
if err != nil {
return "", err
}
// Deploy using Go API
var docSCIDs []string
for _, doc := range docs {
txid, err := tela.Installer(wallet, 2, doc)
if err != nil {
return "", fmt.Errorf("failed to deploy %s: %v", doc.Headers.NameHdr, err)
}
docSCIDs = append(docSCIDs, txid)
fmt.Printf("📄 Deployed: %s (%s)\n", doc.Headers.NameHdr, txid)
}
// Create INDEX
index := &tela.INDEX{
DURL: fmt.Sprintf("%s.tela", strings.ToLower(strings.ReplaceAll(appName, " ", ""))),
DOCs: docSCIDs,
Headers: tela.Headers{
NameHdr: appName,
DescrHdr: fmt.Sprintf("Deployed from %s", projectDir),
},
}
indexTXID, err := tela.Installer(wallet, 2, index)
if err != nil {
return "", fmt.Errorf("failed to deploy INDEX: %v", err)
}
fmt.Printf("🎉 INDEX deployed: %s\n", indexTXID)
return indexTXID, nil
}TELA-CLI + Web Interface
Create a web interface that uses TELA-CLI backend:
web_interface.html:
<!DOCTYPE html>
<html>
<head>
<title>TELA Manager</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
.command-box { background: #f0f0f0; padding: 15px; margin: 10px 0; border-radius: 5px; }
.output { background: #000; color: #0f0; padding: 10px; font-family: monospace; }
button { padding: 10px 20px; margin: 5px; }
</style>
</head>
<body>
<h1>🚀 TELA Manager</h1>
<div class="command-box">
<h3>Quick Actions</h3>
<button onclick="runCommand('search indexes')">Find Apps</button>
<button onclick="runCommand('search docs')">Find Docs</button>
<button onclick="runCommand('list')">Show Servers</button>
<button onclick="runCommand('info')">Show Status</button>
</div>
<div class="command-box">
<h3>Custom Command</h3>
<input type="text" id="customCommand" placeholder="Enter TELA-CLI command" style="width: 300px;">
<button onclick="runCustomCommand()">Execute</button>
</div>
<div class="command-box">
<h3>Output</h3>
<div id="output" class="output" style="height: 400px; overflow-y: scroll;"></div>
</div>
<script>
async function runCommand(command) {
const output = document.getElementById('output');
output.innerHTML += `> ${command}\n`;
try {
const response = await fetch('/api/tela-command', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ command: command })
});
const result = await response.json();
output.innerHTML += result.output + '\n\n';
output.scrollTop = output.scrollHeight;
} catch (error) {
output.innerHTML += `Error: ${error.message}\n\n`;
}
}
function runCustomCommand() {
const command = document.getElementById('customCommand').value;
if (command.trim()) {
runCommand(command);
document.getElementById('customCommand').value = '';
}
}
// Allow Enter key in input
document.getElementById('customCommand').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
runCustomCommand();
}
});
</script>
</body>
</html>Backend server (Go):
package main
import (
"encoding/json"
"net/http"
"os/exec"
"strings"
)
type CommandRequest struct {
Command string `json:"command"`
}
type CommandResponse struct {
Output string `json:"output"`
Error string `json:"error,omitempty"`
}
func handleTELACommand(w http.ResponseWriter, r *http.Request) {
var req CommandRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, "Invalid request", http.StatusBadRequest)
return
}
// Execute TELA-CLI command
cmd := exec.Command("tela-cli")
cmd.Stdin = strings.NewReader(req.Command + "\nexit\n")
output, err := cmd.CombinedOutput()
response := CommandResponse{
Output: string(output),
}
if err != nil {
response.Error = err.Error()
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(response)
}
func main() {
http.HandleFunc("/api/tela-command", handleTELACommand)
http.Handle("/", http.FileServer(http.Dir("./static/")))
fmt.Println("🌐 TELA Web Manager running on :8080")
http.ListenAndServe(":8080", nil)
}Best Practices
Development Best Practices
Development Tips
- Always test locally with
serve localbefore deploying - Use simulator network for development and testing
- Keep your wallet files secure and backed up
- Use compression for files larger than 15KB
- Consider sharding for files larger than 18KB
# Recommended development flow:
endpoint simulator # Safe testing environment
wallet ./dev-wallet.db # Dedicated development wallet
browser true # Auto-open for quick testing
updates true # Allow content updates during development
max-servers 5 # Limit resource usageProduction Best Practices
# Production deployment checklist:
endpoint mainnet # Production network
wallet ./prod-wallet.db # Secure production wallet
browser false # No auto-opening in production
updates false # Restrict to original versions
max-servers 20 # Allow more concurrent users
# Before mainnet deployment:
# ✅ Test thoroughly on simulator
# ✅ Verify all file sizes are optimal
# ✅ Test all functionality works
# ✅ Ensure sufficient DERO balance
# ✅ Backup wallet and SCIDsSecurity Best Practices
-
Wallet Security:
- Use strong passwords
- Keep wallet files secure
- Never share wallet passwords in scripts
- Use separate wallets for development and production
-
Network Security:
- Verify daemon endpoints
- Use local daemons when possible
- Be cautious with remote endpoints
-
Content Security:
- Validate all content before deployment
- Review smart contract code
- Test thoroughly on testnet first
Troubleshooting Common Issues
Command Not Found
# Check if TELA-CLI is in PATH
which tela-cli
# If not found, check Go installation
go env GOPATH
# Add to PATH (Linux/macOS)
export PATH=$PATH:$(go env GOPATH)/bin
# Reinstall if necessary
go install github.com/civilware/tela/cmd/tela-cli@latestConnection Issues
# Test different endpoints
endpoint simulator
endpoint testnet
endpoint mainnet
# Check if daemon is running
# For simulator: derod --simulator
# For testnet: derod --testnet
# For mainnet: derodDeployment Failures
# Check wallet balance
balance
# Verify file sizes
file-info problematic-file.html
# Try with compression
# Edit file to be smaller or use compression
# Check network status
infoThese workflows provide a comprehensive foundation for using TELA-CLI effectively in various scenarios. Adapt them to your specific needs and build upon these patterns for your own TELA development processes.