zinkee 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/chunk-MHEVRMDX.js +1230 -0
- package/dist/chunk-MHEVRMDX.js.map +1 -0
- package/{src/utils/examples.ts → dist/examples-E6FFEVBE.js} +856 -1141
- package/dist/examples-E6FFEVBE.js.map +1 -0
- package/dist/index.js +1145 -8456
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/.github/workflows/npm-publish.yml +0 -77
- package/.github/workflows/pr-checks.yml +0 -36
- package/AGENTS.md +0 -110
- package/docs/cli-contract.md +0 -41
- package/docs/npm-release.md +0 -64
- package/docs/superpowers/plans/2026-03-24-zinkee-cli-implementation.md +0 -837
- package/docs/superpowers/plans/2026-03-25-cli-backend-error-contract.md +0 -503
- package/docs/superpowers/plans/2026-03-26-display-freeform-create.md +0 -389
- package/docs/superpowers/specs/2026-03-24-zinkee-cli-backend-blockers.md +0 -172
- package/docs/superpowers/specs/2026-03-24-zinkee-cli-design.md +0 -1576
- package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-checklist.md +0 -215
- package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-design.md +0 -492
- package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-status.md +0 -307
- package/docs/superpowers/specs/2026-07-30-cli-pr-checks-design.md +0 -37
- package/src/api/automations.ts +0 -404
- package/src/api/comments.ts +0 -51
- package/src/api/displays.ts +0 -337
- package/src/api/document-templates.ts +0 -110
- package/src/api/files.ts +0 -50
- package/src/api/formulas.test.ts +0 -65
- package/src/api/formulas.ts +0 -67
- package/src/api/logs.ts +0 -34
- package/src/api/navigation.ts +0 -70
- package/src/api/records.ts +0 -184
- package/src/api/schemas.ts +0 -148
- package/src/api/teamspace.ts +0 -110
- package/src/cli-examples.ts +0 -130
- package/src/cli-runner.ts +0 -95
- package/src/client.test.ts +0 -189
- package/src/client.ts +0 -269
- package/src/command-registry.ts +0 -882
- package/src/commands/automations.test.ts +0 -1030
- package/src/commands/automations.ts +0 -2102
- package/src/commands/comments.test.ts +0 -214
- package/src/commands/comments.ts +0 -303
- package/src/commands/config.test.ts +0 -81
- package/src/commands/config.ts +0 -150
- package/src/commands/displays.test.ts +0 -1105
- package/src/commands/displays.ts +0 -1442
- package/src/commands/document-templates.test.ts +0 -569
- package/src/commands/document-templates.ts +0 -563
- package/src/commands/files.test.ts +0 -284
- package/src/commands/files.ts +0 -280
- package/src/commands/formulas.test.ts +0 -194
- package/src/commands/formulas.ts +0 -243
- package/src/commands/logs.test.ts +0 -123
- package/src/commands/logs.ts +0 -159
- package/src/commands/navigation.test.ts +0 -211
- package/src/commands/navigation.ts +0 -348
- package/src/commands/profiles.test.ts +0 -191
- package/src/commands/profiles.ts +0 -303
- package/src/commands/records.test.ts +0 -860
- package/src/commands/records.ts +0 -883
- package/src/commands/schemas.test.ts +0 -1252
- package/src/commands/schemas.ts +0 -890
- package/src/commands/teamspace.test.ts +0 -229
- package/src/commands/teamspace.ts +0 -546
- package/src/completion/engine.test.ts +0 -138
- package/src/completion/engine.ts +0 -168
- package/src/completion/install.test.ts +0 -179
- package/src/completion/install.ts +0 -260
- package/src/completion/runtime.ts +0 -150
- package/src/completion/scripts.ts +0 -91
- package/src/config.test.ts +0 -362
- package/src/config.ts +0 -294
- package/src/index.test.ts +0 -217
- package/src/index.ts +0 -8
- package/src/parsers/expressions.test.ts +0 -95
- package/src/parsers/expressions.ts +0 -128
- package/src/parsers/kv.test.ts +0 -35
- package/src/parsers/kv.ts +0 -49
- package/src/parsers/selectors.test.ts +0 -23
- package/src/parsers/selectors.ts +0 -29
- package/src/program.ts +0 -64
- package/src/runtime-context.ts +0 -103
- package/src/types.ts +0 -76
- package/src/utils/argv-rewrite.test.ts +0 -149
- package/src/utils/argv-rewrite.ts +0 -269
- package/src/utils/errors.test.ts +0 -85
- package/src/utils/errors.ts +0 -191
- package/src/utils/examples.test.ts +0 -374
- package/src/utils/output.test.ts +0 -65
- package/src/utils/output.ts +0 -154
- package/src/utils/schema-fields.ts +0 -1016
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -13
package/src/commands/config.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import type { Writable } from "node:stream";
|
|
2
|
-
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
defaultConfigPath,
|
|
7
|
-
readConfig,
|
|
8
|
-
redactConfig,
|
|
9
|
-
resolveProfile,
|
|
10
|
-
} from "../config.js";
|
|
11
|
-
import { CliError } from "../utils/errors.js";
|
|
12
|
-
import { buildJsonSuccess, printTable } from "../utils/output.js";
|
|
13
|
-
|
|
14
|
-
interface CommandIo {
|
|
15
|
-
write(chunk: string): unknown;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface RegisterConfigCommandsOptions {
|
|
19
|
-
configPath?: string;
|
|
20
|
-
stdout?: CommandIo;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface GlobalOptions {
|
|
24
|
-
json?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function getCommandIo(stdout: CommandIo | undefined): CommandIo {
|
|
28
|
-
return stdout ?? (process.stdout as Writable);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function writeLine(stdout: CommandIo, value: string): void {
|
|
32
|
-
stdout.write(`${value}\n`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getGlobalOptions(command: Command): GlobalOptions {
|
|
36
|
-
return command.optsWithGlobals<GlobalOptions>();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function emitJson(
|
|
40
|
-
stdout: CommandIo,
|
|
41
|
-
commandName: string,
|
|
42
|
-
data: unknown,
|
|
43
|
-
configPath: string,
|
|
44
|
-
): void {
|
|
45
|
-
writeLine(
|
|
46
|
-
stdout,
|
|
47
|
-
JSON.stringify(buildJsonSuccess(data, { command: commandName, configPath })),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function toConfigurationError(filePath: string, error: unknown): never {
|
|
52
|
-
if (error instanceof CliError) {
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
typeof error === "object" &&
|
|
58
|
-
error !== null &&
|
|
59
|
-
"code" in error &&
|
|
60
|
-
error.code === "ENOENT"
|
|
61
|
-
) {
|
|
62
|
-
throw new CliError("configuration_error", `Config file not found at ${filePath}.`);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (error instanceof Error) {
|
|
66
|
-
throw new CliError("configuration_error", error.message);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function registerConfigCommands(
|
|
73
|
-
program: Command,
|
|
74
|
-
options: RegisterConfigCommandsOptions = {},
|
|
75
|
-
): void {
|
|
76
|
-
const filePath = options.configPath ?? defaultConfigPath;
|
|
77
|
-
const stdout = getCommandIo(options.stdout);
|
|
78
|
-
const config = program.command("config").description("Inspect local CLI config");
|
|
79
|
-
|
|
80
|
-
config
|
|
81
|
-
.command("path")
|
|
82
|
-
.description("Show the effective config file path")
|
|
83
|
-
.action(function action(this: Command) {
|
|
84
|
-
const data = { path: filePath };
|
|
85
|
-
|
|
86
|
-
if (getGlobalOptions(this).json) {
|
|
87
|
-
emitJson(stdout, "config path", data, filePath);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
writeLine(stdout, filePath);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
config
|
|
95
|
-
.command("show")
|
|
96
|
-
.description("Show the local config with secrets redacted")
|
|
97
|
-
.action(function action(this: Command) {
|
|
98
|
-
try {
|
|
99
|
-
const data = redactConfig(readConfig(filePath));
|
|
100
|
-
|
|
101
|
-
if (getGlobalOptions(this).json) {
|
|
102
|
-
emitJson(stdout, "config show", data, filePath);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
writeLine(stdout, `Default profile: ${data.defaultProfile ?? "(none)"}`);
|
|
107
|
-
printTable(
|
|
108
|
-
Object.entries(data.profiles).map(([name, profile]) => ({
|
|
109
|
-
name,
|
|
110
|
-
default: data.defaultProfile === name ? "yes" : "",
|
|
111
|
-
baseUrl:
|
|
112
|
-
typeof profile.baseUrl === "string"
|
|
113
|
-
? profile.baseUrl
|
|
114
|
-
: "",
|
|
115
|
-
apiKey:
|
|
116
|
-
typeof profile.apiKey === "string"
|
|
117
|
-
? profile.apiKey
|
|
118
|
-
: "",
|
|
119
|
-
})),
|
|
120
|
-
["name", "default", "baseUrl", "apiKey"],
|
|
121
|
-
stdout,
|
|
122
|
-
);
|
|
123
|
-
} catch (error) {
|
|
124
|
-
toConfigurationError(filePath, error);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
config
|
|
129
|
-
.command("validate")
|
|
130
|
-
.description("Validate that the local config can resolve a profile")
|
|
131
|
-
.action(function action(this: Command) {
|
|
132
|
-
try {
|
|
133
|
-
const parsed = readConfig(filePath);
|
|
134
|
-
const profile = resolveProfile(parsed);
|
|
135
|
-
const data = {
|
|
136
|
-
valid: true,
|
|
137
|
-
profile: profile.name,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
if (getGlobalOptions(this).json) {
|
|
141
|
-
emitJson(stdout, "config validate", data, filePath);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
writeLine(stdout, `Config is valid. Resolved profile "${profile.name}".`);
|
|
146
|
-
} catch (error) {
|
|
147
|
-
toConfigurationError(filePath, error);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|