> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# High-code agents

The high-code path suits cases that need custom logic, tools, or multi-agent orchestration: you scaffold a project from a template, write the agent code directly, and let the CLI build the image in the cloud and deploy it as a runtime. The loop starts at scaffolding and runs through editing, deploying, invoking, and reading logs, then returns to editing to iterate.

<Note>
  Configure AK/SK credentials first, or obtain short-lived STS credentials through [SSO login](/productions/agentkit-cli/preview/en/commands/auth). `launch`, `deploy`, and `invoke` use the same credential precedence to resolve valid credentials. See the Authentication section of the [Quickstart](/productions/agentkit-cli/preview/en/quickstart). For the full guide to writing agent code, see the [VeADK docs](/productions/veadk/preview/en/index).
</Note>

<Steps>
  <Step title="Scaffold a project">
    Create a project from a built-in template. Run `agentkit init --list-templates` to list every template first.

    ```bash lines theme={null}
    agentkit init my-agent --template basic --directory my-agent
    cd my-agent
    ```
  </Step>

  <Step title="Edit the agent">
    Modify the scaffolded code to adjust the agent's instruction, tools, and orchestration logic.

    <Note>
      The runtime container must listen on `0.0.0.0:8000` to pass its readiness probe. Templates satisfy this by default, so you rarely need to change it.
    </Note>
  </Step>

  <Step title="Configure the model and cloud">
    Follow the [Quickstart](/productions/agentkit-cli/preview/en/quickstart#create-and-configure-a-project) to select Volcengine or BytePlus and configure the model name, API base URL, and API key. Deployment credentials and model credentials serve different purposes; CLI login alone does not configure the model

    Add `agentkit.yaml` and `.env` to `.gitignore` and `.dockerignore` in the project root, then write the exported model variables to lifecycle configuration

    ```bash lines theme={null}
    agentkit config \
      --runtime_envs "MODEL_AGENT_NAME=$MODEL_AGENT_NAME" \
      --runtime_envs "MODEL_AGENT_API_BASE=$MODEL_AGENT_API_BASE" \
      --runtime_envs "MODEL_AGENT_API_KEY=$MODEL_AGENT_API_KEY" \
      --runtime_envs "MODEL_AGENT_PROVIDER=openai"
    agentkit config --show
    ```

    This writes actual values to local `agentkit.yaml`; root configuration does not substitute `${VAR}` inside the file
  </Step>

  <Step title="Build and deploy">
    Run the full lifecycle flow, building the image in the cloud and creating or updating the runtime.

    <Warning>
      `launch` builds an image and creates or updates cloud resources, which may incur charges. An update also changes the existing Runtime's behavior. Check the configuration, account, region, and project first
    </Warning>

    ```bash lines theme={null}
    agentkit launch
    ```

    <Tip>
      To inspect or hand-edit `agentkit.yaml` or the `Dockerfile` between scaffolding and building, run `agentkit config --show`, then split the flow into `agentkit build` and `agentkit deploy`. See [Config](/productions/agentkit-cli/preview/en/commands/config), [Build](/productions/agentkit-cli/preview/en/commands/build), and [Deploy](/productions/agentkit-cli/preview/en/commands/deploy).
    </Tip>
  </Step>

  <Step title="Invoke the runtime">
    Read the current project's `agentkit.yaml` and invoke the runtime to verify the deployment.

    ```bash lines theme={null}
    agentkit invoke run "Hello, introduce yourself"
    ```
  </Step>

  <Step title="Inspect and iterate">
    Read the logs when the runtime misbehaves; edit the code and redeploy to publish a new version.

    ```bash lines theme={null}
    agentkit runtime logs my-agent --limit 200
    agentkit launch
    ```

    To roll back or adjust resources, use the version and update commands: list history with `agentkit runtime versions my-agent`, publish a specific version with `agentkit runtime release my-agent --rev <n>`, and change CPU and memory with `agentkit runtime update my-agent --cpu-milli 1000 --memory-mb 2048 --auto-release`.
  </Step>
</Steps>

When you no longer need the runtime, delete it to free resources:

<Warning>
  Deletion affects production calls and cannot be undone. Confirm the Runtime and retain required business data first
</Warning>

```bash lines theme={null}
agentkit runtime delete my-agent -y
```

When you only need configuration and no code, use [Using Harness](/productions/agentkit-cli/preview/en/workflows/harness) instead.
