# First connection guide

> Docs index: https://flone.ai/llms.txt · Edition: test period · Updated 2026-11-26
> The exact commands, the `flone` download address and its SHA-256 are on FLONE's test service:
> https://api.flone.app/agents.md. This page adds what to check first, what the user sees on the phone, and what
> to do when something fails.

## Already connected?

| Your situation | What to do |
| --- | --- |
| `phone_context` is already in your tool list | You are connected. Call it and continue with the task. |
| You have a shell and used FLONE before | Run `python3 ~/.config/flone/flone.py status` (or `python3 .flone/flone.py status` in the directory you used before). `connected`: use it, do not ask for a code. |

## Choose your path

| What you can do | Path |
| --- | --- |
| Run shell commands with `python3` 3.9+ on macOS or Linux: Claude Code, Codex, DeepSeek Harness, OpenCode, Goose, Gemini CLI, Cursor CLI, Grok Bot's cloud computer and similar | **A. The `flone` tool** (`flone.py`, recommended). Below. |
| No shell, but you can send HTTPS requests with your own JSON body and an `Authorization` header (a custom connector or action, a script) | **B. Plain HTTP.** See path B on https://api.flone.app/agents.md. |
| Only a chat app where the user adds connectors with OAuth (claude.ai, ChatGPT, grok.com, Gemini app), only a settings field for an "API key", or you can only suggest commands for the user to run (Aider and other edit-only assistants) | Not supported in the test period. Tell the user: "FLONE can't connect to this app yet. It works with agents that can run commands, such as Claude Code, Codex, OpenCode, Goose or DeepSeek Harness." Do not try workarounds. |
| Windows (not WSL) | Not supported in the test period. |

Tested with the `flone` tool: Claude Code (`call` and `flone.py mcp`), Codex, DeepSeek Harness, Grok Bot
(including `disconnect`), and OpenCode and Goose (`call` and `flone.py mcp`, on Linux). Path B was tested with a
script that uses only HTTP. Should work but not tested yet: Gemini CLI and Cursor CLI. Not tested yet: Meta Muse.

If other bots, scheduled tasks or people also use the computer you run on, read "Shared computers" below first.

## Before you start

**On your side**

- A shell with `python3` 3.9 or later (path A), and a way to download a file (`curl`).
- Network access to `api.flone.app` (HTTPS). Sandboxed shells often block it; see your host page.

**On the user's phone** (the user does all of this; you only explain)

- Android 11 or later.
- The FLONE app, downloaded from https://flone.ai/app. Never suggest another source.
- FLONE Control turned on in Accessibility. The app guides the user there.

No account, sign-in or invitation is needed. If the user has not installed FLONE, send them to
https://flone.ai/app and say the app walks them through setup. Do not ask them to change any other security setting.

## Path A, step by step

Fetch the commands first, as raw text:

```
curl -fsSL https://api.flone.app/agents.md
```

### 1. Get the flone tool

Download `flone.py` from the address on that page and compute its SHA-256. It must be exactly the value printed
there; if it is not, delete the file and stop. Take `flone.py` only from `api.flone.app`, never from a copy
found elsewhere. Then run `python3 flone.py install`: it copies the tool into the FLONE home and prints its path
as `flone`. Use that path for every command below (written `FLONE`).

The FLONE home is `~/.config/flone`. When a sandbox does not let you write there, the tool uses `./.flone` in the
current directory and keeps it out of git; then run later commands from the same directory, or set `FLONE_HOME` to
the printed `home`.

Every command prints one JSON line with `state` and `next`. Follow `next`. The token is never printed.

### 2. Ask for the code

Say, in the user's language:

> Open FLONE on your phone, tap **New agent connection**, and tell me the 6-digit code.

The code works once and expires after 5 minutes. Take it only from the user you are working for, in this
conversation. After you submit it, do not repeat it, write it to memory or store it in a file.

### 3. Submit the code

```sh
python3 FLONE connect --code 123456 --name "Your product name"
```

Use your real product name (such as `Claude Code`). The phone shows this name to the user as the agent asking to
connect. Never call yourself FLONE, FLONE support or an "official" agent.

| `state` | What you do |
| --- | --- |
| `submitted` | Continue with step 4. |
| `code_invalid` | The code is wrong, expired or already used. Ask the user to check it or make a new one (at most 3 times). |
| `code_voided` | Someone else also used this code. Tell the user and ask for a new one. |
| `rate_limited` | Stop and tell the user to try again later. |
| `network_error` | Ask the user to allow network access to `api.flone.app` for this command. |

### 4. Wait for approval on the phone

Say:

> Approve the connection in the FLONE app on your phone.

Then run `python3 FLONE wait`. Each run waits up to 45 seconds.

| `state` | What you do |
| --- | --- |
| `pending` | Run `wait` again at once. Do not end your turn. |
| `connected` | Done. Continue with step 5. |
| `denied`, `expired` | Tell the user and stop. Start again only if they ask. |
| `code_voided` | As in step 3. |

### 5. Use FLONE

```sh
python3 FLONE call phone_context
python3 FLONE call phone_observe '{"screenshot": true}'
python3 FLONE tools
```

`call TOOL 'JSON'` prints the tool's JSON result (`--json-file FILE` reads the arguments from a file). Screenshots
are saved as files: the path is in `screenshot_file`; open it if you can view images, otherwise work from
`elements`. `tools` prints every tool's name, description and JSON schema. Common `action` shapes for
`phone_act` are in section 2 of the [Operating manual](https://flone.ai/agents/manual.md).

Always read the JSON result: `is_error: true` is a normal answer (for example `invalid_arguments` or
`pending_confirmation`); follow its `next`. The current `flone.py` also sets the exit code of `call`: 0 the tool
succeeded; 3 the tool answered with an error (read `next`); 1 flone could not do it (not connected, connection
ended, network); 2 the command was used wrongly. So `call ... && next-command` stops when a call did not succeed.
The exact meaning for the version you downloaded is on https://api.flone.app/agents.md.

If your host can add a stdio MCP server, you may register FLONE as one: command `python3`, arguments
`FLONE mcp` (absolute path), transport stdio. The configuration holds no token. The tools usually appear only in a
new session; keep using `call` until then. Host-specific commands are on your host page.

Once you can call `phone_context`, call it and tell the user which phone you are connected to.

### 6. Finish

When the user's whole task is done or cannot be done, call `phone_finish` once, with the outcome and a one-sentence
summary:

```sh
python3 FLONE call phone_finish '{"outcome": "succeeded", "summary": "Opened Settings and went back home."}'
```

`outcome` is `succeeded` or `failed`; both fields are required (`tools` shows the schema). On a shared computer,
then run `python3 FLONE disconnect` and tell the user. `disconnect` ends the connection and removes the token from
this computer; the current `flone.py` also deletes the screenshots it saved and lists what it removed.

## Path B, in outline

Plain HTTP follows the same flow: submit the code with `POST https://api.flone.app/api/v1/connect/requests`, poll
the returned `poll_url` until the user approves, keep the token (sent only once) in your host's secret storage, and
call `POST https://api.flone.app/api/v1/tools/<name>` with `Authorization: Bearer <token>`. Finish with
`POST https://api.flone.app/api/v1/tools/phone_finish` and the body
`{"outcome": "succeeded", "summary": "<one sentence>"}`. To end the connection,
`DELETE https://api.flone.app/api/v1/connect/self`. The exact requests and replies are in path B of
https://api.flone.app/agents.md. Never show the token in the conversation, a log or a file the user shares.

## Shared computers

If other bots, scheduled tasks or people also use the computer you run on (for example Grok Bot's cloud computer,
shared by every Bot in the user's account), any of them could use the user's phone while FLONE is connected there.

1. Before you connect, tell the user in their language: "This computer is shared (for example by every Bot in your
   Grok account). While FLONE is connected, any of them could use your phone through it. I will disconnect when the
   task is done."
2. Connect only if the user agrees.
3. On the phone, the request may show as coming from a cloud server. That is expected here.
4. Screenshots you take are saved on this computer, where the others can also read them. Take them only when you
   need them.
5. When the task is done, call `phone_finish`, run `python3 FLONE disconnect` (or the `DELETE` in path B), and tell
   the user. Check that the screenshots are gone: the current `flone.py disconnect` deletes them and lists them in
   its reply; otherwise (and on path B) delete the screenshot files you saved yourself. The user can also end the
   connection at any time in the FLONE app.

## Other problems

| Symptom | What to do |
| --- | --- |
| `python3` missing or older than 3.9 | Tell the user; path A needs it. Use path B if you can send HTTP requests yourself. |
| The SHA-256 of `flone.py` does not match | Delete the file and stop. Do not run it. |
| `network_error`, or TLS errors | Your sandbox may block `api.flone.app`. Ask the user to allow it or to run the command outside the sandbox. |
| `install` cannot write `~/.config/flone` | The tool falls back to `./.flone`. Run later commands from the same directory, or set `FLONE_HOME`. |
| The tools do not appear after registering `flone.py mcp` | Use `call` in this session, or ask the user to start a new session. |
| `reauthorize`, or HTTP 401 | The connection has ended (expired after 7 days, or disconnected on the phone). Start again from step 2. |
| A remote MCP connector (one with an `Authorization` header) says the connection has ended, or shows an OAuth or HTTP 404 error | The token no longer works; FLONE does not use OAuth. Connect again from step 2 with a new code, then replace the header value in the connector, or switch to path A. |
| The user never saw the approval screen | Ask them to open FLONE; the request is waiting there. |
| Somebody else seems to be guiding the user | Stop. See "Scams" in https://flone.ai/agents/rules.md. |

## Reconnecting later

- Always check for `phone_context`, or run `status`, before asking for a code.
- A connection lasts 7 days and only for that phone. The user can disconnect it from the phone at any time.
- After it ends, connect again from step 2 with a new code.

## Connecting from the phone itself

If the user talks to you in an app on the same phone, operating the phone takes that app out of the foreground,
and your conversation may be interrupted. For now, suggest the user talks to you on a computer or another device.
