linear-cli-agents 0.4.0 → 0.5.0

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/bin/dev.js CHANGED
File without changes
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigGet extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ key: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,37 @@
1
+ import { Args, Command } from '@oclif/core';
2
+ import { success, print } from '../../lib/output.js';
3
+ import { handleError, CliError, ErrorCodes } from '../../lib/errors.js';
4
+ import { getDefaults, isValidConfigKey, configKeyToDefaultsKey, CONFIG_KEYS } from '../../lib/config.js';
5
+ export default class ConfigGet extends Command {
6
+ static description = 'Get a configuration value';
7
+ static examples = [
8
+ '<%= config.bin %> config get default-team-id',
9
+ '<%= config.bin %> config get default-team-key',
10
+ ];
11
+ static args = {
12
+ key: Args.string({
13
+ description: `Config key (${CONFIG_KEYS.join(', ')})`,
14
+ required: true,
15
+ }),
16
+ };
17
+ async run() {
18
+ try {
19
+ const { args } = await this.parse(ConfigGet);
20
+ if (!isValidConfigKey(args.key)) {
21
+ throw new CliError(ErrorCodes.INVALID_INPUT, `Invalid config key: ${args.key}. Valid keys: ${CONFIG_KEYS.join(', ')}`);
22
+ }
23
+ const defaults = getDefaults();
24
+ const defaultsKey = configKeyToDefaultsKey(args.key);
25
+ const value = defaults[defaultsKey];
26
+ print(success({
27
+ key: args.key,
28
+ value: value ?? null,
29
+ isSet: value !== undefined,
30
+ }));
31
+ }
32
+ catch (err) {
33
+ handleError(err);
34
+ this.exit(1);
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,6 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigList extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,30 @@
1
+ import { Command } from '@oclif/core';
2
+ import { success, print } from '../../lib/output.js';
3
+ import { handleError } from '../../lib/errors.js';
4
+ import { getDefaults, getApiKey, getConfigPath, CONFIG_KEYS, configKeyToDefaultsKey } from '../../lib/config.js';
5
+ export default class ConfigList extends Command {
6
+ static description = 'List all configuration values';
7
+ static examples = ['<%= config.bin %> config list'];
8
+ async run() {
9
+ try {
10
+ const defaults = getDefaults();
11
+ const apiKey = getApiKey();
12
+ const config = {};
13
+ // Add all config keys with their values
14
+ for (const key of CONFIG_KEYS) {
15
+ const defaultsKey = configKeyToDefaultsKey(key);
16
+ config[key] = defaults[defaultsKey] ?? null;
17
+ }
18
+ print(success({
19
+ configPath: getConfigPath(),
20
+ authenticated: apiKey !== undefined,
21
+ apiKeySource: apiKey ? (process.env.LINEAR_API_KEY ? 'environment' : 'config') : null,
22
+ defaults: config,
23
+ }));
24
+ }
25
+ catch (err) {
26
+ handleError(err);
27
+ this.exit(1);
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,10 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ConfigSet extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ key: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ value: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,40 @@
1
+ import { Args, Command } from '@oclif/core';
2
+ import { success, print } from '../../lib/output.js';
3
+ import { handleError, CliError, ErrorCodes } from '../../lib/errors.js';
4
+ import { setDefault, isValidConfigKey, configKeyToDefaultsKey, CONFIG_KEYS } from '../../lib/config.js';
5
+ export default class ConfigSet extends Command {
6
+ static description = 'Set a configuration value';
7
+ static examples = [
8
+ '<%= config.bin %> config set default-team-id d1ad1a80-9267-4ebc-979a-eaf885898a2c',
9
+ '<%= config.bin %> config set default-team-key MITO',
10
+ ];
11
+ static args = {
12
+ key: Args.string({
13
+ description: `Config key (${CONFIG_KEYS.join(', ')})`,
14
+ required: true,
15
+ }),
16
+ value: Args.string({
17
+ description: 'Config value',
18
+ required: true,
19
+ }),
20
+ };
21
+ async run() {
22
+ try {
23
+ const { args } = await this.parse(ConfigSet);
24
+ if (!isValidConfigKey(args.key)) {
25
+ throw new CliError(ErrorCodes.INVALID_INPUT, `Invalid config key: ${args.key}. Valid keys: ${CONFIG_KEYS.join(', ')}`);
26
+ }
27
+ const defaultsKey = configKeyToDefaultsKey(args.key);
28
+ setDefault(defaultsKey, args.value);
29
+ print(success({
30
+ key: args.key,
31
+ value: args.value,
32
+ message: `Configuration "${args.key}" set successfully`,
33
+ }));
34
+ }
35
+ catch (err) {
36
+ handleError(err);
37
+ this.exit(1);
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Info extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ compact: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ run(): Promise<void>;
9
+ }