feedbackbasket-cli 0.3.1 → 0.3.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/dist/src/cli.js CHANGED
@@ -11,6 +11,7 @@ import { createDoctorCommand } from './commands/doctor.js';
11
11
  import { createSetupCommand } from './commands/setup.js';
12
12
  import { createWidgetCommand } from './commands/widget.js';
13
13
  import { createTeamCommand } from './commands/team.js';
14
+ import { renderRootHelp } from './help.js';
14
15
  let writer;
15
16
  function resolveFormat(opts) {
16
17
  if (opts.agent || opts.quiet)
@@ -28,11 +29,13 @@ export function run() {
28
29
  const program = new Command('feedbackbasket')
29
30
  .version(VERSION, '-v, --version')
30
31
  .description('Command-line interface for FeedbackBasket')
31
- .option('--json', 'Output as JSON envelope')
32
- .option('--quiet', 'Output raw data only (no envelope)')
32
+ .option('-j, --json', 'Output as JSON envelope')
33
+ .option('-q, --quiet', 'Output raw data only (no envelope)')
33
34
  .option('--agent', 'Agent mode (alias for --quiet)')
34
- .option('--md', 'Output as Markdown')
35
+ .option('-m, --md', 'Output as Markdown')
35
36
  .option('--base-url <url>', 'API base URL override')
37
+ .addHelpText('beforeAll', '')
38
+ .helpOption('--help', 'Show help for command')
36
39
  .hook('preAction', (thisCommand) => {
37
40
  const opts = thisCommand.opts();
38
41
  const format = resolveFormat(opts);
@@ -41,10 +44,20 @@ export function run() {
41
44
  setBaseUrlOverride(opts.baseUrl);
42
45
  }
43
46
  });
47
+ // Custom help for root command
48
+ program.configureHelp({
49
+ formatHelp: (cmd, helper) => {
50
+ if (cmd.name() === 'feedbackbasket') {
51
+ return renderRootHelp();
52
+ }
53
+ // Subcommands use default Commander help
54
+ return helper.formatHelp(cmd, helper);
55
+ },
56
+ });
44
57
  // Register commands
45
58
  program.addCommand(createAuthCommand(getWriter));
46
- program.addCommand(createLoginCommand(getWriter)); // alias: feedbackbasket login
47
- program.addCommand(createLogoutCommand(getWriter)); // alias: feedbackbasket logout
59
+ program.addCommand(createLoginCommand(getWriter));
60
+ program.addCommand(createLogoutCommand(getWriter));
48
61
  program.addCommand(createProjectsCommand(getWriter));
49
62
  program.addCommand(createFeedbackCommand(getWriter));
50
63
  program.addCommand(createBugsCommand(getWriter));
@@ -4,7 +4,9 @@ import { AuthManager } from '../auth/manager.js';
4
4
  import { loadConfig } from '../config/config.js';
5
5
  import { errAuth } from '../output/errors.js';
6
6
  import { brand, divider } from '../output/theme.js';
7
- function resolveProjectId(optProject) {
7
+ function resolveProjectId(optProject, all) {
8
+ if (all)
9
+ return undefined;
8
10
  if (optProject)
9
11
  return optProject;
10
12
  const config = loadConfig();
@@ -17,6 +19,7 @@ export function createBugsCommand(getWriter) {
17
19
  .command('list')
18
20
  .description('List bug reports with severity classification')
19
21
  .option('--project <id>', 'Filter by project ID')
22
+ .option('--all', 'Show bugs across all projects (ignore default project)')
20
23
  .option('--severity <level>', 'Filter by severity (high, medium, low)')
21
24
  .option('--status <status>', 'Filter by status')
22
25
  .option('--search <query>', 'Search bug content')
@@ -27,7 +30,7 @@ export function createBugsCommand(getWriter) {
27
30
  const writer = getWriter();
28
31
  const client = requireClient();
29
32
  const result = await client.getBugReports({
30
- projectId: resolveProjectId(opts.project),
33
+ projectId: resolveProjectId(opts.project, opts.all),
31
34
  status: opts.status,
32
35
  severity: opts.severity,
33
36
  search: opts.search,
@@ -57,12 +60,13 @@ export function createBugsCommand(getWriter) {
57
60
  });
58
61
  bugs
59
62
  .command('stats')
63
+ .option('--all', 'Show stats across all projects')
60
64
  .description('Show bug statistics summary')
61
65
  .option('--project <id>', 'Filter by project ID')
62
66
  .action(async (opts) => {
63
67
  const writer = getWriter();
64
68
  const client = requireClient();
65
- const stats = await client.getBugStats({ projectId: opts.project });
69
+ const stats = await client.getBugStats({ projectId: resolveProjectId(opts.project, opts.all) });
66
70
  if (!writer.isMachineOutput()) {
67
71
  renderBugStats(stats);
68
72
  }
@@ -110,7 +114,8 @@ function renderBugList(bugs) {
110
114
  const sev = severityColor[bug.severity](`[${bug.severity.toUpperCase()}]`);
111
115
  const status = brand.muted(`[${bug.status}]`);
112
116
  const content = bug.content.length > 75 ? bug.content.slice(0, 72) + '...' : bug.content;
113
- console.log(`${sev} ${status} ${brand.muted(bug.id)}`);
117
+ const proj = bug.project ? brand.primary(bug.project.name) : '';
118
+ console.log(`${sev} ${status} ${proj} ${brand.muted(bug.id)}`);
114
119
  console.log(` ${content}`);
115
120
  if (bug.aiSummary) {
116
121
  console.log(` ${brand.hint(bug.aiSummary)}`);
@@ -4,7 +4,9 @@ import { AuthManager } from '../auth/manager.js';
4
4
  import { loadConfig } from '../config/config.js';
5
5
  import { errAuth } from '../output/errors.js';
6
6
  import { brand } from '../output/theme.js';
7
- function resolveProjectId(optProject) {
7
+ function resolveProjectId(optProject, all) {
8
+ if (all)
9
+ return undefined;
8
10
  if (optProject)
9
11
  return optProject;
10
12
  const config = loadConfig();
@@ -29,6 +31,7 @@ export function createFeedbackCommand(getWriter) {
29
31
  .command('list')
30
32
  .description('List feedback with optional filters')
31
33
  .option('--project <id>', 'Filter by project ID')
34
+ .option('--all', 'Show feedback across all projects (ignore default project)')
32
35
  .option('--category <category>', 'Filter by category (BUG, FEATURE_REQUEST, IMPROVEMENT, QUESTION)')
33
36
  .option('--status <status>', 'Filter by status (OPEN, UNDER_REVIEW, PLANNED, IN_PROGRESS, COMPLETE, CLOSED)')
34
37
  .option('--sentiment <sentiment>', 'Filter by sentiment (POSITIVE, NEGATIVE, NEUTRAL)')
@@ -40,7 +43,7 @@ export function createFeedbackCommand(getWriter) {
40
43
  const writer = getWriter();
41
44
  const client = requireClient();
42
45
  const result = await client.getFeedback({
43
- projectId: resolveProjectId(opts.project),
46
+ projectId: resolveProjectId(opts.project, opts.all),
44
47
  category: opts.category,
45
48
  status: opts.status,
46
49
  sentiment: opts.sentiment,
@@ -146,7 +149,8 @@ function renderFeedbackList(items) {
146
149
  const priority = priorityLabel(item.aiPriorityScore);
147
150
  const content = item.content.length > 80 ? item.content.slice(0, 77) + '...' : item.content;
148
151
  const status = brand.muted(`[${item.status}]`);
149
- console.log(`${cat} ${priority} ${status} ${brand.muted(item.id)}`);
152
+ const proj = item.project ? brand.primary(item.project.name) : '';
153
+ console.log(`${cat} ${priority} ${status} ${proj} ${brand.muted(item.id)}`);
150
154
  console.log(` ${content}`);
151
155
  if (item.aiSummary) {
152
156
  console.log(` ${brand.hint(item.aiSummary)}`);
@@ -0,0 +1 @@
1
+ export declare function renderRootHelp(): string;
@@ -0,0 +1,72 @@
1
+ import chalk from 'chalk';
2
+ import { brand, logo } from './output/theme.js';
3
+ import { VERSION } from './version.js';
4
+ const INDENT = ' ';
5
+ function section(title) {
6
+ return chalk.bold(title.toUpperCase());
7
+ }
8
+ function cmd(name, desc, nameWidth = 16) {
9
+ return `${INDENT}${brand.command(name.padEnd(nameWidth))} ${desc}`;
10
+ }
11
+ function flag(name, desc, nameWidth = 18) {
12
+ return `${INDENT}${name.padEnd(nameWidth)} ${desc}`;
13
+ }
14
+ export function renderRootHelp() {
15
+ const lines = [];
16
+ lines.push('');
17
+ lines.push(` ${logo()} CLI ${brand.muted(`v${VERSION}`)}`);
18
+ lines.push('');
19
+ lines.push(` ${brand.muted('The command-line interface for FeedbackBasket.')}`);
20
+ lines.push(` ${brand.muted('Manage projects, feedback, widgets, and team from your terminal.')}`);
21
+ lines.push('');
22
+ // Core Commands
23
+ lines.push(section(' CORE COMMANDS'));
24
+ lines.push(cmd('projects', 'Manage projects (create, show, update, delete)'));
25
+ lines.push(cmd('feedback', 'View and manage feedback'));
26
+ lines.push(cmd('bugs', 'View bug reports with severity'));
27
+ lines.push(cmd('widget', 'Manage feedback widget & get embed code'));
28
+ lines.push(cmd('team', 'Manage organization members'));
29
+ lines.push('');
30
+ // Shortcuts
31
+ lines.push(section(' SHORTCUTS'));
32
+ lines.push(cmd('login', 'Authenticate with FeedbackBasket'));
33
+ lines.push(cmd('logout', 'Clear stored credentials'));
34
+ lines.push('');
35
+ // Search & Export
36
+ lines.push(section(' SEARCH & EXPORT'));
37
+ lines.push(cmd('feedback search', 'Search feedback across projects'));
38
+ lines.push(cmd('feedback export', 'Export feedback to CSV, Markdown, or JSON'));
39
+ lines.push(cmd('bugs stats', 'Bug statistics summary'));
40
+ lines.push('');
41
+ // Auth & Config
42
+ lines.push(section(' AUTH & CONFIG'));
43
+ lines.push(cmd('auth', 'Manage authentication (login, logout, status, token)'));
44
+ lines.push(cmd('doctor', 'Run diagnostics to check CLI health'));
45
+ lines.push(cmd('setup', 'Set up agent integrations (Claude Code)'));
46
+ lines.push('');
47
+ // Flags
48
+ lines.push(section(' FLAGS'));
49
+ lines.push(flag('-j, --json', 'Output as JSON envelope'));
50
+ lines.push(flag('-q, --quiet', 'Quiet output (data only, no envelope)'));
51
+ lines.push(flag('--agent', 'Agent mode (alias for --quiet)'));
52
+ lines.push(flag('-m, --md', 'Output as Markdown'));
53
+ lines.push(flag('--base-url <url>', 'API base URL override'));
54
+ lines.push(flag('--help', 'Show help for command'));
55
+ lines.push(flag('--version', 'Show version'));
56
+ lines.push('');
57
+ // Examples
58
+ lines.push(section(' EXAMPLES'));
59
+ lines.push(`${INDENT}${brand.muted('$')} feedbackbasket projects list`);
60
+ lines.push(`${INDENT}${brand.muted('$')} feedbackbasket feedback list --category BUG --status OPEN`);
61
+ lines.push(`${INDENT}${brand.muted('$')} feedbackbasket bugs list --severity high`);
62
+ lines.push(`${INDENT}${brand.muted('$')} feedbackbasket widget script myapp`);
63
+ lines.push(`${INDENT}${brand.muted('$')} feedbackbasket projects create "My App" --url https://myapp.com`);
64
+ lines.push('');
65
+ // Learn More
66
+ lines.push(section(' LEARN MORE'));
67
+ lines.push(`${INDENT}${brand.command('feedbackbasket <command> --help')} Help for any command`);
68
+ lines.push(`${INDENT}${brand.command('feedbackbasket doctor')} Check CLI health`);
69
+ lines.push(`${INDENT}${brand.muted('Docs:')} https://feedbackbasket.com/docs/cli`);
70
+ lines.push('');
71
+ return lines.join('\n');
72
+ }
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.1";
2
- export declare const USER_AGENT = "FeedbackBasket-CLI/0.3.1";
1
+ export declare const VERSION = "0.3.4";
2
+ export declare const USER_AGENT = "FeedbackBasket-CLI/0.3.4";
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.1';
1
+ export const VERSION = '0.3.4';
2
2
  export const USER_AGENT = `FeedbackBasket-CLI/${VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feedbackbasket-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.4",
4
4
  "description": "Command-line interface for FeedbackBasket — manage feedback from your terminal",
5
5
  "type": "module",
6
6
  "main": "dist/src/cli.js",