Skip to content

CLI API Reference

Command-line interface functions and commands.

CLI Entry Point

The main CLI is built using Click and provides both interactive and single-command modes.

Main Command Group

cli(ctx, host)

Python gRPC client for Siphon service.

Source code in pysiphon/cli.py
@click.group(invoke_without_command=True)
@click.option('--host', default='localhost:50051', help='Server address')
@click.pass_context
def cli(ctx, host):
    """Python gRPC client for Siphon service."""
    ctx.ensure_object(dict)
    ctx.obj['host'] = host

    # If no subcommand, show help
    if ctx.invoked_subcommand is None:
        click.echo(ctx.get_help())

Command Functions

All CLI commands are implemented as Click functions. See the CLI Usage Guide for detailed usage examples.

Available Commands

  • interactive - Start interactive REPL mode
  • init - Initialize all subsystems from config file
  • status - Show server status
  • get - Get attribute value
  • set - Set attribute value
  • input - Tap keys
  • toggle - Toggle key state
  • capture - Capture frame to image
  • move - Move mouse
  • exec - Execute command on server
  • rec-start - Start recording session
  • rec-stop - Stop recording session
  • rec-status - Get recording status
  • rec-download - Download recording file

Helper Functions

get_client(host)

Get or create client instance.

Source code in pysiphon/cli.py
def get_client(host: str) -> SiphonClient:
    """Get or create client instance."""
    global _client
    if _client is None:
        _client = SiphonClient(host)
    return _client