refactor: rename CLI command 'inkreach' -> 'inkreach-teable'
Rename the command (and its config namespace) to match the project name: - bin: inkreach -> inkreach-teable - program name: inkreach -> inkreach-teable - config dir: ~/.inkreach/ -> ~/.inkreach-teable/ - env vars: INKREACH_* -> INKREACH_TEABLE_* - all docs (SKILL.md, guides, api-reference, AGENTS.md, design doc, install.sh) Unchanged (intentional): - npm package name: @inkreach/teable-cli - package directory: packages/inkreach-cli/ - skill name: inkreach-teable-ops - organization/authors: 'inkreach' (npm scope @inkreach) Existing config auto-migrated (~/.inkreach -> ~/.inkreach-teable). Verified end-to-end: auth status, workflow list (636), build clean.
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* inkreach — CLI for operating inkreach-teable.
|
||||
* inkreach-teable — CLI for operating inkreach-teable.
|
||||
*
|
||||
* Entry point. Sets up the global commander program and mounts command groups.
|
||||
*/
|
||||
@@ -14,12 +14,12 @@ import { secretCommand, runsCommand, fireCommand, sqlCommand } from './commands/
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.name('inkreach')
|
||||
.name('inkreach-teable')
|
||||
.description(
|
||||
'Operate inkreach-teable: tables, fields, records, views, and the self-built automation engine (8 triggers + 6 actions).\n' +
|
||||
'Use --json for machine-readable output (agent parsing).'
|
||||
)
|
||||
.version(`inkreach ${version}`, '-v, --version');
|
||||
.version(`inkreach-teable ${version}`, '-v, --version');
|
||||
|
||||
// Global options (highest precedence over config file + env).
|
||||
program
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* `inkreach auth` — authentication & config commands.
|
||||
* `inkreach-teable auth` — authentication & config commands.
|
||||
*/
|
||||
import { Command } from 'commander';
|
||||
import { run, requireBaseId } from '../lib/ctx';
|
||||
@@ -126,7 +126,7 @@ export function authCommand(): Command {
|
||||
['token', created.token],
|
||||
['', ''],
|
||||
['note', 'Save this token now — it cannot be retrieved again.'],
|
||||
['use', 'inkreach auth login --token <above>'],
|
||||
['use', 'inkreach-teable auth login --token <above>'],
|
||||
]);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* `inkreach secret` — manage workflow automation secrets.
|
||||
* `inkreach runs` — execution history.
|
||||
* `inkreach fire` — manual trigger testing (button-click / webhook).
|
||||
* `inkreach sql` — read-only SQL queries.
|
||||
* `inkreach-teable secret` — manage workflow automation secrets.
|
||||
* `inkreach-teable runs` — execution history.
|
||||
* `inkreach-teable fire` — manual trigger testing (button-click / webhook).
|
||||
* `inkreach-teable sql` — read-only SQL queries.
|
||||
*/
|
||||
import { Command } from 'commander';
|
||||
import { run, requireBaseId } from '../lib/ctx';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* `inkreach base|table|field|record|view` — resource CRUD commands.
|
||||
* `inkreach-teable base|table|field|record|view` — resource CRUD commands.
|
||||
*
|
||||
* These endpoints are compatible with official teable open-api.
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* `inkreach workflow` — workflow CRUD + lifecycle.
|
||||
* `inkreach trigger` — set the trigger node's type & config.
|
||||
* `inkreach action` — add/update/delete action nodes.
|
||||
* `inkreach-teable workflow` — workflow CRUD + lifecycle.
|
||||
* `inkreach-teable trigger` — set the trigger node's type & config.
|
||||
* `inkreach-teable action` — add/update/delete action nodes.
|
||||
*
|
||||
* All node-mutating commands operate via PUT /node (whole-graph replacement),
|
||||
* so they internally GET the full graph, mutate, then PUT it back.
|
||||
@@ -123,7 +123,7 @@ export function workflowCommand(): Command {
|
||||
['name', wf.name],
|
||||
['baseId', wf.baseId],
|
||||
['', ''],
|
||||
['next', `inkreach trigger set ${wf.id} --type <T> ...`],
|
||||
['next', `inkreach-teable trigger set ${wf.id} --type <T> ...`],
|
||||
]);
|
||||
}
|
||||
})
|
||||
@@ -296,7 +296,7 @@ export function triggerCommand(): Command {
|
||||
['triggerType', opts.type],
|
||||
['config', JSON.stringify(config)],
|
||||
['', ''],
|
||||
['next', `inkreach action add ${workflowId} --type script ...`],
|
||||
['next', `inkreach-teable action add ${workflowId} --type script ...`],
|
||||
]);
|
||||
}
|
||||
})
|
||||
@@ -432,7 +432,7 @@ export function actionCommand(): Command {
|
||||
['type', opts.type],
|
||||
['config', JSON.stringify(config)],
|
||||
['', ''],
|
||||
['next', `inkreach workflow activate ${workflowId}`],
|
||||
['next', `inkreach-teable workflow activate ${workflowId}`],
|
||||
]);
|
||||
}
|
||||
})
|
||||
|
||||
+7
-7
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* Config storage for inkreach CLI.
|
||||
* Config storage for inkreach-teable CLI.
|
||||
*
|
||||
* Stores endpoint + token at ~/.inkreach/config.json, with environment variable
|
||||
* overrides INKREACH_ENDPOINT / INKREACH_TOKEN. The --endpoint / --token / --base-id
|
||||
* Stores endpoint + token at ~/.inkreach-teable/config.json, with environment variable
|
||||
* overrides INKREACH_TEABLE_ENDPOINT / INKREACH_TEABLE_TOKEN. The --endpoint / --token / --base-id
|
||||
* global flags take the highest precedence (handled by resolveOptions()).
|
||||
*/
|
||||
import * as fs from 'node:fs';
|
||||
@@ -15,7 +15,7 @@ export interface IConfig {
|
||||
baseId?: string;
|
||||
}
|
||||
|
||||
const CONFIG_DIR = path.join(os.homedir(), '.inkreach');
|
||||
const CONFIG_DIR = path.join(os.homedir(), '.inkreach-teable');
|
||||
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
||||
|
||||
export const DEFAULT_ENDPOINT = 'http://localhost:3000';
|
||||
@@ -42,11 +42,11 @@ export function resolveConfig(overrides?: Partial<IConfig>): IConfig {
|
||||
return {
|
||||
endpoint:
|
||||
overrides?.endpoint ||
|
||||
process.env.INKREACH_ENDPOINT ||
|
||||
process.env.INKREACH_TEABLE_ENDPOINT ||
|
||||
file.endpoint ||
|
||||
DEFAULT_ENDPOINT,
|
||||
token: overrides?.token || process.env.INKREACH_TOKEN || file.token || '',
|
||||
baseId: overrides?.baseId || process.env.INKREACH_BASE_ID || file.baseId,
|
||||
token: overrides?.token || process.env.INKREACH_TEABLE_TOKEN || file.token || '',
|
||||
baseId: overrides?.baseId || process.env.INKREACH_TEABLE_BASE_ID || file.baseId,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ export function requireBaseId(ctx: Ctx, flagVal?: string): string {
|
||||
throw new ApiError(
|
||||
0,
|
||||
'MISSING_BASE_ID',
|
||||
'No base id. Pass --base-id <id>, set a default with `inkreach auth login --base-id <id>`, or export INKREACH_BASE_ID.'
|
||||
'No base id. Pass --base-id <id>, set a default with `inkreach-teable auth login --base-id <id>`, or export INKREACH_TEABLE_BASE_ID.'
|
||||
);
|
||||
}
|
||||
return baseId;
|
||||
|
||||
Reference in New Issue
Block a user