Command line
Each function of Opfold is also a command for a terminal. Scripts, skills, and workflows use it.
Install the command
Open Settings, then General, then Command line, and select Install the opfold command. Opfold writes the command to ~/.local/bin/opfold. When your terminal does not find it, add this line to the start file of your shell:
export PATH="$HOME/.local/bin:$PATH"
On Windows, Opfold writes two files to %USERPROFILE%\.local\bin: opfold.cmd for PowerShell and cmd.exe, and opfold for Git Bash. When your terminal does not find the command, run this command in PowerShell. Then start your terminals and Opfold again:
[Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ";$env:USERPROFILE\.local\bin", 'User')
Use the command
Run a command in the folder of your vault, or name the vault with --vault.
opfold task list
opfold workflow runs
opfold usage summary
opfold note brief
opfold skill list
opfold skill diff skills/code-review/SKILL.md
opfold help lists each command.
Each command prints JSON: { "ok": true, "data": … }, or { "ok": false, "error": "…" } after a failure.
Paths for your skills
A skill must not guess where a project or a task is. The kit commands give the paths.
opfold kit resolve project "Website Relaunch"
opfold kit resolve task task-012
opfold kit doctor
kit doctor reports an open task that does not use the split layout as an error. An archived task can keep an older layout, because no command writes to it.
Steps of a task outside of Opfold
Inside Opfold, the workflow runner and the chat record each step of a skill. An agent outside of Opfold, for example Claude Code in a terminal, uses these commands:
opfold kit context --skill code-review --task "02 Projects/Website Relaunch/tasks/task-012 - New pricing page/task-012 - New pricing page.md"
opfold task step start --skill code-review --task "<task root>"
opfold task step end --skill code-review --task "<task root>" --result success --reason "No blocking finding."
kit contextwrites the step context of the skill as Markdown, or as JSON with--json.task step startwrites the start values of the contractopfold.yamland an open entry intotimeline.json.task step endends the open entry. The result issuccess,blocked, orfailed.successwrites the success values.blockedandfailedwrite the values from before the step again. A second end changes nothing.
opfold task timeline <task root> lists the steps of a task. opfold skill flow lists the status values of each skill with a contract.
API keys of the agents
The id of an agent is the program of its CLI, for example claude. An agent command of a workflow file, for example qwen, can also get a key.
pbpaste | opfold agent key set claude # the key comes from the input, never from an argument
opfold agent key set qwen --var DASHSCOPE_API_KEY < key.txt
opfold agent key mode claude api-key # or: login
opfold agent key status # the mode, the variable, and the last four characters
opfold agent key remove claude
A workflow run that starts in a terminal or in the schedule daemon reads the key from the keychain too.
The local HTTP API
Turn on the Local HTTP API in the settings to control Opfold from another program on the same computer. Each request needs the token of the settings page.
| Request | Result |
|---|---|
GET /v1/tasks |
The tasks |
GET /v1/runs |
The runs |
GET /v1/inbox |
The things that need you |
POST /v1/runs |
Starts a workflow |
POST /v1/gates/resolve |
Decides a gate |
POST /v1/notes |
Stores a note in the inbox folder |
POST /v1/events |
Shows a notice, and can start a workflow |
The API listens only on this computer. A program with the token can start a workflow, so give the token only to a program that you trust.