frely-cli 0.19.1 → 0.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,23 +2,35 @@
2
2
 
3
3
  [English](README.md) · [简体中文](README.zh-CN.md)
4
4
 
5
- `frely-cli` turns the computer you choose into a secure remote device that AI agents can operate. Browser agents (ChatGPT, Codex) and command-line agents (Claude Code, pi) connect through Model Context Protocol (MCP) and access the files, commands and processes inside the workspace you authorize — from anywhere.
5
+ `frely-cli` turns a computer you choose into a device that AI agents can work on from anywhere. ChatGPT, Claude, Codex and other MCP clients connect through **FrelyMCP** and use the files, shell commands and processes in the folders you allow. The computer connects out to Frely, so you open no ports.
6
6
 
7
- Two optional features, each with its own setup and authorization:
7
+ It is also the command line for your Frely account:
8
8
 
9
- - **Remote Agent Skill** — install a published Frely Agent as a local trigger Skill and invoke it from automation.
10
- - **Local model sharing** — publish a local Ollama / OpenAI-compatible runtime as your personal Frely Provider.
9
+ - **Device MCP**: let remote AI clients work on this computer.
10
+ - **Local MCP servers**: pass MCP servers that only run on this computer (for example on `127.0.0.1`) through to remote clients.
11
+ - **Agents, Prompts and Skills**: install a published Frely Agent as a local Skill, or install Prompts and Skills you bought.
12
+ - **Local model sharing**: publish a local Ollama or OpenAI-compatible runtime as your own Frely Provider.
11
13
 
12
- This repository contains the open-source Frely client and local MCP runtime. The hosted Frely Relay control plane remains a separate service dependency. There is no separate `friday-local` project; local MCP execution belongs to `frely-cli`.
14
+ ## Install
13
15
 
14
- ```text
15
- Remote Agent Skill: install -> frely login -> frely agent install -> frely agent run
16
- Device MCP: install on target computer -> frely mcp start (signs in first) -> add MCP URL to client -> OAuth authorize
16
+ ### A server, with a Frely account (no browser)
17
+
18
+ Get a one-time install command and paste it on the server. It installs `frely`, signs in to your account, enables Device MCP and starts the background service. Nothing opens in a browser and nothing asks a question.
19
+
20
+ Get the command in either place:
21
+
22
+ - On the Frely website: **My Devices → Add a computer → Create install command**.
23
+ - In ChatGPT or Claude connected to FrelyMCP: ask it to add a computer. `list_devices` returns the command.
24
+
25
+ It looks like this:
26
+
27
+ ```sh
28
+ curl -fsSL https://frely.cloud/start.sh | FRELY_INSTALL_TOKEN=fit_... sh
17
29
  ```
18
30
 
19
- ## Install
31
+ The token works once and expires after 15 minutes. It is not saved on the computer. If the computer already has Frely installed or signed in, the command updates it and switches the sign-in to your account. On Linux, run `sudo loginctl enable-linger $USER` so the service stays online after you log out of SSH.
20
32
 
21
- Install and continue straight into Device MCP setup: `frely mcp start` signs in through the browser when needed (new accounts can register on the same page), asks for device approval and prints the MCP URL. The workspace defaults to the home directory (credential and start-up files stay protected); `FRELY_WORKSPACE` picks another.
33
+ ### A computer with a browser
22
34
 
23
35
  ```sh
24
36
  # macOS / Linux
@@ -30,109 +42,89 @@ curl -fsSL https://frely.cloud/start.sh | sh
30
42
  curl.exe -fsSLo "$env:TEMP\frely-start.ps1" https://frely.cloud/start.ps1; powershell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\frely-start.ps1"
31
43
  ```
32
44
 
33
- For a server without a browser, ask Claude (FrelyMCP `list_devices`) or the Frely console for a one-line install command. It carries `FRELY_INSTALL_TOKEN`, a one-time token valid for 15 minutes, and signs this computer in to your account, enables Device MCP and starts the background service with no browser and no prompts. The token is not stored; if the computer already has Frely installed or is signed in, the command updates it and replaces the sign-in with this account. On Linux the service needs a systemd user manager and lingering (`sudo loginctl enable-linger $USER`) to stay online after you log out.
45
+ The script installs the latest `frely`, then runs `frely mcp start`: it opens the browser to sign in (new accounts can register on the same page), asks you to approve this device and prints your MCP URL. Run it again any time to update; it restarts the background service on the new version.
34
46
 
35
- `install.sh` / `install.ps1` (same URLs) only install, for agents, scripts and Skills that need the CLI. The installers select the platform executable, verify its SHA-256 checksum and install into the user directory without Node.js, npm or a keyring.
47
+ The workspace is your home directory by default (credential and shell start-up files stay protected). Set `FRELY_WORKSPACE=/path` to share another folder, and `FRELY_INSTALL_DIR` to install somewhere other than `~/.local/bin`.
36
48
 
37
- Downloads try GitHub Releases first. When GitHub is unreachable, stalls (under 50 KB/s for 20 s) or fails verification, they fall back to the same build published as the npm package `@frelyhq/cli-<platform>`, downloaded from npmmirror (reachable from mainland China) and then npmjs. Each source is verified against its own `.sha256`. `FRELY_INSTALL_SOURCES` narrows or reorders the list (`github npmmirror npmjs`). `frely update` uses the same chain.
49
+ ### Install only
38
50
 
39
- Or with npm (Node.js 22 or newer required):
51
+ `install.sh` and `install.ps1` (same URLs, `https://frely.cloud/install.sh`) only install the program, for scripts, Skills and agents that need the CLI. Or use npm (Node.js 22 or newer):
40
52
 
41
53
  ```sh
42
54
  npm install --global --ignore-scripts frely-cli@latest
43
55
  ```
44
56
 
45
- To install a specific release, replace `latest` with the version. Tagged releases publish the npm package and standalone GitHub Release assets after cross-platform verification.
57
+ The installers pick the right executable for your platform, check its SHA-256 and install into your user directory without Node.js. They download from GitHub Releases first and fall back to npmmirror and npmjs (`@frelyhq/cli-<platform>`) when GitHub is slow or unreachable. `FRELY_INSTALL_SOURCES` changes the order.
46
58
 
47
- ### Install from a local checkout
59
+ ## Common commands
48
60
 
49
- To install the current source checkout with Bun:
61
+ | Command | What it does |
62
+ | --- | --- |
63
+ | `frely mcp start` | Sign in if needed, enable Device MCP, start the service and print the MCP URL. Safe to re-run. |
64
+ | `frely mcp status` | Show the MCP URL, workspace, authorization expiry and service state. |
65
+ | `frely mcp workspace add <path>` | Share another folder. `frely mcp workspace list` shows them all. |
66
+ | `frely mcp stop` / `frely mcp start` | Pause or resume the background service. |
67
+ | `frely mcp remove` | Revoke access for every client and uninstall the service. |
68
+ | `frely doctor` | Check sign-in, installation, service and connection. `-v` for details. |
69
+ | `frely update` | Update to the latest version in place. |
70
+ | `frely login` / `frely logout` | Sign in or out of your Frely account. |
71
+ | `frely uninstall` | Remove Frely from this computer (lists everything first). |
50
72
 
51
- ```sh
52
- cd /path/to/frely-cli
53
- bun install
54
- bun run build
55
- bun install --global "$PWD"
56
- ```
73
+ Run any command group without a subcommand (for example `frely mcp` or `frely agent`) to see what it offers.
57
74
 
58
- Use the absolute `$PWD` path in the global install command. If `frely` is not found, add the Bun global bin to your `PATH`:
59
-
60
- ```sh
61
- export PATH="$(bun pm bin -g):$PATH"
62
- ```
75
+ ## Use frely-cli with FrelyMCP
63
76
 
64
- This source revision has no keytar dependency or native npm build step. Dependency installation supports `npm ci --ignore-scripts` and `bun install --ignore-scripts`. The repository uses npm as the canonical package manager for CI and releases and commits `package-lock.json`; Bun is for local development — keep the lockfiles synchronized when changing dependencies.
77
+ FrelyMCP is one MCP address for your whole account: `https://mcp.frely.cloud/mcp`. Every computer where you ran `frely mcp start` appears behind it. `frely-cli` runs the tools on each computer; the AI client only needs the URL.
65
78
 
66
- ## First use
79
+ ### Connect a client
67
80
 
68
- Sign in once with the Frely account the consumer uses:
81
+ 1. On the computer to control, run `frely mcp start` (the install scripts above already do this). It prints the MCP URL.
82
+ 2. Add the URL to your client as a remote MCP server with OAuth:
83
+ - ChatGPT or Claude: add a custom connector with the URL.
84
+ - Claude Code on another computer: `claude mcp add --transport http frely "https://mcp.frely.cloud/mcp"`, then open `/mcp` to authorize.
85
+ 3. Sign in to Frely and approve the client.
69
86
 
70
- ```sh
71
- frely login
72
- ```
87
+ To check the connection, ask the client to list the top-level names in your workspace. A result that matches the folder means it works.
73
88
 
74
- The browser opens automatically. To choose another browser or Frely account, run `frely login --no-browser` and open the printed URL only in the browser signed in to the account you want to use. Visiting a device authorization URL while signed in can bind that code to the account before you click Approve — if the default browser already opened it with another account, press Ctrl+C, run `frely login --no-browser` again, and use the **new URL**. Signing in again or reusing the old URL does not switch its account. Keep `--relay <url>` when using a custom Relay. `FRELY_NO_BROWSER=1` remains supported.
89
+ ### What the AI can do
75
90
 
76
- ### Device MCP: control this computer from a remote client
91
+ - `list_devices` shows your computers, whether each is online and its workspaces. If you have none, it gives the install command above.
92
+ - Device tools take a `device` argument and run on that computer:
93
+ - `read`: list, read, search and find files in the workspace.
94
+ - `edit_file`: write whole files or edit lines, atomically.
95
+ - `process`: run shell commands, or start and manage long-running processes.
96
+ - `web_fetch`: read public web pages.
97
+ - `local_mcp_list` and `local_mcp_call` reach MCP servers on that computer that you turned on (see below).
98
+ - `local_models` (background service only) lists model servers on that computer (Ollama, LM Studio, vLLM, llama.cpp) and shares them as a Frely Provider; it uses one Provider slot. Shared models appear in `models_list` marked `local: true`.
99
+ - `frely_list` and `frely_call` manage your Frely account (API keys, credits, plans, orders). `frely api list|describe|call` is the same set from the terminal.
77
100
 
78
- On the computer to control, enable file, shell and process access:
79
-
80
- ```sh
81
- frely mcp url --workspace /path/to/project
82
- ```
83
-
84
- `frely login` requests a restricted account session through browser device authorization. The first `frely mcp url` initializes a separate secure MCP key, requests browser approval for this device and workspace (the home directory when `--workspace` is omitted), installs the user-level Device Relay service (macOS LaunchAgent, Linux systemd user unit, or Windows Task Scheduler), and prints the MCP URL. The default authorization is 90 days; `--days 1..365` selects a duration.
85
-
86
- `frely mcp url` is idempotent: once enabled it only prints the same URL, so run it again whenever you need the address. Prompts go to stderr, so stdout remains a single URL or, with `--json`, a JSON object. No URL is printed if approval or service installation fails. To expose more directories, use `frely mcp workspace add <path>`; `frely mcp workspace list` lists them. A command group run without a subcommand (for example `frely mcp workspace` or `frely agent`) prints the subcommands under it.
101
+ The AI client's own shell still runs where the client runs; ask it to use the Frely tools for work on your computer. All clients share each computer's workspaces and running processes.
87
102
 
88
103
  ### Local MCP servers on this computer
89
104
 
90
- Remote MCP clients can also reach MCP servers that only run on this computer, such as a browser-extension server listening on `127.0.0.1`. Servers listening only on loopback are found automatically (`frely mcp local list`); add others with `frely mcp local add <name> --url http://127.0.0.1:<port>/mcp` or `frely mcp local add <name> [--env KEY=VALUE] -- <command> [args...]` (stdio). Every server stays off for remote clients until you turn it on, one by one, on the Frely connections page. Enabled servers are then reachable through two device tools, `local_mcp_list` and `local_mcp_call`, and run outside the command sandbox with your user account. Only loopback addresses are ever contacted; headers and environment values stay on this computer.
91
-
92
- Add the exact printed URL to a remote MCP client with OAuth support, choose OAuth and complete authorization. Keep the computer online. Verify the first connection by asking the client to list the top-level names in your selected workspace, without writing files or running shell commands — a returned result that matches the folder confirms connectivity.
93
-
94
- For Claude Code on the calling computer:
105
+ Servers that listen only on loopback are found automatically (`frely mcp local list`). Add others with:
95
106
 
96
107
  ```sh
97
- claude mcp add --transport http frely "<MCP_URL>"
108
+ frely mcp local add <name> --url http://127.0.0.1:<port>/mcp
109
+ frely mcp local add <name> [--env KEY=VALUE] -- <command> [args...] # stdio
98
110
  ```
99
111
 
100
- Open `/mcp` in Claude Code to complete OAuth authorization. One URL serves every device on your account with an active MCP permission: `list_devices` shows your devices and their workspaces, and every other tool takes a `device` argument (device name or id). Ask the Agent to use Frely tools for remote work; its built-in shell still runs on the calling computer. Clients share each device's workspaces and managed processes.
101
-
102
- Authorization lifecycle: when the authorization has expired, `frely mcp url` asks for a new approval and rotates the MCP execution key; `frely mcp url --days 365` renews early. The MCP URL is the same for all your devices and does not change on renewal. Login refresh, OAuth refresh and restart do not extend authorization. `frely mcp stop|start` pauses or resumes the background service; `frely mcp remove` revokes access for every client and uninstalls the service (it keeps running provider-only when local Providers exist). Manage your devices in Frely → **Device MCP** (`/user/device-mcp`).
103
-
104
- ### Invoke a Frely-hosted Agent
105
-
106
- Use a published Agent with account or restricted API-key access. To install it as a local trigger Skill (a full manifest URL is also accepted in place of the id):
107
-
108
- ```sh
109
- frely agent install <distribution-id> \
110
- --host pi \
111
- --scope global \
112
- --json
113
- ```
112
+ Each server stays hidden from remote clients until you turn it on, one by one, on the Frely connections page. Enabled servers run outside the command sandbox with your user account. Only loopback addresses are contacted, and headers and environment values never leave the computer.
114
113
 
115
- A Creator can also provide an existing model-scoped, quota-limited API key for a sponsored/demo invocation. Pass it only on stdin so it never appears in argv or the generated Skill:
114
+ ### Authorization
116
115
 
117
- ```sh
118
- printf '%s' "$FRELY_AGENT_KEY" | \
119
- frely agent install <distribution-id> \
120
- --host chatgpt \
121
- --scope global \
122
- --api-key-stdin \
123
- --json
124
- ```
116
+ Device MCP access lasts 90 days by default; `frely mcp start --days 1..365` renews early. When it expires, `frely mcp start` asks for approval again. The URL never changes. Manage your computers on the Frely website under **My Devices**.
125
117
 
126
- The CLI verifies the key against the target model-scoped MCP `tools/list` endpoint, stores it in the secure credential store, and records only `authMode=api-key` in managed Skill metadata. Use short-lived, single-model keys with bounded quota for sharing; do not paste a Creator master key.
118
+ ## More features
127
119
 
128
- The generated Skill calls the published Agent through Frely's model-scoped MCP endpoint. Invoke the installed Agent from automation with the full task on stdin:
120
+ ### Invoke a Frely-hosted Agent
129
121
 
130
122
  ```sh
131
- printf '%s' 'Your complete task' | \
132
- frely agent run '<distribution-id>' --input-stdin --json
123
+ frely agent install <distribution-id> --host claude-code --scope global
124
+ printf '%s' 'Your complete task' | frely agent run <distribution-id> --input-stdin --json
133
125
  ```
134
126
 
135
- `frely agent status <distribution-id>` shows the installed Skill and, for API-key installs, the Key's budget. `frely agent remove <distribution-id>` removes the Skill and its saved key.
127
+ `--host` is one of `chatgpt`, `codex`, `claude-code`, `pi` or `generic`. A full manifest URL also works in place of the id. To use a Creator's sponsored API key instead of your account, pass it on stdin with `--api-key-stdin`; it is stored in the secure credential store, never in the Skill. Use short-lived, single-model keys with a bounded quota. `frely agent status <id>` shows the Skill and the key's budget; `frely agent remove <id>` removes both.
136
128
 
137
129
  ### Install marketplace Prompts and Skills
138
130
 
@@ -140,131 +132,79 @@ printf '%s' 'Your complete task' | \
140
132
  frely item install <item-id> --host claude-code
141
133
  ```
142
134
 
143
- `frely item install` downloads a Prompt or Skill through Frely Cloud (the first call opens a browser for Cloud authorization). A paid part is installed only when your account holds a pass; otherwise the command prints how to buy one. Skills go to the host's Skill folder, Prompts to `--dir` (default: current directory), and scripts are saved without execute permission. Frely never overwrites a folder it did not install or a file you edited.
135
+ The first call opens a browser for Frely Cloud authorization. A paid part is installed only if your account holds a pass; otherwise the command says how to buy one. Skills go to the host's Skill folder, Prompts to `--dir` (default: current directory), and scripts are saved without execute permission. Frely never overwrites a folder it did not install or a file you edited. After you review an installed item, `frely item trust <folder>` remembers it; a new version needs a new review.
144
136
 
145
- Cloud MCPs you buy are not installed on the device: enable them for a connection on the Frely web console (Agents page) and their tools appear inside FrelyMCP.
137
+ Cloud MCPs you buy are not installed on the computer: enable them for a connection on the Frely website and their tools appear in FrelyMCP.
146
138
 
147
- ## Local model sharing
148
-
149
- Publish a loopback OpenAI-compatible runtime as a Frely personal Provider. Ollama is the default driver:
139
+ ### Local model sharing
150
140
 
151
141
  ```sh
152
142
  frely provider share ollama
153
- ```
154
-
155
- Custom endpoint and model selection:
156
-
157
- ```sh
158
- frely provider share openai-compatible \
159
- --url http://127.0.0.1:8080/v1 \
160
- --models model-a,model-b \
161
- --slot <personal-provider-slot-id> \
162
- --name "Local GPU"
163
- ```
164
-
165
- Requirements: Frely login, one empty active personal Provider slot (or a Creator plan, see below), loopback HTTP, OpenAI-compatible `/v1` (default Ollama endpoint `http://127.0.0.1:11434/v1`). Model names cannot contain whitespace or `/`.
166
-
167
- The command creates a server-managed `openai-compatible` personal Provider, stores the local endpoint in owner-only CLI state, starts the Device Relay service, signs a Provider credential with the device Ed25519 key, configures CPA, and enables the declared models. Existing Frely Access Point and API-key flows consume the Provider.
168
-
169
- ### Use a local model as the base of your own Agent (Creator)
170
-
171
- With no empty personal Provider slot, or with `--creator`, `frely provider share` creates a Creator Provider instead, counted against your Creator plan (Creator 3, Creator Plus 100). Its enabled models appear in Frely when you create an Agent. You do not sell the Provider: buyers call your Agent, which runs on your model. Keep this device online while the Agent is used, and make sure the local runtime returns `usage` in its responses.
172
-
173
- Provider inspection:
174
-
175
- ```sh
143
+ frely provider share openai-compatible --url http://127.0.0.1:8080/v1 --models model-a,model-b --name "Local GPU"
176
144
  frely provider list
177
145
  ```
178
146
 
179
- If setup stops after the Provider was prepared, run `frely provider share` again: it resumes that Provider instead of creating a new one.
180
-
181
- ## Update and diagnostics
182
-
183
- ```sh
184
- frely doctor # signed-in account, installation path, distribution, latest stable, MCP/service state
185
- frely doctor -v # + config paths, runtime details, authorization expiry, last heartbeat, sanitized errors
186
- frely update # updates the running installation in place
187
- ```
147
+ This publishes a loopback OpenAI-compatible endpoint (Ollama by default at `http://127.0.0.1:11434/v1`) as a personal Frely Provider, using one empty personal Provider slot. With no empty slot, or with `--creator`, it creates a Creator Provider counted against your Creator plan, and its models can be the base of Agents you publish. Keep the computer online while it is used, and make sure the runtime returns `usage`. If setup stops halfway, run the same command again to resume.
188
148
 
189
- `frely update` never changes to a different installer, edits PATH or downgrades a newer installation. Standalone downloads are checksum-checked and tested before the installed executable is replaced. npm/Bun installations keep their original global directory. A matching, running Device Relay service is paused for maintenance, restarted and checked after installation; credentials, device identity, MCP URL, workspace and authorization expiry are preserved. On Windows, `update` prints a PowerShell command for the detected installation to run in a local terminal.
149
+ ## Local execution boundaries
190
150
 
191
- `frely doctor` is the single diagnostic entry point and never restarts the service. `Connected` means the matching account/device process has received a WebSocket heartbeat within 75 seconds and the MCP authorization and workspace match the running relay. Neither mode completes client OAuth authorization or executes a tool call through the client. `frely doctor --mcp` is the recommended way to check the protected credential and server state.
151
+ - **Files**: file tools stay inside the shared workspaces, reject symlink escapes, cap reads and writes at 1 MiB and write atomically. Credential stores and shell start-up files are protected even inside the home directory.
152
+ - **Commands**: `process` runs as your OS user inside an OS sandbox. Credential folders are unreadable, writes are limited to the workspace and the temp directory, and network goes through a proxy. If the computer cannot sandbox (Windows, or Linux without `bubblewrap`, `socat` and `ripgrep`), commands are refused rather than run unsandboxed. You can open more on the Frely connections page: credential folders to read, extra folders to write, or a time-limited run without the sandbox. `FRELY_SANDBOX=off` turns the sandbox off on the device.
153
+ - **Credentials**: the MCP URL contains no secret. Clients hold OAuth tokens; the CLI holds a separate MCP execution key, encrypted with a master key in macOS Keychain, Windows Credential Manager or Linux Secret Service. Headless machines can set `FRELY_CREDENTIAL_KEY` (32 bytes) with `FRELY_CREDENTIAL_STORE=encrypted-file`. When authorization expires, requests and queued work stop; finished writes are not undone.
192
154
 
193
- Full behavior: [the self-update contract](docs/self-update.md) and [service maintenance and legacy updates](docs/service-maintenance.md). If more than one `frely` is installed, check the path shown by `doctor` before updating.
155
+ Details: [credential and installation boundaries](docs/credential-storage.md).
194
156
 
195
- ## Uninstall
157
+ ## Update, diagnose and uninstall
196
158
 
197
159
  ```sh
198
- frely uninstall # lists everything first, removes it only after you type yes
199
- frely uninstall --yes # non-interactive confirmation for scripts
160
+ frely doctor # account, installation, latest version, MCP and service state
161
+ frely doctor -v # + config paths, authorization expiry, last heartbeat, sanitized errors
162
+ frely update # update in place, keeping your login, device, URL and workspace
163
+ frely uninstall # list everything, then remove it after you type yes (--yes for scripts)
200
164
  ```
201
165
 
202
- `frely uninstall` revokes this device's Device MCP authorization, removes the device from your account and revokes the Cloud and account login on the Frely side, then stops and uninstalls the background service, deletes the saved login, device identity, MCP and Provider settings, state and caches (including the OS credential vault entry), removes installed Agent Skills that Frely manages, and finally removes the `frely` program (standalone file, or the npm/Bun global package). Without a terminal and without `--yes` it only prints the list. If an account-side step fails, it asks (or, with `--yes`, continues) and reports what is left; the exit code is 1 whenever anything remains.
203
-
204
- It does not remove the Frely App (use `frely app uninstall`; the App's `app.json` is kept), Providers or Agents in your Frely account, the PATH lines `install.sh` added to shell profiles, edited Agent Skills, or marketplace items. Source checkouts, local links and unrecognised installations are reported and left alone. It refuses to run inside device MCP because it stops the service that runs the command; run it in a local terminal.
205
-
206
- ## Local execution boundaries
207
-
208
- The local MCP server exposes four tools: `read` (list, read, search and find workspace files), `edit_file` (atomic whole-file writes and line edits), `process` (shell commands, run to completion or started as persistent processes) and `web_fetch` (read-only GET/HEAD of public URLs). Deleting, moving and creating directories go through `process`. Older tool names (`read_file`, `write_file`, `run_command` and so on) are no longer listed but still answer.
209
-
210
- Filesystem tools are constrained to the selected workspace, reject symlink escapes, cap normal file reads/writes at 1 MiB, use no-follow reads, and use atomic replacement for writes. `process` commands execute with the current OS user's permissions inside an OS-level sandbox (credential folders unreadable, writes limited to the workspace and the temp directory, HTTP(S) and ssh/scp/sftp through a proxy). The sandbox fails closed: if this device cannot run it (Windows, or Linux without `bubblewrap`, `socat` and `ripgrep`), `process` commands are refused with an error explaining why, never run unsandboxed. The owner can open more from the Frely connections page: credential folders to read, build-cache or chosen directories to write, or a time-limited run without the sandbox for raw network connections (also the way to run commands on a device that cannot sandbox them). Setting `FRELY_SANDBOX=off` on the device turns the sandbox off entirely; `FRELY_SANDBOX_STRICT` is still accepted but no longer changes anything. The workspace itself only constrains the working directory.
211
-
212
- Read-only local operations may overlap; writes and shell operations use the local fair scheduler — this avoids device-wide `busy -> 429` behavior.
213
-
214
- ## Authentication and secrets
166
+ `frely update` keeps the original install method and never downgrades. It pauses the background service, replaces the program after checking it, and restarts the service. On Windows it prints a PowerShell command to run in a local terminal. See [self-update](docs/self-update.md) and [service maintenance](docs/service-maintenance.md).
215
167
 
216
- Basic account and Network sessions use private plaintext files. They cannot approve MCP authorization or invoke account-management operations outside their explicit scopes. The Provider key is separate from the MCP execution key.
168
+ `frely uninstall` revokes this computer's access on the Frely side, removes the service, saved login, device identity, settings, caches and the Agent Skills Frely installed, and finally removes the `frely` program. It keeps the Frely App, your Providers and Agents in your account, the PATH lines the installer added, Skills you edited and marketplace items. Run it in a local terminal, not through Device MCP.
217
169
 
218
- MCP secrets use AES-256-GCM files with a master key in macOS Keychain, Windows Credential Manager or Linux Secret Service. Headless deployments can inject a 32-byte key through `FRELY_CREDENTIAL_KEY` and select `FRELY_CREDENTIAL_STORE=encrypted-file`. MCP has no plaintext fallback; secure-store failure does not stop basic features.
219
-
220
- The stable MCP URL contains no credential. Remote clients hold OAuth credentials; the CLI holds the MCP execution private key. The Relay checks OAuth resource binding and the current MCP execution lease. Expiry blocks requests and queued work and cancels managed execution; it does not undo writes or create a sandbox around arbitrary shell programs.
221
-
222
- Storage, migration, service injection, release requirements and threat boundaries: [credential and installation boundaries](docs/credential-storage.md).
223
-
224
- ## Architecture
225
-
226
- - Product definition and generic client integration: [docs/device-mcp.md](docs/device-mcp.md)
227
- - Device Relay transport: subprotocol, connection grant, reconnection, fallback state machine: [docs/device-transport.md](docs/device-transport.md)
228
- - Relay OAuth 2.1 Authorization Code + PKCE, discovery and token endpoints: [docs/mcp-oauth-relay-contract.md](docs/mcp-oauth-relay-contract.md)
229
- - Business API commands and authorization: [docs/api.md](docs/api.md)
230
- - Frely Network commands (preview, not listed in `frely --help`): [docs/frely-network.md](docs/frely-network.md)
231
-
232
- The public MCP URL is the canonical resource returned by Relay, `https://mcp.frely.cloud/mcp` (one URL per account, shared by all your devices). Use `frely mcp url`; do not derive the URL from the control-plane hostname. The URL contains no bearer secret.
233
-
234
- ## Commands
170
+ ## All commands
235
171
 
236
172
  ```text
237
173
  frely login [--relay <https-url>] [--no-browser]
174
+ frely login --email <address> [--mcp] [--workspace <path>] then frely login --code <6-digit code>
238
175
  frely logout
176
+ frely uninstall [--yes] [--json]
239
177
  frely doctor [-v] [--json]
240
178
  frely update
241
- frely mcp url [--workspace <path>] [--days 1..365] [--json]
179
+ frely mcp start [--workspace <path>] [--days 1..365] [--no-browser] [--json]
180
+ frely mcp status [--json]
181
+ frely mcp stop|remove
242
182
  frely mcp workspace list [--json]
243
183
  frely mcp workspace add|remove <path>
244
184
  frely mcp local list [--json]
245
- frely mcp local add <name> (--url <address> | -- <command> [args...])
185
+ frely mcp local add <name> (--url <address> | [--env KEY=VALUE] -- <command> [args...])
246
186
  frely mcp local remove <name>
247
- frely mcp stop|start|remove
248
187
  frely agent install <distribution-id|manifest-url> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--api-key-stdin] [--json]
249
188
  frely agent run <distribution-id> (--input <text>|--input-stdin) [--json]
250
189
  frely agent status (<distribution-id>|--api-key-stdin [--relay <url>]) [--json]
251
190
  frely agent remove <distribution-id> [--json]
252
191
  frely item install <item-id> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]
192
+ frely item trust <folder> [--check]
253
193
  frely provider share [ollama|openai-compatible] [--url <loopback-v1-url>] [--models <a,b>] [--slot <slot-id> | --creator] [--name <name>]
254
194
  frely provider list [--json]
255
195
  frely api list|describe|call
256
196
  ```
257
197
 
258
- Not listed in `frely --help`, but in `frely help --agent --json`: `frely mcp stdio [--workspace <path>]` serves the tools over stdio for a local MCP client; `frely mcp serve` is the foreground Device Relay client the background service runs; `frely network` is the Network preview.
198
+ `frely help --agent --json` prints the full machine-readable contract, including commands not shown in `frely --help`: `frely mcp stdio` (serve the tools over stdio to a local client), `frely mcp serve` (the foreground process the service runs) and `frely network` (preview).
259
199
 
260
- `frely logout` removes the account session, revokes Cloud authorization and attempts to stop the background service.
200
+ ## Documentation
261
201
 
262
- ## Landing page
263
-
264
- The open-source CLI landing page lives in [`site/`](site/README.md), alongside the CLI under the same Apache-2.0 license and trademark policy. It is prepared for `cli.frely.cloud` and deploys independently as a static site. Website assets are excluded from the npm package.
202
+ - [Device MCP](docs/device-mcp.md)
203
+ - [Device Relay transport](docs/device-transport.md)
204
+ - [MCP OAuth contract](docs/mcp-oauth-relay-contract.md)
205
+ - [`frely api`](docs/api.md)
206
+ - [Frely Network (preview)](docs/frely-network.md)
265
207
 
266
208
  ## License and trademarks
267
209
 
268
- `frely-cli` is licensed under the Apache License 2.0; see [`LICENSE`](LICENSE). The Frely name, logos, and product names are not licensed as trademarks; see [`TRADEMARKS.md`](TRADEMARKS.md).
269
-
270
- See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidance and [`SECURITY.md`](SECURITY.md) for private vulnerability reporting.
210
+ `frely-cli` is licensed under the Apache License 2.0; see [`LICENSE`](LICENSE). The Frely name, logos and product names are not licensed as trademarks; see [`TRADEMARKS.md`](TRADEMARKS.md). See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development and [`SECURITY.md`](SECURITY.md) to report a vulnerability.