Metadata-Version: 2.1
Name: runinfra-cli
Version: 0.2.2
Summary: Sign in from your terminal and pull the optimized model packages your workspace owns
Author: RightNow AI
Project-URL: Homepage, https://runinfra.ai/catalog
Project-URL: Support, https://runinfra.ai/contact
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Software Distribution
Requires-Python: >=3.8
Keywords: runinfra,cli,model,download,resumable,inference
Description-Content-Type: text/markdown

# runinfra-cli

Sign in from your terminal and pull the optimized model packages your workspace
owns.

```console
$ pip install runinfra-cli
$ runinfra login
$ runinfra pull <slug> --out ./models
```

Replace `<slug>` with the slug shown on your package's page under **Optimized
models** on runinfra.ai.

**No Node.js required.** This distribution carries a self contained program, so
`pip install` is the only step. That is the point of publishing here: the hosts
these packages get pulled onto usually have Python and often do not have Node.

---

## Which package do I want?

There are two, they do different jobs, and installing the wrong one is the most
common mistake we see.

| Install | What it gives you | Use it when |
| --- | --- | --- |
| `pip install runinfra-cli` | The `runinfra` command | You want to sign in and download the packages your workspace bought |
| `pip install runinfra` | The Python SDK, `import runinfra` | You want to call an optimized endpoint from your code |

They are separate products on separate release cycles and they do not conflict.
Installing both in the same environment is fine and supported.

---

## Commands

| Command | What it does |
| --- | --- |
| `runinfra login [--device]` | Connects this terminal by having you approve it in a browser |
| `runinfra pull <slug> [--out DIR] [--concurrency N]` | Downloads a package this workspace owns, resumable |
| `runinfra logout` | Deletes the local credential and tells you where to revoke the key |
| `runinfra whoami` | Shows what this machine has stored, and when its access expires |

Run `runinfra --help` for the full grammar.

### Signing in on a machine with no browser

That is the normal case on a GPU host, and it is handled:

```console
$ runinfra login --device
```

The terminal prints a short code that you type into the approval page on
whatever device does have a browser. The code never arrives inside a link. A
link that shows up with the code already in it did not come from us.

### Downloads resume

Kits are large. If a transfer stops, for any reason including Ctrl-C, run the
same `runinfra pull` command again and it continues from where it stopped
rather than starting over.

---

## Exit codes

These are a contract, not an implementation detail. Scripts branch on them, so
they do not change without a major version.

| Code | Meaning |
| --- | --- |
| 0 | Success |
| 2 | Bad usage, or this machine cannot run the command |
| 3 | Not signed in, denied, or expired |
| 4 | The workspace does not own it |
| 5 | Network or server failure |
| 6 | Integrity failure, such as a checksum mismatch |
| 7 | No disk space, or the destination is not writable |
| 130 | Interrupted |

The split matters in automation. A 5 is worth retrying. A 4 never will be.

Installing through pip does not change any of this. The `runinfra` command
installed here hands control straight to the program and returns its exit code
untouched, including 130 from Ctrl-C.

---

## Supported platforms

| Operating system | Processor |
| --- | --- |
| Linux (glibc 2.17 and newer) | x86-64, arm64 |
| Linux (musl, such as Alpine) | x86-64, arm64 |
| macOS 11 and newer | Apple silicon, Intel |
| Windows 10 and newer | x86-64 |

Python 3.8 or newer. There is nothing to compile and no build step, so the
install is a download and an unpack.

If `pip install runinfra-cli` reports that no matching distribution was found,
your platform is not published yet. Tell us which one you need at
<https://runinfra.ai/contact>.

If the `runinfra` command is not found after a successful install, your
environment's scripts directory is not on PATH. `python -m runinfra_cli` does
the same thing and always works.

---

## What the CLI never does

- **It never sees your password.** Sign in happens in your browser, in your
  existing session. The CLI only ever holds an authorization code and, after
  the exchange, the key that code bought.
- **It never asks you to paste an API key.** Approving in the browser mints
  one, the CLI writes it to a file only you can read, and revoking it in
  Settings kills it.
- **It never prints the key.** `whoami` and `logout` show a redacted form.
- **The key it holds cannot spend money.** It opens exactly one door,
  downloading a package your workspace already owns.

Credentials are stored in `$XDG_CONFIG_HOME/runinfra/credentials.json` on Linux
and macOS, and under `%LOCALAPPDATA%\runinfra\` on Windows. Set
`RUNINFRA_CONFIG_DIR` to put them somewhere else.

You can revoke this machine's access at any time from **Settings, API keys** on
runinfra.ai.

---

## Licence and support

Licensed for use with the RunInfra service. The full text ships in the package
and is reproduced on the product pages. The packages this CLI downloads are
covered by their own licences, stated on each package's page and included in
each kit.

Questions, or a platform you need: <https://runinfra.ai/contact>
