Decompose a task with Codex and dispatch the subtasks to Jules.
Project description
jules-agent
jules-agent is a CLI for handing off work to Jules with a little more structure around it.
It turns a task into a plan, sends the work to Jules, and helps you keep moving through feedback, review, and merge.
- 日本語版: README_ja.md
What it does
jules-agent helps with the full loop around a coding task:
- turn a single request into a workable plan
- surface clarification questions before the work starts
- send the task to Jules
- collect feedback and move the task forward
- review the result and merge the pull request when it is ready
It is useful whether you want a light planning pass or a more hands-on loop around implementation and review.
Requirements
- Python 3.12 or newer
gitavailable onPATHJULES_API_KEYset in the environment, orapi_keyconfigured in TOMLGITHUB_TOKENset when you want review, merge, or PR status syncing
Repository assumptions:
- you are inside a Git repository
- the repository has a GitHub remote
- Jules is already set up for the GitHub account as an app and has access to the repository
jules-agent talks to the Jules API directly, so a local jules CLI binary is not required.
If you do not run the command inside a git repository, pass --repo owner/name.
Install
From PyPI:
pipx install jules-agent
uv tool install jules-agent
pip install jules-agent
From a local checkout:
pip install -e .
After installing, the jules-agent command is available on your PATH.
Usage
jules-agent [flags] <command> [args]
The common flow is:
- Create a task with
run. - Check progress with
statusandsync. - Approve, give feedback, or send a direct message if needed.
- Review the pull request.
- Merge when it is ready.
Subcommands
run [flags] <task>: Analyze a new task with the configured planning tool and dispatch it to Jules.- In interactive mode, it may first ask clarification questions before generating a plan.
--no-confirm: Skip the confirmation loop and dispatch immediately.--auto-plan-approval: Automatically approve the task plan (forcesrequirePlanApproval=false).--automation-mode <mode>: Specify the automation mode for the Jules session.AUTO_CREATE_PR(default): Whenever a final code patch is generated in the session, automatically create a branch and a pull request for it.AUTOMATION_MODE_UNSPECIFIED: The automation mode is unspecified. Default to no automation.
import <session_id>: Import an existing Jules session into the local state.- Supports both bare IDs (e.g.,
12345) and full session names (e.g.,sessions/12345).
- Supports both bare IDs (e.g.,
status: Show the current local state, including runs and tasks. By default, it only shows runs withplannedorrunningstatus.-a,--all: Show all runs, including completed, failed, and cancelled.--show-activities: Show detailed session activities for each task.
sync: Synchronize the local state with the Jules API and GitHub (to update PR status).advance [flags]: Automatically or interactively advance work across the next active task. Forsequential_subtasks, a successful merge also dispatches the nextplannedtask in the same run.cron [flags]: Non-interactive background execution. This is a purely automated version ofadvancethat never asks for input, and it also dispatches the nextplannedtask after a successful sequential merge.approve [task_id]: Manually approve the proposed plan for a specific task. Iftask_idis omitted, it shows a list of tasks awaiting plan approval.send [task_id] message: Send a manual message to a task's Jules session. Iftask_idis omitted, it shows a list of active tasks. If your message contains spaces and you omittask_id, the message must be quoted (e.g.,jules-agent send "hello world").feedback [task_id]: Enter an interactive feedback loop to refine a task's plan or reply. Iftask_idis omitted, it shows a list of eligible tasks.review [task_id]: Run a review for a task with an open pull request. Iftask_idis omitted, it shows a list of tasks with open pull requests.merge [task_id]: Manually merge the pull request associated with a task. Iftask_idis omitted, it first performs a full state synchronization and then shows a list of tasks with open pull requests.next [run_id]: Dispatch the next task in a sequential run. Ifrun_idis omitted, it shows a list of active sequential runs with planned tasks.--automation-mode <mode>: Specify the automation mode for the Jules session (e.g.,AUTO_CREATE_PRorAUTOMATION_MODE_UNSPECIFIED).
delete run [run_id]: Delete a run and its tasks from the local state.delete task [task_id]: Delete a specific task from the local state. If the run becomes empty, it is also removed.rm: An alias fordelete.- Omitting
run_idortask_idtriggers an interactive selection prompt. --dry-run: Show what would be deleted without making changes.--yes,-y: Skip confirmation prompts and proceed immediately.
- Omitting
Global Flags
--repo owner/name: Override the target repository.--tool-bin /path/to/tool: Path to the backend tool executable.--tool <name>: Backend tool to use.--gemini-skip-trust: Pass--skip-trustto the Gemini CLI adapter.--plan-tool <name>: Tool override for the planning phase.--approve-tool <name>: Tool override for the approval phase.--feedback-tool <name>: Tool override for the feedback phase.--review-tool <name>: Tool override for the review phase.--config /path/to/config.toml: Specify a custom configuration file.
Supported backend tools are codex, claude, gemini, opencode, copilot, and cline.
Use --tool to set one default backend, or override individual phases with --plan-tool, --approve-tool, --feedback-tool, and --review-tool.
The --tool-bin flag and tool_bin config field let you point at a specific backend binary.
Automation Flags (for advance and cron)
--auto-plan-approval: Automatically approve plans when recommended by the planning tool.--auto-feedback: Automatically send suggested feedback messages.--auto-merge: Automatically merge pull requests when they are ready.--auto: Enable both plan approval and feedback (does NOT include merge).--json: Emit the result as a single JSON object.
Examples
# 1. Create a task
jules-agent run "Split the parser from the dispatcher"
# 2. Check progress and capture the run/task IDs
jules-agent status
# 3. Refresh local state from Jules and GitHub
jules-agent sync
# 4. If the task is waiting for a plan decision, approve it
jules-agent approve RUN_ID:TASK_ID
# Or, if the plan needs changes, give feedback instead
jules-agent feedback RUN_ID:TASK_ID
# 5. Review the pull request once Jules opens one
jules-agent review RUN_ID:TASK_ID
# 6. Merge the pull request when it is ready
jules-agent merge RUN_ID:TASK_ID
For a sequential run, you can keep going with:
# Dispatch the next planned task in the run
jules-agent next RUN_ID
# Or let the tool advance work and merge automatically
jules-agent advance --auto
Configuration
jules-agent can be configured using TOML files. It searches for configuration in the following locations (in order of increasing priority):
~/.jules-agent.toml~/.config/jules-agent/config.toml./.jules-agent.toml./jules-agent.toml- A custom file specified via
--config
Settings in the configuration file have lower priority than environment variables and command-line flags. For automation flags, the priority is:
- Individual CLI flag (e.g.,
--auto-merge,--automation-mode) - The
--autoflag (sets approval and feedback to true) - Configuration file settings
- Default values (auto_plan_approval=true, others=false, automation_mode="AUTO_CREATE_PR")
GitHub Token
jules-agent reads GITHUB_TOKEN from the environment, or github_token from the TOML configuration file.
Need permissions:
- pull-requests: write
- issues: write
- contents: write
Supported Settings
api_key = "your-jules-api-key"
repo = "owner/repo"
github_token = "ghp_your-github-token"
tool_bin = "path/to/tool"
tool = "codex"
gemini_skip_trust = false
plan_tool = "claude"
approve_tool = "gemini"
feedback_tool = "opencode"
review_tool = "copilot"
base_url = "https://jules.googleapis.com/v1alpha"
merge_method = "rebase"
merge_delete_branch = true
merge_pull = true
automation_mode = "AUTO_CREATE_PR"
Example:
jules-agent --repo example-org/example-repo "Split the parser from the dispatcher"
Output
The CLI prints one line per dispatch result:
Jules dispatch result(s): 2
1. [success] [123456] Update the parser
2. [success] [123457] Add tests
If the planning tool fails, the command exits non-zero and includes the command plus captured stdout and stderr.
If a Jules dispatch fails, the CLI prints failure for that subtask, shows the captured command output, and exits non-zero after the first failure.
If confirmation mode is enabled and stdin is not interactive, the CLI exits with an error and tells you to use --no-confirm.
If a command is run without a task_id and stdin is not interactive, the CLI exits with an error.
How It Works
The planning step expects JSON shaped like this:
{
"strategy": "single_session",
"tasks": [
{ "title": "First task" }
]
}
strategy can be single_session or sequential_subtasks. Each task can also be a plain string. The dispatcher turns the title and any available details into the prompt passed to Jules.
Development
Run the tests with:
python3 -m pytest
The tests cover JSON parsing, subtask normalization, session ID extraction, and the end-to-end pipeline error path.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jules_agent-0.1.2.tar.gz.
File metadata
- Download URL: jules_agent-0.1.2.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3e88f65dde9e75b1c1dd8a7b8febc34b099a7817d9f864c7e79431ffb23aa63
|
|
| MD5 |
5eede569ac5eff3d3c809b550d40759b
|
|
| BLAKE2b-256 |
3fe1964342d4d00fee2ca3aac01da88689563d072fae47229d0053434391bac9
|
File details
Details for the file jules_agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: jules_agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 55.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2b17869b7533e574b5be93ae5238a7a546f2206df4b6a2d0c67b6b3b42d5686
|
|
| MD5 |
21f78da64585fc36ad89247d30cb2724
|
|
| BLAKE2b-256 |
e56116cad3b48d8e802657faca23810bccd94ea52d71d948d2588cd0f2f5bb57
|