@investorlift/cli
v0.2.0
Published
The official command-line tool for the Investorlift God Mode API: every endpoint as one command, with JSON, table, CSV and NDJSON output.
Maintainers
Readme
@investorlift/cli
The official command-line tool for the Investorlift God Mode API. The API answers one question from county deed records: who nearby buys houses like this one. The tool runs every endpoint as one command, through the official TypeScript package, from your terminal. The documentation is at developers.investorlift.com/guides/cli. This tool is in beta. Its version starts at 0.
Run it
npx @investorlift/[email protected] --helpOr install it once. It needs Node 20 or later.
npm install -g @investorlift/cli
investorlift --helpGive it the key
Create a key in the developer console. A key starts with zpka_.
export GM_API_KEY="zpka_..."For a key that stays on this machine, run investorlift auth login. The tool asks for the key with echo off and writes
it to a file only you can read. The tool has no --api-key flag, so a key never lands in your shell history.
| Variable | Default | Meaning |
|---|---|---|
| GM_API_KEY | none | The key. It wins over the key file. |
| GM_BASE_URL | https://api.investorlift.com | The host. --base-url wins over it. |
| XDG_CONFIG_HOME | ~/.config | The key file is $XDG_CONFIG_HOME/investorlift/credentials.json. The tool honours an absolute path only. |
investorlift auth login stores the host in the key file when you pass --base-url or export GM_BASE_URL. A later
call without --base-url and without GM_BASE_URL uses the stored host. investorlift auth status prints
the key source and the host in use.
A key file the tool cannot parse is a usage error, exit code 1, that names the file. The tool refuses a host without
http:// or https://. That error names the source: --base-url, GM_BASE_URL or the key file. On Windows the file
has no 0600 mode. Your user profile alone protects it there.
Make one call
investorlift deals summary --lat 33.476917 --lng -111.920385 --radius-miles 2On a terminal the answer is a table. In a pipe it is the JSON the API sent. --format json, table, csv or
ndjson overrides that. After every call the tool prints the request id, the credits charged and the data end on
stderr, so stdout is the answer alone.
Find the command
The command is the endpoint's SDK name as two words: deals.summary is deals summary, wholesaleListings.list is
wholesale-listings list. A flag is a query parameter with dashes: radius_miles is --radius-miles. An id in the
path is the first argument. investorlift <group> <command> --help lists the flags with the text of the endpoint page.
investorlift investors get inv_0a20a550f33b --market phx
investorlift deals list --zip 85251 --kind flip,wholesale --all --max-pages 5 --format csv > deals.csv
investorlift properties search --body '{"location":{"zip":["85251"]},"limit":25}'
investorlift deals summary --lat 33.476917 --lng -111.920385 --radius-miles 2 --dry-run--all follows page.next_cursor. A command that spends credits requires --max-pages. When a later page fails, the
tool first prints the pages it has, in the requested format. Then it prints the error and exits with the error's code.
Stderr states how many pages it printed and names the resume cursor as --cursor <c>.
--etag works on a command that answers one record. On a paged command the tool refuses it, exit code 1.
investorlift dataset get --etag <etag> is the freshness probe. --dry-run prints the curl command and sends nothing.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success, or 304 Not Modified for --etag. |
| 1 | A usage error of the tool: a bad flag, a missing --max-pages, --etag on a paged command, a key file the tool cannot parse. |
| 2 | The API refused the request. |
| 3 | No key, or the key is refused. |
| 4 | Over a limit: the rate, the quota, the plan, a missing subscription or an overdue payment. |
| 5 | Outside coverage, or a dataset not measured for the market. |
| 6 | The service failed. |
| 7 | No answer: a network failure, a timeout or an abort. |
Shell completion
investorlift completion bash > ~/.local/share/bash-completion/completions/investorlift
investorlift completion zsh > "${fpath[1]}/_investorlift"
investorlift completion fish > ~/.config/fish/completions/investorlift.fishSupport
Quote the request id from the facts line to [email protected]. The tool sends a User-Agent of three parts:
the tool version, the package version and the Node version. It sends nothing else about your machine.
Licence
MIT.
