Files
inkreach-teable-cli/src/bin.ts
T
yeuimu 2a186c9acc chore: standalone repo bootstrap after split from inkreach-teable monorepo
- untrack dist/, add .gitignore, add pnpm-lock.yaml
- inline tsconfig.base.json options (no monorepo extends)
- install.sh: CLI now at repo root; install skill to ~/.zcode/skills (user scope)
- fix stale paths in skill docs; 7 actions in help text; README
2026-09-23 04:01:22 +00:00

51 lines
1.9 KiB
JavaScript

#!/usr/bin/env node
/**
* inkreach-teable — CLI for operating inkreach-teable.
*
* Entry point. Sets up the global commander program and mounts command groups.
*/
import { Command } from 'commander';
import { version } from '../package.json';
import { pluginCommand } from './commands/plugin';
import { authCommand } from './commands/auth';
import { workflowCommand, triggerCommand, actionCommand } from './commands/workflow';
import { baseResourceCommands } from './commands/resources';
import { secretCommand, runsCommand, fireCommand, sqlCommand } from './commands/extras';
import { subscriptionCommand } from './commands/subscription';
const program = new Command();
program
.name('inkreach-teable')
.description(
'Operate inkreach-teable: tables, fields, records, views, and the self-built automation engine (8 triggers + 7 actions).\n' +
'Use --json for machine-readable output (agent parsing).'
)
.version(`inkreach-teable ${version}`, '-v, --version');
// Global options (highest precedence over config file + env).
program
.option('--endpoint <url>', 'Backend URL (default http://localhost:3000)')
.option('--token <token>', 'Personal Access Token')
.option('--base-id <id>', 'Default base id')
.option('--json', 'Output raw JSON for agent parsing')
.option('--debug', 'Print requests/responses to stderr (verbose)');
// Command groups
program.addCommand(authCommand());
program.addCommand(pluginCommand());
for (const c of baseResourceCommands()) program.addCommand(c);
program.addCommand(workflowCommand());
program.addCommand(triggerCommand());
program.addCommand(actionCommand());
program.addCommand(subscriptionCommand());
program.addCommand(secretCommand());
program.addCommand(runsCommand());
program.addCommand(fireCommand());
program.addCommand(sqlCommand());
program.parseAsync(process.argv).catch((err) => {
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}\n`);
process.exit(1);
});