apache / apache/pulsar

pulsar-shell persistent modes

Open
#21,194 1 comment 0 reactions 0 assignees View on GitHub
help wanted Stale type/enhancement
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Motivation

Using pulsar-shell interactively, it's kind of a pain to prefix everything with`admin`. I think it would be nice if the command accepted `admin` and `client` on their own as special commands that put the command into that mode with an implicit prefix.

### Solution

Allow `admin` and `client`, when passed on their own to enter into admin or client mode respectively, with the addition of one more command `exitmode` to return to the base state. These modes would not persist between sessions.

```
configname(hostname)> admin
configname(hostname) admin> help
Usage: pulsar-admin [options] [command] [command options]
Options:
--admin-url
Admin Service URL to which to connect.
Default: https://pulsar.eks.intel.cs.sys:443

namespaces Operations about namespaces
Usage: namespaces [options]

configname(hostname) admin> exitmode
configname(hostname)>
```

### Alternatives

_No response_

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start at the pulsar-shell command handling for interactive input, then trace how the admin and client prefixes are currently processed. Add admin and client modes plus exitmode, preserving the shown prompt and ensuring modes reset between sessions. Verify the interactive behavior manually using the example commands in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.