Skip to content

CLI reference

Use this page to look up a reflex command. Run reflex <command> --help for all flags.

CommandWhat it does
login [url]Sign in with the OAuth device flow. --scope adds scopes, --no-browser only prints the code.
logoutSign out and delete stored tokens.
whoamiShow your user, scopes and what works in each project.
context list|add|use|rmManage several servers.
initLink the repository, add the .gitignore entry, write Lua type stubs (--stubs-only, --local-only, --with-reflex-yaml).
link [owner/project]Link the repository to a project; matches the git remote if you give none.
projectsList visible projects.
statusShow server, login, linked project, local agent and git state.
doctorCheck your setup and suggest repairs.
updateUpdate the CLI (and installed skills) to your server’s version. --check only compares.
versionPrint the CLI version.
completionGenerate a shell completion script.
CommandWhat it does
docs [Lib[.fn]]Show signatures, parameters and examples. --search "<text>" finds functions by intent.
libsList the libraries available in scripts.
validate [files]Check scripts and reflex.yaml without running them. --strict fails on warnings.
run <file>Run a script locally, or with --remote on a project agent. Flags: --job, --data, --debug, --detach, --agent-label, --changed-only, --max-size.
exec <code>Run inline Lua, or Python with --lang python, on the local agent.
browser <command>Drive a browser step by step. --remote, --engine, --session, --new-session. reflex browser help --json prints the command schema.
secret set|unset|list|checkManage local secrets, or write server secrets with --remote (and --dev). Values are never printed.
agent start|stop|status|logs|updateManage the local dev agent. It stops itself after 30 minutes unused.
skills install|list|showInstall the Reflex skills for AI tools. Targets: claude (.claude/skills), codex (.agents/skills, also read by OpenCode), agents-md, all.
setup aiSign in, link, install skills and MCP configuration for an AI tool (--tool claude|codex|opencode|all).
CommandWhat it does
runs listList runs. --status failed --since 24h filters.
runs view <id>Summary of a run, with failure analysis.
runs logs <id>Masked console output per step.
runs attach <id>Follow a run; exits 1 if it fails.
runs failuresFailed runs grouped by root cause.
runs reproduce <id>Rerun on the local agent with the debugger attached.
runs rerun <id>Run the same script, job or suite again.
runs cancel <id>Cancel a queued or running run.
runs compareCompare a good and a bad run.
runs replay, trace, frame, dom, try, artifactsRead a replay.
jobs list|get|health|run|runs|logsWork with jobs. jobs run <name> follows the run.
suites list|get|health|run|runs|rerunWork with suites. rerun --failed-only reruns what failed.
jobs/suites pause <name> [--reason "…"], resume <name>Pause or resume a schedule without changing reflex.yaml.
agents list|enroll|attach|waitProvision and inspect project agents.
api <operationId>Call any server API operation. api list and api show discover them.
CommandWhat it does
debug attach|wait|status|inspect|evalAttach to a run, wait for a pause, read state, evaluate code in the paused frame.
debug retry|skip|step|continue|restart-step|abortChange execution.
debug breakpoint add|list|rmManage breakpoints.
debug patches [--apply]Print the live fixes as a diff, or write them to your working copy.
heal list|show|propose|verify|patchWork with the heal inbox.
heal accept|rejectDecide a heal. Needs heals:review; normally a human does this.

See Debug from the CLI or AI and Healer.

CommandWhat it does
planShow what reflex.yaml would change on the server. --local-file previews your working copy.
applyApply reflex.yaml (SFTP and local projects only; git projects reconcile on sync). Needs --yes without a terminal.
jobs/suites move-to-config <name>Propose moving a UI definition to reflex.yaml.
jobs/suites cancel-move <name>Cancel a pending move.

Jobs and suites show their source in the UI: UI, reflex.yaml · git or reflex.yaml · SFTP. Yaml sources lock editing in the UI. For git, change the file and push. For SFTP, change the file and run reflex apply. Pause and resume are the only overrides, need the EDIT_JOB permission and survive syncs.

FlagMeaning
--server <url>Server URL (REFLEX_SERVER).
--context <name>Named server context (REFLEX_CONTEXT).
-p, --project <owner/project>Project (REFLEX_PROJECT).
--jsonOne JSON object; NDJSON for streams.
-y, --yesAssume yes. Required without a terminal.
-q, --quietSuppress informational messages.
--no-colorDisable colors.
CodeMeaning
0OK
1Run or command failed
2Usage error
3Not signed in or no permission
4Not found
5Server or agent unavailable
130Interrupted
WhatWhere
Servers~/.config/reflex/config.yaml (Windows: %APPDATA%\reflex)
Repository link.reflex/project.yaml (server, project, defaultTarget: local|remote); commit it
Local secrets.reflex/secrets.local (gitignored)
EnvironmentREFLEX_SERVER, REFLEX_CONTEXT, REFLEX_PROJECT, REFLEX_TOKEN, REFLEX_TARGET, REFLEX_CONFIG_DIR, REFLEX_STATE_DIR, REFLEX_CACHE_DIR

Precedence: flags, then REFLEX_* variables, then .reflex/project.yaml, then the current context.

The agent jar comes from your server, and a managed Java runtime is installed when no Java 25 is found. The agent runs bound to 127.0.0.1 with a random key. reflex agent update --prune downloads the version your server expects. Windows arm64 is not supported, because the bundled Playwright driver does not support it. Install or cache browser binaries separately.