---
title: "oz0 workspace export"
description: "Usage and flags for oz0 workspace export."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/workspace/export"
---
# oz0 workspace export

> Usage and flags for oz0 workspace export.

For: Operators and developers looking up a command.

Push a revision (default: the head) as a new branch (default oz0/\<folder>-\<revision>) on top of --base (default: the repository's default branch), into --path (default: the root), with the token in the tenant secret --secret. A branch that exists is refused: the export never force-pushes. --pull-request opens a pull request on GitHub, Gitea or Forgejo, or a merge request on GitLab; --forge and --forge-api name a self-hosted forge's kind and API address.

## Usage

```bash
oz0 workspace export <folder> --repo <git-url> [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --base
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the default branch
      </code>
    </td>
    
    <td>
      the branch to start from and open the pull request against
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --body
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the pull request's description
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --branch
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        oz0/&lt;folder>-&lt;revision>
      </code>
    </td>
    
    <td>
      the new branch
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --forge
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        guessed from the host
      </code>
    </td>
    
    <td>
      github, gitlab, gitea or forgejo
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --forge-api
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the forge's API base URL, for a self-hosted forge
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --json
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      print JSON instead of a table
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --path
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the root
      </code>
    </td>
    
    <td>
      the repository's folder for the plugin
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --pull-request
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      open a pull request (a merge request on GitLab)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --repo
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the repository's https:// Git URL
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --revision
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the head
      </code>
    </td>
    
    <td>
      the revision to export
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --secret
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      tenant secret with a token that may push (the token, or user:token), bound to the repository's host and, for a pull request on another API host, that one too (oz0 secret set NAME --host HOST)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      the tenant
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --title
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the revision's message
      </code>
    </td>
    
    <td>
      the pull request's title
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
