Skip to content

Feat/cli - #14

Merged
sudoping01 merged 5 commits into
mainfrom
feat/cli
Jul 26, 2026
Merged

Feat/cli#14
sudoping01 merged 5 commits into
mainfrom
feat/cli

Conversation

@sudoping01

@sudoping01 sudoping01 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Description

Adds a djelia command-line interface to the SDK, built with typer and rich, and rewrites the README to document it alongside a restyled, official-SDK-style layout.

Related Issue(s)

None

Changes Made

  • Added a new djelia CLI exposing languages, translate, transcribe, speak, and version commands
  • CLI accepts friendly language names or raw codes, reads text from stdin, and surfaces auth/config errors cleanly instead of raw tracebacks
  • Registered the djelia=djelia.cli:app console script entry point and a cli extra (typer, rich) in setup.py
  • Rewrote README.md in the official-SDK layout, adding a full CLI section covering every command

Testing

  • Describe how you tested your changes (e.g. ran python -m cookbook, manually exercised each CLI command against a live/staging API key)
  • Confirm that all tests pass and no linting errors exist (./fix-code.sh)

Checklist

  • Code follows style guidelines (ruff, isort, and optionally black)
  • Tests added or updated in the cookbook module
  • Documentation updated (README.md)
  • All tests pass (python -m cookbook)
  • No linting errors (ruff check . and isort . --check-only)

Additional Notes

None

Tag @sudoping01 for review. Thanks for contributing to Djelia Python SDK! ❤️🇲🇱

Summary by CodeRabbit

  • New Features

    • Added a command-line interface for listing languages, translating text, transcribing audio, synthesizing speech, streaming results, and viewing version information.
    • Added support for API key and base URL configuration through command-line options or environment variables.
    • Added readable tables, panels, and standardized error messages for CLI output.
  • Documentation

    • Reworked the README into concise SDK documentation covering installation, synchronous and asynchronous usage, streaming, resources, errors, CLI commands, versioning, and contributing.

New 'djelia' command exposing languages, translate, transcribe, speak, and version. Accepts friendly language names or raw codes, reads text from stdin, and surfaces auth/config errors cleanly instead of raw tracebacks.
Add the console_scripts entry point 'djelia=djelia.cli:app' and a 'cli' extra installing typer and rich.
Rewrite the README in the official-SDK layout and add a command-line interface section covering every command.
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@sudoping01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24faaf50-9963-4fa4-9698-5b3eebc36a02

📥 Commits

Reviewing files that changed from the base of the PR and between 2855834 and 4ec63f6.

📒 Files selected for processing (2)
  • README.md
  • djelia/cli.py
📝 Walkthrough

Walkthrough

The pull request adds a Typer/Rich CLI for core SDK operations, configures its optional dependencies and console entry point, and replaces the workshop README with concise documentation for SDK usage, streaming, versions, errors, CLI workflows, and contribution guidance.

Changes

CLI and documentation

Layer / File(s) Summary
CLI foundation and packaging
djelia/cli.py, setup.py
Defines the Typer application, shared state, input and version resolvers, client initialization, standardized failures, stdin support, CLI dependencies, and the djelia console command.
SDK operation commands
djelia/cli.py
Adds language listing, translation, transcription, speech synthesis, streaming output, audio reporting, and SDK/API version commands.
SDK usage documentation
README.md
Replaces the workshop content with installation, sync/async usage, streaming, resources, version management, parallel operations, error handling, CLI, cookbook, and contribution sections.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant TyperCLI
  participant DjeliaSDK
  participant DjeliaAPI
  participant RichConsole
  User->>TyperCLI: invoke command and options
  TyperCLI->>DjeliaSDK: resolve inputs and call SDK operation
  DjeliaSDK->>DjeliaAPI: send translation, transcription, or speech request
  DjeliaAPI-->>DjeliaSDK: return result or stream
  DjeliaSDK-->>TyperCLI: return SDK result or chunks
  TyperCLI->>RichConsole: render command output
  RichConsole-->>User: display results or progress
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague to convey the primary change and reads like a shorthand label rather than a meaningful summary. Use a concise, descriptive title such as "Add Typer-based CLI for the Djelia SDK".
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template structure and covers the CLI, packaging, README changes, testing, checklist, and notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@djelia/cli.py`:
- Around line 309-316: Validate the stream/version combination in the CLI flow
before calling get_client() or _speak_stream: when stream is enabled with
Versions.v1, raise a clear CLI error indicating that streaming is supported only
for v2. Preserve the existing v2 streaming and non-streaming behavior.
- Line 12: Remove the unused List symbol from the typing import in cli.py, while
retaining Optional if it is still used.

In `@README.md`:
- Line 100: Update the README sentence describing synchronous and asynchronous
client equivalence to qualify streaming usage: explain that streaming examples
require async for in addition to await, while preserving the existing claim for
other examples and aligning with the following iteration example.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a959c27-14ad-4ee7-ac98-4e6eb882606c

📥 Commits

Reviewing files that changed from the base of the PR and between f96aa3d and 2855834.

📒 Files selected for processing (3)
  • README.md
  • djelia/cli.py
  • setup.py

Comment thread djelia/cli.py Outdated
Comment thread djelia/cli.py
Comment thread README.md Outdated
sudoping01 and others added 2 commits July 26, 2026 18:46
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sudoping01
sudoping01 merged commit 9c30cdb into main Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant