diff --git a/CLAUDE.md b/CLAUDE.md index e1fc55f..2f241da 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -80,9 +80,9 @@ Add `toes.tool` to your app's `package.json`: ### CLI Flags ```bash -toes list # Lists regular apps only (excludes tools) +toes list # Lists all apps including tools toes list --tools # Lists tools only -toes list --all # Lists all apps including tools +toes list --apps # Lists regular apps only (excludes tools) ``` ### Tool vs App diff --git a/src/cli/commands/manage.ts b/src/cli/commands/manage.ts index 3b1f205..d2fab62 100644 --- a/src/cli/commands/manage.ts +++ b/src/cli/commands/manage.ts @@ -74,15 +74,24 @@ export async function infoApp(arg?: string) { } interface ListAppsOptions { + apps?: boolean tools?: boolean - all?: boolean } export async function listApps(options: ListAppsOptions) { const allApps: App[] | undefined = await get('/api/apps') if (!allApps) return - if (options.all) { + if (options.apps || options.tools) { + const filtered = allApps.filter((app) => { + if (options.tools) return app.tool + return !app.tool + }) + + for (const app of filtered) { + console.log(`${STATE_ICONS[app.state] ?? '◯'} ${app.name}`) + } + } else { const apps = allApps.filter((app) => !app.tool) const tools = allApps.filter((app) => app.tool) @@ -104,15 +113,6 @@ export async function listApps(options: ListAppsOptions) { console.log(` ${STATE_ICONS[tool.state] ?? '◯'} ${tool.name}`) } } - } else { - const filtered = allApps.filter((app) => { - if (options.tools) return app.tool - return !app.tool - }) - - for (const app of filtered) { - console.log(`${STATE_ICONS[app.state] ?? '◯'} ${app.name}`) - } } } diff --git a/src/cli/setup.ts b/src/cli/setup.ts index 7f60414..8f53d21 100644 --- a/src/cli/setup.ts +++ b/src/cli/setup.ts @@ -69,7 +69,7 @@ program .command('list') .description('List all apps') .option('-t, --tools', 'show only tools') - .option('-a, --all', 'show all apps including tools') + .option('-a, --apps', 'show only apps (exclude tools)') .action(listApps) program