bunq-cli 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {bunq_cli-0.2.0/src/bunq_cli.egg-info → bunq_cli-0.2.1}/PKG-INFO +1 -1
  2. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/login.py +2 -2
  3. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/profiles.py +4 -4
  4. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/main.py +35 -2
  5. {bunq_cli-0.2.0 → bunq_cli-0.2.1/src/bunq_cli.egg-info}/PKG-INFO +1 -1
  6. bunq_cli-0.2.1/src/bunq_cli.egg-info/scm_version.json +8 -0
  7. bunq_cli-0.2.0/src/bunq_cli.egg-info/scm_version.json +0 -8
  8. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/.github/workflows/release.yml +0 -0
  9. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/.gitignore +0 -0
  10. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/LICENSE +0 -0
  11. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/README.md +0 -0
  12. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/accounts.md +0 -0
  13. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/callbacks.md +0 -0
  14. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/cards.md +0 -0
  15. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/getting-started.md +0 -0
  16. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/payment-requests.md +0 -0
  17. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/docs/payments.md +0 -0
  18. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/pyproject.toml +0 -0
  19. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/setup.cfg +0 -0
  20. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/__init__.py +0 -0
  21. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/client.py +0 -0
  22. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/__init__.py +0 -0
  23. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/accounts.py +0 -0
  24. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/bunqme.py +0 -0
  25. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/callbacks.py +0 -0
  26. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/cards.py +0 -0
  27. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/drafts.py +0 -0
  28. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/events.py +0 -0
  29. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/oauth_client.py +0 -0
  30. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/payments.py +0 -0
  31. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/requests.py +0 -0
  32. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/sandbox.py +0 -0
  33. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/scheduled.py +0 -0
  34. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/commands/statements.py +0 -0
  35. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/config.py +0 -0
  36. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/oauth.py +0 -0
  37. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli/output.py +0 -0
  38. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/SOURCES.txt +0 -0
  39. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/dependency_links.txt +0 -0
  40. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/entry_points.txt +0 -0
  41. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/requires.txt +0 -0
  42. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/scm_file_list.json +0 -0
  43. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/src/bunq_cli.egg-info/top_level.txt +0 -0
  44. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/__init__.py +0 -0
  45. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/conftest.py +0 -0
  46. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_cli.py +0 -0
  47. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_commands/__init__.py +0 -0
  48. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_config.py +0 -0
  49. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_oauth.py +0 -0
  50. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_output.py +0 -0
  51. {bunq_cli-0.2.0 → bunq_cli-0.2.1}/tests/test_profiles.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bunq-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Command-line interface for the Bunq API
5
5
  Author-email: Koert van der Veer <koert@ondergetekende.nl>
6
6
  License-Expression: MIT
@@ -17,7 +17,7 @@ from bunq_cli.config import (
17
17
  set_profile,
18
18
  validate_profile_name,
19
19
  )
20
- from bunq_cli.main import Context, pass_context
20
+ from bunq_cli.main import Context, complete_profile, pass_context
21
21
  from bunq_cli.oauth import oauth_login
22
22
 
23
23
 
@@ -112,7 +112,7 @@ def login(
112
112
 
113
113
 
114
114
  @click.command()
115
- @click.option("--profile", "profile_name", default=None, help="Profile to log out (default: the selected profile).")
115
+ @click.option("--profile", "profile_name", default=None, shell_complete=complete_profile, help="Profile to log out (default: the selected profile).")
116
116
  @click.option("--all", "all_profiles", is_flag=True, help="Log out of every profile.")
117
117
  @pass_context
118
118
  def logout(ctx: Context, profile_name: str | None, all_profiles: bool) -> None:
@@ -12,7 +12,7 @@ from bunq_cli.config import (
12
12
  save_config,
13
13
  validate_profile_name,
14
14
  )
15
- from bunq_cli.main import Context, pass_context
15
+ from bunq_cli.main import Context, complete_profile, pass_context
16
16
  from bunq_cli.output import echo_output
17
17
 
18
18
 
@@ -42,7 +42,7 @@ def list_profiles(ctx: Context) -> None:
42
42
 
43
43
 
44
44
  @profiles.command("use")
45
- @click.argument("name")
45
+ @click.argument("name", shell_complete=complete_profile)
46
46
  @pass_context
47
47
  def use_profile(ctx: Context, name: str) -> None:
48
48
  """Set the default profile."""
@@ -55,7 +55,7 @@ def use_profile(ctx: Context, name: str) -> None:
55
55
 
56
56
 
57
57
  @profiles.command("rename")
58
- @click.argument("old")
58
+ @click.argument("old", shell_complete=complete_profile)
59
59
  @click.argument("new")
60
60
  @pass_context
61
61
  def rename_profile(ctx: Context, old: str, new: str) -> None:
@@ -76,7 +76,7 @@ def rename_profile(ctx: Context, old: str, new: str) -> None:
76
76
 
77
77
 
78
78
  @profiles.command("set")
79
- @click.argument("name")
79
+ @click.argument("name", shell_complete=complete_profile)
80
80
  @click.option("--read-only/--read-write", default=None, help="Block or allow commands that change data.")
81
81
  @pass_context
82
82
  def set_profile_options(ctx: Context, name: str, read_only: bool | None) -> None:
@@ -17,7 +17,7 @@ from bunq_cli.config import (
17
17
  from bunq_cli.output import format_output
18
18
 
19
19
  # Commands that manage profiles/credentials themselves and make no sense per profile.
20
- SINGLE_PROFILE_COMMANDS = {"login", "logout", "profiles", "sandbox", "oauth-client"}
20
+ SINGLE_PROFILE_COMMANDS = {"login", "logout", "profiles", "sandbox", "oauth-client", "completion"}
21
21
 
22
22
 
23
23
  class Context:
@@ -121,6 +121,15 @@ def _run_for_all_profiles(ctx: Context) -> None:
121
121
  click_ctx.exit(1 if failed else 0)
122
122
 
123
123
 
124
+ def complete_profile(ctx: click.Context, param: click.Parameter, incomplete: str) -> list[str]:
125
+ config_path = ctx.find_root().params.get("config_path") or DEFAULT_CONFIG_PATH
126
+ try:
127
+ profiles = load_config(config_path).get("profiles", {})
128
+ except Exception: # never break the shell over a bad config
129
+ return []
130
+ return [name for name in profiles if name.startswith(incomplete)]
131
+
132
+
124
133
  @click.group(cls=_CliGroup)
125
134
  @click.version_option(package_name="bunq-cli", prog_name="bunq")
126
135
  @click.option("-v", "--verbose", is_flag=True, help="Enable verbose output.")
@@ -142,7 +151,14 @@ def _run_for_all_profiles(ctx: Context) -> None:
142
151
  help="Custom config file path.",
143
152
  )
144
153
  @click.option("--sandbox", is_flag=True, help="Use the sandbox environment.")
145
- @click.option("-p", "--profile", envvar="BUNQ_PROFILE", default=None, help="Profile (client) to use. Env: BUNQ_PROFILE.")
154
+ @click.option(
155
+ "-p",
156
+ "--profile",
157
+ envvar="BUNQ_PROFILE",
158
+ default=None,
159
+ shell_complete=complete_profile,
160
+ help="Profile (client) to use. Env: BUNQ_PROFILE.",
161
+ )
146
162
  @click.option("--all-profiles", is_flag=True, help="Run a read-only command for every profile.")
147
163
  @pass_context
148
164
  def cli(
@@ -177,6 +193,23 @@ def cli(
177
193
  _run_for_all_profiles(ctx)
178
194
 
179
195
 
196
+ @cli.command()
197
+ @click.argument("shell", type=click.Choice(["bash", "zsh", "fish"]))
198
+ def completion(shell: str) -> None:
199
+ """Print the shell completion script for SHELL.
200
+
201
+ \b
202
+ Install it with:
203
+ bash: echo 'eval "$(bunq completion bash)"' >> ~/.bashrc
204
+ zsh: echo 'eval "$(bunq completion zsh)"' >> ~/.zshrc
205
+ fish: bunq completion fish > ~/.config/fish/completions/bunq.fish
206
+ """
207
+ from click.shell_completion import get_completion_class
208
+
209
+ comp_cls = get_completion_class(shell)
210
+ click.echo(comp_cls(cli, {}, "bunq", "_BUNQ_COMPLETE").source())
211
+
212
+
180
213
  # Register commands
181
214
  from bunq_cli.commands.login import login, logout # noqa: E402
182
215
  from bunq_cli.commands.accounts import accounts # noqa: E402
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bunq-cli
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Command-line interface for the Bunq API
5
5
  Author-email: Koert van der Veer <koert@ondergetekende.nl>
6
6
  License-Expression: MIT
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.2.1",
3
+ "distance": 0,
4
+ "node": "g04f755243287ac5c5e0628bbd81fd07457292f55",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-29"
8
+ }
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.2.0",
3
- "distance": 0,
4
- "node": "g31e8ff0fce9cce9357bed94c70f556df6bd91567",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-27"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes