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'],