CLI
Install rtree, create a database, ingest data, and query it.
Quickstart with the CLI
The rtree CLI is the fastest way to use RawTree from a terminal.
1) Install
curl -fsSL https://rawtree.com/install.sh | bash2) Log in
rtree login
rtree statusIn an agent session or another shell without a terminal on stdin, rtree login
uses JSON automatically. It prints an approval link in a
device_approval_required event on stderr, then waits for you to open the link
and approve in a browser. Read that event while the command is running.
After approval, the CLI selects resources automatically when there is only one
choice. Otherwise, it returns JSON with needs and the available choices on
stdout, then exits with code 2. Rerun with the requested flags, or supply all
three if you already know them:
rtree login --org team-alpha --cluster production --database analyticsEach retry requires approval again. Credentials are saved only when login completes. See the CLI reference for the JSON responses.
3) Create and select a database
rtree database create analytics
rtree database use analytics4) Insert data
rtree insert --table events \
--data '[{"action":"click","user":"alice","value":42}]'You can also ingest files and public URLs:
rtree insert --table events --file ./events.jsonl
rtree insert --table events --url https://example.com/events.jsonl5) Query data
rtree query "SELECT action, count() AS total FROM events GROUP BY action ORDER BY total DESC LIMIT 10"