-c, --config: configuration file path--session: explicit session identifier--owner: owner label override (default:OKDEV_OWNERor localUSER)-n, --namespace: namespace override--context: kubeconfig context override. When omitted,spec.kubeContextis used if set; otherwise kubeconfig current-context is used.--output text|json: output format (list,status)--verbose: debug loggingNO_COLOR=1orTERM=dumb: disable ANSI color/styling in interactive terminal output
Commands that resolve a session distinguish failure classes so scripts and agents can react without launching a diagnostic chain on every blip:
0: success.- non-zero from a remote command (e.g.
okdev exec -- false→1,exit 7→7): the remote process's own status, always preserved. 74: the cluster was reachable but the session has no pods — it is genuinely gone.78: a transient cluster-contact failure (API timeout, connection refused/reset, server overload). okdev already retries once with backoff before surfacing this; on78the caller should retry rather than treat the session as dead.1: any other error (configuration, permissions/RBAC, a failed job result, etc.).
okdev versionokdev init [--workload pod|job|pytorchjob|generic] [--dev-image <image>] [--template <name>|<path>|<url>] [--set key=value] [--stignore-preset default|python|node|go|rust] [--force]okdev template list [--all]okdev template show <name>okdev validateokdev up [--wait-timeout 10m] [--dry-run]okdev down [session] [--delete-pvc] [--dry-run] [--wait] [--wait-timeout 2m] [--output json]okdev restart [session] [--yes] [--wait-timeout 10m]okdev status [session] [--all] [--all-users] [--details]okdev list [--all-namespaces] [--all-users]okdev use <session>okdev target showokdev target set [--pod <name> | --role <role>]okdev agent listokdev exec [session] [--shell /bin/bash] [--no-tty] [--pod <name> | --role <role> | --label <k=v>] [--exclude <pod>] [--container <name>] [--detach] [--timeout <duration>] [--log-dir <path>] [--no-prefix] [--json] [--require-all] [--gateway <pod>] [--fanout N] [-- command...]okdev jobs list [session] [--job-id <id>] [--container <name>] [--fanout N]okdev jobs logs <job-id> [session] [-f|--follow] [--pod <name> | --role <role> | --label <k=v>] [--exclude <pod>] [--container <name>] [--fanout N]okdev jobs stop <job-id> [session] [--container <name>] [--fanout N]okdev jobs wait <job-id> [session] [--container <name>] [--fanout N]okdev exec-jobs [session] [--job-id <id>] [--container <name>] [--fanout N]okdev cp [session] <src> <dst> [--all | --pod <name> | --role <role> | --label <k=v>] [--exclude <pod>] [--container <name>] [--fanout N]okdev logs [session] [--container <name> | --all] [--tail N] [--since 5m] [--follow] [--previous]okdev ssh [session] [--setup-key] [--user root] [--cmd "..."] [--no-tmux] [--forward-agent|--no-forward-agent]okdev portsokdev port-forward [session] <local:remote>... [--address <addr>[,<addr>...]] [--pod <name> | --role <role>] [--ready-only]okdev sync [--mode up|down|bi] [--foreground] [--reset] [--dry-run]okdev prune [--ttl-hours 72] [--all-namespaces] [--all-users] [--include-pvc] [--dry-run]okdev migrate [--template <name>] [--set key=value] [--dry-run] [--yes]okdev upgrade
- Shows session status for the current or selected session.
- When
sessionis provided,okdevcan resolve the saved config from session metadata even outside the repo. --details: prints a single-session diagnostic view with target selection, pod list, pod IP and node placement, mount persistence, sync path semantics, managed SSH state, key local paths, and target pod details.- Abnormally terminated containers are surfaced per pod, e.g.
container pytorch: OOMKilled (exit 137, finished 2026-07-05T06:32:11Z)— both the current state (container stayed down) and the last termination before a restart (suffixedbefore last restart). The podreasoncolumn also falls back to the termination reason when no waiting reason applies. - Detailed JSON output includes per-pod mount metadata, a
containerIssuesarray (container,reason,exitCode,finishedAt,current), and apathSemanticssection describing which configured sync paths are shared via the workspace sync and which are expected to survive a session restart. --detailsis only valid when exactly one session is selected.
- Prints the pinned interactive target for the current session and shows the session pod set.
- The selected row is marked with
*.
- Explicitly repins the interactive target used by
ssh,exec,ports, and sync. --podselects one concrete session pod.--roleselects the highest-priority eligible pod with the matchingokdev.io/workload-role.- When attachable pods are defined, repinning is restricted to those pods.
- Shows configured coding agents, whether their CLI binary is installed, and whether auth is staged in the current session container.
okdev upperforms best-effort install checks for configured agents, bootstraps a modern Node/npm runtime vianvmwhen supported, and then installs missing CLIs.okdev upalso stages local auth files for dedicated sessions when a configured local auth file exists.- Codex uses
~/.codex/auth.jsonby default, butspec.agents[].auth.localPathcan point at a different local auth file. okdev downremoves staged agent auth symlinks/runtime files when it can still reach the target container.okdevdoes not own agent process launch; users runcodex,claude,gemini,opencode, or similar CLIs manually after connecting.
- Opens a shell or runs a command in one or more session pods.
- Without
-- command..., opens an interactive shell on the pinned target pod. - With
-- command..., runs the command across all running pods by default, with output prefixed by short pod name on a TTY. When stdout is piped or redirected (scripts, CI, agents), the prefix is auto-suppressed so captured output is clean; pass--no-prefix=falseto force it back on. --allexplicitly targets all session pods. This matches the existing default fanout behavior when you pass a command with no selector.--workerstargets only worker-role pods.--podaccepts the full pod name, the short name shown byokdev status(e.g.master-0,worker-1), or any unique-<name>suffix — no need to carry the full hash name across pod recreations. Unknown or ambiguous names error out (listing the available names) instead of silently matching nothing.--excludeaccepts the same aliases (unknown exclusions are tolerated). The same aliases work forokdev cp --pod,okdev jobs ... --pod, andokdev target set --pod.--group <pod-a,pod-b>targets an explicit pod group. Repeat--groupto define multiple groups, and use either full pod names or the short names shown inokdev status. A pod may appear in at most one group.- Declared groups run one after another by default.
--sequentialruns selected pods one-by-one when no groups are declared (output and--log-dirlayout are unchanged), or makes the default group-after-group ordering explicit when groups are declared.--parallelruns declared groups in parallel.--fanoutcaps total concurrent pod executions across all groups.--script <file>uploads a local script file and runs it across the targeted pods. In v1 this is local-file-only;--script -is not supported.- With
--script, everything after--is passed to the script as positional arguments ($1,$2, … /"$@"):okdev exec --script ./bench.sh -- --steps 100 --warmup 10runsbench.shon each pod with$1=--steps $2=100 $3=--warmup $4=10. Arguments containing spaces are preserved. - The
-- command...path is non-interactive fanout execution, not a terminal session. TTY-dependent programs such aswatch,top,htop, or full-screen TUIs are not expected to work there; useokdev sshorokdev execwithout-- command...to open an interactive shell first. -- command...preserves raw argv to the remote process. If you choosebash -lc '...', that remote shell layer is still yours.--scriptavoids the quoting/stitching problem for non-trivial shell pipelines by uploading the file and running it remotely instead of embedding the body in a one-liner.--pod: target specific pods by name (repeatable or comma-separated).--role: target pods byokdev.io/workload-rolelabel (case-insensitive).--label: target pods by arbitrary labelkey=value(repeatable, AND logic).--exclude: exclude specific pods from the selected set (repeatable or comma-separated). Cannot be used with--pod.--groupis mutually exclusive with--all,--workers,--pod,--role,--label, and--exclude.--paralleland--sequentialare mutually exclusive.--container: override which container to exec into (default: session target container). Works in both modes.--scriptexecutes the uploaded file directly when it has a shebang; otherwise it falls back tosh <file> ....--shellcannot be combined with--script.--detach: launches the command in the background and returns immediately. Prints per-pod launch details including job id, pid, log path, and metadata path. The command runs in its own process group (viasetsid) sookdev jobs stopcan terminate the entire process tree, not just the leader.- When
--log-diris used with multiple declared groups, logs are written into per-group subdirectories under the requested path.--log-dirhas no effect with--detach(detached jobs log inside the pod). - Detached exec preserves argv to the remote process; it is not flattened back into a single shell string. Detached
--scriptuploads a per-pod temp file, launches it, and removes that temp file after completion. - Detached jobs store combined stdout/stderr and JSON metadata under
/var/okdev/exec/on the shared okdev-runtime volume, so logs and metadata survive a target-container crash (e.g. OOMKill) and remain readable through the sidecar. If that directory cannot be created or written by the container user (e.g. a user-supplied root-owned volume with a non-root container), the launcher falls back to the legacy/tmp/okdev-exec/with a notice on stderr — same lifetime semantics as before. For large outputs (training logs, profiles, dumps), prefer--log-diron the caller or redirect inside your command to a session volume; the runtime volume is a node-local emptyDir and heavy writers can fill it. - The
pidreturned from--detachis the pid of your command itself (okdev re-parents the launcher so$!is your program's pid afterexecve).kill <pid>orokdev exec --pod <pod> -- kill <pid>therefore targets your command, not a wrapper shell. - When using
--detach, pass the command you want okdev to launch directly. Do not add an extranohup ... &inside the command string. --timeout: per-pod command timeout (e.g.,30s,5m). Pods exceeding the timeout are cancelled and reported as failed.--log-dir: write per-pod output to<dir>/<short-name>.log. Streaming to stdout still happens.--no-prefix: suppress the pod name prefix in output. Auto-enabled when stdout is not a terminal (pipe/redirect/CI); pass--no-prefix=falseto keep the prefix in that case.--fanout N: maximum concurrent pod executions (default 16).--pod,--role, and--labelare mutually exclusive.--json: capture each pod's result into a JSON envelope instead of streaming. Output is always a JSON array with one envelope per pod in selection order — a single resolved pod still emits a length-1 array, so callers never branch on object-vs-array by pod count. Each envelope is{"pod": "<name>", "exit": N, "stdout": "...", "stderr": "...", "status": "..."}, with an"error"field added when the command could not be run or completed (in which caseexitis-1).statusmakes per-pod delivery explicit:responded(the command ran and reported an exit code — even a non-zero one),unreachable(the pod could not be reached; the command did not run),timeout,error(outcome unknown), ormissing(no result came back for the pod). Use it to tell "responded with empty output" apart from "never responded".--require-all(requires--json): exit non-zero after emitting the JSON document unless every targeted pod's status isresponded, listing the missing pods. A responded pod with a non-zero exit code does not fail--require-all— its exit code is data.- With
spec.exec.fanoutMode: auto|gatewayand interpod SSH enabled, multi-pod--jsonruns route through an in-cluster gateway pod: one apiserver exec, fanout over the pod network (seespec.execin the config manifest).--gateway <pod>picks the gateway explicitly (and enables the gateway path even below the auto threshold). If the gateway driver is unavailable (older sidecar image), okdev prints a notice on stderr and falls back to direct per-pod exec. - The remote command's own exit code is reported as data in
exit, so a non-zero remote exit (e.g.pgrepreturning 1 for no match) does not makeokdevexit non-zero.okdevexits 0 whenever the JSON document is produced; inspect each envelope'sexit/errorto react. Pre-flight failures (session not found, cluster unreachable) still use stderr and the dedicated exit codes (74/78) rather than JSON. --jsonrequires a command (after--or via--script) and cannot be combined with--detach,--group,--parallel,--sequential, or--log-dir. The[<pod>]prefix is never applied in JSON mode.
- Lists detached
okdev exec --detachjobs across the session's running pods. - Reads job metadata from
/var/okdev/exec/*.jsonin the target container (plus the legacy/tmp/okdev-exec/location for jobs launched by older okdev versions). - If the target container is gone (e.g. OOMKilled), listing and
jobs logsautomatically retry through theokdev-sidecarcontainer, which mounts the same runtime volume. - When a command fails because the container is gone, the error carries the termination cause when it can be determined, e.g.
container "pytorch" terminated: OOMKilled (exit 137, finished 2026-07-05T06:32:11Z). The same hint is appended tookdev execFAILED lines and single-pod exec errors. - Text output is grouped by logical job id, with one row per detached launch showing job id, summarized state, pod count, earliest start time, and original command.
- On a terminal the COMMAND column is truncated (with
…) to the remaining terminal width so long training commands don't wrap rows; piped/redirected output and--jsonalways carry the full command. - JSON output includes both the logical job summary and the per-pod
podStatesrecords (withpgidandgroupLive— the count of live processes still in the job's process group — when available). - State values:
running(wrapper alive and user command in flight),exited(user command finished; exit code is recorded inpodStates/ JSON), andorphaned(metadata still saysrunningbut the pid has exited or been recycled - typically the wrapper wasSIGKILLed or the container was restarted before the completion metadata could be written). Grouped text summaries render forms such asrunning(1/2),exited(2/2), andfailed(1/2). - When any pod fails to list its jobs, the command still prints the jobs it was able to collect from the healthy pods and reports the failures in a
FAILED:footer (or anerrorsarray in--jsonoutput); exit status is non-zero so scripts can detect partial failures. - With
spec.exec.fanoutMode: auto|gatewayand interpod SSH enabled, the per-pod listing routes through the in-cluster fanout gateway (one apiserver exec instead of one per pod). The listing is read-only, so any gateway problem silently falls back to direct per-pod queries. --pod: target specific pods by name (repeatable or comma-separated).--role: target pods byokdev.io/workload-rolelabel (case-insensitive).--label: target pods by arbitrary labelkey=value(repeatable, AND logic).--exclude: exclude specific pods from the selected set (repeatable or comma-separated). Cannot be used with--pod.--container: override which container to inspect (default: session target container).--job-id: filter to a specific detached exec job id.--fanout N: maximum concurrent pod queries (default 16).--ready-only: inspect only pods that are already running.
- Streams the detached job's combined stdout/stderr aggregated across all pods in the logical job.
- Each line is prefixed by the pod short name so multi-pod output stays attributable.
--pod: stream logs from specific pods by name (repeatable or comma-separated).--role: stream logs from pods with the matching workload role.--label: stream logs from pods matching label selectors.--exclude: exclude specific pods from the selected set. Cannot be used with--pod.-f/--follow: keep following until every pod in the job reaches a terminal state.- If the job's container is gone (e.g. OOMKilled), logs are read through the
okdev-sidecarcontainer instead — job logs live on the shared runtime volume and survive the container. - If some pod logs are unavailable, okdev still streams the logs it can read and reports the missing pods in a
FAILED:footer before returning non-zero.
- Polls the detached job until all pod-local records are terminal.
- Returns success only when every pod exits cleanly.
- Returns non-zero when any pod exits non-zero, becomes
orphaned, cannot be queried, or the job id does not exist.
- Stops every still-running pod in the logical job by sending
SIGTERM, waiting 10 seconds, then sendingSIGKILLto survivors. - Signals the job's whole process group when available: detached jobs are launched via
setsid, so children the command forked (e.g.torchrunworkers) are signaled too — including stragglers whose leader already exited. Stop only reports success once no live group member remains, so a clean return means the process tree (and its GPU memory) is gone. - Group membership is verified via the job's
OKDEV_JOB_IDenvironment marker before signaling, so recycled pids/pgids are never signaled by mistake. Jobs launched by older okdev versions (or in containers withoutsetsid) fall back to leader-only signaling. - Prints which pods were signaled (
pgid=Nfor group signals,pid=Nfor the fallback) during the stop flow. - Returns non-zero when any pod could not be queried or signaled, or if processes are still alive after the stop attempt.
- Compatibility alias for
okdev jobs list [session]. - Uses the same grouped logical-job output and flags as
okdev jobs list.
- Copies files or directories between the local machine and session pods.
- Prefix the remote path with
:(e.g.,:/workspace/data). The other argument is a local path. - Single-pod mode (default): copies to/from the pinned target pod.
- Multi-pod upload (
--all,--pod,--role,--label): fans out the same local source to all matched pods in parallel. - Multi-pod download: downloads from each matched pod into
<dest>/<short-pod-name>/subdirectories. - Files are streamed via
catpipes. Directories are tar-streamed automatically. - Single-file downloads resume from an undersized
<dest>or a saved<dest>.okdev-partfrom a previous attempt. - If a previous attempt finished streaming but failed before the final rename, rerunning
okdev cppromotes the completed<dest>.okdev-partwithout redownloading. --verifyverifies single-file download SHA-256 after copy. It is not supported for uploads or directory downloads.- With
--verify, resumed downloads hash the existing local bytes once and continue hashing the streamed remainder, so success does not require a second full local reread. --verifycurrently requirespython3orpythonin the target container to emit the remote SHA-256 during the download stream.- Directory and multi-pod downloads do not yet support resume.
- On a TTY, an in-place progress line shows transferred bytes, transfer rate, and elapsed time (after a few seconds). For multi-pod copies the line aggregates across pods (e.g.
Copying to 8 pods · 3/8 done · 5 in flight · 1.2 GiB · 28.0 MiB/s · 00:42) and surfaces a noticeably slow pod inline. Progress is suppressed on non-TTY writers (pipes, redirects, CI), so machine-readable output is unaffected. --all: target all running pods in the session.--pod: target specific pods by name (repeatable or comma-separated).--role: target pods byokdev.io/workload-rolelabel (case-insensitive).--label: target pods by arbitrary labelkey=value(repeatable, AND logic).--exclude: exclude specific pods from the selected set (repeatable or comma-separated). Cannot be used with--pod.--container: override which container to copy to/from (default: session target container).--fanout N: maximum concurrent pod transfers (default 16).--verify: verify single-file download SHA-256 after copy.--all,--pod,--role, and--labelare mutually exclusive.
okdev init [--workload pod|job|pytorchjob|generic] [--template <name>|<path>|<url>] [--set key=value] [--stignore-preset default|python|node|go|rust] [--force]
- Writes a starter config manifest.
- Pod-only setups default to
.okdev.yaml. - When built-in workload scaffolding also writes files under
.okdev/, the config is written as.okdev/okdev.yaml. --workload: chooses the scaffold mode.podkeeps the current simple config shape;jobandpytorchjobadd aspec.workloadblock plus a starter manifest;genericrequires explicit inject information and can optionally use a preset such as--generic-preset deployment.--dev-image: sets the dev container image for pod workloads. Pod configs generated from the built-in template include apodTemplatewith the dev container image plus equal CPU/memory requests and limits for the dev container and sidecar, so the starter pod is eligible for KubernetesGuaranteedQoS.--template: accepts a project template from.okdev/templates/<name>.yaml.tmpl, a user template from~/.okdev/templates/<name>.yaml.tmpl, built-inbasic, a file path, or a URL. Runokdev template listto see available names.--set: sets a frontmatter-declared template variable. Repeat it for multiple variables, for example--set numWorkers=4 --set baseImage=pytorch:latest.- Templates can declare
string,int, andboolvariables in YAML frontmatter. Resolved values are available as.Vars.<name>during rendering and are persisted underspec.template.vars. - Templates can also declare companion
filesin frontmatter. Each file has a renderedpathand atemplatepath resolved relative to the selected template, which lets a PyTorch template render bothokdev.yamland a matchingpytorchjob.yaml. - For built-in templates, it also writes a starter local
.stignorefile for the initialized sync root. - For built-in
basic,jobandpytorchjobscaffold.okdev/job.yamlor.okdev/pytorchjob.yaml. When the config itself is.okdev/okdev.yaml, the generatedmanifestPathstays relative to that directory, for examplejob.yamlorpytorchjob.yaml. okdev resolves those paths from.okdev/first and falls back to the project root for compatibility with older layouts.generic --generic-preset deploymentscaffolds.okdev/deployment.yamlwhile still usingspec.workload.type=generic. --stignore-preset: override the starter.stignorepatterns with a project-oriented preset.- When
--stignore-presetis omitted,okdev inittries to detect a preset from common repo markers likego.mod,package.json,Cargo.toml, andpyproject.toml.
- Lists templates from project, user, and built-in sources in resolution order.
- Project templates in
.okdev/templates/shadow user templates, and user templates shadow built-ins. --allincludes shadowed lower-priority entries.
- Prints a template's resolved source, description, declared companion files, and declared variables.
- Description and variables come from optional YAML frontmatter at the top of the template.
- Without
--template, migrates older config schema fields to the current schema. - With
--template, re-renders the selected template, overlays existing config values so local edits win, writes the merged config, and regenerates any template-declared companion files. Unlike the config, companion files are fully overwritten from the re-rendered template; local edits to those files will be lost (the.bakbackup is your recovery path). - Existing
spec.template.varsseed template variables during migration;--setoverrides stored values. - Unless
--no-backupis set,okdev migrate --templatewrites.bakbackups for the config and any rewritten companion files before overwriting them. --dry-runprints the merged config and lists the companion files that would be rewritten, without writing.--yesskips confirmation when writing.
- Reconciles Pod/PVC resources, updates SSH config, initializes managed forwarding/sync, then exits.
- If the session workload already exists,
okdev upreuses it and only reruns setup. - Workload resources are named per run, for example
okdev-<session>-<run-id>;okdev down && okdev upcreates a fresh workload name for the same session. - If a Job or PyTorchJob created or recreated by this
okdev upreaches a failed pod state before readiness, okdev stops waiting, deletes that failed workload, and clears local session state. Reused existing workloads are not auto-deleted. - tmux-backed persistent interactive shells are enabled by default.
--tmux: explicitly enable tmux mode in the dev container.--no-tmux: disable tmux mode for this pod.- When
sync.engine=syncthing,okdev uprefreshes the session's local Syncthing processes, starts background sync in bidirectional mode by default, and waits for the initial sync to converge before exiting. spec.portsis materialized as SSHLocalForwardorRemoteForwardbased ondirection.
- Deletes the current session workload and cleans up local SSH/sync metadata.
- When
sessionis provided,okdevcan resolve the saved config from session metadata even outside the repo. - Prompts for confirmation by default; use
--yesin scripts or non-interactive environments. --dry-run: previews what would be deleted without removing cluster or local state.--wait: waits for the workload object to disappear and then for any remaining session pods to terminate before returning.--wait-timeout: caps the total time spent waiting for workload/pod termination when--waitis enabled.--output json: emits a machine-readable summary of the planned or completed deletion and local cleanup steps.--delete-pvcremains accepted for compatibility but is ignored;okdevno longer manages PVC lifecycle automatically.
- One-command recovery when a container died and the restart policy will not bring it back: deletes the session workload, waits for termination, resets local per-session sync state, and runs the full
upflow against the current config. - PVCs and other resources referenced by
spec.volumesare untouched; auto-provisioned sync volumes are recreated. - Lifecycle hooks (
postCreate/postSync) re-run automatically on the fresh pods — configure them for setup that must survive recreation (installed tools, editable installs). - Pod names change on recreation; use the short-name aliases (
master-0,worker-1) with--podso scripts survive restarts. - Prompts for confirmation;
--yesfor scripts.--wait-timeoutcaps both the deletion wait and pod readiness.
okdev ssh [session] [--setup-key] [--user root] [--cmd "..."] [--no-tmux] [--forward-agent|--no-forward-agent]
- Targets
okdev-sshdin the resolved interactive container. - The default interactive container name is
dev; override it withspec.workload.attach.containerwhen your workload uses a different main container name. - When
sessionis provided,okdevcan resolve the saved config from session metadata even outside the repo. - Maintains managed host alias in
~/.ssh/configasokdev-<session>. --no-tmux: bypass tmux for this SSH session when tmux mode is enabled.--forward-agent: forwards the localSSH_AUTH_SOCKinto the live SSH session so Git/SSH inside the workload can use your local agent.--no-forward-agent: disables forwarding for this SSH session even whenspec.ssh.forwardAgent: true.- Agent forwarding only applies to the live
okdev sshconnection; keys are not copied into the workload. - Requires a local SSH agent with identities already loaded, for example
eval "$(ssh-agent -s)"andssh-add ~/.ssh/id_ed25519.
- Streams logs from the resolved target pod for the current session.
- When
sessionis provided,okdevcan resolve the saved config from session metadata even outside the repo. - Defaults to the pinned target container when
--containeris omitted. - The default target container name is
devunlessspec.workload.attach.containerselects a different interactive container. --all: streams all regular containers in the target pod and prefixes each line with[container].--follow: follows logs by default; use--follow=falsefor a bounded dump.--tailand--sincemirror the usual Kubernetes log filters.--previous: reads the previous instance logs for the selected container(s).
- Advanced/recovery command. Rebuilds managed SSH
LocalForward/RemoteForwardstate fromspec.portsafter disconnects or local port changes. - No-op when managed forwards are already healthy and config is unchanged.
--dry-run: previews the SSH alias and port-forward actions without updating SSH config or starting/stopping managed forwards.
- Runs direct foreground Kubernetes port-forwarding to one selected session pod.
- Uses the current session target pod by default.
--address: local listen addresses (default:localhost). Accepts comma-separated values or repeated flags, for example--address localhost,0.0.0.0.--podselects one explicit pod by name.--roleselects one pod by workload role. Ambiguity is an error.--ready-only: restricts selection to already-running pods.- Only
LOCAL:REMOTEmappings are supported (kubectl-style:REMOTEor barePORTare rejected). - The command stays attached until interrupted.
- Advanced command. Starts detached background sync by default; use
--foregroundfor sync debugging, or explicit one-way sync (up/down). - By default each configured mapping syncs in its own
direction(spec.sync.paths[].direction, falling back tobi); an explicit--modeforces that mode onto every mapping for the invocation. See the config manifest for choosing persistent directions —downmakes the pod the authority so local writes can never clobber pod-generated results. - With multiple mappings, each becomes its own syncthing folder; the first (primary) mapping is the one shared to mesh receivers, and
sync reset-remoteclears only the primary remote. - A mapping's local root may nest inside the primary root: okdev maintains a managed block in the primary root's
.stignoreexcluding it from the primary folder (written before the sync daemon starts). Removing a mapping retains the entry as a tombstone so the subtree never silently joins the primary folder; sync start prints a notice andstatus --detailslists active/retained excludes. - Without an explicit
--mode, no-op when background sync is already active for the session. --background: explicitly request detached background mode.--reset: check local-to-hub sync and mesh receiver health, then reset only what is broken. Skips the local sync teardown when the primary sync is already healthy. For sessions with mesh receivers, probes each receiver and re-runs mesh setup only when broken or disconnected receivers are found.--reset --force/--reset -f: unconditionally reset without health checks.--reset --local: scope reset to local-to-hub sync only (skip mesh).--reset --mesh: scope reset to mesh receivers only (skip local sync).--reset --force --local/--reset --force --mesh: force reset a specific component.okdev initwrites the starter config and, for built-in templates, a starter local.stignorefile for the initialized sync root.
- Checks the latest GitHub release and upgrades the
okdevbinary in place. - Downloads the correct archive for the current OS/architecture, verifies the SHA256 checksum, and atomically replaces the running binary.
- No-op when already on the latest version.
- After
okdev upcompletes successfully, a non-blocking version check runs (cached for 24 hours) and prints a reminder to stderr if a newer version is available.