Skip to main content

afire

The command-line client for Afire. Run a command on any of your devices and get its output and exit code back, move files, and open a shell, from your own terminal or from a coding agent.

Install

pip install afire-ai
afire --help

Python 3.9 or newer. The only dependency is websocket-client.

The same program is also a single file: afire.py, downloadable from any device page. python3 afire.py run ... and afire run ... behave the same.

Make a token

  1. Open Settings → API tokens (/settings#tokens).
  2. Give the token a label and press generate. Copy it: it is shown once.
  3. Put it in your environment:
export AFIRE_TOKEN="paste-the-token-here"

The default scopes cover everything below. run, push, pull and screenshot need the control scope; ssh needs ssh; ls needs read.

Limit a token to some devices. Under scopes…, set devices to only these and tick the devices. That token can run commands, move files and open a terminal on those devices and no others, and it cannot start agent chats. Use one of these for scripts and coding agents.

AFIRE_URL points the client at a different server. Leave it unset to use the default.

The five commands most people use

Devices can be named by id or by name. Put names with spaces in quotes.

afire ls                                   # your devices and whether they are online
afire run "my laptop" "df -h"              # run one command, print its output
afire ssh "my laptop"                      # interactive shell
afire push "my laptop" ./build.zip /tmp/   # copy a file to a device
afire pull "my laptop" /var/log/app.log ./ # copy a file from a device

run prints the command's own stdout and stderr and exits with the command's own exit code. It runs in the device's afire workspace (~/afire) unless you pass --cwd. Use full paths for push and pull: an unquoted ~ is expanded by your own shell before afire sees it. On a Windows device the shell is cmd.exe; pass --shell powershell for PowerShell. Long scripts read from a file with --file script.sh (or --file - for stdin), so no local shell can change them on the way.

Exit code 75 means the command reached the device but the reply was lost. It may have run. Check its effect before running it again.

Run afire --help for everything else: cp between two devices, forward a port, screenshot, input (mouse and keyboard), audio and more.

Run commands on your device from any coding agent

Make a token limited to the device, set AFIRE_TOKEN in the environment the agent runs in, and add this to the agent's instructions file (CLAUDE.md, AGENTS.md, .cursorrules or similar):

## Running commands on my build box

Use the `afire` CLI to run commands on the device named "build-box".

    afire run build-box "cd ~/app && git pull && make test"

- Output is the command's own stdout and stderr; the exit code is the command's own.
- For anything with quotes, pipes or several lines, write it to a file and use
  `afire run build-box --file script.sh`.
- Copy files with `afire push build-box ./dist/app.tar.gz /srv/app/` and
  `afire pull build-box /srv/app/logs/test.log ./`.
- A request held open longer than about a minute can be dropped by the network.
  For long jobs, start them in the background on the device and check on them
  with a second `afire run`.
- Exit code 75: the command reached the device but the reply was lost. Check
  its effect before running it again.

The agent then runs afire run build-box "..." like any other shell command and reads the result.

Metadata

Release files for afire-ai 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for afire-ai 1.3.1
File Size Uploaded Provenance Actions
afire_ai-1.3.1.tar.gz 24.5 kB Without provenance Details for afire_ai-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for afire-ai 1.3.1
File Interpreter ABI Platform Actions
afire_ai-1.3.1-py3-none-any.whl Python 3 none any Details for afire_ai-1.3.1-py3-none-any.whl

Total release size: 48.7 kB

Release files / afire_ai-1.3.1.tar.gz

Download URL afire_ai-1.3.1.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3b2a2f8eb433acb76d4ce22b9417635762e3593a9a621bf5aa3ad0374058ad97
BLAKE2b-256 checksum
How to use checksums
edadca8757fb8a5bf332ed4497dbf9189187735f4a244543c11834f0eaeb4563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / afire_ai-1.3.1-py3-none-any.whl

Download URL afire_ai-1.3.1-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c86eb71f76e1b15064058903041e91f457f8c59f1411dabe1505cfbe03c20aa3
BLAKE2b-256 checksum
How to use checksums
df91619c12759e3a88551bda606dc87633ef32ae7c4b599c46432678b61eafb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for afire-ai 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page