Configuration¶
Classes for configuring flaude machine instances and repository specifications.
MachineConfig
dataclass
¶
MachineConfig(image=DEFAULT_IMAGE, claude_code_oauth_token='', github_username='', github_token='', prompt='', repos=list(), region=DEFAULT_REGION, vm_size=DEFAULT_VM_SIZE, vm_cpus=DEFAULT_VM_CPUS, vm_memory_mb=DEFAULT_VM_MEMORY_MB, auto_destroy=DEFAULT_AUTO_DESTROY, env=dict(), metadata=dict(), output_format='', volume_id='', volume_mount_path='/data', session_id='')
Configuration for a flaude Fly.io machine.
Attributes:
| Name | Type | Description |
|---|---|---|
image |
str
|
Docker image reference for the machine. |
claude_code_oauth_token |
str
|
OAuth token for Claude Code authentication. |
github_username |
str
|
GitHub username for repo cloning. |
github_token |
str
|
GitHub personal access token for repo cloning. |
prompt |
str
|
The Claude Code prompt to execute. |
repos |
list[str | RepoSpec]
|
List of repositories to clone before running the prompt.
Each entry can be a plain URL string or a :class: |
region |
str
|
Fly.io region to launch in. |
vm_size |
str
|
Fly.io VM preset size (e.g. |
vm_cpus |
int
|
Number of vCPUs. |
vm_memory_mb |
int
|
Memory in megabytes. |
auto_destroy |
bool
|
Whether to auto-destroy the machine when it exits. |
env |
dict[str, str]
|
Additional environment variables to set on the machine. |
metadata |
dict[str, str]
|
Arbitrary key-value metadata attached to the machine. |
RepoSpec
dataclass
¶
Specification for a repository to clone on machine startup.
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
Repository URL (e.g. |
branch |
str
|
Optional branch/tag/ref to check out after cloning. Defaults to the repository's default branch when empty. |
target_dir |
str
|
Optional target directory name under |
build_machine_config
¶
Build the Fly.io Machines API create-machine payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
MachineConfig
|
A :class: |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dict suitable for JSON-serialising and POSTing to |
dict[str, Any]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing. |
Source code in flaude/machine_config.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |