---
id: TASK-2
title: Add `profiles` command to list configured profiles
status: Done
assignee: []
created_date: '2026-01-29 18:13'
updated_date: '2026-01-29 18:28'
labels: []
dependencies: []
references:
  - lua/zync/api.lua
  - lua/zync/api/commands/commands.lua
  - lua/zync/api/manager.lua
  - lua/zync/api/configurator.lua
  - spec/zync_spec.lua
  - spec/api_spec/commands_spec.lua
  - README.md
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Introduce a new `profiles`/`p` command, similar to `boards`/`runners`, that lists configured profiles from zconf.lua. If no profiles are configured, emit the same message used by profile status logging for profile-less projects.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 New CLI command `profiles` (shorthand `p`) is available and documented in help/README
- [x] #2 When profiles are configured, the command lists profile names in deterministic order (as defined in zconf.lua) and exits 0
- [x] #3 When profiles are not configured, the command prints `No profiles configured - project configured in profile-less mode` and exits 0
- [x] #4 Command works from project root or build dir (including build/<profile>) without breaking existing commands
- [x] #5 Tests added/updated to cover configured and non-configured project cases
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added new `profiles`/`p` command to list configured profiles, preserving zconf order via `config.profile_order`. Implemented manager handler that prints the profile list or the profile‑less message when no profiles are configured. Updated README to document the command, ordering, and message text. Added tests for command registration and manager output; `busted` passes.
<!-- SECTION:FINAL_SUMMARY:END -->
