ticketlens 0.1.2 → 0.1.4
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/ticketlens.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { run as runCache } from '../skills/jtb/scripts/lib/cache-manager.mjs';
|
|
|
20
20
|
import { printHelp, printProfiles } from '../skills/jtb/scripts/lib/help.mjs';
|
|
21
21
|
import { createStyler } from '../skills/jtb/scripts/lib/ansi.mjs';
|
|
22
22
|
import { readCliToken, saveCliToken, deleteCliToken } from '../skills/jtb/scripts/lib/cli-auth.mjs';
|
|
23
|
-
import { syncProfiles, getApiBase } from '../skills/jtb/scripts/lib/sync.mjs';
|
|
23
|
+
import { syncProfiles, getApiBase, getConsoleBase } from '../skills/jtb/scripts/lib/sync.mjs';
|
|
24
24
|
import { promptSecret, promptText } from '../skills/jtb/scripts/lib/prompt-helpers.mjs';
|
|
25
25
|
|
|
26
26
|
const args = process.argv.slice(2);
|
|
@@ -266,7 +266,7 @@ switch (command) {
|
|
|
266
266
|
const s = createStyler({ isTTY: process.stderr.isTTY });
|
|
267
267
|
process.stderr.write(`\n ${s.bold('TicketLens Login')}\n`);
|
|
268
268
|
process.stderr.write(` ${s.dim('─'.repeat(44))}\n`);
|
|
269
|
-
process.stderr.write(` ${s.dim(`Generate a CLI token at ${s.cyan(`${
|
|
269
|
+
process.stderr.write(` ${s.dim(`Generate a CLI token at ${s.cyan(`${getConsoleBase()}/console/account`)}`)}\n`);
|
|
270
270
|
process.stderr.write(` ${s.dim('then paste it below.')}\n\n`);
|
|
271
271
|
|
|
272
272
|
const token = await promptSecret(`CLI Token ${s.dim('(tl_…)')}:`, { stream: process.stderr });
|
package/package.json
CHANGED
|
@@ -24,11 +24,13 @@ export function printHelp({ stream = process.stdout } = {}) {
|
|
|
24
24
|
'',
|
|
25
25
|
` ${s.bold('USAGE')}`,
|
|
26
26
|
'',
|
|
27
|
-
// visible widths
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
` ${s.brand('ticketlens')}
|
|
27
|
+
// visible widths — target column = 36 visible chars for the command portion
|
|
28
|
+
// Groups: Console sync ─── Setup ─── Daily use ─── Account / Maintenance
|
|
29
|
+
` ${s.brand('ticketlens')} login Connect CLI to your TicketLens account`,
|
|
30
|
+
` ${s.brand('ticketlens')} logout Remove stored credentials`,
|
|
31
|
+
` ${s.brand('ticketlens')} sync Pull tracker profiles from the console`,
|
|
32
|
+
'',
|
|
33
|
+
` ${s.brand('ticketlens')} init Configure connections locally`,
|
|
32
34
|
` ${s.brand('ticketlens')} switch Switch active profile`,
|
|
33
35
|
` ${s.brand('ticketlens')} config ${s.dim('[--profile=NAME]')} Edit profile settings`,
|
|
34
36
|
` ${s.brand('ticketlens')} profiles List all configured profiles ${s.dim('(alias: ls)')}`,
|
|
@@ -75,6 +77,8 @@ export function printHelp({ stream = process.stdout } = {}) {
|
|
|
75
77
|
'',
|
|
76
78
|
` ${s.bold('EXAMPLES')}`,
|
|
77
79
|
'',
|
|
80
|
+
` ${s.dim('$')} ticketlens login ${s.dim('# first-time setup')}`,
|
|
81
|
+
` ${s.dim('$')} ticketlens sync ${s.dim('# pull connections from console')}`,
|
|
78
82
|
` ${s.dim('$')} ticketlens PROJ-123`,
|
|
79
83
|
` ${s.dim('$')} ticketlens get PROJ-123 --depth=0 --profile=myteam`,
|
|
80
84
|
` ${s.dim('$')} ticketlens triage`,
|
|
@@ -83,11 +87,13 @@ export function printHelp({ stream = process.stdout } = {}) {
|
|
|
83
87
|
'',
|
|
84
88
|
` ${s.bold('CONFIGURATION')}`,
|
|
85
89
|
'',
|
|
90
|
+
` ${s.dim('CLI token:')} ~/.ticketlens/cli-token ${s.dim('(written by ticketlens login)')}`,
|
|
86
91
|
` ${s.dim('Profiles:')} ~/.ticketlens/profiles.json`,
|
|
87
92
|
` ${s.dim('Credentials:')} ~/.ticketlens/credentials.json`,
|
|
88
93
|
` ${s.dim('License:')} ~/.ticketlens/license.json`,
|
|
89
94
|
'',
|
|
90
95
|
` ${s.dim('Or use env vars:')} JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN`,
|
|
96
|
+
` ${s.dim(' ')} TICKETLENS_API_URL ${s.dim('(override API host for local dev)')}`,
|
|
91
97
|
'',
|
|
92
98
|
'',
|
|
93
99
|
];
|
|
@@ -14,9 +14,11 @@ import {
|
|
|
14
14
|
} from './profile-resolver.mjs';
|
|
15
15
|
import { DEFAULT_CONFIG_DIR } from './config.mjs';
|
|
16
16
|
|
|
17
|
-
const DEFAULT_API_BASE = 'https://ticketlens.app';
|
|
17
|
+
const DEFAULT_API_BASE = 'https://api.ticketlens.app';
|
|
18
18
|
|
|
19
|
-
export const getApiBase
|
|
19
|
+
export const getApiBase = () => process.env.TICKETLENS_API_URL ?? DEFAULT_API_BASE;
|
|
20
|
+
// Strip the api. subdomain to get the console base URL (e.g. api.ticketlens.app → ticketlens.app)
|
|
21
|
+
export const getConsoleBase = () => getApiBase().replace('://api.', '://');
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* Convert a server profile (snake_case) to the CLI profile shape (camelCase).
|