API Documentation
Complete reference for AetherPost CLI commands, configuration, and Python API.
Core Commands
aetherpost init
Setup
Initialize a new AetherPost workspace with configuration files and project structure.
Usage
aetherpost init [OPTIONS] COMMAND [ARGS]...
Commands:
main Initialize workspace (like 'terraform init')
Options:
--quick Skip interactive prompts, use defaults
--backend Specify backend type [local|aws|cloud]
--help Show help message
Examples
# Interactive initialization
aetherpost init main
# Quick setup with defaults
aetherpost init main --quick
# Initialize with AWS backend
aetherpost init main --backend aws
aetherpost plan
Planning
Preview campaign content before deployment. Shows generated content for each platform.
Usage
aetherpost plan [OPTIONS]
Options:
-c, --config PATH Configuration file [default: campaign.yaml]
-v, --verbose Show detailed information
--output FORMAT Output format [table|json|yaml]
--help Show help message
Examples
# Preview default campaign
aetherpost plan
# Preview specific config file
aetherpost plan -c my-campaign.yaml
# Verbose output with details
aetherpost plan --verbose
# JSON output for automation
aetherpost plan --output json
aetherpost apply
Deployment
Execute campaign and post content to configured platforms.
Usage
aetherpost apply [OPTIONS]
Options:
-c, --config PATH Configuration file [default: campaign.yaml]
--dry-run Show what would be posted without posting
--auto-approve Skip confirmation prompts
--platform TEXT Only post to specific platform
--help Show help message
Examples
# Deploy campaign with confirmation
aetherpost apply
# Dry run to test without posting
aetherpost apply --dry-run
# Auto-approve for CI/CD
aetherpost apply --auto-approve
# Deploy to specific platform only
aetherpost apply --platform bluesky
aetherpost now
Quick Post
Quick post without configuration file. Perfect for immediate announcements.
Usage
aetherpost now [OPTIONS] MESSAGE
Arguments:
MESSAGE Text to post [required]
Options:
--to TEXT Platforms (comma-separated) [default: bluesky]
--hashtags TEXT Hashtags (comma-separated)
--style TEXT Posting style [default: casual]
-y, --yes Skip confirmation
--skip-review Skip content review
--help Show help message
Examples
# Quick post to Bluesky
aetherpost now "Just launched our new feature! 🚀"
# Multi-platform post
aetherpost now "Product update available" --to bluesky,twitter
# With hashtags and style
aetherpost now "New tutorial published" \
--hashtags tutorial,learning \
--style professional
Campaign Configuration
YAML configuration schema for defining campaigns.
Basic Campaign Structure
name: "My Campaign" # Campaign name
concept: "What you're promoting" # Brief description
platforms: [bluesky, twitter] # Target platforms
content: # Content configuration
style: "professional" # Content style
action: "Learn more!" # Call to action
hashtags: ["tech", "innovation"] # Default hashtags
schedule: # Posting schedule
type: "immediate" # immediate|delayed|recurring
timezone: "UTC" # Timezone for scheduling
analytics: true # Enable analytics tracking
Configuration Reference
name
string required
Display name for the campaign. Used in logs and analytics.
concept
string required
Brief description of what you're promoting. Used by AI for content generation.
platforms
array required
List of platforms to post to. Available: bluesky
(free), twitter
(paid), mastodon
content
object optional
Content generation settings. See Content Configuration for details.
schedule
object optional
Posting schedule configuration. See Schedule Configuration for details.
analytics
boolean optional
Enable analytics tracking for this campaign. Default: false
Content Configuration
Configure how content is generated and optimized for each platform.
content:
style: "professional" # Content style/tone
action: "Try it now!" # Call to action
hashtags: ["tech", "ai"] # Default hashtags
# AI-specific settings
ai_prompt: "Custom generation prompt"
temperature: 0.7 # AI creativity (0.0-1.0)
# Platform-specific content
platform_specific:
bluesky:
max_length: 300
style: "casual"
twitter:
max_length: 280
include_media: true
Content Options
style
string
Content tone and style. Options: casual
, professional
, technical
, friendly
action
string
Call-to-action text to include in posts.
hashtags
array
Default hashtags to include. Platform-specific limits apply.
ai_prompt
string
Custom prompt for AI content generation. Overrides default prompts.
temperature
number
AI creativity level (0.0-1.0). Higher values = more creative, lower = more focused.
Plugin Development
Build custom connectors, AI providers, and analytics plugins.
Custom Platform Connector
from aetherpost.plugins.base import BaseConnector
from aetherpost.core.config.models import CredentialsConfig
class MyPlatformConnector(BaseConnector):
"""Custom connector for MyPlatform social network."""
def __init__(self, credentials: dict):
super().__init__()
self.api_key = credentials.get('api_key')
self.api_secret = credentials.get('api_secret')
async def post_content(self, content: str,
media_urls: list = None,
**kwargs) -> dict:
"""Post content to MyPlatform."""
# Implement platform-specific posting logic
response = await self._api_call('POST', '/posts', {
'text': content,
'media': media_urls,
})
return {
'success': True,
'post_id': response['id'],
'url': response['url'],
}
async def validate_credentials(self) -> bool:
"""Validate API credentials."""
try:
await self._api_call('GET', '/account/verify')
return True
except Exception:
return False
def get_character_limit(self) -> int:
"""Return platform character limit."""
return 500
Custom AI Provider
from aetherpost.plugins.base import BaseAIProvider
class MyAIProvider(BaseAIProvider):
"""Custom AI provider for content generation."""
def __init__(self, credentials: dict):
super().__init__()
self.api_key = credentials.get('api_key')
async def generate_content(self,
prompt: str,
platform: str,
max_length: int = None,
**kwargs) -> str:
"""Generate content using custom AI service."""
# Platform-specific optimization
if platform == 'bluesky':
prompt += " Make it engaging and conversational."
elif platform == 'twitter':
prompt += " Keep it under 280 characters."
# Call your AI service
response = await self._ai_api_call(prompt, {
'max_tokens': max_length,
'temperature': kwargs.get('temperature', 0.7),
})
return response['generated_text']
async def improve_content(self, content: str,
feedback: str) -> str:
"""Improve content based on feedback."""
prompt = f"Improve this content: {content}\nFeedback: {feedback}"
return await self.generate_content(prompt)
def get_supported_features(self) -> list:
"""Return list of supported features."""
return ['text_generation', 'content_improvement', 'hashtag_generation']
Plugin Registration
# In your plugin's __init__.py
from aetherpost.plugins.manager import plugin_manager
from .connector import MyPlatformConnector
from .ai_provider import MyAIProvider
# Register plugins
plugin_manager.register_connector('myplatform', MyPlatformConnector)
plugin_manager.register_ai_provider('myai', MyAIProvider)
# Plugin metadata
PLUGIN_INFO = {
'name': 'MyPlatform Plugin',
'version': '1.0.0',
'description': 'Connector for MyPlatform social network',
'author': 'Your Name',
'requires': ['aetherpost>=1.0.0'],
}
Python SDK
Use AetherPost programmatically in your Python applications.
Basic Usage
from aetherpost import AetherPost
from aetherpost.core.config.models import CampaignConfig, ContentConfig
# Initialize AetherPost
ap = AetherPost()
# Create campaign configuration
campaign = CampaignConfig(
name="API Demo",
concept="Demonstrating AetherPost Python SDK",
platforms=["bluesky", "twitter"],
content=ContentConfig(
style="professional",
action="Check it out!",
hashtags=["demo", "api"]
)
)
# Generate content preview
preview = await ap.plan(campaign)
print(f"Generated content: {preview}")
# Deploy campaign
result = await ap.apply(campaign, auto_approve=True)
print(f"Deployment result: {result}")
Advanced Usage
import asyncio
from aetherpost import AetherPost
from aetherpost.core.analytics.dashboard import AnalyticsDashboard
async def automated_campaign():
"""Example of automated campaign management."""
ap = AetherPost()
# Load configuration from file
campaign = ap.load_config('campaign.yaml')
# Generate and review content
content = await ap.generate_content(campaign)
# Customize content if needed
if 'bluesky' in campaign.platforms:
content['bluesky'] = await ap.optimize_for_platform(
content['bluesky'], 'bluesky'
)
# Schedule for optimal timing
optimal_times = await ap.get_optimal_posting_times(campaign.platforms)
campaign.schedule.datetime = optimal_times[0]
# Deploy campaign
result = await ap.apply(campaign)
# Track analytics
analytics = AnalyticsDashboard()
await analytics.track_campaign(campaign.name, result)
return result
# Run automated campaign
result = asyncio.run(automated_campaign())
Core Classes
AetherPost
Main SDK class for campaign management and content generation.
plan(campaign: CampaignConfig) → dict
Generate content preview without posting.
apply(campaign: CampaignConfig, **options) → dict
Execute campaign and post to platforms.
load_config(path: str) → CampaignConfig
Load campaign configuration from YAML file.
ContentGenerator
AI-powered content generation and optimization.
generate_for_platform(platform: str, **options) → str
Generate optimized content for specific platform.
improve_content(content: str, feedback: str) → str
Improve content based on feedback.