-
Notifications
You must be signed in to change notification settings - Fork 168
Add workflow cli #613
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
Open
giordano-lucas
wants to merge
6
commits into
main
Choose a base branch
from
add-workflow-cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add workflow cli #613
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2f56289
add notte cli
giordano-lucas cb1655f
simplfy code
giordano-lucas 0424ba7
add benchmark // and server url dectection
giordano-lucas a7dd8ed
improve few stuff
giordano-lucas fa8d53f
remove mfa coed
giordano-lucas a2c2df4
simplify cli
giordano-lucas 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
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 |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Notte Workflow CLI | ||
|
|
||
| Manage Notte workflow lifecycle from the command line. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| notte workflow [--workflow-path FILE] COMMAND [OPTIONS] | ||
| ``` | ||
|
|
||
| ## Commands | ||
|
|
||
| ### Create | ||
| ```bash | ||
| notte workflow --workflow-path my_workflow.py create | ||
| ``` | ||
|
|
||
| ### Update | ||
| ```bash | ||
| notte workflow --workflow-path my_workflow.py update | ||
| ``` | ||
|
|
||
| ### Run | ||
| ```bash | ||
| # Run locally | ||
| notte workflow --workflow-path my_workflow.py run --local | ||
|
|
||
| # Run on cloud | ||
| notte workflow --workflow-path my_workflow.py run --variables vars.json | ||
| ``` | ||
|
|
||
| ### Benchmark | ||
| ```bash | ||
| # Run 10 iterations locally | ||
| notte workflow --workflow-path my_workflow.py benchmark --local --iterations 10 | ||
|
|
||
| # Run on cloud with parallelism | ||
| notte workflow --workflow-path my_workflow.py benchmark --iterations 50 --parallelism 4 | ||
| ``` | ||
|
|
||
| ## Auto-Detection | ||
|
|
||
| When running from a workflow file, `--workflow-path` is optional: | ||
|
|
||
| ```python | ||
| # my_workflow.py | ||
| from notte_sdk import NotteClient, workflow_cli | ||
|
|
||
| def run(url: str) -> str: | ||
| # ... workflow code ... | ||
| return result | ||
|
|
||
| if __name__ == "__main__": | ||
| workflow_cli() # Enables CLI commands | ||
| ``` | ||
|
|
||
| ```bash | ||
| # These work without --workflow-path | ||
| python my_workflow.py create | ||
| python my_workflow.py run --local | ||
| python my_workflow.py benchmark --iterations 10 | ||
| ``` | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| - `NOTTE_API_KEY` - API key (required for cloud operations) | ||
| - `NOTTE_API_URL` - API server URL (optional) | ||
|
|
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,53 @@ | ||
| """ | ||
| Main CLI module for Notte. | ||
|
|
||
| This module aggregates all CLI subcommands (workflow, session, agent, etc.) | ||
| into a single unified CLI interface. | ||
|
|
||
| Usage: | ||
| notte workflow create <file> | ||
| notte workflow run <file> | ||
| notte workflow benchmark <file> | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import typer | ||
|
|
||
| from notte_sdk.cli import workflow | ||
|
|
||
| # Main CLI app | ||
| app = typer.Typer( | ||
| name="notte", | ||
| help="Notte CLI - Manage workflows, sessions, agents, and more", | ||
| add_completion=False, | ||
| no_args_is_help=True, | ||
| ) | ||
|
|
||
| # Add workflow subcommand | ||
| app.add_typer(workflow.workflow_app, name="workflow") | ||
|
|
||
| # Future subcommands can be added here: | ||
| # from notte_sdk.cli import session | ||
| # app.add_typer(session.session_app, name="session") | ||
| # | ||
| # from notte_sdk.cli import agent | ||
| # app.add_typer(agent.agent_app, name="agent") | ||
|
|
||
|
|
||
| def main(_file_path: Path | None = None) -> None: | ||
| """ | ||
| Main CLI entry point. | ||
|
|
||
| Args: | ||
| _file_path: Optional path to workflow file. If None, will be auto-detected from sys.argv. | ||
| Currently unused, kept for compatibility with workflow_cli(). | ||
| """ | ||
| # Run typer app directly - typer handles help, argument parsing, etc. | ||
| app() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify that
notte_llmaligns with the security model.The security comments (lines 62-66) specify that allowed modules must not provide file system access, process control, network access beyond basic parsing, system introspection, or code execution capabilities. Please confirm that
notte_llmadheres to these constraints.🏁 Script executed:
Length of output: 173
Length of output: 65
Length of output: 4153
Length of output: 422
Length of output: 1092
Length of output: 3964
Length of output: 386
Critical:
notte_llmexposes file system access, violating the stated security model.Adding
notte_llmtoALLOWED_IMPORTSallows user scripts to import and instantiateLlmUsageFileTracer, which internally usesopen()for file I/O. This bypasses RestrictedPython's restrictions—while RestrictedPython blocks directopen()calls in user code, it cannot prevent allowed modules from using unrestricted builtins. User scripts can therefore write arbitrary files:This violates lines 62-64 which explicitly forbid "File system access". Either remove
notte_llmfromALLOWED_IMPORTSor create a restricted wrapper that excludes tracer functionality.🤖 Prompt for AI Agents