a2aproject / a2aproject/a2a-rs

a2acli: completion <shell> command

Open
#182 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
75
Forks
19
Avg merge
11h 27m
Merged PRs (30d)
21

Description

Part of #181 (Tier 2).

## Summary

`A2ACLI_CLI_002` (Tier 2) requires a `completion ` command that emits a shell completion script for the named shell (§7.1).

`a2acli` has no such command. The canonical Go CLI gets this for free — cobra registers a default `completion` command — which is why it does not appear in its `internal/cli/`. clap does not, so this needs the `clap_complete` crate.

## Why

It is the cheapest requirement in the tier and the one a person at a terminal notices first. `a2acli`'s surface is deep (`task push-config create --auth-scheme …`), which is precisely the shape that is unpleasant to type without completion.

## Scope

- [ ] Add `clap_complete` and a `completion ` subcommand covering at least bash, zsh, fish and PowerShell, matching the shells cobra's default command supports.
- [ ] Emit the script on **stdout** and nothing else — the output is meant to be redirected to a file or `eval`'d, so a diagnostic on stdout would corrupt it (§11.1).
- [ ] An unsupported shell name is a usage error (exit 2) with the accepted values named.
- [ ] `completion` takes no agent and performs no network call: it must work with no agent configured at all, so it MUST NOT resolve an Agent Card. Same for `--help` and `--version`.
- [ ] `-o json` has no meaning here; the script is emitted regardless of output mode rather than wrapped.
- [ ] Document it in `a2acli/README.md` with the per-shell install line.
- [ ] Tests: each supported shell emits a non-empty script on stdout with empty stderr and exit 0; an unknown shell exits 2.

## Requirements closed

| ID | Requirement |
| --- | --- |
| `A2ACLI_CLI_002` | `completion ` — emits a shell completion script for the named shell (§7.1) |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.