The LakeQL CLI (@lakeql/cli) orchestrates schema introspection from Trino and generates TypeScript code — interfaces, query schemas, and configs — that power type-safe GraphQL query endpoints in your project.
Install globally #
npm install -g @lakeql/cliRun without installing #
Use npx or pnpm dlx to invoke the CLI without a global install:
npx lakeql-cliRun within the monorepo #
If you're working inside the LakeQL monorepo:
1
2
pnpm -F cli cli
Environment variables #
The CLI connects to Trino for schema introspection. Set the following environment variables before running any command:
| Variable | Required | Description |
|---|---|---|
HIVE_HOST | Yes | Trino host URL including protocol |
HIVE_PORT | Yes | Trino port |
HIVE_USERNAME | Yes | Authentication username |
HIVE_PASSWORD | Yes | Authentication password |
HIVE_CATALOG | Yes | Default catalog name |
Create a .env file in your project root:
1
2
3
4
5
6
7
# .env.example
HIVE_HOST=https://trino.example.com
HIVE_PORT=443
HIVE_USERNAME=your-username
HIVE_PASSWORD=your-password
HIVE_CATALOG=hive
The CLI does not auto-load .env files.
Load variables into the process environment before invocation.
1
2
3
4
5
6
7
8
9
10
11
# Option 1: export in your shell
export HIVE_HOST=https://trino.example.com
export HIVE_PORT=443
export HIVE_USERNAME=your-username
export HIVE_PASSWORD=your-password
export HIVE_CATALOG=hive
lakeql-cli pull
# Option 2: use dotenv-cli
dotenv -e ./.env -- lakeql-cli pull