devicerent 0.1.0
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 +85 -0
- package/bin/devicerent.mjs +5 -0
- package/dist/devicerent.mjs +41264 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# devicerent
|
|
2
|
+
|
|
3
|
+
DeviceRent from your terminal. Rent a **real** Android phone by the minute,
|
|
4
|
+
install your APK, run Espresso or a Quick test, get a hosted Appium URL, or hand
|
|
5
|
+
the phone to DeviceyAI — everything the website does except show you the live
|
|
6
|
+
screen.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g devicerent # Node 22 or newer
|
|
10
|
+
devicerent login # approve in your browser, like `gh auth login`
|
|
11
|
+
devicerent devices # what is in the rack right now
|
|
12
|
+
devicerent rent "Pixel 7a" # billing starts now
|
|
13
|
+
devicerent install app-debug.apk --launch
|
|
14
|
+
devicerent test quick com.example.app --report quick-test.md
|
|
15
|
+
devicerent stop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Signing in
|
|
19
|
+
|
|
20
|
+
`devicerent login` opens `devicerent.net` in your browser and asks you to
|
|
21
|
+
approve the sign-in. Nothing is typed into the terminal: the page hands the
|
|
22
|
+
terminal a one-time sign-in token, encrypted so that only the waiting
|
|
23
|
+
`devicerent` process can open it. If your account has two-factor turned on, the
|
|
24
|
+
terminal asks for your authenticator code too.
|
|
25
|
+
|
|
26
|
+
Signing in on a machine without a browser (an SSH session, a VM):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
devicerent login --no-browser # open the printed link anywhere, paste the code back
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The session is stored in `~/.config/devicerent/` (`%APPDATA%\devicerent` on
|
|
33
|
+
Windows), readable only by you, and is only ever sent to the DeviceRent that
|
|
34
|
+
issued it. `devicerent logout` signs this terminal out and leaves your browser
|
|
35
|
+
sessions alone.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
| Group | Commands |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| Account | `whoami`, `wallet [--history]`, `history`, `credits [buy s\|m\|l]`, `topup <eur>`, `subscribe <plus\|pro\|slot> [--yearly]`, `billing`, `keys list\|create\|revoke` |
|
|
42
|
+
| Rentals | `devices [--available]`, `rent <device…>` (up to three), `status`, `stop [rental] \| --all` |
|
|
43
|
+
| Phone | `install <apk…> [--launch]`, `apps`, `launch <pkg>`, `uninstall <pkg>`, `shell [cmd]`, `logcat [-f] [--package] [--level]`, `screenshot [file]`, `push`, `pull`, `ui [--xml]` |
|
|
44
|
+
| Testing | `test espresso [--runner] [--class] [--junit out.xml]`, `test quick <apk\|pkg> [--report] [--fix-prompt]`, `appium [--check]`, `connect [--port]` |
|
|
45
|
+
| DeviceyAI | `ai "<task>" [--allow-actions] [--allow-shell] [--model]`, `ai --models` |
|
|
46
|
+
|
|
47
|
+
Every command takes `--json` for machine-readable output, and `-h` for help.
|
|
48
|
+
With more than one rental running, pick the phone with `--rental <id or name>`.
|
|
49
|
+
|
|
50
|
+
Payments always happen in the browser: `topup`, `subscribe`, `credits buy` and
|
|
51
|
+
`billing` print a Stripe link and open it.
|
|
52
|
+
|
|
53
|
+
## How you are billed
|
|
54
|
+
|
|
55
|
+
Exactly as on the website. A rental bills per minute from `rent` until `stop`,
|
|
56
|
+
at your plan's rate. A rental with no activity for 30 minutes is stopped for
|
|
57
|
+
you; installing, testing, shell input and DeviceyAI steps count as activity,
|
|
58
|
+
merely holding `logcat -f` or an idle `connect` tunnel open does not.
|
|
59
|
+
DeviceyAI spends AI credits, the same as in the panel.
|
|
60
|
+
|
|
61
|
+
## Exit codes
|
|
62
|
+
|
|
63
|
+
`0` success · `1` failure (a test failed, the app crashed, a request was
|
|
64
|
+
refused) · `2` usage error or not signed in · `3` the test run itself broke.
|
|
65
|
+
|
|
66
|
+
`test espresso` writes JUnit XML with `--junit`, so it drops into a CI report.
|
|
67
|
+
|
|
68
|
+
## Pointing at another DeviceRent
|
|
69
|
+
|
|
70
|
+
`--api-base <url>` (or `DEVICERENT_API_BASE`) targets another deployment, for
|
|
71
|
+
example a local `next start` on `http://localhost:3000`. Each deployment keeps
|
|
72
|
+
its own session.
|
|
73
|
+
|
|
74
|
+
## Security
|
|
75
|
+
|
|
76
|
+
- The terminal holds an ordinary DeviceRent session for your account — the same
|
|
77
|
+
identity and the same row-level security as your browser tab. It can do what
|
|
78
|
+
you can do on the site; admin pages stay browser-only.
|
|
79
|
+
- Phones are reached over the same serial-pinned, ten-minute bridge tokens the
|
|
80
|
+
session page uses. The Pi never sees your session.
|
|
81
|
+
- Approve a sign-in only if you just ran `devicerent login` yourself, and never
|
|
82
|
+
send the code from `--no-browser` to anyone.
|
|
83
|
+
|
|
84
|
+
Source: [`clients/devicerent-cli`](https://github.com/DeviceRent-net/devicerent.net/tree/main/clients/devicerent-cli).
|
|
85
|
+
Design notes: `docs/CLI.md` in the same repository.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The published entry point. Everything lives in the bundle `npm run build`
|
|
3
|
+
// writes to dist/ — the CLI imports the web app's own device and DeviceyAI
|
|
4
|
+
// modules from src/lib, so it cannot run from source without the bundler.
|
|
5
|
+
import "../dist/devicerent.mjs";
|