- Node.js >= 18
- A getlark API key
Clone the repository and install dependencies:
git clone <repo-url> getlark-cli
cd getlark-cli
npm installnpm run buildThis compiles TypeScript from src/ into dist/.
Authenticate:
getlark loginThis will prompt you to enter your API key.
Development (no build step needed):
npm run dev -- workflows <subcommand>Production (after building):
node dist/index.js workflows <subcommand>You can also link the CLI globally for local testing:
npm link
getlark workflows <subcommand>| Script | Description |
|---|---|
npm run build |
Compile TypeScript to dist/ |
npm run dev |
Run the CLI via tsx (no build needed) |
npm run start |
Run the built CLI from dist/ |
npm run typecheck |
Type-check without emitting files |
src/
├── index.ts # CLI entry point — registers commands and global options
├── config.ts # Resolves API key/URL from flag, env, profile
├── profile.ts # Read/write ~/.getlark/config.json profiles
├── prompt.ts # Interactive secret prompt for `login`
├── api/
│ ├── client.ts # GetLarkClient — wraps fetch with X-API-Key auth
│ └── types.ts # API resource and response types
└── commands/
├── login.ts # `login` — save API key to a profile
├── logout.ts # `logout` — remove a profile
├── config.ts # `config list` / `config use`
├── list-workflows.ts # `workflows list`
├── get-workflow.ts # `workflows get`
├── create-workflow.ts # `workflows create`
├── update-workflow.ts # `workflows update`
├── archive-workflow.ts # `workflows archive` / `unarchive`
├── invoke.ts # `workflows invoke` (+ --wait polling)
├── execution.ts # `workflows executions` (get/logs/cancel)
├── repairs.ts # `workflows repairs` (trigger/list/get/cancel/logs)
├── generations.ts # `workflows generations cancel`
├── events.ts # `workflows events list`
├── workflow-groups.ts # `workflow-groups` (CRUD)
└── secret-contexts.ts # `secret-contexts` (CRUD + delete-key)