@lotics/cli
v0.31.0
Published
Lotics SDK and CLI for AI agents
Downloads
2,740
Readme
@lotics/cli
CLI and SDK for AI agents to interact with Lotics.
Lotics is an AI-powered operations platform. Through this CLI you can:
- Manage tables, records, and views (structured data with typed fields)
- Generate documents from templates (Excel, Word, PDF, Email)
- Build and run automations — schedules, webhooks, table lifecycle workflows, button actions, app-action workflows; inspect execution and version history
- Administer the workspace — invite members, manage groups, share resources, transfer ownership, browse connected accounts (OAuth attach is web-only)
- Create and manage apps, knowledge docs, and files
Install
npm install -g @lotics/cliUpdate
npm install -g @lotics/cli@latestThe CLI checks for updates once per day and prompts when a new version is available.
Authentication
lotics auth signup — Creates a new Lotics account, organization, workspace, and API key in one step. Sends a magic link email so you can access the web app.
lotics auth signup # interactive prompts
lotics auth signup [email protected] --name "Agent" # non-interactivelotics auth web — Send a magic link email to access the web app (requires prior signup or setup).
lotics auth weblotics auth api-key — Saves an existing API key directly (e.g. one created in the Lotics web app).
lotics auth api-key # interactive prompt
lotics auth api-key ltk_... # non-interactiveAPI key is saved to the config file. Run lotics auth logout to remove saved credentials.
Auth priority: --api-key flag > LOTICS_API_KEY env > config file.
Config file location
The CLI resolves .lotics/config.json by walking up from the current working directory — the first ancestor that has one wins, otherwise the global ~/.lotics/config.json. A per-directory config lets a project or worktree pin its own account and workspace; commands run from a subdirectory still resolve to it.
Create one by passing --local to lotics auth:
cd my-worktree
lotics auth api-key ltk_... --local # writes ./.lotics/config.json
lotics workspace select wks_... # auto-resolves to the local config.lotics/ should be gitignored. Note: an exported LOTICS_API_KEY overrides the config file's key.
Workspaces
If your organization has multiple workspaces, select one before running tools:
lotics workspace # list workspaces (marks current)
lotics workspace select wks_... # switch to a workspace
lotics workspace create "Sales" # create a new workspace (admin only)Single-workspace organizations auto-select on first use.
CLI
# Discover tools
lotics tools # list tools by category with descriptions
lotics tools query_records # show full description + input schema
# Execute
lotics run query_tables '{}'
lotics run query_records '{"table_id":"tbl_...","field_keys":["name"]}'
# Pipe args via stdin
echo '{"table_id":"tbl_..."}' | lotics run query_records
# Upload files (multiple files and directories supported)
lotics upload ./report.pdf ./data.csv ./documents/
# Generate a file, then download it
lotics run generate_excel_from_template '{"..."}'
lotics download <file_id> -o ./reports/
# CI / non-interactive
LOTICS_API_KEY=ltk_... lotics run query_tables '{}'SDK
import { LoticsClient } from "@lotics/cli";
const client = new LoticsClient({ apiKey: "ltk_..." });
const { result } = await client.execute("query_tables", {});
const upload = await client.uploadFiles(["./report.pdf", "./data.csv"]);
await client.downloadFile(url, "./output.xlsx");
const { tools, categories } = await client.listTools();
const info = await client.getTool("query_records");