Commands¶
octomate_cli.main ¶
The root Typer app: client commands at the root, server commands under service.
Every group is mounted whatever the machine holds — server or client — so the surface stays discoverable; a command that needs the absent half says so when invoked rather than vanishing.
options ¶
options(
show_version: Annotated[
bool,
Option(
"--version",
is_eager=True,
help="Show installed package versions.",
),
] = False,
) -> None
Source code in cli/octomate_cli/main.py
octomate_cli.config ¶
The client's server addresses and credentials for hooks and native history reads.
A settings class, the way the deployment's own config is one, so the variables,
the files and their precedence are declared in CLISettings rather than assembled by hand, and every
command reads the one cli_settings() object rather than building its own. Owned here
so a machine holding only octomate-cli never touches the server's config.
The stdlib hook scripts (emit.py, launch.py) cannot use it, and that is not an
oversight to be tidied away later. They exist to stay off the import cost of a
package on a hook the session blocks on, several times a turn: tomllib costs ~7ms
against pydantic_settings' ~230ms, on a script whose whole budget is ~25ms. So they
re-spell the variable names and the same file precedence in stdlib. Two tests in
tests/cli/test_codex_emit.py are what stop them drifting — one holds the names
against CLISettings.env, the other that both halves still pick the same file — so
a renamed field fails a test rather than a session going unauthenticated.
Scope ¶
DeepseekSettings
pydantic-model
¶
Bases: BaseModel
The local gateway used to read native DeepSeek history.
Fields:
-
url(str | None)
Source code in cli/octomate_cli/config.py
url
pydantic-field
¶
The local DeepSeek gateway's launch URL, including its authentication token. Store in cli.toml so native hooks can authenticate even when DeepSeek removes DSH_* environment variables.
CLISettings ¶
Bases: BaseSettings
What this machine's client half knows, resolved the same way everywhere.
Reached through cli_settings() rather than constructed: one object per process,
which is what a command or a hook is.
Source code in cli/octomate_cli/config.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 | |
model_config
class-attribute
instance-attribute
¶
model_config = SettingsConfigDict(
extra="ignore",
env_prefix="OCTOMATE_CLI_",
env_ignore_empty=True,
toml_file=(USER_CONFIG, PROJECT_CONFIG),
)
url
class-attribute
instance-attribute
¶
url: str | None = Field(
default=None,
description="Octomate's base URL (`http://host:port`), resolved when a hook fires rather than pinned at install time — so switching servers is a config switch, not a re-install. An explicit `--url` beats it.",
)
token
class-attribute
instance-attribute
¶
token: str | None = Field(
default=None,
description="A server-issued API token with hooks and/or mcp scope, obtained through the authenticated account API.",
)
deepseek
class-attribute
instance-attribute
¶
deepseek: DeepseekSettings = Field(
default_factory=DeepseekSettings,
description="DeepSeek's native history gateway settings.",
)
env
classmethod
¶
CLISettings.env("token") — the variable that field reads.
The class is asked every time rather than a constant standing beside it, so no variable name is ever spelled by hand: this composes from the prefix pydantic is holding, and a renamed field changes what every message says.
A method and not __class_getitem__, which would read better at the ~20 call
sites: a subscript on a class is a type to a type checker, so pyright reads
CLISettings["token"] as specialising the model and calls the result
type[CLISettings] whatever the override returns. Every site would be
mistyped, and silently so wherever the value is only interpolated.
.get with a default rather than a subscript because the key is optional in
SettingsConfigDict, and an absent prefix is the empty one.
Source code in cli/octomate_cli/config.py
settings_customise_sources
classmethod
¶
settings_customise_sources(
settings_cls: type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> tuple[PydanticBaseSettingsSource, ...]
Which kinds of source there are, and in what order — per key, following
Claude's own settings pattern: an explicit value wins, then the environment,
then the files. Which files is toml_file's to say, above.
The environment is ahead of the files for the cases with no home to write
into, a container or a CI step. Everywhere else the files are the durable
home and what configure writes: they survive launch paths the environment
does not — a GUI-launched editor never sourced a shell profile — and they are
per-user, where an exported credential is inherited by everything that shell
starts.
No dotenv and no secrets dir: ./.env on a server machine is the
deployment's environment, and reading it here would let a server's file
decide a person's credential.
Source code in cli/octomate_cli/config.py
user_config_path ¶
~/.config/octomate/cli.toml — where CLI tools keep their config, git and
ruff alike.
project_config_path ¶
./.octomate/cli.toml — beside the directory a session runs in, the way
.claude/settings.json scopes Claude. On a server machine .octomate/ is also
the data directory; the two uses share the name, not their files.
Source code in cli/octomate_cli/config.py
cli_settings
cached
¶
This process's client config — the one object every command reads.
Typer has nothing like FastAPI's Depends to hand a command its config, and its
one shared-state channel, ctx.obj, is untyped and reaches only commands invoked
through the root app. So the dependency is this function, and every call site
asks it rather than building a settings object of its own.
Cached because a process is one CLI invocation or one hook, and neither moves its
own environment or working directory while it runs. Not for speed: a settings
object costs ~0.13ms to build and no invocation wants more than two. The suite is
the one process that plays many, and tests/conftest.py clears this between them.
Source code in cli/octomate_cli/config.py
load_config ¶
One file's table, {} when absent — what configure reads back before
rewriting it, so keys it does not own survive. A file that does not parse is an
operator's mistake worth a precise error, not a silent fallback.
Source code in cli/octomate_cli/config.py
configure ¶
configure(
url: Annotated[
str | None,
Option(
help="Octomate's base URL (http://host:port)."
),
] = None,
token: Annotated[
str | None,
Option(
help="A server-issued API token. Omitted, the token already resolving is kept."
),
] = None,
dsh_url: Annotated[
str | None,
Option(
help="Save DeepSeek's gateway launch URL (including ?token=) under [deepseek]."
),
] = None,
scope: Annotated[
Scope,
Option(
help="Which file to write: 'user' (~/.config/octomate/cli.toml) or 'project' (./.octomate/cli.toml, resolved first)."
),
] = Scope.user,
) -> None
Write the client config every hook, tail and MCP entry on this machine reads.
Sign in through Trunkline and issue a token through the account API first.
The environment still overrides both scopes, and a --url pinned at install time
beats everything — the files are the durable floor, so ingest works from any
launch path on a machine where octomate-cli is the only thing installed.
Source code in cli/octomate_cli/config.py
octomate_cli.cli ¶
Manage the operator CLI independently from the deployed service.
upgrade ¶
Upgrade a standalone uv tool installation of octomate-cli.
Source code in cli/octomate_cli/cli.py
octomate_cli.service ¶
Run the server and manage the desktop account's GUI service.
RELEASE_URL
module-attribute
¶
service_typer
module-attribute
¶
service_typer = typer.Typer(
help="Prepare macOS, Linux or Docker deployments; run the server and manage its macOS GUI service."
)
Release
pydantic-model
¶
Bases: BaseModel
GitHub release metadata used to select a server upgrade.
Fields:
-
tag_name(str) -
draft(bool) -
prerelease(bool)
Source code in cli/octomate_cli/service.py
PlistService
pydantic-model
¶
Bases: BaseModel
A launchd job and its runtime configuration, loaded from a service plist.
Config:
hide_input_in_errors:True
Fields:
-
label(str) -
directory(Path) -
user(None) -
group(None) -
arguments(list[str]) -
environment(dict[str, str]) -
stdout(Path) -
stderr(Path) -
session_type(Literal['Aqua']) -
program(None) -
keep_alive(Literal[True]) -
abandon_process_group(Literal[False])
Source code in cli/octomate_cli/service.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
model_config
class-attribute
instance-attribute
¶
path
staticmethod
¶
load
classmethod
¶
Source code in cli/octomate_cli/service.py
require_gui ¶
Source code in cli/octomate_cli/service.py
loaded ¶
Check whether the launchd job defined by this plist is loaded.
Source code in cli/octomate_cli/service.py
launchctl ¶
Apply an unprivileged action in the desktop launchd domain.
stop ¶
Disable the job and wait for its process group to exit.
Source code in cli/octomate_cli/service.py
maintenance ¶
Run maintenance with the plist's working directory and environment.
Source code in cli/octomate_cli/service.py
report ¶
Print service status and log it beside the plist's configured checkout.
Source code in cli/octomate_cli/service.py
latest_server_release ¶
Find the highest stable server version across all release pages.
Source code in cli/octomate_cli/service.py
manage_service ¶
Serialize service changes, preserving the installed release on ordinary starts.
Source code in cli/octomate_cli/service.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |
upgrade ¶
start ¶
Ask macOS launchd to start and manage the installed GUI service.
Does not update code or migrate data. Use service serve to run the server
directly in the foreground for Docker or development.
Source code in cli/octomate_cli/service.py
stop ¶
restart ¶
verify ¶
Check schema and protected HTTP routes; no model or connector requests.
Source code in cli/octomate_cli/service.py
status ¶
Show the installed GUI job and its configured paths without modifying it.
Source code in cli/octomate_cli/service.py
logs ¶
Read the configured stdout and stderr logs.
Source code in cli/octomate_cli/service.py
invite ¶
invite(
url: Annotated[
str | None,
Option(
help="Print a registration link for this URL instead of a code."
),
] = None,
) -> None
Issue an anonymous, single-use registration invitation.
Source code in cli/octomate_cli/service.py
serve ¶
serve(
host: Annotated[
str | None,
Option(
help="Address to bind. Defaults to octomate.host (127.0.0.1)."
),
] = None,
port: Annotated[
int | None,
Option(
help="Port to bind. Defaults to octomate.port (8000)."
),
] = None,
reload: Annotated[
bool,
Option(
help="Restart when files under octomate/ change."
),
] = False,
tmux: Annotated[
bool,
Option(
help="Serve inside a detached tmux session and attach to it."
),
] = False,
session: Annotated[
str, Option(help="tmux session name.")
] = "octomate",
) -> None
Run the server directly in the foreground for Docker or development.
Use service start to have macOS launchd start and manage the installed GUI
service. Use --tmux to create or attach to a persistent terminal session.
Source code in cli/octomate_cli/service.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | |
octomate_cli.init ¶
Interactive service setup: installation, network, agents, channels and preparation.
init ¶
init(
prepare: Annotated[
bool,
Option(
"--prepare",
help="Prepare files only; do not initialize data or start services.",
),
] = False,
root: Annotated[
Path | None,
Option(
help="Service installation directory; prompts when omitted."
),
] = None,
source: Annotated[
Path | None,
Option(
exists=True,
file_okay=False,
help="Copy a local Git working tree, including uncommitted files, for development.",
),
] = None,
port: Annotated[
int | None,
Option(
min=1,
max=65535,
help="Loopback port for the service.",
),
] = None,
agent: Annotated[
list[str] | None,
Option(
"--agent",
help="Agent template: claude, codex or deepseek (DSH; experimental). Repeat for multiple agents.",
),
] = None,
channel: Annotated[
list[str] | None,
Option(
"--channel",
help="Channel template: slack, lark, discord, trunkline or none. Repeat for multiple channels; fill credentials in config later.",
),
] = None,
target: Annotated[
DeploymentTarget | None,
Option(
help="Deployment target; defaults to launchd on macOS and systemd on Linux."
),
] = None,
yes: Annotated[
bool,
Option(
"--yes",
help="Confirm preparation with explicit root, port, agent and channel choices; skip optional MCP setup.",
),
] = False,
) -> None
Prepare a macOS, Linux or Docker installation through the same wizard.
Currently requires --prepare. Creates a private installation and a reviewable service definition inside it. Database initialization, account creation, service activation and live agent verification remain explicit operator steps.
Source code in cli/octomate_cli/init.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 | |
installation_step ¶
Source code in cli/octomate_cli/init.py
validate_existing ¶
Source code in cli/octomate_cli/init.py
select_source ¶
Source code in cli/octomate_cli/init.py
network_step ¶
Source code in cli/octomate_cli/init.py
build_environment ¶
build_environment(
root: Path,
home: str,
username: str,
target: DeploymentTarget,
) -> dict[str, str]
Source code in cli/octomate_cli/init.py
review_step ¶
review_step(
service: Installation,
source: Path | None,
revision: str,
port: int,
agent: list[str],
channels: list[str],
mcps: list[McpPreset],
yes: bool,
) -> None
Source code in cli/octomate_cli/init.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
prepare_step ¶
prepare_step(
service: Installation,
source: Path | None,
revision: str,
git: str,
installer: str,
port: int,
agent: list[str],
channels: list[str],
mcps: list[McpPreset],
) -> None
Source code in cli/octomate_cli/init.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | |
copy_working_tree ¶
Snapshot Git-visible working files without sharing ignored local config or data.
Source code in cli/octomate_cli/init.py
octomate_cli.users ¶
The octomate user commands: create an account from an invitation, reset a
password.
user_typer
module-attribute
¶
password_error ¶
Source code in cli/octomate_cli/users.py
create ¶
create(
username: Annotated[
str, Option(help="Username for the new account.")
],
password: Annotated[
str, Option(help="Password for the new account.")
],
invitationcode: Annotated[
str,
Option(
help="An unused registration invitation code."
),
],
name: Annotated[
str | None,
Option(
help="Display name; defaults to the username."
),
] = None,
) -> None
Register a user with an invitation using the server's config and database.
Source code in cli/octomate_cli/users.py
reset_password ¶
reset_password(
username: Annotated[
str,
Option(help="Username of the existing account."),
],
password: Annotated[
str,
Option(
help="New password; prompts securely when omitted.",
prompt=True,
hide_input=True,
confirmation_prompt=True,
),
],
) -> None
Reset an account's password using local administrator access to the database.
Source code in cli/octomate_cli/users.py
octomate_cli.mcp ¶
Generate local MCP tentacle configuration from provider presets.
mcp_typer
module-attribute
¶
McpPreset
pydantic-model
¶
Bases: BaseModel
A provider preset rendered into an MCP tentacle's configuration.
Config:
str_strip_whitespace:Trueextra:forbid
Fields:
Source code in cli/octomate_cli/mcp.py
model_config
class-attribute
instance-attribute
¶
configuration ¶
Source code in cli/octomate_cli/mcp.py
preset ¶
preset(
provider: Annotated[
Literal["github"], Argument(help="Provider preset.")
],
client_id: Annotated[
str | None,
Option(
help="OAuth application client ID; enable Device Flow in the app."
),
] = None,
name: Annotated[
str | None, Option(help="Tentacle ID.")
] = None,
output: Annotated[
Path | None,
Option(
help="Destination YAML; defaults to tentacles.yaml in the config home."
),
] = None,
read_only: Annotated[
bool,
Option(
help="Use GitHub's read-only MCP endpoint. OAuth scopes still permit repository writes."
),
] = False,
) -> None
Save an MCP tentacle preset with endpoints and scopes filled in.