-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor CLI with Cyclopts, split models/services, add stats & docs — 1.0.0 stable #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2578d12
Refactor CLI with Cyclopts, split models/services, add stats & docs
dcode 09c3808
remove deprecated shim methods before 1.0.0 stable release
dcode e03a7f0
docs: update for 1.0.0 stable release
dcode e0f34ca
ci: fix pwn-request vulnerability in dependabot lock workflow
dcode 3ba044d
chore: Final polish for 1.0.0 release
dcode 8c9913c
chore: merge main into PR branch and resolve conflicts
dcode c698ff8
chore: Restore documentation updates lost in merge
dcode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: "Dependabot: Commit uv.lock" | ||
| # Privileged companion to dependabot-uv-lock.yml. | ||
| # Triggered only after the unprivileged lock workflow succeeds. Downloads the | ||
| # artifact produced there and commits it to the PR branch. No untrusted code | ||
| # from the PR is executed here — only git operations on a known-good artifact. | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| workflow_run: | ||
| workflows: ["Dependabot: Update uv.lock"] | ||
| types: [completed] | ||
| jobs: | ||
| commit: | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.actor.login == 'dependabot[bot]' | ||
|
|
||
| permissions: | ||
| contents: write | ||
| steps: | ||
| # Checkout by exact SHA so we commit on top of what the lock job saw. | ||
| - name: Checkout PR branch at workflow HEAD SHA | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} | ||
| token: ${{ secrets.DEPENDABOT_PAT }} | ||
| # Download after checkout so the artifact lands directly in the workspace, | ||
| # overwriting the existing uv.lock with the freshly-generated one. | ||
| # Push target is passed via env to avoid shell-injection from branch names. | ||
| - name: Download uv.lock artifact | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: uv-lock | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Commit and push changes | ||
| env: | ||
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git add uv.lock | ||
|
|
||
| if ! git diff --staged --quiet; then | ||
| git commit -m "chore(dependabot): synchronize uv.lock" | ||
| git push origin "HEAD:${HEAD_BRANCH}" | ||
| else | ||
| echo "uv.lock is already up to date." | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to | ||
| [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [1.0.0] - 2026-02-23 | ||
|
|
||
| ### Breaking Changes | ||
|
|
||
| - Removed deprecated shim methods from `PrusaConnectClient` that were present in | ||
| the alpha releases. The service-based API is now the sole public interface: | ||
|
|
||
| | Removed method | Replacement | | ||
| | -------------------------------- | ----------------------------------------- | | ||
| | `client.get_printers()` | `client.printers.list_printers()` | | ||
| | `client.get_printer(uuid)` | `client.printers.get(uuid)` | | ||
| | `client.get_cameras()` | `client.cameras.list()` | | ||
| | `client.get_teams()` | `client.teams.list_teams()` | | ||
| | `client.get_team(id)` | `client.teams.get(id)` | | ||
| | `client.send_command(uuid, cmd)` | `client.printers.send_command(uuid, cmd)` | | ||
|
|
||
| ### Added | ||
|
|
||
| - **Service-based API:** Resources are now accessed through dedicated service | ||
| objects on the client — `client.printers`, `client.cameras`, `client.teams`, | ||
| `client.files`, `client.jobs`, and `client.stats`. | ||
| - **`prusactl` CLI** with full subcommand coverage: `printer`, `camera`, `team`, | ||
| `job`, `file`, `stats`, and `auth`. | ||
| - **Statistics service** (`client.stats`) for per-printer material usage, print | ||
| time, planned tasks, and job success metrics. | ||
| - **Printer command discovery** — `client.printers.get_supported_commands(uuid)` | ||
| with optional disk caching and TTL. | ||
| - **Validated command execution** — `client.execute_printer_command()` validates | ||
| arguments against the printer's reported command schema before sending. | ||
| - **Camera Signal.IO signaling client** (`PrusaCameraClient`) for pan/tilt | ||
| control and image adjustment via the Prusa signaling protocol. | ||
| - **G-code metadata parser** (`client.validate_gcode(path)`) for pre-flight | ||
| checks before uploading. | ||
| - **Persistent credential caching** — CLI credentials are stored in the platform | ||
| config directory and auto-loaded by the SDK. | ||
| - **CLI output format control** — the `--format` global flag selects between | ||
| `rich` (coloured tables; default when stdout is a TTY), `plain` | ||
| (tab-separated text with no ANSI escapes or table borders; default when | ||
| stdout is not a TTY), and `json` (JSON array per table to stdout, all status | ||
| messages to stderr). | ||
| - The active format can also be set via the `output_format` key in `config.json` | ||
| or the `PRUSACTL_OUTPUT_FORMAT` environment variable; the priority is: CLI | ||
| flag → env var → config file → TTY auto-detect. | ||
|
|
||
| ### Changed | ||
|
|
||
| - CLI rewritten with [Cyclopts](https://github.com/BrianPugh/cyclopts) for | ||
| richer help output and `--verbose` / `--debug` global flags. | ||
| - Pydantic models split into focused submodules under | ||
| `prusa.connect.client.models`. | ||
| - `AppConfig` is now fetched at client init time to validate that the server | ||
| supports the `PRUSA_AUTH` backend. | ||
|
|
||
| ## [1.0.0a2] - 2025-01-13 | ||
|
|
||
| ### Changed | ||
|
|
||
| - Refactored CLI to use Cyclopts; split monolithic models into service modules; | ||
| added stats commands and documentation site. | ||
|
|
||
| ## [1.0.0a0] - Initial alpha release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../LICENSE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ | |
| ``` | ||
| """ | ||
|
|
||
| __version__ = "1.0.0a2" | ||
| __version__ = "1.0.0" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.