dailybot-cli 1.3.0__tar.gz → 1.4.0__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 (25) hide show
  1. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/PKG-INFO +9 -1
  2. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/README.md +8 -0
  3. dailybot_cli-1.4.0/dailybot_cli/commands/upgrade.py +235 -0
  4. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/main.py +2 -0
  5. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/PKG-INFO +9 -1
  6. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/SOURCES.txt +1 -0
  7. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/pyproject.toml +1 -1
  8. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/LICENSE +0 -0
  9. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/__init__.py +0 -0
  10. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/api_client.py +0 -0
  11. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/__init__.py +0 -0
  12. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/agent.py +0 -0
  13. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/auth.py +0 -0
  14. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/config.py +0 -0
  15. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/interactive.py +0 -0
  16. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/status.py +0 -0
  17. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/update.py +0 -0
  18. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/commands/version.py +0 -0
  19. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/config.py +0 -0
  20. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli/display.py +0 -0
  21. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/dependency_links.txt +0 -0
  22. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/entry_points.txt +0 -0
  23. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/requires.txt +0 -0
  24. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/dailybot_cli.egg-info/top_level.txt +0 -0
  25. {dailybot_cli-1.3.0 → dailybot_cli-1.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dailybot-cli
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: Dailybot CLI - The command-line bridge between humans and agents. Progress reports, observability, and workflow automation for modern teams across Slack, Google Chat, Discord, MS Teams, and more.
5
5
  Author-email: Dailybot <support@dailybot.com>
6
6
  License: MIT
@@ -86,6 +86,14 @@ dailybot version --check
86
86
 
87
87
  `dailybot version --check` is the recommended way to find out whether you should upgrade. If a newer release is available, the output lists the upgrade command for each install method (Homebrew, Linux binary, pipx, pip), so you don't need to remember which channel you used to install in the first place.
88
88
 
89
+ To upgrade, just run:
90
+
91
+ ```bash
92
+ dailybot upgrade
93
+ ```
94
+
95
+ The CLI auto-detects how it was installed and either runs the right upgrade command for you (pipx / uv tool / pip) or prints the exact command you should run yourself (Homebrew, Linux binary, editable dev install). Use `dailybot upgrade --dry-run` to preview without executing.
96
+
89
97
  > **Bug reports?** Always include the full output of `dailybot version` — the install path and Python runtime are usually enough to tell us whether the issue is in the CLI itself, in a transitive dep, or in the host environment.
90
98
 
91
99
  ## For humans
@@ -52,6 +52,14 @@ dailybot version --check
52
52
 
53
53
  `dailybot version --check` is the recommended way to find out whether you should upgrade. If a newer release is available, the output lists the upgrade command for each install method (Homebrew, Linux binary, pipx, pip), so you don't need to remember which channel you used to install in the first place.
54
54
 
55
+ To upgrade, just run:
56
+
57
+ ```bash
58
+ dailybot upgrade
59
+ ```
60
+
61
+ The CLI auto-detects how it was installed and either runs the right upgrade command for you (pipx / uv tool / pip) or prints the exact command you should run yourself (Homebrew, Linux binary, editable dev install). Use `dailybot upgrade --dry-run` to preview without executing.
62
+
55
63
  > **Bug reports?** Always include the full output of `dailybot version` — the install path and Python runtime are usually enough to tell us whether the issue is in the CLI itself, in a transitive dep, or in the host environment.
56
64
 
57
65
  ## For humans
@@ -0,0 +1,235 @@
1
+ """`dailybot upgrade` subcommand — self-update the installed CLI.
2
+
3
+ Auto-detects the installation method (pipx / uv tool / pip / Homebrew /
4
+ PyInstaller binary / editable) and either:
5
+
6
+ - runs the right upgrade command in a subprocess (pipx / uv / pip), or
7
+ - prints the command the user should run themselves (Homebrew / binary /
8
+ editable installs, where invoking the package manager from inside the
9
+ CLI is risky — sudo prompts, locks, dev iteration).
10
+
11
+ The command is intentionally honest about what it can and cannot do
12
+ automatically. Mirrors the design of `bun upgrade` / `deno upgrade` /
13
+ `oh-my-posh upgrade` for cases the CLI controls, and falls back to a
14
+ "copy this command" hint everywhere else.
15
+ """
16
+
17
+ import platform
18
+ import shutil
19
+ import subprocess
20
+ import sys
21
+ from pathlib import Path
22
+
23
+ import click
24
+
25
+ from dailybot_cli import __version__
26
+ from dailybot_cli.commands.version import _fetch_latest_pypi_version
27
+ from dailybot_cli.display import (
28
+ print_error,
29
+ print_info,
30
+ print_success,
31
+ print_warning,
32
+ )
33
+
34
+ _PACKAGE: str = "dailybot-cli"
35
+
36
+ # Install methods we can reliably detect. Each maps to:
37
+ # - a "label" for human-facing output
38
+ # - a list of argv tokens (subprocess.run safe — no shell=True) when we can
39
+ # execute the upgrade ourselves; or `None` if we should print a command
40
+ # and let the user run it.
41
+ # - a "manual command" string for the print-only path.
42
+ _METHOD_LABELS: dict[str, str] = {
43
+ "pipx": "pipx",
44
+ "uv-tool": "uv tool",
45
+ "pip": "pip",
46
+ "homebrew": "Homebrew",
47
+ "binary": "PyInstaller binary",
48
+ "editable": "editable install (development)",
49
+ "unknown": "unknown",
50
+ }
51
+
52
+
53
+ def _resolve_install_path() -> Path:
54
+ """Return the on-disk path of the running `dailybot_cli` package."""
55
+ import dailybot_cli
56
+
57
+ return Path(dailybot_cli.__file__).resolve().parent
58
+
59
+
60
+ def _detect_install_method() -> str:
61
+ """Best-effort detection of how this CLI was installed.
62
+
63
+ Returns one of: pipx, uv-tool, pip, homebrew, binary, editable, unknown.
64
+
65
+ The heuristics inspect the install path's directory components. They
66
+ are deliberately conservative: when in doubt, fall back to "pip" (which
67
+ is always safe to upgrade with `python -m pip install --upgrade ...`).
68
+ """
69
+ # PyInstaller frozen build → can't trivially auto-replace itself.
70
+ if getattr(sys, "frozen", False):
71
+ return "binary"
72
+
73
+ path = _resolve_install_path()
74
+ parts_lower = [p.lower() for p in path.parts]
75
+
76
+ # Editable install: pyproject.toml lives next to the package source.
77
+ if (path.parent / "pyproject.toml").exists():
78
+ return "editable"
79
+
80
+ # Homebrew formulas live under .../Cellar/<formula>/<version>/...
81
+ if "cellar" in parts_lower and any("dailybot" in p for p in parts_lower):
82
+ return "homebrew"
83
+
84
+ # pipx isolated venvs live under .../pipx/venvs/<package>/...
85
+ if "pipx" in parts_lower:
86
+ return "pipx"
87
+
88
+ # uv tool installs live under .../uv/tools/<package>/... (XDG_DATA_HOME)
89
+ # or .../.local/share/uv/tools/<package>/...
90
+ if "uv" in parts_lower and "tools" in parts_lower:
91
+ return "uv-tool"
92
+
93
+ # Generic pip install (system, user-site, or a regular venv).
94
+ return "pip"
95
+
96
+
97
+ def _build_upgrade_argv(method: str) -> list[str] | None:
98
+ """Return argv for `subprocess.run` to perform the upgrade, or None.
99
+
100
+ `None` means "we don't auto-run for this method — print the command
101
+ instead". `homebrew`, `binary`, `editable`, and `unknown` fall in
102
+ that category for safety reasons documented above.
103
+ """
104
+ if method == "pipx":
105
+ # `pipx` itself drives the venv — no need to find it manually.
106
+ if shutil.which("pipx"):
107
+ return ["pipx", "upgrade", _PACKAGE]
108
+ # pipx not on PATH but maybe the package was installed via
109
+ # `python -m pipx`. Try that as a fallback.
110
+ return [sys.executable, "-m", "pipx", "upgrade", _PACKAGE]
111
+
112
+ if method == "uv-tool":
113
+ if shutil.which("uv"):
114
+ return ["uv", "tool", "upgrade", _PACKAGE]
115
+ return None # uv not findable — bail to "manual" path
116
+
117
+ if method == "pip":
118
+ # Use the same Python that's running the CLI. Reliable across venvs.
119
+ return [sys.executable, "-m", "pip", "install", "--upgrade", _PACKAGE]
120
+
121
+ return None # homebrew, binary, editable, unknown
122
+
123
+
124
+ def _manual_command_hint(method: str) -> str:
125
+ """Human-readable upgrade command for methods we don't auto-run."""
126
+ if method == "homebrew":
127
+ return "brew update && brew upgrade dailybot"
128
+ if method == "binary":
129
+ if platform.system() == "Windows":
130
+ return "irm https://cli.dailybot.com/install.ps1 | iex"
131
+ return "curl -sSL https://cli.dailybot.com/install.sh | bash"
132
+ if method == "editable":
133
+ return "git pull # then 'pip install -e .' if dependencies changed"
134
+ if method == "uv-tool":
135
+ return "uv tool upgrade dailybot-cli"
136
+ return f"pip install --upgrade {_PACKAGE}"
137
+
138
+
139
+ def _print_status(current: str, latest: str | None) -> None:
140
+ """Print the version status header common to all paths."""
141
+ print_info(f"Current version: {current}")
142
+ if latest is None:
143
+ print_warning("Could not reach PyPI to check for the latest version.")
144
+ return
145
+ if latest == current:
146
+ print_info(f"Latest version: {latest}")
147
+ return
148
+ print_info(f"Latest version: {latest} (update available)")
149
+
150
+
151
+ @click.command(name="upgrade")
152
+ @click.option(
153
+ "--dry-run",
154
+ is_flag=True,
155
+ default=False,
156
+ help="Print the upgrade command but do not execute it.",
157
+ )
158
+ @click.option(
159
+ "--force",
160
+ is_flag=True,
161
+ default=False,
162
+ help="Run the upgrade even when already on the latest version.",
163
+ )
164
+ def upgrade(dry_run: bool, force: bool) -> None:
165
+ """Upgrade the Dailybot CLI to the latest version on PyPI.
166
+
167
+ \b
168
+ Auto-detects how the CLI was installed and runs the right upgrade
169
+ command. For installs managed by an external tool (Homebrew, the
170
+ Linux/Windows binary installers, editable dev installs), the command
171
+ you should run is printed instead — running those automatically is
172
+ risky (sudo prompts, file locks, dev iteration).
173
+
174
+ \b
175
+ Examples:
176
+ dailybot upgrade # check + upgrade if newer is available
177
+ dailybot upgrade --dry-run # show what would happen, do nothing
178
+ dailybot upgrade --force # reinstall even if already latest
179
+ """
180
+ print_info("Checking PyPI for the latest version...")
181
+ latest: str | None = _fetch_latest_pypi_version()
182
+ _print_status(current=__version__, latest=latest)
183
+
184
+ if latest == __version__ and not force:
185
+ print_success("You're already on the latest version. Nothing to do.")
186
+ return
187
+
188
+ method: str = _detect_install_method()
189
+ label: str = _METHOD_LABELS.get(method, method)
190
+ install_path: Path = _resolve_install_path()
191
+ print_info(f"Install method: {label} ({install_path})")
192
+
193
+ if method == "editable":
194
+ print_warning(
195
+ "This is an editable (development) install. "
196
+ "Refusing to auto-upgrade — manage it with git instead:"
197
+ )
198
+ click.echo(f"\n {_manual_command_hint(method)}\n")
199
+ return
200
+
201
+ argv: list[str] | None = _build_upgrade_argv(method)
202
+
203
+ if argv is None:
204
+ # Methods we don't auto-run: homebrew, binary, uv-tool-not-found, unknown.
205
+ print_warning(
206
+ f"This is a {label} install. We don't run the package manager "
207
+ "automatically; run this command yourself:"
208
+ )
209
+ click.echo(f"\n {_manual_command_hint(method)}\n")
210
+ return
211
+
212
+ pretty_cmd: str = " ".join(argv)
213
+ if dry_run:
214
+ click.echo(f"\nWould run: {pretty_cmd}\n")
215
+ return
216
+
217
+ print_info(f"Running: {pretty_cmd}")
218
+ click.echo() # blank line so the subprocess output is easy to scan
219
+ try:
220
+ subprocess.run(argv, check=True)
221
+ except subprocess.CalledProcessError as exc:
222
+ print_error(
223
+ f"Upgrade command failed with exit code {exc.returncode}. "
224
+ f"You can try running it manually:\n {pretty_cmd}"
225
+ )
226
+ raise SystemExit(exc.returncode)
227
+ except FileNotFoundError:
228
+ print_error(
229
+ f"Could not find the executable for {label}. "
230
+ f"Try the manual command:\n {_manual_command_hint(method)}"
231
+ )
232
+ raise SystemExit(1)
233
+
234
+ click.echo()
235
+ print_success("Upgrade complete. Run 'dailybot --version' to confirm.")
@@ -11,6 +11,7 @@ from dailybot_cli.commands.config import config
11
11
  from dailybot_cli.commands.interactive import run_interactive
12
12
  from dailybot_cli.commands.status import status
13
13
  from dailybot_cli.commands.update import update
14
+ from dailybot_cli.commands.upgrade import upgrade
14
15
  from dailybot_cli.commands.version import version
15
16
  from dailybot_cli.config import set_api_url_override
16
17
 
@@ -64,6 +65,7 @@ cli.add_command(status)
64
65
  cli.add_command(agent)
65
66
  cli.add_command(config)
66
67
  cli.add_command(version)
68
+ cli.add_command(upgrade)
67
69
 
68
70
 
69
71
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dailybot-cli
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: Dailybot CLI - The command-line bridge between humans and agents. Progress reports, observability, and workflow automation for modern teams across Slack, Google Chat, Discord, MS Teams, and more.
5
5
  Author-email: Dailybot <support@dailybot.com>
6
6
  License: MIT
@@ -86,6 +86,14 @@ dailybot version --check
86
86
 
87
87
  `dailybot version --check` is the recommended way to find out whether you should upgrade. If a newer release is available, the output lists the upgrade command for each install method (Homebrew, Linux binary, pipx, pip), so you don't need to remember which channel you used to install in the first place.
88
88
 
89
+ To upgrade, just run:
90
+
91
+ ```bash
92
+ dailybot upgrade
93
+ ```
94
+
95
+ The CLI auto-detects how it was installed and either runs the right upgrade command for you (pipx / uv tool / pip) or prints the exact command you should run yourself (Homebrew, Linux binary, editable dev install). Use `dailybot upgrade --dry-run` to preview without executing.
96
+
89
97
  > **Bug reports?** Always include the full output of `dailybot version` — the install path and Python runtime are usually enough to tell us whether the issue is in the CLI itself, in a transitive dep, or in the host environment.
90
98
 
91
99
  ## For humans
@@ -19,4 +19,5 @@ dailybot_cli/commands/config.py
19
19
  dailybot_cli/commands/interactive.py
20
20
  dailybot_cli/commands/status.py
21
21
  dailybot_cli/commands/update.py
22
+ dailybot_cli/commands/upgrade.py
22
23
  dailybot_cli/commands/version.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dailybot-cli"
7
- version = "1.3.0"
7
+ version = "1.4.0"
8
8
  description = "Dailybot CLI - The command-line bridge between humans and agents. Progress reports, observability, and workflow automation for modern teams across Slack, Google Chat, Discord, MS Teams, and more."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes