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

> Usage and flags for oz0 client generate.

For: Operators and developers looking up a command.

Write typed wrappers of a tenant's agents and flows for the Python, TypeScript or Go client SDK: a type per object of their input and output schemas, and per agent and flow a method that starts it with its input typed and one that runs it and returns its answer typed.

They come from the tenant's OpenAPI document, GET /v1/openapi.json, which the command reads from the edge: with an API key from $OZ0_API_KEY (--api-key-env) when --url or $OZ0_URL names the edge, and with the CLI context's operator certificate otherwise. --from reads a saved document instead.

Without --out the code goes to stdout. With --out DIR it goes to DIR/agents.py, agents.ts or agents.go; a file there that was generated from the same catalog (its ETag), by the same version of the generator, for the same tenant and Go package, is left as it is unless --force, so an app's CI can run this on every build and commit what changed.

--plugin limits it to one plugin's agents and flows (GET /v1/openapi.json?plugin=), for a tenant whose whole document is large: with thousands of agents it is megabytes.

## Usage

```bash
oz0 client generate [flags]
```

## Flags

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

<tbody>
  <tr>
    <td>
      <code>
        --api-key-env
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        OZ0_API_KEY
      </code>
    </td>
    
    <td>
      the environment variable that holds the API key, with --url
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --ca-file
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CA_FILE
      </code>
    </td>
    
    <td>
      the cluster's CA certificate, with --url
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --force
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      write the file even when the catalog has not changed since it was generated
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --from
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      read the OpenAPI document from this file ("-" for stdin) instead of the edge
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --lang
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the SDK's language: python, ts or go
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --out
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      a directory to write agents.py, agents.ts or agents.go to, instead of stdout
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --package
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        the --out directory's name, or agents
      </code>
    </td>
    
    <td>
      the Go package's name
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --plugin
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      only this plugin's agents and flows
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_TENANT, else the API key's, or the document's
      </code>
    </td>
    
    <td>
      the tenant
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --url
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_URL, or the CLI context's
      </code>
    </td>
    
    <td>
      the edge's runtime API, such as <code>
        https://edge.example.com:7443
      </code>
    </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.
