diff --git a/logfire/_internal/cli/__init__.py b/logfire/_internal/cli/__init__.py index 8ea03b110..f008b01d1 100644 --- a/logfire/_internal/cli/__init__.py +++ b/logfire/_internal/cli/__init__.py @@ -122,6 +122,7 @@ def parse_list_projects(args: argparse.Namespace) -> None: projects = client.get_user_projects() if projects: + sys.stderr.write("List of the projects you have write access to (requires the 'write_token' permission):\n\n") sys.stderr.write( _pretty_table( ['Organization', 'Project'], diff --git a/logfire/_internal/config.py b/logfire/_internal/config.py index cda6b17c7..64dec2501 100644 --- a/logfire/_internal/config.py +++ b/logfire/_internal/config.py @@ -1482,7 +1482,7 @@ def use_existing_project( [f'{index}. {item[0]}/{item[1]}' for index, item in project_choices.items()] ) selected_project_key = Prompt.ask( - f'Please select one of the following projects by number:\n{project_choices_str}\n', + f"Please select one of the following projects by number (requires the 'write_token' permission):\n{project_choices_str}\n", choices=list(project_choices.keys()), default='1', ) diff --git a/tests/test_cli.py b/tests/test_cli.py index d71fcd6ac..ab3c0a0b9 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -500,6 +500,8 @@ def test_projects_list(default_credentials: Path, capsys: pytest.CaptureFixture[ output = capsys.readouterr().err assert output.splitlines() == snapshot( [ + "List of the projects you have write access to (requires the 'write_token' permission):", + '', ' Organization | Project', '----------------|--------', ' test-org | test-pr',