Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Commit 638519e

Browse files
Chrisclaude
andcommitted
refactor: drop realms --add/--init/--remove/--llm hidden aliases
PR #15 introduced positional subcommands (realms add/remove/init/llm) and kept the old flag forms as hidden aliases for backwards compat. Since the restructure has not yet been released (still on PR), there are no users to migrate. Clean break is simpler. Per backspace's PR #15 review: "do we want backward compatibility? IMO we might as well make a clean break as this is not officially released." - Remove 9 `.addOption(new Option('--xxx').hideHelp())` calls - Remove legacy flag dispatcher `realmsCommand()` and RealmsOptions - Drop unused `Option` import from commander `boxel realms` with no subcommand still shows the list. The `list` alias for `workspace-list` stays (backspace: "I think we can treat list as a shorthand"). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dba568c commit 638519e

2 files changed

Lines changed: 5 additions & 73 deletions

File tree

‎src/commands/realms.ts‎

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -108,50 +108,6 @@ export async function realmsLlmCommand(): Promise<void> {
108108
console.log(generateLLMGuidance(config));
109109
}
110110

111-
// Legacy flag-based interface (backwards compat)
112-
interface RealmsOptions {
113-
add?: string;
114-
remove?: string;
115-
purpose?: string;
116-
patterns?: string;
117-
cardTypes?: string;
118-
notes?: string;
119-
default?: boolean;
120-
llm?: boolean;
121-
init?: boolean;
122-
}
123-
124-
export async function realmsCommand(options: RealmsOptions): Promise<void> {
125-
if (options.init) {
126-
await realmsInitCommand();
127-
return;
128-
}
129-
130-
if (options.add) {
131-
await realmsAddCommand(options.add, {
132-
purpose: options.purpose,
133-
patterns: options.patterns,
134-
cardTypes: options.cardTypes,
135-
notes: options.notes,
136-
default: options.default,
137-
});
138-
return;
139-
}
140-
141-
if (options.remove) {
142-
await realmsRemoveCommand(options.remove);
143-
return;
144-
}
145-
146-
if (options.llm) {
147-
await realmsLlmCommand();
148-
return;
149-
}
150-
151-
// Default: show summary
152-
await realmsListCommand();
153-
}
154-
155111
export async function updateRealmConfig(
156112
realmPath: string,
157113
updates: Partial<RealmConfig>

‎src/index.ts‎

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
import 'dotenv/config';
4-
import { Command, InvalidArgumentError, Option } from 'commander';
4+
import { Command, InvalidArgumentError } from 'commander';
55

66
/** Parse a positive integer from a CLI flag; throw a friendly error otherwise. */
77
function parsePositiveInt(raw: string, _prev: unknown): number {
@@ -30,7 +30,7 @@ import { editCommand } from './commands/edit.js';
3030
import { milestoneCommand } from './commands/milestone.js';
3131
import { shareCommand } from './commands/share.js';
3232
import { gatherCommand } from './commands/gather.js';
33-
import { realmsCommand, realmsListCommand, realmsAddCommand, realmsRemoveCommand, realmsInitCommand, realmsLlmCommand } from './commands/realms.js';
33+
import { realmsListCommand, realmsAddCommand, realmsRemoveCommand, realmsInitCommand, realmsLlmCommand } from './commands/realms.js';
3434
import { profileCommand } from './commands/profile.js';
3535
import { repairRealmCommand, repairRealmsCommand } from './commands/repair.js';
3636
import { consolidateWorkspacesCommand } from './commands/consolidate.js';
@@ -362,33 +362,9 @@ program
362362
const realmsCmd = program
363363
.command('realms')
364364
.description('Manage local realm configurations for development')
365-
.addOption(new Option('--init').hideHelp())
366-
.addOption(new Option('--add <path>').hideHelp())
367-
.addOption(new Option('--remove <path>').hideHelp())
368-
.addOption(new Option('--purpose <text>').hideHelp())
369-
.addOption(new Option('--patterns <list>').hideHelp())
370-
.addOption(new Option('--card-types <list>').hideHelp())
371-
.addOption(new Option('--notes <text>').hideHelp())
372-
.addOption(new Option('--default').hideHelp())
373-
.addOption(new Option('--llm').hideHelp())
374-
.action(async (options: {
375-
init?: boolean;
376-
add?: string;
377-
remove?: string;
378-
purpose?: string;
379-
patterns?: string;
380-
cardTypes?: string;
381-
notes?: string;
382-
default?: boolean;
383-
llm?: boolean;
384-
}) => {
385-
// Handle legacy flag-based usage
386-
if (options.init || options.add || options.remove || options.llm) {
387-
await realmsCommand(options);
388-
} else {
389-
// Default: show list
390-
await realmsListCommand();
391-
}
365+
.action(async () => {
366+
// `boxel realms` with no subcommand shows the list
367+
await realmsListCommand();
392368
});
393369

394370
realmsCmd

0 commit comments

Comments
 (0)