CLI Reference

The package exposes two equivalent commands:

co-auto-research
auto-research

These commands are available after installing the npm package:

npm install -g co-auto-research

To update:

npm install -g co-auto-research@latest

Source-checkout development commands are covered in the contributor guide.

Commands

Command

Purpose

init <dir>

Copy the template into a new empty project directory.

ls

List generated projects under the current folder and co-autoresearch-projects/.

attach [project]

Reopen the UI for an existing generated project.

ui

Start the local web UI.

ui --projects-dir <dir>

Start a dashboard over several generated projects.

install-cloudflared

Install the Cloudflare tunnel CLI into the user directory on Linux, without sudo.

install-graftcp

Install the Linux proxy helper used when --remote runs behind an HTTP proxy.

doctor

Check local prerequisites and port availability.

upgrade

Print installed version, detected project template version, and npm update command.

upgrade-project

Sync core reviewer and trial-protocol instructions in an existing project, with backup.

version

Print the installed CLI package version.

Start the UI

co-auto-research ui

Inside a generated project, this serves that project using the package-managed UI runtime. Outside a generated project, it creates or serves co-autoresearch-projects/ as a dashboard.

Project Dashboard

co-auto-research ui --projects-dir ./projects

The dashboard lists generated projects directly inside ./projects and can create new projects from the UI.

Return to Existing Work

co-auto-research ls
co-auto-research attach my-project

ls scans the current directory, immediate generated-project children, and a co-autoresearch-projects/ dashboard folder when present. It prints project names, statuses, and paths.

attach resolves a project by display name, directory name, path, or project ID prefix, then starts the same UI server that ui --project <path> would use. This is the normal command when you closed the browser or terminal yesterday and want to continue a previous project today.

If you keep projects somewhere else:

co-auto-research ls --projects-dir ./projects
co-auto-research attach my-project --projects-dir ./projects

Autoresearch Commands

The dashboard exposes these as buttons, and the composer also accepts the same slash commands:

Command

Meaning

/goal

Show the current autoresearch state.

/goal resume

Resume the loop from the latest active trial.

/goal pause

Let the current turn finish, then prevent the next trial from starting.

/goal restart

Confirm, archive the current trajectory, and start a new Trial 1.

/status

Show session and gate status.

/ps

Show running process state.

/diff

Show changed files.

/goal restart is not a lightweight reset. It archives existing trials, runtime state, working manuscript, generated workspace, and current findings under archive/restarts/. User-uploaded or user-confirmed resources remain available; autoresearch-discovered or generated resources become prior-run context until you explicitly reattach or confirm them.

The dashboard ships with Ivory and Nocturne themes. The setting is local to the browser and does not clear composer text, attachments, or context chips.

Update Project Instructions

The npm package updates the CLI and UI runtime. Existing project research files are not rewritten automatically, but core reviewer and trial-protocol instructions can be synced when doctor or the UI reports an outdated instruction baseline:

co-auto-research upgrade-project

For a dashboard folder:

co-auto-research upgrade-project --all --projects-dir co-autoresearch-projects

The command backs up previous core reviewer and protocol files under archive/template_migrations/ and preserves custom extra reviewer or instruction files outside the managed core set.

Port and Browser Options

co-auto-research ui --port 8780
co-auto-research ui --no-open
co-auto-research ui --open
co-auto-research attach my-project --port 8780

If the requested port is busy, the server tries the next available port and prints the actual URL.

Remote Mode

co-auto-research ui --remote
co-auto-research ui --remote --proxy http://10.21.11.21:8888

Remote mode is for SSH-accessible servers. It keeps browser launch disabled on the server, keeps the UI bound to 127.0.0.1, and prints a temporary Cloudflare browser link. Install the official cloudflared CLI on the remote server for this one-command browser access. If cloudflared is missing, the command prints a short Cloudflare CLI setup guide with install, run, and check commands. Keep the terminal open while using the link.

On Linux servers that require an HTTP proxy for internet access, CoAutoResearch detects COAUTO_REMOTE_PROXY, HTTPS_PROXY, or HTTP_PROXY and runs cloudflared through graftcp with --protocol http2. If the proxy helper is missing, the CLI prints co-auto-research install-graftcp before starting the UI server.

If Cloudflare is blocked on the server, set COAUTO_REMOTE_MODE=ssh to force SSH-only remote mode. In that fallback path, the command uses user@<ssh-host> unless COAUTO_REMOTE_TARGET is set, because server hostnames are often not valid SSH aliases from your laptop.

Environment Variables

Variable

Purpose

COAUTO_PYTHON

Python executable used to start the UI server.

COAUTO_AGENT_BACKEND

Force the runtime backend for UI-launched agent runs: codex or claude. Other values are ignored with a warning. Codex remains the default when unset.

COAUTO_CODEX

Explicit Codex executable path.

CODEX_BIN

Alternate Codex executable path.

COAUTO_CLAUDE

Explicit Claude Code executable path.

CLAUDE_BIN

Alternate Claude Code executable path.

OPENAI_API_KEY

Used by the Codex OpenAI API key provider when no saved Settings key is present. Not passed to Claude Code runs.

ANTHROPIC_API_KEY

Used by the Claude Anthropic API key provider when no saved Settings key is present. Not passed to Codex runs.

ANTHROPIC_AUTH_TOKEN / ANTHROPIC_BASE_URL

Used by Claude gateway providers such as Z.AI GLM or custom Anthropic-compatible gateways. Not passed to Codex runs.

COAUTO_NO_OPEN

Disable automatic browser launch.

COAUTO_CLOUDFLARED

Explicit cloudflared executable path for --remote.

COAUTO_CLOUDFLARED_DOWNLOAD_URL

Override the standalone cloudflared download URL used by install-cloudflared.

COAUTO_GRAFTCP

Explicit graftcp executable path for proxy-aware --remote.

COAUTO_GRAFTCP_DOWNLOAD_URL

Override the standalone graftcp archive URL used by install-graftcp.

COAUTO_REMOTE_PROXY

HTTP proxy used for proxy-aware --remote, for example http://10.21.11.21:8888.

COAUTO_REMOTE_PROXY_MODE

Set to off to disable automatic graftcp wrapping even when proxy variables are present.

COAUTO_REMOTE_MODE

Set to ssh to disable the default Cloudflare Quick Tunnel link and print SSH tunnel instructions instead.

COAUTO_REMOTE_TARGET

Override the SSH target printed by the SSH fallback path, for example yihong@login.example.edu.