Page MenuHomePhabricator

[logs-cli] add a `--first` flag, or replace `--latest` with `--lines`
Closed, InvalidPublic

Description

This will allow showing only certain lines, without having to aggregate all of them first before presenting to the user (memory in the bastion is quite limited).

It would be similar to | tail and | head, but implementing it on the client side might allow some performance/memory savings.

Note that currently we only allow --latest that gets you the newest logs.

The API implements lines (see https://api-docs.toolforge.org/docs#/Logs/logs_get_tool_logs).

Event Timeline

dcaro triaged this task as High priority.Sep 14 2026, 4:21 PM
dcaro moved this task from Backlog to Todos on the tools-platform-team board.
dcaro added a project: OKR-Work.
dcaro moved this task from Todos to Done on the tools-platform-team board.

there's no task needed anymore

I think this would still be a nice feature to have, although it shouldn't block the current hypothesis and could be implemented later.

The --lines and --direction options that are already implemented are fine, but are not covering all the use cases: it is currently not possible to show the last X lines, ordered oldest-to-newest.

Maybe we can reopen this, but do it at the API level?

there's no task needed anymore

I think this would still be a nice feature to have, although it shouldn't block the current hypothesis and could be implemented later.

The --lines and --direction options that are already implemented are fine, but are not covering all the use cases: it is currently not possible to show the last X lines, ordered oldest-to-newest.

Maybe we can reopen this, but do it at the API level?

Yep, please add comments here T434093: Establish design principles for parity between interfaces (CLI vs REST API)