From e90c185e60ecee98da8e4f3cbc6db28c0e05f025 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Tue, 9 Jun 2026 11:23:06 +0200 Subject: [PATCH] feat(cli): add `ls` alias for the list command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `agent-tty ls` now resolves to `agent-tty list`. Like the `d`→`dashboard` alias, it is an explicit Commander alias (not prefix matching), so it resolves unambiguously to `list` and never collides with other commands. Change-Id: Id0acb444de05e1bf96bc3d8c3f18b86c62661527 Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Thomas Kosiewski --- CHANGELOG.md | 4 ++++ src/cli/main.ts | 1 + test/integration/cli.test.ts | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1f42d8..afb15c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Added + +- `agent-tty ls` is now a short alias for `agent-tty list`. Like the `d`→`dashboard` alias, it is an explicit alias (not prefix matching), so it resolves unambiguously to `list` and is unaffected by the other commands ([#135](https://github.com/coder/agent-tty/pull/135)). + ## [v0.4.0] - 2026-06-08 ### Added diff --git a/src/cli/main.ts b/src/cli/main.ts index e2ebd2f..cd93f59 100644 --- a/src/cli/main.ts +++ b/src/cli/main.ts @@ -354,6 +354,7 @@ async function main(): Promise { program .command('list') + .alias('ls') .description('List sessions') .option('--all', 'Include exited sessions', false) .option('--json', 'Emit a JSON command envelope', false) diff --git a/test/integration/cli.test.ts b/test/integration/cli.test.ts index 0e62b70..c97b5dd 100644 --- a/test/integration/cli.test.ts +++ b/test/integration/cli.test.ts @@ -197,6 +197,16 @@ describe('CLI integration', () => { ); }); + it('resolves the `ls` alias to the list command', () => { + // `--help` exits before the action runs, so this exercises alias + // resolution without touching the Home Registry or reconciling sessions. + const result = runCli(['ls', '--help'], testEnv()); + + expect(result.status).toBe(0); + expect(result.stderr).toBe(''); + expect(result.stdout).toContain('List sessions'); + }); + it('accepts --append-newline for type', () => { const result = runCli( ['type', 'session-01', 'hello', '--append-newline', '--json'],