ae-system
Use the
domain for Agent system administration:
bash
ae-cli system +<command> [options]
Mandatory Rules
- These commands are only for users whose Agent role is or .
- The te-agent endpoint is the final authorization boundary. A member receives a permission error (HTTP 403). Do not retry login or attempt a different endpoint after a 403.
- Run
ae-cli auth login --host <host>
before using this domain. System administration requires a user access-token session; sandbox identity headers are not an authorization substitute.
- is the exception that must also run inside a Linux te-agent sandbox because it packages the installed Linux files. It still requires the logged-in user to be or .
- Discover real IDs with a list command before any update or delete. Never guess a user, sandbox, model, quota rule, or channel ID.
- Before every write, run , show the target and effect, and obtain explicit user confirmation. The CLI itself prompts only for ; can bypass that prompt and is not a security boundary.
- Use to inspect method, path, query, and redacted body without executing.
- JSON inputs accept inline JSON, , or for stdin. Prefer for channel credentials and other sensitive values.
- Successful output is JSON by default. Use only when a human-readable table is more useful.
- After each command, check stderr and . If present, show the version warning and its update commands before the business result.
- Do not treat an absent ae-cli command as proof that an HTTP endpoint is unreachable. An Agent with Bash/network access can construct requests directly; server authentication, role checks, company isolation, and resource ownership are the actual controls.
- Do not call
DELETE /api/admin/members?openId=...
or /api/internal/sandboxes/**
through ad-hoc HTTP. They are intentionally excluded from this Skill because other systems own those integration contracts.
Command Groups
Members
| Command | Risk | Purpose |
|---|
| read | List TE company users that can be added. |
| read | List Agent members in the current company. |
| write | Add one or more TE users, optionally binding a quota rule or creating sandboxes. |
| write | Enable or disable a member. |
| write | Change a non-root member between and . |
| high-risk-write | Remove a non-root member. |
| read | Get one member's token usage and recent conversation count. |
Examples:
bash
ae-cli system +list-members --status enabled --page 1 --page-size 20
ae-cli system +add-members \
--members '[{"openId":"ou_x","loginName":"alice","displayName":"Alice"}]' \
--create-sandbox true
ae-cli system +set-member-role --user-id <user-id> --role agent_admin
- : login/display name search.
- : .
- , : page size is 1-100.
- : return all matches.
--sort-field periodUsedAmount
, : central usage sort.
json
[
{
"openId": "required",
"loginName": "optional",
"displayName": "optional"
}
]
Optional flags are
and
--create-sandbox true|false
.
Sandboxes
| Command | Risk | Purpose |
|---|
| read | List company sandboxes. |
| read | Read feature status and create/active seat limits. |
| write | Create personal sandboxes for 1-100 users. |
| write | Update a sandbox description. |
| write | Enable or disable a sandbox. |
| write | Start a sandbox container. |
| write | Stop a sandbox container. |
| read | List users bound to a sandbox. |
| write | Bind a member to a sandbox. |
| high-risk-write | Remove a sandbox user binding. |
| high-risk-write | Delete a sandbox and its bindings. |
Examples:
bash
ae-cli system +batch-create-sandboxes \
--user-ids '["<user-id-1>","<user-id-2>"]' \
--description "Data team"
ae-cli system +set-sandbox-enabled --id <sandbox-id> --enabled true
ae-cli system +bind-sandbox-user --id <sandbox-id> --user-id <user-id>
Use Agent database user IDs from
, not TE openIds, for sandbox commands.
Shared Sandbox Tools
| Command | Risk | Purpose |
|---|
| write | Validate, ZIP, and upload an existing tool directory. |
| write | Install one exact npm CLI version in a temporary sandbox directory, generate , and upload it. |
| read | List preset and custom tools for the current company. |
| write | Synchronize preset tools from the server manifest. |
+get-sandbox-tool-distribution
| read | Read the sandboxes currently receiving one tool. |
+set-sandbox-tool-enabled
| write | Enable or disable one registered tool. |
| high-risk-write | Delete a fully reclaimed tool registration. |
| write | Activate selected commands on selected or all running sandboxes. |
+deactivate-sandbox-tools
| write | Remove managed command shims from selected or all running sandboxes. |
+refresh-sandbox-tool-status
| write | Refresh observed tool state on target sandboxes. |
+list-sandbox-tool-operations
| read | List activation/deactivation history. |
Uploaded tools are registered for the current company with
. Upload does not activate the tool in any running sandbox. Review and enable/activate it through sandbox tool management after upload.
For activate/deactivate/status operations:
bash
ae-cli system +activate-sandbox-tools \
--target-mode selected \
--sandbox-ids '["<sandbox-id>"]' \
--tool-ids '["<tool-id>"]'
- requires 1-50 ; forbids them.
- contains 1-20 real IDs from .
--command-names-by-tool-id
optionally limits an operation to named commands.
--expected-tool-snapshots-by-id
carries the version/package/command snapshot returned by the server for optimistic concurrency checks.
- JSON maps accept inline JSON, , or stdin. Use dry-run and user confirmation before distribution changes.
Preferred npm Flow
Run this inside the target Linux te-agent sandbox:
bash
ae-cli auth login --host <host>
ae-cli system +npm-install --package eslint@9.32.0
For a scoped package or a custom shared-tool identifier:
bash
ae-cli system +npm-install \
--package @scope/example-cli@1.2.3 \
--name example-cli
Requirements and behavior:
- must be an exact registry package version. Tags, ranges, URLs, Git sources, npm aliases, and local paths are rejected.
- The installed package must expose at least one entry. Each bin becomes one tool command.
- The default tool name is the unscoped package name. Use only when a different valid lowercase tool identifier is required.
- npm lifecycle scripts are disabled with by default. Use only after reviewing and trusting the package and all transitive dependencies.
- The command calls the admin upload-policy endpoint before starting npm. A disabled feature, expired session, or non-admin role fails before installation.
- Installation uses a temporary prefix with development dependencies omitted. Temporary installation and ZIP files are removed whether upload succeeds or fails.
- npm-created symlinks are converted to regular executable wrappers in the ZIP. All other symlinks, special files, and links resolving outside the package root are rejected.
- Pure JavaScript Node.js CLIs are the supported baseline. Packages that require native addons, downloaded platform binaries, build tools, system libraries, or lifecycle setup may fail when scripts are disabled or when activated in a different runtime image.
- If lifecycle scripts are necessary, install and upload from the same Linux sandbox image family that will execute the tool. Upload never makes an incompatible native artifact portable.
Existing Directory Flow
Use the low-level command when the tool is already installed or assembled:
bash
ae-cli system +upload-sandbox-tool --path /absolute/path/to/tool-root
The directory root must contain exactly one
. An external manifest is allowed only when the root has no
:
bash
ae-cli system +upload-sandbox-tool \
--path /absolute/path/to/tool-root \
--manifest /absolute/path/to/tool.json
Minimal manifest:
json
{
"schemaVersion": 1,
"name": "example-cli",
"displayName": "Example CLI",
"description": "Optional description",
"version": "1.2.3",
"commands": [
{
"name": "example",
"entry": "node_modules/example-cli/bin/example.js",
"runtime": "node"
}
]
}
Upload contract:
- and command names must start with a lowercase letter and contain only lowercase letters, numbers, , , or , with a maximum length of 64.
- Command names must not replace reserved runtime commands such as , , , , , , , or .
- Every command must be a regular file under the upload root. Use for JavaScript entry files and only for an executable compatible with the sandbox Linux image.
- Paths must be relative and normalized. Absolute paths, , backslashes, control characters, empty segments, and a path segment are rejected.
- ZIP limits are 50 MB compressed, 500 MB unpacked, 50 MB per file, and 10,000 files. The server publishes only after independently validating the same boundaries.
- Do not pre-create or write
/data/app/te_agent_ta/share/tools
from a sandbox. Sandboxes are read-only for that directory; the authenticated te-agent upload endpoint owns the final write and registration.
- A tool name can be registered only once per company in this first static-version flow. Choose the final name and version before upload.
Models
| Command | Risk | Purpose |
|---|
| read | List system models and company visibility. |
+set-system-model-enabled
| write | Toggle a system model for the current company. |
| read | Read the default visibility policy for newly synchronized system models. |
| write | Update the new-system-model visibility policy. |
+get-system-model-price-rules
| read | Read one managed system model's stored pricing snapshot. |
| read | List company models, including disabled models. |
+set-company-model-enabled
| write | Toggle a company model for all company users. |
| read | Read the and default slots. |
| write | Set one default model slot. |
| high-risk-write | Clear one default model slot. |
Examples:
bash
ae-cli system +list-system-models
ae-cli system +set-system-model-enabled --model-id <model-id> --enabled false
ae-cli system +set-default-model --model-id <model-id> --biz-type AE_AGENT
is
and defaults to
. Use the database
returned by a model list, not the provider model name.
Usage
| Command | Risk | Purpose |
|---|
| read | Get token/cost summary for a relative or absolute range. |
| read | Get paginated usage grouped by user, model, date, or application type. |
| read | Get Agent tool-call count for a range, optionally refreshing the cache. |
| read | Drill one parent group into the remaining dimensions. |
| read | Stream filtered one-dimension usage groups to CSV. |
| read | Stream full or drill-down multi-dimension details to CSV. |
Examples:
bash
ae-cli system +get-usage-summary --days 30
ae-cli system +get-usage-summary --days 30 --refresh true
ae-cli system +get-usage-details \
--start-date 2026-07-01 \
--end-date 2026-07-24 \
--group-by user \
--page 1 \
--page-size 20
ae-cli system +get-usage-combinations \
--start-date 2026-07-01 \
--end-date 2026-07-24 \
--parent-dimension user \
--open-id <open-id>
ae-cli system +export-usage \
--start-date 2026-07-01 \
--end-date 2026-07-24 \
--group-by user \
--output ./system-usage.csv
Summary range:
- Use , or provide both and .
- Dates use .
- Do not combine with an absolute date pair.
- is available on and and bypasses the overview cache.
Details flags:
- and are required.
- :
user | model | date | app_type
.
- Optional filters: , , , , .
- requires .
- :
totalTokens | cost | share | requestCount
.
- : .
Combination drill-down requires exactly one parent selector:
- → only.
- → and only.
- → only.
- → only, inside the selected range.
CSV exports require an explicit
. The target is created exclusively: an existing file is never overwritten, and an HTTP or stream failure removes the incomplete file. The JSON result reports the absolute local path, bytes written, server filename, and content type.
Cost Control
| Command | Risk | Purpose |
|---|
| read | Get company cost, quota, and usage summary. |
| read | Get the current model account balance and currency. |
| read | List members over cost or token quota limits. |
| read | Get balance alert config and current status. |
| write | Enable, update, or disable the balance alert. |
| read | List cost/token quota rules. |
| write | Create a company or user quota rule. |
| write | Update a quota rule. |
| high-risk-write | Delete a quota rule. |
| write | Bind a quota rule to a TE user openId. |
Examples:
bash
ae-cli system +set-balance-alert --enabled true --threshold 100
ae-cli system +create-quota-rule --rule @quota-rule.json
ae-cli system +bind-quota-rule-user --id <rule-id> --open-id <open-id>
Quota rule JSON:
json
{
"name": "Daily user quota",
"subjectType": "USER",
"periodType": "DAY",
"quotaType": "TOKEN",
"totalTokens": "10",
"allowedModels": ["<model-id>"],
"modelLimits": [
{
"modelId": "<model-id>",
"limitTokens": "5"
}
],
"openIds": ["<open-id>"]
}
Rules:
- : .
- : .
- : .
- COST uses ; TOKEN uses . Token values are expressed in millions.
- and are optional according to the server rule type.
- Update accepts a partial rule object.
Channels
| Command | Risk | Purpose |
|---|
| read | List Feishu, Lark, and Slack channels. |
| write | Create one channel. |
| write | Update channel settings, credentials, model, prompt, or enabled state. |
| high-risk-write | Delete a channel, unbind users, and stop its connection. |
Always use
for channel payloads when they contain credentials:
bash
ae-cli system +create-channel --channel @channel.json
ae-cli system +update-channel --id <channel-id> --channel @channel-update.json
Create schema:
json
{
"name": "Required display name",
"type": "feishu",
"config": {
"appId": "Feishu/Lark",
"appSecret": "Feishu/Lark",
"botToken": "Slack",
"appToken": "Slack",
"clientId": "optional",
"clientSecret": "optional"
},
"model": "optional Model.id or modelId::scope",
"systemPrompt": "optional"
}
Update accepts a partial object with
,
,
,
,
, or
. Channel type is immutable after creation. Dry-run replaces secret values with
.
Permission Errors
A permission response looks like:
json
{
"ok": false,
"error": {
"type": "permission",
"message": "..."
}
}
On this response:
- Do not retry with another admin path.
- Do not recommend re-login unless the server returned 401 instead.
- Tell the user that or is required.
An authenticated
or
is still scoped to their own company. The current service checks the database role and company against the session, and audited member, channel, sandbox-tool, and sandbox-management routes apply company/resource ownership checks. Never use that statement as a claim that every unreviewed admin route is safe.
Transport Status
This is a Transitional L2 domain backed by te-agent
.
- Maintainer: te-agent admin routes and
src/commands/te-system/**
.
- Migration target: system Capability Gateway.
- Review date: 2026-10-24.
- Exit condition: migrate after equivalent gateway schema, auth, risk, dry-run, and output contracts are stable.