MQL5-Google-Onedrive/docs/Jules_CLI_setup.md
copilot-swe-agent[bot] 8d01718383 Add Jules CLI installation script and update documentation
Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-02-17 13:10:04 +00:00

3.6 KiB

Jules CLI Setup

Installation

Use our installation script:

bash scripts/install_jules.sh

This script will:

  • Check Node.js version (requires >= 18.0.0)
  • Install Jules CLI globally via npm
  • Verify the installation
  • Show next steps

Manual Install

Alternatively, install directly with npm:

npm install -g @google/jules

Authentication

Before you can use the tool, you must authenticate with your Google account.

jules login

This command will open a browser window to guide you through the Google authentication process.

GitHub org + private repo access (required)

If you’re working in an organization (or on private repositories), you must also install/authorize the Jules GitHub App for the org. Installing it only on a personal account does not automatically grant access to org repos.

  • Install Jules on the org account (separately):

    • In GitHub, open the organizationSettingsGitHub Apps (or “Installed GitHub Apps”).
    • Find Jules and Install it for the org.
    • Choose All repositories or explicitly select the repos Jules should access.
  • Private repos need explicit permissions:

    • For private repos, the GitHub App must be granted repository access and the required permissions.
    • In practice this commonly means allowing full repo access/control (or equivalent “Repository contents” + PR permissions), otherwise Jules will not be able to read/write PRs or fetch repo contents.

Refresh Jules after GitHub authorization

After you install/approve the GitHub App permissions (especially changing org/private-repo access), refresh Jules so it re-reads the updated authorization state:

  1. Close and restart Jules (exit the TUI, re-run jules, or re-run your jules new ... command).
  2. If the newly-authorized repos still don’t appear or actions still fail, force a clean re-auth:
jules logout
jules login

Quick verification

Use these commands to sanity-check connectivity after setup/authorization changes:

jules version
jules remote list --repo

CI/CD Environment Setup

For automated environments (GitHub Actions, GitLab CI, etc.), authentication requires a token:

1. Get a Jules Token

First, authenticate locally and extract your token:

jules login
# After successful login, your token is stored

The token location varies by platform:

  • Linux/macOS: ~/.config/jules/credentials
  • Windows: %APPDATA%\jules\credentials

2. Add Token to CI/CD Secrets

In your CI/CD platform (e.g., GitHub):

  1. Go to repository SettingsSecrets and variablesActions
  2. Add new repository secret: JULES_TOKEN
  3. Paste your token value

3. Use in Workflow

Example GitHub Actions workflow:

name: Jules Automation

on: [push]

jobs:
  jules-task:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - uses: actions/setup-node@v4
        with:
          node-version: '18'
      
      - name: Install Jules CLI
        run: npm install -g @google/jules
      
      - name: Run Jules Task
        env:
          JULES_TOKEN: ${{ secrets.JULES_TOKEN }}
        run: |
          # Jules will use JULES_TOKEN from environment
          jules remote list --repo

Notes for CI/CD

  • The npm package installs successfully in CI environments
  • First jules command execution requires authentication (downloads binary)
  • In sandboxed environments without authentication, the wrapper is installed but commands require valid credentials
  • Use JULES_TOKEN environment variable for non-interactive authentication