setup
setup
¶
Global bootstrap: terok setup installs host services.
Thin wrapper over terok_executor.ensure_sandbox_ready — the
executor-level composer that generates vault routes from the agent
roster and then runs the sandbox aggregator (shield hooks + reader +
vault + gate + clearance hub/verdict/notifier with a full
stop → uninstall → install → verify cycle per service). On top,
terok adds its own desktop-entry install for terok-tui. Safe
to re-run; every phase is idempotent.
Base images are not built by default: each project declares its
own image.base_image in project.yml (ubuntu, fedora,
nvidia/cuda, …), so at setup time there's nothing sensible to
pre-build. L0/L1 build happens lazily on first terok task run
keyed by the project's declared base, or explicitly via
terok project init. The --with-images=<BASE> flag is the
expert escape hatch for operators who know a fleet-wide base
image and want to pay the build cost once up front.
Per-project operations live under the project group in
project.py; cmd_project_init stays here because
project.py (and its tests) import it.
DOWNGRADE_HINT = 'upgrade back, or run `terok setup --allow-downgrade`'
module-attribute
¶
How an operator gets past a refused downgrade; the escape hatch is theirs to pull.
register(subparsers)
¶
Register the setup top-level command.
Source code in src/terok/cli/commands/setup.py
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 | |
dispatch(args)
¶
Handle setup. Returns True if handled.
Source code in src/terok/cli/commands/setup.py
cmd_setup(*, no_desktop_entry=False, install_desktop_entry=False, with_images=None, family=None, passphrase_tier=None)
¶
Install the sandbox stack + desktop entry; optionally pre-build one L0/L1 pair.
Exits non-zero if the sandbox aggregator fails (one or more service phases unreachable) or if a requested image build fails. The desktop entry can be skipped when optional xdg-utils is missing; a failed installation never receives a successful setup receipt.
Desktop-entry policy resolution: --no-desktop-entry /
--install-desktop-entry (mutually exclusive) override the
config key tui.desktop_entry (auto / skip / install,
default auto) for a single run.
When with_images is None (the default) the L0/L1 build is
skipped entirely — image-build decisions are per-project and
happen on first terok task run / terok project init. Pass
a base image (e.g. "ubuntu:24.04") to eagerly build once up
front for a known fleet. family overrides package-family
detection for that build.
Source code in src/terok/cli/commands/setup.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 | |
cmd_project_init(project_name)
¶
Full project setup: ssh-init, generate, build, gate-sync.
The final gate-sync step is skipped when gate.enabled is false in
project.yml — the container fetches directly from upstream (or runs
with an empty workspace) instead of through a host-side mirror. This
is the escape hatch for hosts that cannot reach the remote (firewall
blocking SSH, corporate proxy, offline laptop) while the container's
network path still works.
Source code in src/terok/cli/commands/setup.py
prompt_ssh_key_comment(project, *, comment=None, force=False)
¶
Offer an editable default only when an interactive init will create a key.