Spritz CLI (spx) - Deploy and manage AI agents
Project description
Spritz CLI (spx)
Command-line interface for deploying and managing Spritz AI agents across dev and production environments.
๐ Table of Contents
๐ง Requirements
- Python: 3.7 or higher
- Browser: Modern browser with localStorage support
- Internet: Active internet connection
- Access: Spritz dashboard access
โ๏ธ Setup
1. Installation
Install via pip:
pip install spritz-cli
Verify installation:
spx --version
spx --help
2. Configure Environment
Configure your development environment:
spx configure --profile dev
# Spritz URL: https://app.dev.spritz.activate.bar
# API URL: https://api.dev.spritz.activate.bar
Configure your production environment:
spx configure --profile prod
# Spritz URL: https://spritz.activate.bar
# API URL: https://api.spritz.activate.bar
3. Login
Authenticate with Spritz:
# Login to dev
spx login --profile dev
# Login to prod
spx login --profile prod
You're ready! ๐
๐ Commands
spx configure
Configure Spritz URL and API URL for different environments.
Usage:
spx configure [--profile PROFILE]
Options:
--profile- Profile name (default, dev, prod)
Example:
spx configure --profile dev
# Spritz URL [https://app.dev.spritz.activate.bar]:
# API URL [https://api.dev.spritz.activate.bar]:
# โ Profile 'dev' configured successfully
# Do you want to login now? [Y/n]: y
Configuration File: ~/.spx/config
Format:
[profile default]
spritz_url = https://spritz.activate.bar
api_url = https://api.spritz.activate.bar
[profile dev]
spritz_url = https://app.dev.spritz.activate.bar
api_url = https://api.dev.spritz.activate.bar
[profile prod]
spritz_url = https://spritz.activate.bar
api_url = https://api.spritz.activate.bar
spx login
Authenticate with Spritz via browser.
Usage:
spx login [--profile PROFILE]
Options:
--profile- Profile to login (default: default)
Example:
spx login --profile prod
# Output:
# โ Opening browser for authentication...
# Spritz URL: https://spritz.activate.bar
# Waiting for authentication...
# Please login in the browser window.
#
# [Browser opens, user logs in, window closes]
#
# โ Verifying token...
# โ Authentication successful!
# Logged in as: pradeep@incaendo.com
How it works:
- Opens browser to Spritz dashboard
- Extracts token from localStorage automatically
- Verifies token with API
- Saves token for future use
- Browser window closes automatically
spx list-profiles
List all configured profiles and their login status.
Usage:
spx list-profiles
Example:
spx list-profiles
# Output:
# Configured profiles:
# - default (https://spritz.activate.bar) โ logged in
# - dev (https://app.dev.spritz.activate.bar) โ logged in
# - prod (https://spritz.activate.bar) โ not logged in
spx whoami
Show current user information for a profile.
Usage:
spx whoami [--profile PROFILE]
Example:
spx whoami --profile prod
# Output:
# Profile: prod
# Spritz URL: https://spritz.activate.bar
# Email: pradeep@incaendo.com
# Auth0 ID: email|64e8a0485efd44509ed20f06
# Organization ID: 64a54a30899afb66425722fc
# Last Login: 2025-10-13T09:20:00.988Z
spx help
Show help for commands.
Usage:
spx --help # Show all commands
spx configure --help # Configure command help
spx login --help # Login command help
spx agent-onboarding --help # Agent onboarding help
spx agent-update --help # Agent update help
spx agent-onboarding
Deploy new agents from a configuration URL.
Usage:
spx agent-onboarding --profile PROFILE --url URL [--dry-run]
Options:
--profile- Environment profile (default, dev, prod)--url- URL that returns agent configuration JSON (required)--dry-run- Preview without deploying
Example:
spx agent-onboarding --profile prod --url https://config.example.com/agents.json
# Output:
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ ๐ SPRITZ AGENT ONBOARDING โ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#
# ๐ Profile: prod
# ๐ Spritz Web: https://spritz.activate.bar
# ๐ Spritz API: https://api.spritz.activate.bar
#
# ๐ฅ Loading agent configuration...
# Source: https://config.example.com/agents.json
# โ
Found 3 agent(s) to onboard
#
# ๐ฆ Agent Configurations:
# [1] Customer Support Agent
# [2] Sales Assistant
# [3] Analytics Bot
#
# โ๏ธ Creating agents...
# โ
[1/3] Customer Support Agent onboarded successfully
# ๐ Agent ID: 6925db4a0ad000cbdfa44cb5
# โ
[2/3] Sales Assistant onboarded successfully
# ๐ Agent ID: 6925db4a0ad000cbdfa44cb6
# โ
[3/3] Analytics Bot onboarded successfully
# ๐ Agent ID: 6925db4a0ad000cbdfa44cb7
#
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ ๐ SUMMARY โ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#
# โ
Success: 3/3
#
# ๐ All agents onboarded successfully!
Agent Configuration Format:
Single agent:
{
"name": "Customer Support Agent",
"url": "https://your-agent.com/agent",
"type": "chat",
"description": "Handles customer inquiries"
}
Multiple agents:
[
{
"name": "Customer Support Agent",
"url": "https://your-agent.com/agent1",
"type": "chat"
},
{
"name": "Sales Assistant",
"url": "https://your-agent.com/agent2",
"type": "voice"
}
]
spx agent-update
Update existing agents from a configuration URL.
Usage:
spx agent-update --profile PROFILE --url URL [--dry-run]
Options:
--profile- Environment profile (default, dev, prod)--url- URL that returns agent configuration JSON (required)--dry-run- Preview without updating
How it works:
- Fetches agent configuration from the provided URL
- Extracts the
urlfield from the configuration - Searches for the existing agent in Spritz using that URL
- Updates the agent with the new configuration (PATCH)
Example:
spx agent-update --profile prod --url http://localhost:8000/agent
# Output:
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ ๐ SPRITZ AGENT UPDATE โ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#
# ๐ Profile: prod
# ๐ Spritz Web: https://spritz.activate.bar
# ๐ Spritz API: https://api.spritz.activate.bar
#
# ๐ฅ Loading agent configuration...
# Source: http://localhost:8000/agent
# โ
Configuration loaded successfully
#
# ๐ Agent URL from config: http://localhost:8000/agent
# ๐ Searching for existing agent in Spritz...
# โ
Found agent: Customer Support Agent
# Agent ID: 6925db4a0ad000cbdfa44cb5
#
# โ๏ธ Updating agent...
#
# โ
Agent updated successfully!
#
# ๐ Agent: Customer Support Agent
# ๐ ID: 6925db4a0ad000cbdfa44cb5
Requirements:
- Agent must already exist in Spritz
- Agent configuration must have a
urlfield - The
urlfield must match the agent's URL in Spritz
spx assign-agents
Assign agents (resolved from a discover JSON) to an organization.
Usage:
spx assign-agents --profile PROFILE --url URL
What it does:
- Fetches organizations from Spritz
(
$limit=999,$skip=0, sorted by_id desc, selectingprofile.name/logo) - Shows the names in 3-4 columns with numbered entries (logo indicator when present)
- Prompts you to pick an organization number
- Loads agents from your discover JSON, searches Spritz by each agent
urlto resolve IDs - PATCHes the organization with the resolved agent IDs
Example:
spx assign-agents \
--profile dev \
--url https://example.com/agents-discover.json
# Output (trimmed):
# ๐ฅ Fetching organizations...
# โ
Found 10 organization(s)
# [ 1] ๐ผ๏ธ Alpha Labs [ 2] ๐ผ๏ธ Beta Group [ 3] Gamma Corp
# [ 4] Delta Ventures [ 5] ๐ผ๏ธ Epsilon Studio [ 6] Zeta Partners
# ...
# ๐ข Enter organization number: 3
# โ
Selected: Gamma Corp
# ๐ฅ Loading agent configuration...
# ๐ Resolving agent IDs...
# โ
Resolved 3 agent ID(s)
# โ๏ธ Assigning agents to organization...
# โ
Agents assigned successfully!
Agent JSON requirements:
- Provide a
urlfor each agent so the CLI can search and resolve the Spritz agent ID. - Other agent fields are ignored for assignment but help with readability in logs.
spx validate
Validate profile configuration and authentication.
Usage:
spx validate [--profile PROFILE]
Example:
spx validate --profile prod
# Output:
# โ Profile 'prod' is valid
# Spritz URL: https://spritz.activate.bar
# API URL: https://api.spritz.activate.bar
# Token: ****************************************...tQuDQ
# User: pradeep@incaendo.com
# Organization: 64a54a30899afb66425722fc
What it checks:
- Profile exists
- Spritz URL is configured
- API URL is configured
- Authentication token is present
- Token is valid and not expired
- User information is accessible
Preview Before Deploy (Dry Run)
Test your deployment without making changes using the --dry-run flag.
Agent Onboarding (Dry Run):
spx agent-onboarding \
--profile prod \
--url https://config.example.com/agents.json \
--dry-run
# Output:
# โ ๏ธ DRY RUN MODE - No changes will be made
#
# ๐ฆ Agent Configurations:
# [1] Customer Support Agent
# [2] Sales Assistant
#
# ๐ [DRY RUN] Would create the above agents
# Endpoint: POST https://api.spritz.activate.bar/v1/agent/create
Agent Update (Dry Run):
spx agent-update \
--profile prod \
--url http://localhost:8000/agent \
--dry-run
# Output:
# โ ๏ธ DRY RUN MODE - No changes will be made
#
# ๐ง DRY RUN: Would PATCH the following data:
# {
# "name": "Customer Support Agent",
# "url": "http://localhost:8000/agent",
# "type": "chat"
# }
# Endpoint: PATCH https://api.spritz.activate.bar/v1/agent/6925db4a0ad000cbdfa44cb5
๐ Complete Workflow
Development to Production Pipeline
# 1. Configure environments
spx configure --profile dev
spx configure --profile prod
# 2. Login to both environments
spx login --profile dev
spx login --profile prod
# 3. Deploy to dev first (test environment)
spx agent-onboarding \
--profile dev \
--url https://config-dev.example.com/agents.json
# 4. Test your agents in dev
# ... manual testing ...
# 5. Preview production deployment
spx agent-onboarding \
--profile prod \
--url https://config-prod.example.com/agents.json \
--dry-run
# 6. Deploy to production
spx agent-onboarding \
--profile prod \
--url https://config-prod.example.com/agents.json
# 7. Update agents when configuration changes
spx agent-update \
--profile prod \
--url https://config-prod.example.com/agents.json
๐ Troubleshooting
"Profile not found"
Problem: Profile hasn't been configured.
Solution:
spx configure --profile prod
"Token expired" or "Authentication failed"
Problem: Authentication token has expired or is invalid.
Solution:
# Re-authenticate
spx login --profile prod
"Agent not found" (during update)
Problem: Agent doesn't exist in Spritz or URL doesn't match.
Solution:
# Option 1: Create the agent first
spx agent-onboarding --profile prod --url https://config.example.com/agent.json
# Option 2: Verify the agent exists and URL matches
spx whoami --profile prod
"Connection Error" or "Connection refused"
Problem: Agent server is not running or URL is incorrect.
Solution:
# Check if your agent server is running
curl http://localhost:8000/agent
# Test with dry-run first
spx agent-onboarding --profile dev --url http://localhost:8000/agent --dry-run
# Verify the URL is correct and accessible
"Request Timeout"
Problem: Server is taking too long to respond.
Solution:
# Check server response time
curl -w "@curl-format.txt" -o /dev/null -s http://localhost:8000/agent
# Increase timeout by contacting support
# Or optimize your agent's response time
"Browser doesn't close automatically"
Problem: Browser automation didn't complete properly.
Solution:
- Close the browser window manually after seeing the success message
- Token has already been saved to your configuration
"Cannot connect to localhost:8765"
Problem: Port 8765 is already in use.
Solution:
# Check what's using the port
lsof -i :8765
# Kill the process if needed
kill -9 <PID>
# Try login again
spx login --profile prod
Reset Everything
Remove all configuration and credentials:
rm -rf ~/.spx
Uninstall CLI:
pip uninstall spritz-cli -y
Complete reinstall:
# 1. Uninstall
pip uninstall spritz-cli -y
rm -rf ~/.spx
# 2. Reinstall
pip install spritz-cli
# 3. Reconfigure
spx configure --profile default
spx login --profile default
๐ป Development
Project Structure
spritz-cli/
โโโ spritz.py # Main CLI entry point
โโโ setup.py # Package configuration
โโโ pyproject.toml # Build configuration
โโโ requirements.txt # Dependencies
โโโ README.md # This file
โโโ LICENSE # MIT License
โโโ MANIFEST.in # Package manifest
โโโ publish.sh # Publishing script
โโโ src/
โ โโโ __init__.py
โ โโโ config.py # Configuration management
โ โโโ auth.py # Authentication handling
โ โโโ utils.py # Utility functions
โ โโโ commands/
โ โโโ __init__.py
โ โโโ configure.py # Configure command
โ โโโ login.py # Login command
โ โโโ onboarding.py # Agent onboarding & update
โ โโโ info.py # whoami, list-profiles, validate
โโโ tests/
โโโ test_cli.py # Unit tests
Getting Started
1. Clone the repository:
git clone https://github.com/Activate-Intelligence/spritz-cli.git
cd spritz-cli
2. Create virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
3. Install dependencies:
pip install -r requirements.txt
4. Install in editable mode:
pip install -e .
5. Test the CLI:
spx --version
spx --help
6. Run tests:
pytest tests/
Publishing to PyPI
Quick Publish
Make the script executable (first time only):
chmod +x publish.sh
Publish to PyPI:
./publish.sh
Publish to TestPyPI (for testing):
./publish.sh --test
Manual Publishing
Install build tools:
pip install --upgrade pip build twine
Clean and build:
rm -rf dist/ build/ *.egg-info
python -m build
Check the package:
twine check dist/*
Upload to TestPyPI (recommended first):
twine upload --repository testpypi dist/*
Test installation:
pip install --index-url https://test.pypi.org/simple/ spritz-cli
Upload to PyPI:
twine upload dist/*
Verify:
pip install spritz-cli
spx --version
Troubleshooting Publishing
Package name already taken:
Update setup.py:
setup(
name='spritz-ai-cli', # Or 'incaendo-spritz-cli'
version='1.0.0',
# ... rest of configuration
)
Then rebuild and publish:
rm -rf dist/ build/ *.egg-info
python -m build
twine upload dist/*
Upload with verbose output:
twine upload dist/* --verbose
Clear pip cache:
pip cache purge
pip install spritz-cli --no-cache-dir
Verify package exists:
curl -I https://pypi.org/project/spritz-cli/ | grep HTTP
PyPI Credentials
Create API Token:
- Go to https://pypi.org/manage/account/token/
- Click "Add API token"
- Name:
spritz-cli-upload - Scope: "Entire account" or specific project
- Copy the token (starts with
pypi-)
Save credentials:
cat > ~/.pypirc << 'EOF'
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-YOUR-TOKEN-HERE
[testpypi]
username = __token__
password = pypi-YOUR-TESTPYPI-TOKEN-HERE
repository = https://test.pypi.org/legacy/
EOF
chmod 600 ~/.pypirc
Using environment variables:
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=pypi-YOUR-TOKEN-HERE
twine upload dist/*
๐ค Automation Scripts
Shell Scripts
agent-onboarding.sh - Onboard agents without assuming authentication
#!/bin/bash
# Configuration
PROFILE="prod"
AGENT_URL="http://localhost:8000/agent"
echo "๐ Spritz Agent Onboarding Automation"
echo "======================================"
# Check if spx is installed
if ! command -v spx &> /dev/null; then
echo "โ Error: spritz-cli is not installed"
echo "Install with: pip install spritz-cli"
exit 1
fi
# Check if profile exists
if ! spx list-profiles 2>/dev/null | grep -q "$PROFILE"; then
echo "โ๏ธ Configuring profile: $PROFILE"
spx configure --profile "$PROFILE"
fi
# Check authentication
echo "๐ Checking authentication..."
if ! spx validate --profile "$PROFILE" &>/dev/null; then
echo "๐ Authentication required"
spx login --profile "$PROFILE"
fi
# Onboard agents
echo "๐ฆ Onboarding agents from: $AGENT_URL"
spx agent-onboarding --profile "$PROFILE" --url "$AGENT_URL"
if [ $? -eq 0 ]; then
echo "โ
Agent onboarding completed successfully!"
else
echo "โ Agent onboarding failed!"
exit 1
fi
Make it executable:
chmod +x agent-onboarding.sh
Usage:
./agent-onboarding.sh
agent-update.sh - Update agents without assuming authentication
#!/bin/bash
# Configuration
PROFILE="prod"
AGENT_URL="http://localhost:8000/agent"
echo "๐ Spritz Agent Update Automation"
echo "=================================="
# Check if spx is installed
if ! command -v spx &> /dev/null; then
echo "โ Error: spritz-cli is not installed"
echo "Install with: pip install spritz-cli"
exit 1
fi
# Check if profile exists
if ! spx list-profiles 2>/dev/null | grep -q "$PROFILE"; then
echo "โ๏ธ Configuring profile: $PROFILE"
spx configure --profile "$PROFILE"
fi
# Check authentication
echo "๐ Checking authentication..."
if ! spx validate --profile "$PROFILE" &>/dev/null; then
echo "๐ Authentication required"
spx login --profile "$PROFILE"
fi
# Update agents
echo "๐ Updating agent from: $AGENT_URL"
spx agent-update --profile "$PROFILE" --url "$AGENT_URL"
if [ $? -eq 0 ]; then
echo "โ
Agent update completed successfully!"
else
echo "โ Agent update failed!"
exit 1
fi
Make it executable:
chmod +x agent-update.sh
Usage:
./agent-update.sh
Python Scripts
agent-onboarding.py - Python automation for agent onboarding
#!/usr/bin/env python3
"""
Spritz Agent Onboarding Automation
Handles authentication automatically before onboarding
"""
import subprocess
import sys
# Configuration
PROFILE = "prod"
AGENT_URL = "http://localhost:8000/agent"
def run_command(cmd):
"""Run shell command and return result"""
try:
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True,
check=False
)
return result.returncode == 0, result.stdout, result.stderr
except Exception as e:
return False, "", str(e)
def check_spx_installed():
"""Check if spx CLI is installed"""
success, _, _ = run_command("spx --version")
return success
def check_profile_exists(profile):
"""Check if profile is configured"""
success, output, _ = run_command("spx list-profiles")
return success and profile in output
def check_authentication(profile):
"""Check if user is authenticated"""
success, _, _ = run_command(f"spx validate --profile {profile}")
return success
def configure_profile(profile):
"""Configure a new profile"""
print(f"โ๏ธ Configuring profile: {profile}")
success, _, _ = run_command(f"spx configure --profile {profile}")
return success
def login(profile):
"""Login to profile"""
print(f"๐ Logging in to: {profile}")
success, _, _ = run_command(f"spx login --profile {profile}")
return success
def onboard_agent(profile, url):
"""Onboard agent"""
print(f"๐ฆ Onboarding agent from: {url}")
cmd = f"spx agent-onboarding --profile {profile} --url {url}"
result = subprocess.run(cmd, shell=True)
return result.returncode == 0
def main():
print("๐ Spritz Agent Onboarding Automation")
print("=" * 40)
# Check if spx is installed
if not check_spx_installed():
print("โ Error: spritz-cli is not installed")
print("Install with: pip install spritz-cli")
sys.exit(1)
# Check if profile exists
if not check_profile_exists(PROFILE):
if not configure_profile(PROFILE):
print(f"โ Failed to configure profile: {PROFILE}")
sys.exit(1)
# Check authentication
print("๐ Checking authentication...")
if not check_authentication(PROFILE):
if not login(PROFILE):
print("โ Authentication failed")
sys.exit(1)
# Onboard agent
if onboard_agent(PROFILE, AGENT_URL):
print("โ
Agent onboarding completed successfully!")
sys.exit(0)
else:
print("โ Agent onboarding failed!")
sys.exit(1)
if __name__ == "__main__":
main()
Make it executable:
chmod +x agent-onboarding.py
Usage:
python3 agent-onboarding.py
agent-update.py - Python automation for agent updates
#!/usr/bin/env python3
"""
Spritz Agent Update Automation
Handles authentication automatically before updating
"""
import subprocess
import sys
# Configuration
PROFILE = "prod"
AGENT_URL = "http://localhost:8000/agent"
def run_command(cmd):
"""Run shell command and return result"""
try:
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True,
check=False
)
return result.returncode == 0, result.stdout, result.stderr
except Exception as e:
return False, "", str(e)
def check_spx_installed():
"""Check if spx CLI is installed"""
success, _, _ = run_command("spx --version")
return success
def check_profile_exists(profile):
"""Check if profile is configured"""
success, output, _ = run_command("spx list-profiles")
return success and profile in output
def check_authentication(profile):
"""Check if user is authenticated"""
success, _, _ = run_command(f"spx validate --profile {profile}")
return success
def configure_profile(profile):
"""Configure a new profile"""
print(f"โ๏ธ Configuring profile: {profile}")
success, _, _ = run_command(f"spx configure --profile {profile}")
return success
def login(profile):
"""Login to profile"""
print(f"๐ Logging in to: {profile}")
success, _, _ = run_command(f"spx login --profile {profile}")
return success
def update_agent(profile, url):
"""Update agent"""
print(f"๐ Updating agent from: {url}")
cmd = f"spx agent-update --profile {profile} --url {url}"
result = subprocess.run(cmd, shell=True)
return result.returncode == 0
def main():
print("๐ Spritz Agent Update Automation")
print("=" * 40)
# Check if spx is installed
if not check_spx_installed():
print("โ Error: spritz-cli is not installed")
print("Install with: pip install spritz-cli")
sys.exit(1)
# Check if profile exists
if not check_profile_exists(PROFILE):
if not configure_profile(PROFILE):
print(f"โ Failed to configure profile: {PROFILE}")
sys.exit(1)
# Check authentication
print("๐ Checking authentication...")
if not check_authentication(PROFILE):
if not login(PROFILE):
print("โ Authentication failed")
sys.exit(1)
# Update agent
if update_agent(PROFILE, AGENT_URL):
print("โ
Agent update completed successfully!")
sys.exit(0)
else:
print("โ Agent update failed!")
sys.exit(1)
if __name__ == "__main__":
main()
Make it executable:
chmod +x agent-update.py
Usage:
python3 agent-update.py
Using Scripts in CI/CD
GitHub Actions Example:
name: Deploy Agent
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Spritz CLI
run: pip install spritz-cli
- name: Configure Spritz
run: |
mkdir -p ~/.spx
echo "[profile prod]" > ~/.spx/config
echo "spritz_url = https://spritz.activate.bar" >> ~/.spx/config
echo "api_url = https://api.spritz.activate.bar" >> ~/.spx/config
- name: Set Credentials
run: |
echo "${{ secrets.SPRITZ_TOKEN }}" > ~/.spx/credentials_prod
env:
SPRITZ_TOKEN: ${{ secrets.SPRITZ_TOKEN }}
- name: Deploy Agent
run: |
python3 agent-onboarding.py
GitLab CI Example:
deploy_agent:
stage: deploy
image: python:3.11
before_script:
- pip install spritz-cli
- mkdir -p ~/.spx
- echo "[profile prod]" > ~/.spx/config
- echo "spritz_url = https://spritz.activate.bar" >> ~/.spx/config
- echo "api_url = https://api.spritz.activate.bar" >> ~/.spx/config
- echo "$SPRITZ_TOKEN" > ~/.spx/credentials_prod
script:
- python3 agent-onboarding.py
only:
- main
๐ Security Best Practices
Local Development
# Use dev profile for local testing
spx configure --profile dev
spx login --profile dev
spx agent-onboarding --profile dev --url http://localhost:8000/agent
Production
# Always verify before deploying to prod
spx agent-onboarding --profile prod --url https://prod.example.com/agent --dry-run
# Deploy after verification
spx agent-onboarding --profile prod --url https://prod.example.com/agent
CI/CD
- Store tokens as encrypted secrets
- Use separate profiles for different environments
- Rotate tokens regularly
- Never commit tokens to version control
Token Management
# Check token status
spx validate --profile prod
# Re-authenticate when needed
spx login --profile prod
# Logout to remove token
rm ~/.spx/credentials_prod
๐ค Contributing
We welcome contributions! Here's how to get started:
Development Setup
# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/spritz-cli.git
cd spritz-cli
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install in development mode
pip install -e .
# Install development dependencies
pip install pytest black flake8 mypy
# Run tests
pytest tests/
# Format code
black .
# Lint code
flake8 .
Making Changes
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests for new features
- Run tests:
pytest tests/ - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
๐ Additional Resources
Documentation
- Spritz Platform: https://docs.spritz.ai
- API Documentation: https://api.spritz.activate.bar/docs
- GitHub Repository: https://github.com/Activate-Intelligence/spritz-cli
Support
๐ Changelog
v1.0.0 (2024-12-02)
Initial Release
- โ Profile-based configuration management
- โ Browser-based authentication
- โ Agent onboarding from URL
- โ Agent updates from URL
- โ Multiple environment support (dev, prod)
- โ Dry-run mode for safe previews
- โ Automatic token refresh
- โ Comprehensive error handling
๐ Acknowledgments
- Click - Beautiful command line interfaces
- Requests - HTTP library for Python
- PyYAML - YAML parser and emitter
Built with โค๏ธ by the Incaendo Technology Team
Quick Links:
- ๐ฆ PyPI Package
- ๐ป GitHub Repository
- ๐ Report Issues
- โญ Star on GitHub
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spritz_cli-1.2.0.tar.gz.
File metadata
- Download URL: spritz_cli-1.2.0.tar.gz
- Upload date:
- Size: 35.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe5641072a100200892cf58306c242b579cc235dfb6181d5b02ed25760df4e51
|
|
| MD5 |
94f72fef76d116e63a5d425d3940ae8a
|
|
| BLAKE2b-256 |
8c78aa120fbc2efe65d61a1a73749979d853420cb9cb47381cabad268b994020
|
File details
Details for the file spritz_cli-1.2.0-py3-none-any.whl.
File metadata
- Download URL: spritz_cli-1.2.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9c59046ed8a976405773008392fd5cc444a5644feaaee8a8e683605715b777a
|
|
| MD5 |
33ef297487787cf5bfc54518de86bd43
|
|
| BLAKE2b-256 |
8dc4c001178757dfd42082519897b2e23694e66b3331ae1852daae2ff8f837e7
|